Move up when Bed Mesh or QGL fails

Basic Information:

Printer Model: Voron 2.4
MCU / Printerboard: BTT Octopus Pro (446)
klippy.log

Describe your issue:

(As far as I can tell, this is not an issue with my configuration, but the default behaviour of klipper)
When BED_MESH_CALIBRATE or QUAD_GANTRY_LEVEL fails, the current print is aborted. This sometimes happens to me when I did not preheat my printer.

However, the print is aborted immediately. Since I am using a microswitch as a bed probe, the triggered microswitch remains on the hot bed. While I have always noticed that in time and the microswitch has not melted, I feel like that’s bound to happen at some point.

TLDR: Can klipper be configured to move the toolhead up after QUAD_GANTRY_LEVEL or BED_MESH_CALIBRATE fails, before aborting the current print?

klippy.log (737.5 KB)

I second this request.

Even if the switch does not melt, subjecting it to elevated temperatures (110C for ABS, for example) will definitely degrade the switch. I already had an Omron switch start giving me bad readings because of this.

I think that Klipper should run the on_error_gcode from [virtual_sdcard] since that is technically an error during an SD card print.

You should be able to accomplish this with on_error_gcode in the virtual_sdcard module. Just add a few lines of gcode to put the printer in relative coordinate mode and move Z up a few millimeters.

https://www.klipper3d.org/Config_Reference.html#virtual_sdcard

Ah, that’s cool, didn’t know about that setting, thanks!
Seems to work if the probe exceeds the tolerance, for QGL and bed mesh. Awesome!

I had a similar issue:
When QGL fails due to “required adjustment greater than max_adjust” it would move the same way it does when canceling a print, in my case across the bed. But that error means my gantry is unlevel so printhead moved into my bed.