MENU

Back EMF method detects stepper motor stall: Pt. 1—The basics

Back EMF method detects stepper motor stall: Pt. 1—The basics

Technology News |
By eeNews Europe



(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.)

For many years we thought we understood stepper motors. They seemed fairly straightforward machines. A stepper motor is essentially a motor who is a slave to the controller. “Aren’t they all?” You say. Not like this. Commutation is done by the controller, when the controller wants to; without regard to anything the stepper motor has to say. The controller requires no feedback to help with appropriate times to commutate.

In comparison, a brush type motor commutates when it wants to and doesn’t need the controller to perform any of the commutation. The brushless DC (BLDC) motor, a close relative to the stepper motor, at least gets to tell the controller when it wants to commutate. A stepper motor, on the other hand, is told to go or told to stop at any point… a slave. As a result the motor has to be driven well beyond what is necessary to ensure that it moves (and stops) when told. The stepper motor controller doesn’t need feedback. When one is yelling he/she is not interested in feedback. A stepper motor controller is, in effect, yelling at the motor.

A good analogy would be a restaurant:

  • A brush type motor is like a buffet… You eat what you want when you want. The amount of food available is all that is controlled.
  • A brushless motor is like a fancy sit-down restaurant where the waiter is waiting for you to tell him when to serve you. He does his best to serve you when you want to be served. He only has control as to the amount of food you get to eat.
  • For a stepper motor, the waiter says “YOU EAT NOW!” or “YOU GO HOME NOW!”… I think you get my point.

In reality, feedback is important
Even in a stepper motor feedback can be desirable. For instance it would be good to know if the motor stops listening (i.e., stalls). We can look for feedback on the state of the motor by polling a third party such as a position sensor. Or we can look to the motor itself for rotational information. This can be done in the form of motor current monitoring as a reflection of back electro-motive force (Back EMF or BEMF). Or we can look directly at BEMF.

External components to monitor motor position can add cost to the system. If we can get what we need without adding components or cost then we will. Our mantra… "More Features with Less Cost" is a good thing. After all, we are engineers.

The L9942
The L9942 is an integrated stepper motor driver for bipolar stepper motors used in automotive headlamp leveling. Among its many features is (quoting from the datasheet) “a programmable current profile look-up-table to allow for flexible adaptation of the stepper a motor characteristics and intended operating conditions.” In other words it can do full stepping, half stepping, and micro-stepping nicely. The L9942 micro-stepping mode provides for 32 programmable current regulated steps over 360 electrical degrees. That translates to eight different levels of current per quadrant.

Each step current is regulated by pulse-width modulation (PWM) control. The PWM on-time is fixed by an oscillator. The off-time is set by the current measured. A current mirror feedback provided from the high side switches is compared to a preset (programmable) current value through a look-up table. When the current in the phase matches the value in the look-up table the phase is turned off until the next PWM on-time. As a result a current sine wave is approximated in 32 steps through PWM control of the outputs.


Figure 2, L9942 current regulation block diagram


Stall detection methods

Of the two methods previously described, monitoring motor current for the absence of back EMF is more indirect. During stall, the motor current rises quickly because the back EMF is absent. Lack of BEMF does two things. First, it increases the potential current in a winding at a given voltage per Ohm’s law. Secondly, it increases the rate of change of the current in the windings because the rate of change of current in an inductor is proportional to the voltage across the inductor. With little or no BEMF in a motor winding the current both rises, and rises quickly.

However, when micro-stepping, the system regulates the motor phase current by turning off the phase when the preprogrammed current threshold is reached. As a result, the motor current will not spike when the motor is stalled. Instead, the duty cycle will reduce to something fairly small as the current control algorithm compensates for the loss of BEMF. Loss of BEMF is then detected by observing an abnormally low duty cycle for a given commanded current. The L9942 has the ability to measure this duty cycle and report back to the host micro the information via SPI (Serial Peripheral Interface).

The difficulty with this method is that there are many parameters that can move around in the normal operating space of a stepper motor. Things like temperature, battery voltage, and loading or torque can have a dramatic affect on the current regulation duty cycle. In the end the operating point at one end of the normal spectrum can look like a stalled motor at the other end. Overlapping parameters make it difficult at best to safely discern a stalled rotor. As a result it is not as simple as measuring a current or looking at a regulated duty cycle.

To minimize the effects of motor resistance, battery voltage, and temperature the stall detection algorithm can look directly at BEMF.

BEMF sensing explained
The next thought then is to approach the issue at the source, sensing BEMF directly. Overdriving a stepper motor phase causes the BEMF to be shifted up to 90°. As a result in an unloaded stepper motor, the BEMF is highest in a phase when the current is the lowest in that phase.

We can take full advantage of this phenomenon when sensing BEMF. When the phase current is transitioning from one polarity to the other, the current passes through zero. Little or no current in the phase means that when we turn off the phase to look for BEMF there are no big issues with the inductive flyback. Actually, we are off anyway. We might as well look.

The resulting waveforms (Figure 5) look as we would expect. In an unloaded motor at the points where the phase current is at or near zero the back EMF for that phase is the strongest.

Where we have to be careful is when understanding the effects of motor loading on the phasing (or phase shifting) of the back EMF. Since this algorithm only looks for BEMF when the phase is not being driven, there is a very short window to “look.” As the motor is loaded, the back EMF shifts such that it will be more in line with the driving voltage/current for that phase. As can be expected motor loading adds some variation to the BEMF detection. A fully loaded motor just on the edge of stall looks to be the same as a fully stalled motor. Fortunately, a stepper motor is not intended to be driven with that much load. Universal motor concepts
There are two universal concepts in motors that will always be true. The first is that Back EMF is directly proportional to angular velocity (or armature speed). The second is that motor torque is directly proportional to motor current.

BEMF vs. angular velocity
The back EMF equations illustrate the relationship between angular velocity and BEMF quite clearly:

Notice that N, B, and A are all constants specific to the motor construction. They never change, unless there is some dramatic entropy going on! At that point BEMF detection is the least of your concerns!

Aside from the sinusoidal nature of the signal, BEMF (bemf) is directly proportional to motor speed (ω) and nothing else.

Current vs. torque
The next universal concept is the relationship between motor torque and motor current. Again, the equations describe this clearly:

Note again that current (I) and torque (T) are directly proportional to each other. Yes, there are other factors that affect current like voltage and the temperature dependence on resistivity of copper. These things can increase or decrease the motor current capability which will affect the total available torque. However, they will not change the torque-to-current relationship.

Let’s think for a moment. A stepper motor is typically a fixed current system. That is, the controller feeds a fixed set of currents into two phases at a rotational velocity that ends up being directly reflected by the rotor. If a fixed current into a motor produces a fixed torque how can a stepper motor have a fixed current and rotate at a fixed speed for a wide range of loads or torques? The answer is in the phase shifting, automatically, of the BEMF with respect to the drive current.

The phase current will generate the torque based on the aforementioned equations. What direction that torque will be applied will depend on the load. A lightly loaded stepper motor will have a small portion of the torque actually driving the load. A remaining portion of the motor torque is used to slow the motor down. To never go above the commanded rotational speed the current is first driving the motor to go faster and then braking it to go slower. The overall torque coming out the output shaft is zero for an unloaded motor.

The following graphs estimate BEMF and motor current. BEMF also is a good representation of rotor position as the moving magnets in the rotor induce BEMF in the stator. It is not as pretty as I have drawn it but it is a reasonable illustration of the point. The rotor magnetic field is fixed to the rotor and rotates with it. The stator field is related to the current in the stator. A “positive” current in the stator creates a “positive” field and vice versa.

With magnetics (and some people), opposites attract. Looking at Figure 6 above when the polarity in the stator is the opposite of the rotor there is attraction and thus acceleration. When the polarity is the same in both the rotor and stator, braking occurs. In an unloaded motor we get an almost perfect distribution of acceleration and braking. As the stepper motor is loaded, the BEMF shifts to convert more of the torque to forward motion and less to braking.

In Figure 7, which illustrates a partially loaded stepper motor, the back EMF has shifted to increase the percentage of driving torque over the braking torque. This shift will continue as external loading is increased until the loading exceeds the potential torque capability.

In a fully loaded stepper motor, the moment that the torque demand causes the back EMF to shift any further the output torque decreases. Then it is all over. The motor stops rotating. “YOU EAT NOW!” has no effect. All the yelling in the world is not going to get this thing moving again.

Part 2 of this series will look at the effects of torque on back EMF and BEMF detection circuitry.

David Swanson is principal engineer and Radek Stejskal is application support senior engineer at STMicroelectronics.

If you enjoyed this article, you will like the following ones: don't miss them by subscribing to :    eeNews on Google News

Share:

Linked Articles
10s