# Archive for January 26th, 2018

### MPCNC: Stepper Motor Back EMF

A plot of the back EMF for an  Automation Technology KL17H248-15-4A stepper motor looks like I’m making stuff up again:

KL17H248-15-4A stepper motor – Back EMF vs RPM – data

Maybe the only questions I ask are ones with linear solutions?

Anyhow, the data comes from the Z-axis motor in the lathe:

Stepper back EMF test setup

Scary-looking, but reasonably safe. The chuck holds the motor shaft so it’s not going anywhere, the boring bar prevents any rotation, and the motor bearings do exactly what they’re supposed to. Shorting the motor leads would definitely put a hurt on the PLA frame, so I didn’t do that.

The scope sat on the floor beside the lathe, capturing waveforms and doing calculations:

Motor Back EMF – 500 RPM

Some waveforms look bent:

Motor Back EMF – 300 RPM

I asked the scope to measure the RMS voltage, rather than the peak, because it’s less sensitive to distortions.

Each winding produces one electrical cycle across four mechanical full steps, with the windings in quadrature. One shaft revolution thus produces 200 / 4 = 50 electrical cycles, so converting from shaft RPM into electrical cycles/s goes a little something like this:

`Electrical cycles/s = (shaft rev/min) * (50 cycles/rev) / 60 (s/min)`

Which works out to a tidy 0.833 Hz/RPM, basically spot on the last data point’s 839 Hz at 1000 RPM.

The motivation for this comes from the third column in the scribbles: back EMF = 22.7 mVrms/RPM = 32 mVpk/RPM.

A rapid move at 12 k mm/min = 200 mm/s shows the motor current collapsing to the ragged edge of not working:

G0 X 200 mm-s – 24V 200mA-div

Converting motor speed to shaft RPM:

```RPM = (axis mm/s) / (32 mm/rev) * (60 s/min) RPM = (axis mm/min) / (32 mm/rev)```

So the shaft turns at 375 RPM when the X axis moves at 12 k mm/min, with each motor generating 8.5 Vrms = 12 Vpk of back EMF.

The MPCNC wires the two motors on each axis in series, so the 24 V power supply faces 24 V of back EMF (!) from both motors, leaving exactly nothing to push the winding current around. Because the highest EMF occurs at the zero crossing points of the (normal) winding current, I think the current peaks now occur there, with the driver completely unable to properly shape the current waveform.

What you see in the scope shot is what actually happens: the current stabilizes at a ragged square-ish wave at maybe 300 mA (plus those nasty spikes). More study is needed.