Back EMF method detects stepper motor stall: Pt. 2 – Torque effects and detection circuitry
(Automotive applications for stepper motors may include headlight leveling, adaptive headlamps (that is where the headlamps turn right or left with the steering wheel), EGR (exhaust gas recirculation) valves, and adjustable mirrors. Non-automotive apps for the method described in this series would be any stepper motor application where the current is around 1A.)
Part 1 of this series covered stepper motor basics.
To more easily see the effects of torque on back EMF (BEMF) the following is a look at a stepper motor driven in full step mode. Figure 9 (below) illustrates an unloaded motor being driven in full step mode. The red is the current while the purple is the voltage on the phase. The thin black line is a feeble attempt at estimating the back EMF.
Figure 9, Unloaded motor driven in full step mode
In an unloaded motor (Figure 9), the back EMF leads the phase current. What are seen here is a skewed BEMF peak and a prolonged low (near zero) period. This is the torque first speeding up the rotor then slowing it down. Just spinning the motor would provide a very symmetrical BEMF waveform.
Looking at Figure 10 (below) for a loaded motor, we can see the loading is more in line with the current it is being fed. The back EMF is more symmetrical to the driving currents. The zero crossing point is more in the middle, or between the two driving current regions. If we were to load this motor much further, it would stall.
Figure 10, A loaded motor driven in full step mode
You can see why systems that use stepper motors severely overdrive their motors to ensure that they never, under all normal operating conditions, approach stall.
Now, if we were to compare these waveforms with what appears during stall, we can see a dramatic difference.
Figure 11, Motor in hard stall
In Figure 11 (above) we see that there is virtually no back EMF during the non-driven intervals. This would be nice if there wasn’t some play in the mechanical aspect of the system. Typically, a stalled rotor will actually vibrate as it tries to move. As we know, any rotational movement will translate to BEMF.
Looking at a stalled but vibrating rotor (Figure 12, below) we can see that there is somewhat of an issue with BEMF detection.
Figure 12, An example where the motor is in stall but allowed to “vibrate.”
Comparing these waveforms with the previous running waveforms we can see that there is some overlap. Of course, this figure is showing the behavior of a full step mode driven motor. This is a bit different than a motor driven in micro step mode. In micro step mode we are only looking during that short moment when the current is zero. It is like reading a document through a straw. You can only see a small portion at a time. It may seem limiting but it is enough.
To get some idea what the BEMF looks like on average for a given motor we built a simple system that will check BEMF synchronously with the stepper motor phasing.
Figure 13, Simplified block diagram of Back EMF detection circuit
With our microprocessor A to D sampling we were able to obtain several thousand BEMF readings in a short period of time and generate a histogram of the values. This provided an understanding as to what to expect.
Histograms, circuitry, and limitations
For the following histograms the L9942 stepper motor was used as shown previously with an STM8A 8-bit microcontroller. This micro has the ability to synchronously sample the back EMF in step with the L9948. The step clock frequency for the L9942 was set at 2 kHz, and the peak current in micro-stepping mode was set to 400 mA.
Each ADC sample was taken right at the end of the zero current step. This ensured that we would get the most consistent BEMF readings.
Where:
- Mean = 4.7278V
- Std Dev = 0.2007V
- Min = 3.6V
- Max = 6.6V
Now to compare the stalled rotor BEMF with the running BEMF.
Figure 15, Combined histograms of an unloaded and stalled motor at both hot and cold
We see that there are instances where the stalled rotor BEMF shows some variance and overlaps with the running motor BEMF readings. This is simply due to motor vibration causing BEMF to be above zero at the times when the ADC sample was taken. Statistically this overlap is minimal in that a majority of the time the BEMF is much lower than usual.
By setting the BEMF threshold at something around 2V a reliable detection can take place as the vast majority of the BEMF measurements were well below that level. If we look at the time it takes to effectively detect stall for this motor we find that the stall can be detected well within one mechanical revolution of the motor.
Figure 16, Histogram of stall detection times in one motor (Right is a zoom of the left)
A “current period” (as shown in the above graphs) is the time duration to make one full 360 degree electrical rotation. For this example we were stepping 32 times at 2 kHz for one full period. That translates to 16 ms per period. Within 10 half periods, or 80 ms, stall was detected 100% of the time.
Limitations
These cases compare an unloaded motor with a stalled motor. The differences between these two states are dramatic and easily detectable. From the above analysis we can see that a loaded motor will cause the detected BEMF thresholds to droop as the BEMF shifts to be more aligned with current. This drooping must be taken into account when considering an acceptable stall threshold. For every application there is a maximum expected torque requirement for an application. This maximum torque requirement must be taken into account when determining the BEMF stall threshold.
Other things that might limit this method include a loose or spongy transmission or “soft” stall where the rotor is allowed to bounce. These limitations are even more difficult to overcome using the current/duty cycle methodology. Because the BEMF sensing is done externally to the IC, this limitation can be overcome to some extent with a statistical method discerning the stall threshold.
Conclusions
The BEMF method for detecting stall while using the L9942 can be reliable and cost effective. This method takes advantage of motor parameters that change little with time or temperature. As a result this method overcomes many of the limitations found in the more traditional stall detection method of current / duty cycle sensing. In fact there is at least one automotive headlamp application where this algorithm is in full use.
David Swanson is principal engineer and Radek Stejskal is application support senior engineer at STMicroelectronics.