@Phaedrux , I am trying to detect it during normal operation. This is not a printer application, so there are no E moves. Only two axes move at any given time, and one (Z) is very slow. Because of that, I am only trying to detect stall on one axis (Y), a high-speed rotary that is configured as linear (set up with 1 rotation per "millimeter").
(Full steps/rev * Rated Current * actual current ) / ( Sqrt(2) pi rated holding torque in NM) =
(200 * 1.68 *1) / (1.4142135623731 * 3.14159265358979 * 0.536677939)
= 336/2.385
= 140.91
So I used 150, but my RPS is around 10, which is WAY faster than 150 full-step per second. There are very few 3d printers that spin any motor at 10 RPS, so I do not believe the minimum speed is an issue. I've tried stalling the motor at start-up, and at speed, and it is not detecting it.
This is my motor:
https://openbuildspartstore.com/nema-17-stepper-motor/
And this is the site I used to convert the 76 oz*in to Nm:
https://www.convertunits.com/from/oz-in/to/N-m
The reason I am trying to detect the stall is because it can run without stalling 100 times in a row, then stall inexplicably. No change in code, no change in load. When it does stall, sometimes it stalls halfway through accel (probably at the resonance speed), and sometimes its at decel, but once in a while it's while it's running at full speed. At 1.6A, it's more reliable than at 1A, but it is not 100% reliable anywhere.
It is also more reliable when warm (i.e. after running a "burn-in" sequence for a few minutes). Warm, I'm having better luck with .5A than cold at 1A, but no matter the current, it's not detecting it.
Thanks!