diff --git a/better-load-unload.cfg b/better-load-unload.cfg index bdda5e1..2e9c499 100644 --- a/better-load-unload.cfg +++ b/better-load-unload.cfg @@ -7,8 +7,12 @@ description: Unload filament gcode: {% set hotendtemp = params.S|default(250)|int %} + {% set current_state = params.F|default(1)|int %} {% set accel = printer.toolhead.max_accel|int %} - M104 S{hotendtemp} + + M104 S{hotendtemp} + M106 S0 + {% if "y" not in printer.toolhead.homed_axes %} G28 Y {% endif %} @@ -17,6 +21,7 @@ gcode: {% endif %} M204 S10000 + G1 Y150 F9000 G1 X305 F9000 G1 Y20 F9000 @@ -26,15 +31,15 @@ gcode: G1 Y5 F3000 G4 P500 G1 Y20 F9000 + + TEMPERATURE_WAIT SENSOR=extruder MINIMUM={hotendtemp-50} G1 X56 F12000 G1 Y310 F12000 G1 Y324 F600 G1 X95 F600 - M106 S0 M109 S{hotendtemp} - M118 Heat up complete G92 E0 G1 E5 F50 @@ -45,8 +50,7 @@ gcode: M106 S255 M104 S{hotendtemp-100} - G4 P5000 - + TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={hotendtemp-50} G1 Y318 F9000 G1 Y322 F600 @@ -58,7 +62,7 @@ gcode: M106 S0 M400 M204 S{accel} - M118 Unload finish + M118 Unload finished [gcode_macro M604] description: Load filament @@ -66,8 +70,9 @@ gcode: {% set hotendtemp = params.S|default(250)|int %} {% set current_state = params.F|default(1)|int %} {% set accel = printer.toolhead.max_accel|int %} - M204 S10000 + M104 S{hotendtemp} + M106 S0 {% if "y" not in printer.toolhead.homed_axes %} G28 Y @@ -76,6 +81,9 @@ gcode: G28 X {% endif %} + M204 S10000 + TEMPERATURE_WAIT SENSOR=extruder MINIMUM={hotendtemp-50} + {% if current_state == 1 %} {% if (printer.gcode_move.position.y) > 300 %} G91 @@ -89,7 +97,6 @@ gcode: G1 Y324 F600 {% endif %} M109 S{hotendtemp} - M118 Heat up complete G1 X95 F600 G1 Y324 F600 @@ -102,8 +109,8 @@ gcode: G4 P300 M106 S255 - M104 S{hotendtemp-100} - G4 P5000 + M104 S{hotendtemp-100} + TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={hotendtemp-50} G1 Y318 F9000 G1 Y322 F600 @@ -113,7 +120,6 @@ gcode: G1 Y324 F600 M106 S0 - M400 M204 S{accel} - M118 Load finish + M118 Load finished