Skip to content

Instantly share code, notes, and snippets.

@bistory
Created February 11, 2023 21:06
Show Gist options
  • Save bistory/629b596c5c49d6b01f5cf06ea2f2690f to your computer and use it in GitHub Desktop.
Save bistory/629b596c5c49d6b01f5cf06ea2f2690f to your computer and use it in GitHub Desktop.
Macros for loading and unloading filament with Klipper
[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
@bistory
Copy link
Author

bistory commented Feb 9, 2024

And where is the nozzle heating? Can't you load or unload the nozzle when it's cold...

Pre-heat the nozzle...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment