How to log stepper skipping by monitoring its driver
-
I am wondering if it is possible to log a message to a file every time a stepper skips or fails to execute commanded steps because of insufficient torque. This could be possible by monitoring current or voltage of its driver. I am using a Duet2 WiFi which has some sensors and the stepper drivers are built-in, so this idea is not completely fallacious (I hope).
-
@Triet I assume you have read https://docs.duet3d.com/en/User_manual/Connecting_hardware/Sensors_stall_detection
Main issue here is you can measure a stall, but not the number of steps skipped / lost, or rather the positional displacement. You need closed loop control for that which RepRapFirmware supports as well: https://docs.duet3d.com/en/User_manual/Tuning/Duet_3_1HCL_tuning
-
@Triet stall detection is limited in its capabilities. What actually happens is that the TMC driver measures the load on the motor. This doesn't work at low speeds because it relies on the back emf of the motor being large enough to not be confused with the voltage needed to overcome the resistance of the motor. So if you tune the stall detection parameters appropriately then a "stall detection" event means that the motor was moving quickly enough for stall detection to be operating, and the motor load was high enough to suggest it may have stalled.
The resistance of the motor increases with temperature, and this has the effect that the stall detection threshold reduces as the motor heats up; which could lead to false stall reports.
-
@dc42 said in How to log stepper skipping by monitoring its driver:
...and the motor load being high enough to suggest t may have stalled.
OK, an event only suggests it may have stalled. I may get false positives then.
Not exactly what I would expect but still a help. If, for example, the print fails, and the stepper was stalling very offen, then I would well-grounded assume that the stepper was overstrained.@oliof said in How to log stepper skipping by monitoring its driver:
"Main issue here is you can measure a stall, but not the number of steps skipped / lost, or rather the positional displacement."
I would be satisfied just to know that a meaningfull stall event happened. 100 steps skipped are no better than 200.
I will read that documentation, thanks. Did not even know this is possible.
Thanks very much for this valuable information
-
If you want to log the detected stall (regardless of accuracy) then look at the events functionality
https://docs.duet3d.com/User_manual/RepRapFirmware/Eventscreate a driver-stall.g
In that use echo to log the event to file
(From memory - check syntax)echo >>"stall-log.txt" param.S
-
@OwenD
That is what I did, thanks.
Now I am tuning the value of the S parameter in this line of the config.g file:
M915 X Y S30 R2
At S30 no stall events reported yet, but they were reported at values smaller than 10 (false positives).