I almost gave up on this a few times. I’m still not sure that we’ll be able to set the threshold to make this viable, but here’s a working proof of concept.
I’m getting good info now without needing to hook up a computer. I reduced the auto-reporting interval and enabled debug messages (which you’ll want to set back to “Info” when done):
$Report/Interval=100
$Message/Level=Debug
I have a wire running from the diag pin on the X stepper driver to the signal pin on gpio 39.
For config, I set stallguard to 15 and turned on the debug. I reduced the amp settings to make skipping steps easier.
I set the fault_pin to gpio.39:high. Originally I had this set to low, which was wrong and caused it to alarm on startup since it can’t be active then.
I also turned on line_numbers. I created a test gcode file (sgtest.gcode) with line numbers. Ideally, when recovering from a job, knowing the line number would be very helpful. This test gcode has G1 moves every 10 mm from 0 to 200 and back.
sgtest.gcode (559 Bytes)
configsg.zip (1.5 KB)
Here you can see that I run the gcode, force it to skip a step, it alarms and stops the job, and I can see that the last line number is 35. That line number is this: N35 G0 X100
which is halfway back returning to 0. That’s about right.