From 1d9aab9cdf7f44f212f1070551a65cbe2ba0c131 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 3 Oct 2021 12:12:31 +0200 Subject: [PATCH] v2.4: update macros --- macros.cfg | 61 +++++++++++++++++++++++++++++++++++++++++++++++------ printer.cfg | 3 +++ 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/macros.cfg b/macros.cfg index d8050b1..54ddd3f 100644 --- a/macros.cfg +++ b/macros.cfg @@ -7,6 +7,16 @@ gcode: 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 @@ -14,6 +24,16 @@ 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 @@ -23,8 +43,10 @@ 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 %} - {% set y_park = printer.toolhead.axis_maximum.y|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 %} @@ -34,6 +56,7 @@ gcode: {% set z_safe = max_z - act_z %} {% endif %} # end of definitions + M117 >> pause PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} @@ -62,9 +85,10 @@ gcode: {% set get_params = "" %} {% endif %} # end of definitions + M117 >> resume {% if printer.extruder.can_extrude|lower == 'true' %} G91 - G1 E{E} F2100 + G1 E{E} F6000 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} @@ -76,7 +100,7 @@ description: unload filament gcode: {% if printer.extruder.can_extrude|lower == 'true' %} M83 # e relative coordinates - G0 E-75 F3000 # unload + G0 E-75 F3000 # unload M82 # e absolute coordinates {% else %} {action_respond_info("extruder not hot enough")} @@ -88,8 +112,9 @@ description: load filament gcode: {% if printer.extruder.can_extrude|lower == 'true' %} M83 # e relative coordinates - G0 E75 F3000 - G0 E30 F300 + 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")} @@ -102,13 +127,22 @@ gcode: {% set e = params.e|default(10)|float %} {% if printer.extruder.can_extrude|lower == 'true' %} M83 # e relative coordinates - G1 E-{e} F300 + 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 @@ -135,6 +169,21 @@ gcode: 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 diff --git a/printer.cfg b/printer.cfg index 3b5a3af..c1144b0 100644 --- a/printer.cfg +++ b/printer.cfg @@ -227,6 +227,9 @@ min_extrude_temp: 170 pressure_advance: 0.05 ## Default is 0.040, leave stock pressure_advance_smooth_time: 0.040 +# Maximum length (in mm of raw filament) that a retraction or +# extrude-only move may have, default: 50 +max_extrude_only_distance: 100 ## E0 on MOTOR6 [tmc2209 extruder]