Problem statement
Your RAMPs board is supplying your drivers all with similar voltages, with the basic settings calculated for a NEMA 17.
So, we got different Resistances R, so why do they heat differently?
Physics background: energy transformation and dissipation
Resistance can be described as "friction of electrons in the conductor" to some degree. When electrons flow through a wire, then a current $I$ is trying to equalize a potential difference $U$. A flowing current transforms the kinetic energy of the electrons ($\propto U$) into an electromagnetic field and heat from the resistance. The electromagnetic field then is used to spin a rotor together with the magnets in the motor, which transforms the energy in the field into kinetic energy again. The end result is, that the kinetic energy of the electrons is transformed into the motion of the motor and heat.
Can we get the Current?
OR: "What if there was no driver?"
How does Resistance figure into all this? Well, Ohms Law is there: $U=RI$. With it, one can solve how much current I flows through an aperture of known resistance R and voltage U. The operation of the circuits that contain a CD stepper motor is usually 5 V, while 12 V is used for NEMA 17 and the typical steppers from Printer/scanner combos.
Those results wouldn't match the currents they are operated on as the motors are supplied via a motor driver chipset. We can look up the spec sheets to get a short glimpse of how they might dissipate heat in both constant voltage and constant current setups. Most stepper driver adjusts the voltage so we get constant current but there might be some cases one wants constant voltage. To estimate their heat generation, one needs...
Joules Formula of electric Heating
Constant Voltage case
Joules Formula of electric heating is written as $H=I^2Rt$, which gives us Energy in Joules. We can make it easier on us and drop the time to get the derivate power of electric heating. $P=\frac{H}{t}= I^2\ R= U \ I=\frac {U^2} {R}$
- $P={12\ \text V}\times {0.4\ \text A}=4.8\ \text {W}$
- $P=\frac{144\ \text V^2}{9.5\ \Omega}=15.14\ \text {W}$
- $P=\frac{25\ \text V^2}{10\ \Omega}=2.5\ \text {W}$
if we throw 12 V at the poor small stepper though...
- $P=\frac{144\ \text V^2}{10\ \Omega}=14.4\ \text {W}$
How did the small one survive this torture? I have no idea!
Constant Current case
Now, that is pretty much "constant voltage" but the stepper drivers used try to give always a set constant current to the motors. For most motors I have found, this is apparently in the area around 0.5 A, which gives us a better estimation
- $P={0.25\ \text A^2}\times {2.4\ \Omega}=0.6\ \text {W}$
- $P={0.25\ \text A^2}\times {9.5\ \Omega}=2.375\ \text {W}$
- $P={0.25\ \text A^2}\times {10.5\ \Omega}=2.625\ \text {W}$
If they all are operated at the same, set current (with adjusted voltage to match that), we get about a factor 4 for the heat generation on the middle and 4.3 on the CD stepper. Even with a higher current, the factors for heat dissipation are what is really interesting here.
Heating and temperature
Another small part of the answer is the mass of the motor and when it was touched. The thermal energy $E_T$ in a whole object is not directly equal to the temperature $T$ of the object, it is just proportional to it but also the specific heat capacity $c$ of the body... all in all we get for an amount of energy $Q$ deposited in an object $\text Q = \text m\ \text c\ \Delta\text T$.
Assuming that c is equal for the motors, one can do a quick estimation with typical weights via $\Delta\text T \propto \frac H m$
A typical NEMA 17 motor weighs about 280 grams while the typical CD-drive stepper (PL15S-020-PNA9) weighs 19 grams.
You see, the smaller steppers not only dissipates more heat, it also heats up faster than the chunky NEMA 17. The reason why after a short time the smaller one with not that much more heating than the big one felt considerably hotter is, that there is less mass that needs to be heated up: it might be already at its maximum temperature while the middle one still is heating up.
All in all
This is not a marlin issue but one from your material choice. Getting all similar motors makes motion control all the much easier, but you are not necessarily in danger of burning the motors.
To cool the motors...
- figure out what current I the smaller motors want to be operated on and adjust your setup to that, so to stay safe.
- there are potentiometers for this on most boards.
- mount a heatsink on the motors, increasing their effective thermal mass and their ability to dissipate the heat to the room around by increasing the surface area.