Created
February 11, 2023 21:06
-
-
Save bistory/629b596c5c49d6b01f5cf06ea2f2690f to your computer and use it in GitHub Desktop.
Macros for loading and unloading filament with Klipper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [gcode_macro LOAD_FILAMENT] | |
| gcode: | |
| {% set speed = params.SPEED|default(300) %} | |
| {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity %} | |
| SAVE_GCODE_STATE NAME=load_state | |
| M300 # beep | |
| G91 | |
| G92 E0 | |
| G1 E350 F{max_velocity} # fast-load | |
| G1 E25 F{speed} # purge | |
| M300 | |
| M300 | |
| RESTORE_GCODE_STATE NAME=load_state | |
| [gcode_macro UNLOAD_FILAMENT] | |
| gcode: | |
| {% set speed = params.SPEED|default(300) %} | |
| {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity %} | |
| SAVE_GCODE_STATE NAME=unload_state | |
| G91 | |
| M300 # beep | |
| G92 E0 | |
| G1 E25 F{speed} # purge | |
| G1 E-420 F{max_velocity} # fast-unload | |
| M300 | |
| M300 | |
| RESTORE_GCODE_STATE NAME=unload_state |
I have hated this change ever since it was implemented because I cannot get it to work. I create these macros and when I try using them from the extrude menu, I get a temperature too low error. I put messages in the macros to see if they get called, but never see the message. Is there something I am missing? The macros I have will heat the extruder.
There is an issue with the heating macro as it does not wait for the filament to be extruded before turning off the heater. To fix this we need to insert an M400 before the M104 S0. It is not really necessary for the unload macro, since it quickly pulls the filament off the nozzle, but for the load one it may get the nozzle to be too cold for properly extrude the new filament.
{% if turn_off_extruder %}
M400
M104 S0 ; Turn off extruder heater
{% endif %}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks - I edited my previous post!