Enable/Disable Crash Detection with G-Code?  

New Member

Is it possible to enable/disable crash detection during a print with g-code commands? If not directly, can a variable be toggled with g-code (namely, the tmc2130_sg_stop_on_crash variable in this case)? For the latter, I can see an argument for not allowing g-code to mess with system variables, but I thought I'd ask. Thanks for the info.


Posted : 08/04/2020 1:48 am
Active Member

Did you end up finding this?  Im looking for the same code.

Posted : 26/04/2020 10:19 pm
New Member

No, I never did. A cursory examination of the firmware code leads me to believe it's not there, but I would love to be wrong about that.

This post was modified 3 months ago by kristoffer.l
Posted : 26/04/2020 10:59 pm
Karl Herbert
Famed Member


Here the possible Marlin g-codes for Prusa printers and other: https://marlinfw.org/meta/gcode/

I think deactivate crash detection over standard g-code is not possible on the MK series.


Statt zu klagen, dass wir nicht alles haben, was wir wollen, sollten wir lieber dankbar sein, dass wir nicht alles bekommen, was wir verdienen....
Posted : 27/04/2020 12:01 am
Active Member

thanks, i checked them out and it does not look like its available over gcode, shame. Trying to do exactly the same as the OP and i have the printer set up to eject and detect that it has ejected with a camera and motion detection but crash detection has to be manually disabled for the print.


Posted : 27/04/2020 12:05 am
Honorable Member


if you are familiar with the firmware:

There are service G codes for a comparable function. This allows you to set the threshold for triggering the "crash-detect" function, which leads to the desired result.
Threshold values for the axes are currently X = 3, Y = 3, Z = 4, E = 3.
M916 [X | Y | Z | E] for normal printing (e.g. "M916 X3"); this is not used for homing.
Use a higher threshold (e.g. 10) to switch off the "crash-detect" function for the corresponding axis.
The service G codes must be switched on in the firmware (TMC2130_SERVICE_CODES_M910_M918) and the firmware must then be recompiled and flashed. This G code can then be used in either the user start or user end code of the slicer. The changed settings cannot be saved permanently in the printer using the M500 code.

greetings, Holger 🙂 



2x Personal MK3IR-BMG09 (Full) BEAR + MMU2S mod., ......
Posted : 27/04/2020 1:45 am

Please Login or Register