ISO current-spike-detector for stepper limit detection

Thread Starter

Supuflounder

Joined Jun 5, 2020
13
I need to detect end-of-travel of a stepper. There is no good way to use a limit switch (the obvious solution) because it takes several revolutions of the stepper to move between the limits and there is no place I can mount six limit switches on the small volume being controlled by three steppers (not x, y and z, but zoom, aperture and focus). So I want to look for the current spike when the steppers hit the end. I am using a RasPi 4 and the stepper {shields, bonnets, hats, whatever, I can't track all the terms} I just ordered. What I want to do is generate a digital signal when I hit the end of travel. While I can probably do this with a sense resistor and some simple circuitry behind it, I am looking ideally for a prepackaged solution that might support all three steppers on one breakout, or even a sense chip that can monitor more than one current sensor and produce a clean digital signal without having to use discrete Schmitt trigger chips and a bunch of analog circuitry. Nothing jumped out at me from DigiKey searches
 

Irving

Joined Jan 30, 2016
3,887
A stalled rotor will result in increased stator current, but with lightweight steppers its going to be hard to distinguish that. An encoder disc would tell you if the rotor is moving or stalled and would provide feedback to help with positioning. As it stands, once you've hit the limit you risk missing steps so your subsequent positioning will be inaccurate. I don't know of any prepackaged current sense solutions, but I doubt they'll help here.
 

AlbertHall

Joined Jun 4, 2014
12,346
An encoder disk would allow correction for the missed steps.

Rather than hitting the end stop, if you know how steps it is from end to end, could you count the steps and avoid the end stop?
 

Thread Starter

Supuflounder

Joined Jun 5, 2020
13
An encoder disk would allow correction for the missed steps.

Rather than hitting the end stop, if you know how steps it is from end to end, could you count the steps and avoid the end stop?
Once I hit the end point, even if I miss a few steps, I now know my starting point. But I do not trust an open-loop control system in the long-term.
 

Irving

Joined Jan 30, 2016
3,887
It's possible to detect the stall, but hardly a simple "spike in the current" - the link below will help you to get a clearer idea of what is involved.

https://www.st.com/resource/en/appl...ll-detection-algorithm-stmicroelectronics.pdf
Thanks for that; an excellent article, and similar to the technique used to detect stall in a sensorless BLDC motor. I knew of the technique but not seen such a good explanation with waveforms....

Stall current. I got an answer on a different path, and am looking into the TMC2130 chip.
Nice chip. Looks like "Stallguard" is similar to the ST technique though not as well explained. The configuration/setup is pretty daunting though!
 
Last edited:

Reloadron

Joined Jan 15, 2015
7,517
Count the steps? With the direction known you will have N number of steps per revolution. Stepper motors usually have 200 or 400 full steps per one rotation of its shaft. one step is equal to 1.8°. For motors with 400 steps per revolution this means one step is equal to 0.9°. That or as you plan, look at the current for each motor and detect the stall.

Ron
 
Top