[gcode_macro PRIME_NOZZLE]
gcode:
SAVE_GCODE_STATE NAME=PRIME_NOZZLE_STATE
M117 Priming ...
G28
G1 X6.0 Y4.0 F18000 ; go to edge of bed
G1 Z0.2 F5000 ; lower nozzle
G92 E0.0 ; reset extruder position
G1 X200.0 E8.0 F1000.0 ; start intro line
G1 X300.0 E9.0 F1000.0 ; finish thicker
G1 X300.0 Y6 E9.0 F1000.0 ; finish thicker
G1 X6.0 E9.0 F1000.0 ; finish thicker
G92 E0.0
M117 Printing ... ; display message
RESTORE_GCODE_STATE NAME=PRIME_NOZZLE_STATE
[gcode_macro G32]
gcode:
SAVE_GCODE_STATE NAME=STATE_G32
BED_MESH_CLEAR #TODO: should we use this here?
G90
CLEAN_NOZZLE
G28
QUAD_GANTRY_LEVEL
CLEAN_NOZZLE
G28
CALIBRATE_Z
BED_MESH_CALIBRATE
CLEAN_NOZZLE
G28
BED_MESH_PROFILE LOAD="default" #TODO: Should we use this here?
RESTORE_GCODE_STATE NAME=STATE_G32
[gcode_macro PRINT_START]
# Use PRINT_START for the slicer starting script - please customise for your slicer of choice
gcode:
G32 ; home all axesbsolute positioning
G90 ; a
G1 Z20 F3000 ; move nozzle away from bed
STATUS_PRINTING
#PRIME_NOZZLE
[gcode_macro PRINT_END]
# Use PRINT_END for the slicer ending script - please customise for your slicer of choice
gcode:
# safe anti-stringing move coords
{% set th = printer.toolhead %}
{% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %}
{% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %}
{% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %}
SAVE_GCODE_STATE NAME=STATE_PRINT_END
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-5.0 F1800 ; retract filament
TURN_OFF_HEATERS
G90 ; absolute positioning
CLEAN_NOZZLE
G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing
G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 ; park nozzle at rear
M107 ; turn off fan
BED_MESH_CLEAR
RESTORE_GCODE_STATE NAME=STATE_PRINT_END