There has been some recent discussion on the current rating of the power supply to run a microstepping driver, such as the DRV8825 or DM542 type. As there seems to be diverging views, and on the basis that an ounce of experiment is worth a ton of theory, I have done some experiments with a DRV8825 type that I use in the controller of my milling machine x-axis power feed. This actually has 2 axes, the second one being available to drive a rotary axis for example. The unit has a Uno, a CNC shield rev3, HC06 Bluetooth module, and a 24v/2A, 5V 4A supply for the stepper and Uno. The unit uses the Pololu 8825 carriers
For the experiments I disconnected the internal 24v and ran the drivers from a 0 - 20v bench power supply, measuring the current with a DMM. I ran tests at 12, 15, 20.8 (max of PSU), and 24v (using the internal supply). For each I ran the axis at 150mm/min to make sure the steppers were doing some work. For each voltage I measured the Vref on the current adjustment pot and verified that actually it was constant at ~0.5v. The Pololu instructions here:
give a formula for the winding current which is Vref = Current/2. So for Vref = 0.5V the current is 1 amp/phase.
The table below gives the measured supply currents for the various voltages. One can see from the DMM display that actually the current is fluctuating quite a lot so one has to "eyeball" a mean.
Volts Current (A) Supply power (W)
12 0.20 2.4
15 0.18 2.7
20.8 0.16 3.33
24 0.18 4.32
I guess the most obvious observation is that the supply current is only about a 5th of the winding current. The actual power consumed is roughly the same though the 24v value is an outlier.
At first sight the fact that I have a 2A 24v supply rail seems inadequate. When I built the unit though these are the kind of numbers that I expected (actually they are lower than I expected) so I reckoned that 2A would be more than adequate.
These measurements show that at least for this type of current-controlled microstepping driver the approach sometimes recommended, where you take the set phase current, double it for 2 phases, and choose a power supply with the resulting current rating, can greatly overestimate the required current. A better approach is as follows (based on my example).
-
From the winding resistance and the required current, compute the power needed. This has a twist since the two coils are driven in quadrature. Held at a whole step, one winding has the set current through it and the other has zero. If the rotor rotates half a step, the first phase current is reduced to 1/root(2) = 0.7071 of the peak and the second phase current is set to the same value. The total current is now root(2) x the single winding current - this is the maximum current draw.
-
Now calculate the maximum power needed from I^2 * R for each winding. My stepper has a coil resistance of 2.3 ohms, so it works out the power per winding is 1.15W, total power is 2.3W.
-
These stepper drivers, if one looks at the outline schematics for the output stage, essentially work as buck converters, stepping down the supply voltage to the winding by PWM'ing the voltage to the motor. This diagram shows just one side of the H bridge.
There's a big cap C to smooth the current pulses; a MOSFET to switch the voltage to the coil, which has an inductance and resistance; and a commutating switch which is represented by a diode. On the other side the winding is connected to ground through a switch which would usually be a MOSFET. (Actually the commutating diode would then also be a MOSFET.)
The MOSFET is turned on and off by a PWM signal. When the MOSFET is on it feeds current into the winding; when it switches off the current continues to circulate through the commutating diode. By adjusting the PWM duty cycle the equilibrium current in the winding can be adjusted - for example to obtain a sinusoidal waveform for microstepping. The PWM switching is operating much faster than the actual stepping rate. While the MOSFET is on it increases the current in the inductor, and therefore the stored energy, to compensate for the decay when it is off. This is operating exactly like a buck converter - ideally all the power from the DC supply is delivered to the winding resistance. The power absorbed from the supply will be VDC x supply current and that has to equal the voltage dropped on the winding resistance x winding current - since the second voltage is much smaller then the first, the first (average) current is much smaller than the second.