[gcode_macro CANCEL_PRINT] rename_existing: BASE_CANCEL_PRINT gcode: TURN_OFF_HEATERS CLEAR_PAUSE SDCARD_RESET_FILE {% set x_park = printer.toolhead.axis_minimum.x|float + 5.0 %} {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 20.0) %} {% set z_safe = 20.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 G91 G1 Z{z_safe} F900 G90 G0 X{x_park} Y{y_park} F6000 BASE_CANCEL_PRINT [gcode_macro PAUSE] rename_existing: BASE_PAUSE gcode: {% set x_park = printer.toolhead.axis_minimum.x|float + 5.0 %} {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 5.0) %} {% set z_safe = 5.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} G92 E0 G1 E-1.0 F1500.0 G90 SAVE_GCODE_STATE NAME=PAUSE_state BASE_PAUSE G91 G1 Z{z_safe} F900 G90 G0 X{x_park} Y{y_park} F6000 [gcode_macro RESUME] rename_existing: BASE_RESUME gcode: {% if printer["gcode_macro ERCF_PAUSE"].is_paused|int != 0 %} M118 You can't resume the print without unlocking the ERCF first. M118 Run ERCF_UNLOCK and solve any issue before hitting Resume again {% else %} RESTORE_GCODE_STATE NAME=PAUSE_state G90 {% if printer["gcode_macro ERCF_VAR"].clog_detection|int == 1 %} SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 {% endif %} BASE_RESUME {% endif %}