Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions better-load-unload.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand All @@ -17,6 +21,7 @@ gcode:
{% endif %}

M204 S10000

G1 Y150 F9000
G1 X305 F9000
G1 Y20 F9000
Expand All @@ -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
Expand All @@ -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
Expand All @@ -58,16 +62,17 @@ gcode:
M106 S0
M400
M204 S{accel}
M118 Unload finish
M118 Unload finished

[gcode_macro M604]
description: Load filament
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
Expand All @@ -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
Expand All @@ -89,7 +97,6 @@ gcode:
G1 Y324 F600
{% endif %}
M109 S{hotendtemp}
M118 Heat up complete

G1 X95 F600
G1 Y324 F600
Expand All @@ -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
Expand All @@ -113,7 +120,6 @@ gcode:
G1 Y324 F600

M106 S0

M400
M204 S{accel}
M118 Load finish
M118 Load finished