Example program · 3D printing

Klipper M600 Filament Change Macro — G-Code Example

Klipper has no built-in M600. This macro pauses, parks the head and unloads, so slicer colour changes work like on Marlin.

By cnccode · Updated
On this page
  1. Macro for printer.cfg
  2. How it works
  3. Codes used in this program
  4. More 3D printing programs

Klipper has no built-in M600. This macro pauses, parks the head and unloads, so slicer colour changes work like on Marlin.

ItemValue
Machine3D printer (Klipper)
UnitsMetric
Lines19

Macro for printer.cfg

Klipper config
[pause_resume]

[gcode_macro M600]
description: Filament change
gcode:
  {% set X = params.X|default(10)|float %}
  {% set Y = params.Y|default(10)|float %}
  {% set Z = params.Z|default(10)|float %}
  SAVE_GCODE_STATE NAME=M600_state
  PAUSE
  G91
  G1 E-1 F2700
  G1 Z{Z} F600
  G90
  G1 X{X} Y{Y} F6000
  G91
  G1 E-50 F1000                  ; unload (set to your Bowden length)
  RESTORE_GCODE_STATE NAME=M600_state
; load new filament by hand, then press RESUME

▶ Check it in the 3D printer simulator

How it works

  • Many PAUSE macros already park the head; then remove the park moves here.
  • Long unload moves can hit max_extrude_only_distance: split them or raise the limit.

Codes used in this program

Check bed size, temperatures, probe and macro names against your own printer before you use this code, and stay at the printer for the first run.

More 3D printing programs

Was this page helpful?