How can I detect when a stepper motor has stalled?

A google search led me to some people who say that when the stepper motor stalls, the current spikes up, which is easily detectable with a Hall sensor. (Or, I suppose, by any of the other current sensors mentioned at "How can I sense the motor's current?" ).

However, I measured the current through (one of the 4 wires of) my stepper motor, and it's always within a few percent of 0.5 A, whether my stepper driver is holding one position, moving it normally (which in my application is very slowly), or the stepper driver thinks it is telling the stepper to move normally, but the motor has pegged out against the hard limit. Measuring the current in the +12V power supply going to the stepper motor driver, also seemed to give a fairly constant current. This may be because I turned down the current limit to that amount on my "chopper" stepper motor driver.

Am I missing some key detail in the "measure the current" approach?

A google search led me to some other people that measure the back-EMF (BEMF) in one coil of the stepper during the time the stepper driver is only driving the other coil. But that only seems to distinguish between "a motor moving quickly" vs "a motor stopped", and doesn't seem to distinguish between my case of "a motor moving slowly" vs "a motor stopped".

Is there some way to apply the BEMF approach even in a system where I always drive the stepper slowly, and never spin it quickly?

I'm currently using a stepper driver board with the TI DRV8825 chip on it, and I hoped the "fault" pin would tell me when the stepper motor has stalled against my hard stop. But it doesn't seem to be doing anything -- is it supposed to tell me about a stall, but I just have it wired up wrong?

Is there some other chip or drive technique that detects when the stepper has stalled out against the hard stop?

Is there some other technique for detecting a hard stall that I can "add on" to a system using an off-the-shelf stepper motor driver?

(Is there some other StackExchange site that is more appropriate for questions about motors and motor drivers?)

  • $\begingroup$ Related: robotics.stackexchange.com/questions/865/… $\endgroup$ Commented May 9, 2013 at 23:37
  • $\begingroup$ current sensing via a shunt resistor fed to an op amp to a simple PID controller to the adc might work... $\endgroup$
    – user9758
    Commented May 20, 2015 at 21:40
  • $\begingroup$ Huh? How does that help me detect when a stepper motor has stalled? As I mentioned in the original question, "I measured the current ... and it's always within a few percent of 0.5 A, whether my stepper driver is ... moving it normally (which in my application is very slowly), or the stepper driver thinks it is telling the stepper to move normally, but the motor has pegged out against the hard limit." $\endgroup$
    – David Cary
    Commented May 20, 2015 at 23:21
  • $\begingroup$ This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. $\endgroup$
    – Shahbaz
    Commented May 28, 2015 at 16:19
  • $\begingroup$ i was searched this too. i think best possible way to using feedback encoder comparing step angle and stepping number with input pulse $\endgroup$
    – user10002
    Commented Jun 24, 2015 at 14:01

5 Answers 5


One option is a stepper motor driver which uses sensorless stall system, such as the STMicroelectronics L6470 dSPIN: Fully integrated microstepping motor driver with motion engine and SPI.

Once calibrated it can detect a stall condition and raise the FLAG pin high to alert to the uC of the problem.

  • 3
    $\begingroup$ Welcome to robotics kurtnelle, and thanks for your answer. I've edited it to provide a little more context and provide enough information from the link so that people can find the information elsewhere if the link rots. $\endgroup$
    – Mark Booth
    Commented May 8, 2013 at 12:01
  • 1
    $\begingroup$ I've found that the L6470 stall detection is very hard to calibrate. My process has been to find the minimum kvals required for reliable, normal operation (ignoring stall threshold). Then I move up the stall threshold until it stops reporting stall errors. Then I increase it a little more for headroom. But many times, it still does not detect a stall condition... do you have any suggestions? $\endgroup$
    – Dave
    Commented Nov 4, 2015 at 15:48

If you want to detect missed steps, you want an encoder. Luckily, both magnetic and optical encoders exist that easily give you 4096 steps per revolution, so even a micro-stepping stepper motor will be measured with at least one step per step.

Note that some CNC mills may not necessarily detect missed steps; it's up to the operator to not program a tool path that's too hard for the spindle and tool, and to hear the problem when it happens. Instead, those CNCs just use end limit switches to find the absolute home, and then work entirely by assuming steps are taken.

Encoders may allow you to experiment with other features, too, like using an assist DC motor for non-engaged moves for really fast rapids :-)


I found that the FFT of the current waveform of the stepper often shows the natural frequency harmonics of the motor+driver system AND that during a stall extra frequency harmonics appear!!! all you need is a fast, bidirectional current to voltage conversion IC and a narrow band pass filter to detect if the extra harmonics are present.


You need to quantify : "I measured the current through (one of the 4 wires of) my stepper motor, and it's always within a few percent of 0.5 A". A 'few percent' may be all you need to detect a little extra current during stall (if there is extra current as I would also assume but would need to prove), which can be sensed and compared to normal stepping current. In some cases 40 uA is major and in some cases 4 mA is major difference. Without measurement parameters from you it is impossible to really advise you.

So, what exactly is the current for a step versus stall, and is the difference consistent? I would measure all the wires as well... You are using a unipolar correct? I have used steppers but never bothered to measure current as the steppers I used matched the load requirements and never stalled. So one quick answer is just to get a bigger stepper.


Unfortunately, as you've discovered, it is difficult to tell if a stepper motor is stalled because the current through the coils of a stepper motor is roughly the same if it is stalled (can't step), holding position, or stepping normally.

You could definitely detect a stall with ease if you added an encoder or used a stepper motor that already had one.

Why do you want to detect the stepper motor stall? Unlike a brushed DC motor, stalling a stepper motor is typically not bad for it. Could you achieve the same purpose with a limit switch?

  • 4
    $\begingroup$ Detecting stall is important for detecting missed steps esp. in CNC milling where part tolerances are critical. $\endgroup$
    – user797
    Commented May 9, 2013 at 18:38
  • 2
    $\begingroup$ Old post, but detecting stalls is also important if you're driving a single axis (on a CNC machine, for instance) with two motors. Otherwise you're nice square, carefully-crafted and no-doubt-expensive gantry can tear itself to shreds. $\endgroup$
    – 3Dave
    Commented Jul 6, 2018 at 18:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.