[gcode_macro G32] gcode: BED_MESH_CLEAR G28 QUAD_GANTRY_LEVEL G28 G0 X150 Y150 Z30 F3600 [gcode_macro M600] description: Change filament gcode: SAVE_GCODE_STATE NAME=M600_state PAUSE FILAMENT_UNLOAD M117 >> change filament RESTORE_GCODE_STATE NAME=M600_state [gcode_macro CANCEL_PRINT] description: Cancel the actual running print rename_existing: CANCEL_PRINT_BASE gcode: TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro CENTER] gcode: {% if "xyz" in printer.toolhead.homed_axes %} G0 X150 Y150 F10000 {% else %} {action_respond_info("Printer not homed")} {% endif %} [gcode_macro PAUSE] description: Pause the actual running print rename_existing: PAUSE_BASE # change this if you need more or less extrusion variable_extrude: 1.0 gcode: # read E from pause macro {% set E = printer["gcode_macro PAUSE"].extrude|float %} # set park positon for x and y ## close to max {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} ## close to min {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} # calculate save lift position {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 2.0) %} {% set z_safe = 2.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} # end of definitions M117 >> pause PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} [gcode_macro RESUME] description: Resume the actual running print rename_existing: RESUME_BASE gcode: # read E from pause macro {% set E = printer["gcode_macro PAUSE"].extrude|float %} # get VELOCITY parameter if specified {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} # end of definitions M117 >> resume {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F6000 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro FILAMENT_UNLOAD] description: unload filament gcode: {% if printer.extruder.can_extrude|lower == 'true' %} M83 # e relative coordinates G0 E-75 F3000 # unload M82 # e absolute coordinates {% else %} {action_respond_info("extruder not hot enough")} {% endif %} [gcode_macro FILAMENT_LOAD] description: load filament gcode: {% if printer.extruder.can_extrude|lower == 'true' %} M83 # e relative coordinates G0 E50 F3000 # load fast G4 P1000 # wait 1s G0 E35 F300 # load slow M82 # e absolute coordinates {% else %} {action_respond_info("extruder not hot enough")} {% endif %} [gcode_macro FILAMENT_PURGE] description: purge filament gcode: {% set e = params.e|default(10)|float %} {% if printer.extruder.can_extrude|lower == 'true' %} M83 # e relative coordinates G1 E{e} F300 M82 # e absolute coordinates {% else %} {action_respond_info("extruder not hot enough")} {% endif %} [gcode_macro HOME] gcode: M117 >> homing G28 M117 >> moving G0 X150 Y25 Z30 F10000 M117 >> homing done [gcode_macro PRINT_START] gcode: M117 >> configuring SET_LED LED=caselight RED=0.00 GREEN=0.00 BLUE=0.50 M140 S{BED} # start bed heating M104 S{EXTRUDER} # start extruder heating G92 E0 # reset extruder G21 # set units to millimeters G90 # use absolute coordinates M83 # use relative distances for extrusion G4 P1000 M117 >> homing SET_LED LED=caselight RED=0.00 GREEN=0.50 BLUE=0.00 G32 # home all axes M117 >> heating SET_LED LED=caselight RED=0.50 GREEN=0.00 BLUE=0.00 G92 E0 # reset extruder M190 S{BED} # set and wait for bed temperature M109 S{EXTRUDER} # set and wait for nozzle temperature M117 >> starting SET_LED LED=caselight RED=0.50 GREEN=0.50 BLUE=0.50 [gcode_macro CLEAN_NOZZLE] gcode: {% set y0=params.y0|default(15) %} {% set y1=params.y1|default(15.8) %} {% set x0=params.x0|default(75) %} {% set x1=params.x1|default(225) %} M117 >> clean nozzle G0 Z5 F300 # move Z to travel height G0 X{x0} Y{y0} F5000 # move to x0/y0 G0 Z0.2 F1500 # lower Z G0 X{x1} E30 # draw line G0 Y{y1} # move to y1 G0 X{y0} E15 # draw fine line [gcode_macro PRINT_END] gcode: M117 >> finished M400 ; wait for buffer to clear G92 E0 ; zero the extruder G1 E-10.0 F3600 ; retract filament G91 ; relative positioning G0 Z1.00 X20.0 Y20.0 F20000 ; move nozzle to remove stringing TURN_OFF_HEATERS M107 ; turn off fan G1 Z2 F3000 ; move nozzle up 2mm G90 ; absolute positioning G0 X125 Y250 F3600 ; park nozzle at rear BED_MESH_CLEAR