Paste into a file called macros.cfg, add [include macros.cfg] to printer.cfg, and restart firmware. Needs [virtual_sdcard], [pause_resume] and [display_status] in your config. Remove any older PAUSE/RESUME/CANCEL_PRINT macros first.
These macros use END_PRINT for cancel; define your own or replace that line with TURN_OFF_HEATERS.
[gcode_macro PAUSE]
description: Pause, retract and park
rename_existing: BASE_PAUSE
gcode:
{% set z = params.Z|default(10)|int %}
{% if printer['pause_resume'].is_paused|int == 0 %}
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
G91
G1 E-2 F2100
G1 Z{z} F900
G90
G1 X10 Y10 F6000
{% endif %}
[gcode_macro RESUME]
description: Return to position, unretract, resume
rename_existing: BASE_RESUME
gcode:
{% if printer['pause_resume'].is_paused|int == 1 %}
G91
G1 E2 F2100
G90
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1 MOVE_SPEED=100
BASE_RESUME
{% endif %}
[gcode_macro CANCEL_PRINT]
description: Cancel and run the end routine
rename_existing: BASE_CANCEL_PRINT
gcode:
TURN_OFF_HEATERS
CLEAR_PAUSE
SDCARD_RESET_FILE
END_PRINT
[gcode_macro Z_OFFSET_UP]
description: Nudge live Z offset up 0.02 mm
gcode:
SET_GCODE_OFFSET Z_ADJUST=0.02 MOVE=1
[gcode_macro Z_OFFSET_DOWN]
description: Nudge live Z offset down 0.02 mm
gcode:
SET_GCODE_OFFSET Z_ADJUST=-0.02 MOVE=1
[gcode_macro COOLDOWN]
description: Everything off
gcode:
TURN_OFF_HEATERS
M106 S0
Want the rest?
The Klipper Macro Pack adds START_PRINT (adaptive mesh, prime line), END_PRINT, LOAD/UNLOAD_FILAMENT, PID shortcuts, PARK and more, plus slicer start/end gcode: https://spectre5.gumroad.com/l/lkjfl ($6)
More guides: https://patreon.com/123black
Use at your own risk. Not printer-tested by the author on every machine. Not affiliated with Creality.
Top comments (0)