Back to the Gcode Dictionary
M915: Configure motor stall detection
- Pnnn:nnn:... Drive number(s) to configure
- X,Y,Z,U,V,W,A,B,C Axes to configure (alternative to using the P parameter)
- Snnn Stall detection threshold (-64 to +63, values below -10 not recommended). Lower values make stall detection more sensitive. S3 is a good starting point for many motors.
- Fn Stall detection filter mode, 1 = filtered (one reading per 4 full steps), 0 = unfiltered (default, 1 reading per full step)
- Hnnn (optional) Minimum motor full steps per second for stall detection to be considered reliable, default 200
- Tnnn (optional) Coolstep control register, 16-bit unsigned integer
- Rn Action to take on detecting a stall from any of these drivers: 0 = no action (default), 1 = just log it, 2 = pause print, 3 = pause print, execute /sys/rehome.g, and resume print
If this command refers to any axes other than X, Y and Z then it must appear later in config.g than the M584 command that creates those additional axes.
- M915 P0:2:3 S10 F1 R0
- M915 X Y S5 R2
This sets the stall detection parameters and optionally the low-load current reduction parameters for TMC2660, TMC2130 or similar driver chips. Use either the P parameter to specify which driver number(s) you want to configure, or the axis names of the axes that those motors drive (the parameters will then be applied to all the drivers associated with any of those axes).
If any of the S, F, T and R parameters are absent, the previous values for those parameters associated with the specified drivers will continue to be used. If all the parameters are absent, the existing settings for the specified drive(s) will be reported.
See the Trinamic TMC2660 and TMC2130 datasheets for more information about the operation and limitations of motor stall detection.
See here for more detailed information on Stall Detection and Sensorless Homing.