The following configuration is an example of an X-In/1-Out Hot-End such as:
Or a multi-in splitter such as:
2-in/1-Out: G1/8 "Y-piece" 1.75mm dual extusion upgrade (prometheus system) ( 1/8PT ) by SilasPfeifer - Thingiverse
4-in/1-Out: 4 in 1 out multi filament upgrade M5 by SilasPfeifer - Thingiverse
This configuration works with the following Klipper Version/Builds:
v0.10.0-312
v0.10.0-320
v0.10.0-333
v0.10.0-368
v0.10.0-377
v0.11.0-5
v0.11.0-6
v0.11.0-14
v0.11.0-30
v0.11.0-41
v0.11.0-173
For reference, the following configuration is a single v6 style hot-end and 2 extruder/steppers; BMG is the primary and a self-designed 4:1 ratio belted extruder is a secondary.
.
Klipper printer.cfg
Setup the [extruder]
object with one stepper just as you would with a single stepper extruder:
Reference: Configuration reference - Klipper documentation
[extruder]
step_pin: PC1
dir_pin: PC3
enable_pin: !PC7
microsteps: 16
rotation_distance: 22.024
full_steps_per_rotation: 200
gear_ratio: 50:17
nozzle_diameter: 0.400
filament_diameter: 1.750
The remaining configuration of the [extruder] module was not included here in order to save space.
Next, configure [extruder_stepper]
objects, one per additional stepper.
Note that âextruder1â, âextruder2â, etc. are reserved for the [extruder]
object.
Reference: Configuration reference - Klipper documentation
[extruder_stepper belted_extruder]
extruder:
step_pin = PA4
dir_pin = PA6
enable_pin = !PA2
microsteps: 16
rotation_distance: 22.5
full_steps_per_rotation: 200
gear_ratio: 4:1
At this point, the printer has 2 steppers configured; one to one Hot End and one is not attached to any Hot End. There needs to be some gcode macroâs to un-sync and switch active steppers.
Here we will configure two macros making T0 = stepper on the [extruder]
object and T1 the stepper on the [extruder_stepper]
object. This will allow only one active stepper during extrude operations.
[gcode_macro T0]
gcode:
# Deactivate stepper in my_extruder_stepper
SYNC_EXTRUDER_MOTION EXTRUDER=belted_extruder MOTION_QUEUE=
# Activate stepper in extruder
SYNC_EXTRUDER_MOTION EXTRUDER=extruder MOTION_QUEUE=extruder
[gcode_macro T1]
gcode:
SYNC_EXTRUDER_MOTION EXTRUDER=extruder MOTION_QUEUE=
# Activate stepper in my_extruder_stepper
SYNC_EXTRUDER_MOTION EXTRUDER=belted_extruder MOTION_QUEUE=extruder
Note: EXTRUDER is the stepper while MOTION_QUEUE is the hot-end
Next, remap the built-in ACTIVATE_EXTRUDER gcode macro so it can be used in your slicer:
[gcode_macro ACTIVATE_EXTRUDER]
description: Replaces built-in macro for a X-in, 1-out extruder configuration SuperSlicer fix
rename_existing: ACTIVATE_EXTRUDER_BASE
gcode:
{% if 'EXTRUDER' in params %}
{% set ext = params.EXTRUDER|default(EXTRUDER) %}
{% if ext == "extruder"%}
{action_respond_info("Switching to extruder.")}
T0
{% elif ext == "belted_extruder" %}
{action_respond_info("Switching to belted_extruder.")}
T1
{% else %}
{action_respond_info("EXTRUDER value being passed.")}
ACTIVATE_EXTRUDER_BASE EXTRUDER={ext}
{% endif %}
{% endif %}
Finally, create a delayed gcode macro to set make one stepper active upon Klipper startup:
[delayed_gcode activate_default_extruder]
initial_duration: 1
gcode:
ACTIVATE_EXTRUDER EXTRUDER=extruder
.
Printer Settings - SuperSlicer/PrusaSlicer/Slic3r
Note: As of the initial write-up of this document, I have not implemented tool-changing in a single print for either multi-color printing or multi-material printing (PETG print/PLA supports). This thread will be expanded to cover that in the future.
-
Printer Settings â General - Set the number of Extruders configured in Klipper and tick the Single Extruder Multi Material check-box
-
Printer Settings â Extruder 1 - modify the Tool name to be âextruderâ, or the first stepper you have configured.
-
Printer Settings â Extruder 2 - modify the Tool name to match the [extruder_stepper] object configured in Klipper. In this image, itâs set to âbelted_extruderâ
-
Printer Settings â Custom G-code - Add in custom gcode to switch extruder stepper and pressure advance.
[tool_name] is linked to Printer Settings â Extruder1/2 values modified earlier
Note: starting about Klipper version v0.10.0-312, and additional PA option was added; EXTRUDER, which allows PA to be used on
[extruder_stepper] objects and it must be included when using SET_PRESSURE_ADVANCE.
ACTIVATE_EXTRUDER EXTRUDER=[tool_name]
SET_PRESSURE_ADVANCE ADVANCE=0 EXTRUDER=[tool_name]
I have this set at the top of the created gcode to make sure a tool is set. I also do not apply pressure advance at this point in printing.
Filament Settings - > Custom G-Code - Here, enter in custom code for PA and Tool on a per-filament basis
; Filament gcode
; PLA PA
{if tool_name == "belted_extruder"}
SET_PRESSURE_ADVANCE ADVANCE=0.4176 SMOOTH_TIME=0.040 EXTRUDER=[tool_name]
{endif}
You can add additional âifâ loops once you know the PA value for all your steppers, if they are not the same. If all your extruders are the same type/design, then you do no need an âifâ statement.
At this point, all the basics are supplied in order to start printing and switch extruders.
Klipper - TUNING_TOWER command -
To perform a PA test using the TUNING_TOWER command is slightly different. Just as with the SET_PRESSURE_ADVANCE command, a EXTRUDER needed to be specified to apply PA to, the same needs to be set in the TUNING_TOWER command:
TUNING_TOWER COMMAND="SET_PRESSURE_ADVANCE [EXTRUDER=<config_name>]" PARAMETER=<name> START=<value> FACTOR=<value>
Basically, putting SET_PRESSURE_ADVANCE [EXTRUDER=<config_name>]
between double quotes so the COMMAND
will be passed as one value.
Example using belted_extruder: TUNING_TOWER COMMAND="SET_PRESSURE_ADVANCE EXTRUDER=belted_extruder" PARAMETER=ADVANCE START=0 FACTOR=.020
.
Final Thoughts
Klipper has options/features that you can achieve the same thing different ways. This is just one way that works. If you have suggestions, recommendations, or Tool Change G-Code suggestions, please post them below.
I will do my best to keep a basic working example updated though future Klipper updates.
Slicer Setup:
Please reference this post for how to setup SuperSlicer/Prusa Slicer/Slic3r: X-In/1-Out Non-Mixing Extruder - Automate SuperSlicer Filament Swaps