Archive for August 26th, 2019
Herewith, a look at CNC 3018-Pro stepper motor current waveforms as a function of supply voltage, PWM decay mode, and motor speed.
The scope displays X and Y axis motor current at 1 A/div, with sensing through a pair of Tektronix Hall effect current probes:
The X axis driver is an unmodified DRV8825 PCB operating in default mixed-decay mode. The Y axis DRV8825 has its DECAY pin pulled high, thereby putting it in fast decay mode.
The scope timebase varies to match the programmed feed rate. Because the X and Y axes move simultaneously, each axis moves at 1/√2 the programmed speed:
G1 X10 Y10 F100 → 71 mm/min on X and Y
The motor generates minimal back EMF at slow speeds, so the winding sees nearly the full supply voltage. As described in the previous post, the basic problem arises when the current rises too fast during each PWM cycle:
V = L di/dt di/dt = 24 V / 3 mH = 8 kA/s
The first 1:32 microstep away from 0 calls for 5% of max current = 50 mA at a 1 A peak. The DRV8825 datasheet says the PWM typically runs at 30 kHz = 33 µs/cycle, during which the current will change by 270 mA:
267 mA = 8 kA/s × 33.3 µs
Notice how the current slams to a nearly constant, much-too-high value just after the first microstep. The incorrect current level decreases with lower supply voltage, because the rate-of-change decreases and the commanded current level reaches the actual (incorrect) current sooner.
Varying the motor voltage at a constant 10 mm/min:
Note that reducing the supply voltage doesn’t change the motor winding current, because the DRV8825 controls the current during each microstep, at least to the best of its ability.
Also note that the current overshoots the target for those microsteps, even when the motor is stopped, because there’s no back EMF, so the power dissipation is too high even at rest.
Enough back EMF appears at 100 mm/min to begin tamping down the current overshoot at 24 V:
The current waveform looks good at 12 V:
The back EMF at 1000 mm/min nearly eliminates the overshoot at 24 V, with fast decay in the Y axis causing some PWM ripple:
Both decay modes look good at 12 V:
At 1500 mm/min, the highest reasonable speed for the thing, and a 24 V supply, both waveforms still look good:
However, the back EMF is now high enough to buck the 12 V supply, preventing the current from decreasing fast enough in mixed decay mode (top trace):
Tweaking the GRBL config to allow 2000 mm/min feeds shows the waveforms starting to become triangular, even at 24 V:
And a 12 V supply opposed by the back EMF simply can’t change the current fast enough to keep up with the DRV8825 microstep current levels:
Bottom line: a +12 V motor supply and DRV8825 drivers modified to run in fast decay mode look like the best setup for the 3018-Pro: good current control at low speeds with enough moxie to handle higher speeds.
I should hack the DRV8825 boards into 1:8 microstep mode to reduce the IRQ rate by a factor of four, then see what happens to the back EMF at absurd speeds.