Benefits of sensorless stall detection in stepper motor drivers
The ability to reliably detect the stall of a stepper motor for overload or end-of travel conditions without the aid of external sensors has long been sought after in stepper drive systems. By detecting back-emf phase shift between rising and falling current quadrants of the motor current, learn how stepper devices from Texas Instruments can detect a motor stall that is independent of changes in motor current, motor winding resistance, ambient temperature, and supply voltage.
Resources
Welcome, everyone, to the industrial TI Tech Day. So this is of Sensorless Stall Detection session being presented by Ryan Kehr. My name is Pablo [? Arment, ?] and I'll be the moderator for this session.
All participants will be muted for this session, so please use the chat function to ask any questions, and make sure that it's addressed to everyone so that Ryan and I can see them. Also, if during the presentation you have any problems hearing or seeing the presentation, please let us know in the chat so we can fix them. With that being said, I'll hand it off to Ryan so we can get started.
Hello, everyone. My name is Ryan Kehr, as Pablo mentioned. And I will be presenting this session. So let's get right into it.
So first of all, let's begin by just discussing, what is stall when we talk about stepper motors? And what are the main causes of stall in a stepper motor system? The stall condition is what happens when the load torque on a motor exceeds the motors pull-out torque. And this pull-out torque is the maximum torque that the motor can produce at a given speed before the rotor becomes out of sync with the magnetic field. And when the rotor becomes out of sync with the magnetic field, then the motor will stall.
So these curves are typically provided by motor manufacturers that provide the torque or the pull-out curves similar to the one shown on the screen here. This curve shows the motors pull-out torque for a range of speeds. So the pull-out curve profile will be different from motor to motor. And designers use this curve to ensure that the motor's torque capability can meet the mechanical torque requirement of the system.
As you can see, the pull-out torque decreases as the speed increases. It is also proportional to the motor current. So you'll see, it'll be given for a particular drive current. In this case, it's a 0.6 amps per phase for a two phase excitation. And then the voltage is also given there at 24 volts.
There are many ways that a motor can experience a stall event. This is just one of the more abusive conditions where you can physically jam the rotor by grabbing it with, say, a pliers in this example. The motor can be overloaded with a, and then exceed the pull-out torque curve. Or there can be some sort of a physical obstruction, like in a machine environment where a user, an operator somehow gets in the way of the movement of a robot arm or something like that. Anything that will prevent the rotor from spinning is considered a stall event.
So what about the need for sensorless stall? This is due to the lack of feedback in an open-loop motor system. So most stepper motor devices operate with an open loop control. So there is no feedback on position, and there's no feedback on speed. So it's required to have either an external observer of some sort or some sort of a centralist way to detect stall based off of current or voltage.
So the stall detection in the system allows the system to work in a closed loop operation, making it possible for the system to determine if the motor is spinning or not. Additionally, stall detection can be helpful for applications that require sensing when the motor has reached an end of line or a fixed mechanical stop. And furthermore, stall detection can reduce potential mechanical failures and audible noise that it can occur if the motor continues to be driven through an obstacle. So sensorless stall detection can replace expensive motor position modules like haul sensors and encoders that we'll talk about later.
So some examples of applications, one of them is an ATM machine. So here, if you had some issue with bills in the machine getting jammed up, similar to a paper jamming in a printer, stall detect that can be used to detect that and flag the system. Other applications would be a surveillance camera. If during icy conditions, somehow the movement was obstructed or required more torque than normal, or if a user had jammed the camera from moving in a pan tilt, Zoom type fashion, this could be detected.
Other applications are automotive. This would be in a headlight leveling system, where the motor is either moved up and down for leveling or left and right for steering. And the stall detect can be used to detect an end of travel for both up and down or right to left.
And then, finally, industrial textile machines, so there's many stepper motors that are used. And there's often a lot of human interaction with these machines. And for safety reasons, you may want to make sure that you detect when something is jammed in the system or if a human is somehow interacting with the machine in a way that they is not expected.
So just to talk about some existing solutions, so this would be a sensor solution to stall detect. So this would be using an encoder as an external observer. So these could be positioning coders to monitor the motor movement, the rotor movement, and detect stall. The encoder shown in this animation is an optical encoder. And an optical encoder has two different patterns of alternating, opaque and transparent segments.
So as photodetector detects light passing through the transparent segments of the plate, then this is picked up on the other side by a biosensor. And as the rotor plate begins to rotate, the photodetector output generates square wave pulses. And these pulses correspond to the rotor movement.
So by monitoring the number of pulses and the relative phase of the signals A and B, it is possible to track both the position and the direction of the rotation. And then the indexer pulse, which is generated one time for every revolution, helps the controller determine the absolute position of the encoder. So you can see here in this animation, this is the type of feedback that you would get from the encoder.
Depending on the encoder resolution and the chosen step mode, either full step or micro step being the number of encoder outputs for each step would be different. Under normal driving conditions, the number of encoder outputs per step should remain constant. However, if the encoder counts per step are less than they expected, then you know motor has experienced some sort of a stall event.
While the encoder can monitor position and detect stall, it adds an extra component to the system, which increases the overall cost and size. So the benefits are that they are multifunctional both in the ability to detect position and speed. They are typically robust. The drawbacks are the high cost and also the increase in system area just to, for the physical encoder itself, and then also for the circuitry required on the PCP. To look in an encoder designed example, please refer to the reference design cited at the end of this presentation.
So let's talk about a sensorless solution. So we talked about a sensored solution before within encoder. But now we want to talk about a sensorless back-emf measurement. And in this case, the system may only need to detect stall but not position. So the encoder does give you that position information, but in this case, we're actually trying to detect speed, and since the motor's back-emf to detect stall in order to eliminate the cost of the encoder.
The back-emf is the voltage induced by the rotor's magnetic field moving past the stator coils. So this is the equation here. The back-emf in a stepper motor can be expressed as the following, where p is the number of pull pairs, psi-m is the motor's maximum magnetic flux, and omega is the motor's angular speed. p and psi will be constant, specific to each motor. Therefore, the back-emf will be sinusoidal in nature and directly proportional to the motor speed.
So to better visualize this, let's take a look at a real back-emf waveform of a stepper motor for two different speeds. So the first plot that we show here is at 200rpm. And the back-emf amplitude is 3.95 folds. And it's frequency is 181 Hertz.
As the speed is increased, you can see in the bottom right graph, the speed is increased by a factor of 4 to 800rpm. The back-emf amplitude increases to 17.2 volts, which is almost four times larger than the back-emf at 200rpm. And then the frequency also increases by a factor of 4 to 683 Hertz as expected. When the motor stalls, the back-emf up goes to 0 volts since the motor speed is 0rpm in a stall condition. Therefore, a drop in back-emf is a good indication that the motor is stalling.
So the benefits of this is it can be implemented without any sensors. Eliminates the need for any additional external components, both physically with the encoder segments themselves, and then also with the circuitry on the board. There's also a software improvement because you don't have to have that software built into your microprocessor.
There is, however, a fundamental limit on the performance of the back-emf stall detection method, is the minimum back-emf voltage that can be detected. So this corresponds to some sort of a minimum speed for the algorithm to properly detect a stall. And the minimum speed for successful back-emf stall detection will change for various motors, depending on the number of poles and the maximum magnetic flux. So it will need to be tuned for different motor applications.
So let's look at an example of this direct back-emf measurement as it is currently implemented in one of our devices today. TI implements a direct back-emf measuring scheme where the back-emf is measured and sampled during the 0 current step to detect the stall. The DRV87-11 uses this solution today for its stall detector algorithm.
The following animation will demonstrate how this algorithm functions. So during the normal, when the motor is running and the winding current approaches the 0 current step, so here in this animation, you can see the current's flowing from VM through one of the high side transistors, down to one of the low side transistors, and then into a shunt resistor. Once the winding current approaches 0 current state, one side of the H bridge is placed in a high impedance state.
And the opposite side's load side FET is turned on for a brief moment of time. This is also known as the back-emf sample threshold. And by putting the transistors in this state, it allows the current to quickly decay through the low side FET and the body diode of the opposite FET.
Then the back-emf is sampled on the high output at the end of this sample threshold. So during this normal motor operation, the sample back-emf should be stable, sinusoidal, and greater than 0. However, the sample back-emf should decrease to 0 when the motor stalls.
Since this back-emf is only monitored during the 0 current step, the drawback to this method is that it will not work when the stepper motor is running in a full step mode. The reason for this is in full step mode, the coil current switches between the positive and negative maximum current set by the user, and it is never in a 0 current step. Therefore, the back-emf of measurement cannot be made for the full step mode, so this is one of the limitations of the direct back-emf measurement technique.
So let's talk about an indirect back-emf measurement. So the indirect back-emf measurement utilizes the relationship between the winding current, back-emf, and mechanical torque of the motor to detect a stall condition. As shown in this figure, the back-emf is 90 degrees out of phase with the winding current for an unloaded motor. The back-emf phase shift will start to decrease as the load increases.
Finally, as the load approaches the motor's pull-out torque at a given winding current, the back-emf will move in phase with the winding current. And when the low torque exceeds the pull-out torque, the motor stalls, and the back-emf goes to 0. By being able to detect the back-emf phase shift between rising and falling current quadrants of the motor current, it is possible to detect a motor stall condition or end of line travel.
This stall detection solution estimates the back-emf phase shift by constantly monitoring the effect of back-emf on the current regulation waveform. The current regulation waveform is observed in both rising and falling quadrants to estimate the back-emf phase shift between both quadrants and determine if the motor is unloaded, fully loaded, or has reached a stall condition. The constant current regulation waveform allows the algorithm to work for all micro-step settings, including full steps.
So this is an advantage that the indirect back-emf measurement has over the direct back-emf. However, a drawback of the solution is that the current regulation waveform can have heavy dependencies on supply voltage, motor current, and motor resistance, which can make it difficult to properly monitor the back-emf. The following slide will show how TI implement this solution for its stall detect algorithm and how it overcomes its drawbacks.
So the TI solution uses a fixed current ripple method. This stall detection algorithm monitors the back-emf phase shift between rising and falling quadrants by measuring the off time for both quadrants to determine if the motor is stalling. Measuring the PWM off time eliminates any dependencies on supply voltage, as the supply voltage is disconnected during this off time when current is recirculating to the load side FETs.
The off time gives a good indication on how much back-emf is present. And usually, the more back-emf present, the longer the off time will be. So this regulation technique is a variable off time approach. So therefore, we can use that off time information to determine if we have a stall.
The algorithm uses the delta of the T off reciprocal between the rising and falling quadrants to estimate the change in back-emf. During normal operation, there will be more back-emf present in the falling quadrant than in the rising quadrant, due to the back-emf being out of phase with the current. Therefore, the change in back-emf should be positive and greater than 0 when the motor is not stalling. And as the motor approaches a fully loaded condition, the back-emf will become in phase with the current.
This causes the back-emf to evenly balance out between both quadrants. And as the motor fully stalls, the back-emf disappears completely. And in this case of a fully loaded installed conditions, the off time will be approximately the same in both quadrants. The algorithm can detect the stall condition when the change in T off time equals to 0, which also means the change in back-emf is also 0 since the motor inductance in current ripple are constants.
To look at a device which implements this stall detect algorithm, search for DRV8889-Q1 or DRV8434A or DRV8434S. These are all devices that currently implement this type of stall technique. So what does this look like on a scope capture?
So down here in the bottom of the slide, the bottom middle of the slide, is a representation of the torque count in the device. So the device will either have an internal register that can be read to pull out this torque count information, or there'll be an analog output with a voltage that's proportional to this torque count values. So a higher voltage on that pin represents a higher torque count for the device.
Either way, it depends on the device that's chosen. This account information is available. And then a threshold that's represented by this red line can also be set in the device to allow a trigger event for a stall condition.
So you can see here, during normal speed operation on the left, the torque count value is high and above the stall threshold. And there's more back-emf in the second half, quadrant two, than the first half, quadrant one, due to the back-emf being 90 degrees out of phase. So you can see that there is this difference in T off time here represented by the yellow waveform between quadrant one and quadrant two.
When the motor stalls the back-emf shifts the left to evenly balance out in the second half of quadrant two and the first half of quadrant one. And this is what brings this torque count value below the stall threshold and would trigger a stall. This stall was created abruptly by holding with a pair of pliers, as we showed in the very first slide.
So in summary, these are the three different techniques that we talked about, the encoder, the direct back-emf measurement, and the indirect back-emf measurement. Detecting when a motor stalls or reaches a fixed mechanical stop or end of line travel can greatly benefit many industrial and automotive systems. Stall detection helps prevent potential mechanical failures that can occur when a motor is overdriven past an obstacle.
We have discussed three methods. This table summarizes the advantages and disadvantages. And the encoder method can precisely monitor the motor position and can work at very low speeds if the encoder resolution is high enough.
However, using the encoder will increase the system cost and size. You can see there, that's listed as a disadvantage. Direct and indirect backing and measurement methods are both sensoral solutions, which help to reduce the design costs and system size, so there's no need for an external encoder.
Both methods also require a minimum motor running speed in order to properly detect the stall condition. The indirect back-emf measurement method will be able to detect stall for all micro-step settings, including full step. On the other hand, the direct back-emf measurement will not work in full-step.
The indirect method may not work properly if there are large supply voltage motor currents or motor resistant variations. However, there are ways to minimize the effect of those parameters when detecting stall. For example, TI solves this issue by measuring the current regulation PWM off time to determine if a motor is stalled.
Thank you for attending the session today. These are just some call outs for diagrams that we've used in the presentation, as well as a link to an encoder-based stall detect reference design. And these are some devices that we discussed today, as well the DRV8889-Q1, DRV8434A, and the DRV8434S. Thank you for your time.