X-In/1-Out Non-Mixing Extruder Config

@Snakn1,
I have 3 microswitch runout sensors, one on each of my three extruders. Each runout sensor has its own pin

What I’ve done is turn on/off each sensor with activating the extruder.

[gcode_macro T0]
gcode:
    SYNC_EXTRUDER_MOTION EXTRUDER=belted_extruder MOTION_QUEUE=
    SET_FILAMENT_SENSOR SENSOR=T1_Filament_Runout_Sensor ENABLE=0
    SYNC_EXTRUDER_MOTION EXTRUDER=m4_extruder MOTION_QUEUE=
    SET_FILAMENT_SENSOR SENSOR=T2_Filament_Runout_Sensor ENABLE=0
 
    # Activate stepper in extruder
    SYNC_EXTRUDER_MOTION EXTRUDER=extruder MOTION_QUEUE=extruder
    SET_FILAMENT_SENSOR SENSOR=T0_Filament_Runout_Sensor ENABLE=1

Give something like this a try.

Yes , I agree the micro switch style works great, but not the motion style does not, But I guess I am the only one running more then one motion runout style. The shared pins are for the hot end , not the runout. With the motion style, you can see it trigger on the active extruder in Mainsail and that part works, but the system will only react to the T0 not T1 or T2 rigger, but it will show up as triggered on the display, but again, it does not trigger the pause with any extruder other then T0.

If anybody still having an Unable to infer active extruder stepper error when switching it back to the 1st extruder with PrusaSlicer, I’ve managed to get it working with latest SuperSlicer (v2.5.59) and latest klipper (v0.12.0-179-g434770ea).

The problem with PrusaSlicer is that slicer adds SET_PRESSURE_ADVANCE ADVANCE=0 SMOOTH_TIME=0 in wipe tower without EXTRUDER= section. In SuperSlicer this is added.

Here are my settings/gcodes/macros:

SuperSlicer

Extruders
Extruders are named (in slicer) extruder and extruder1 - same as in klipper config

Filament custom gcode

; Filament specific Start G-code
SET_PRESSURE_ADVANCE ADVANCE=0.392 SMOOTH_TIME=0.040 EXTRUDER={tool_name}
  • adjust pressure advance settings to your measurements

Printer start gcode

;Extruder Setup
ACTIVATE_EXTRUDER EXTRUDER=[tool_name]
SET_PRESSURE_ADVANCE ADVANCE=0 EXTRUDER=[tool_name]

Printer end gcode

SET_PRESSURE_ADVANCE ADVANCE=0 EXTRUDER=[tool_name]

Printer tool change gcode - is empty


Klipper

printer.cfg

[extruder]
max_extrude_only_distance: 900.0
max_extrude_cross_section: 900.0
step_pin: P2.13
dir_pin: !P0.11
enable_pin: !P2.12
heater_pin: P2.7
sensor_pin: P0.24
sensor_type: EPCOS 100K B57560G104F
pullup_resistor: 4700
microsteps: 16
gear_ratio: 3:1
rotation_distance: 23.132
nozzle_diameter: 0.400
filament_diameter: 1.750
min_extrude_temp: 180
smooth_time: 2.0
min_temp: 0
max_temp: 280
smooth_time: 1.0

[tmc2208 extruder]
uart_pin: P1.4
run_current: 0.700
hold_current: 0.500
stealthchop_threshold: 0


[extruder_stepper extruder1]
extruder: 
step_pin: P1.15
dir_pin: !P1.14
enable_pin: !P1.16
microsteps: 16
rotation_distance: 24
gear_ratio: 3:1

[tmc2208 extruder_stepper extruder1]
uart_pin: P1.1
run_current: 0.700
hold_current: 0.500
stealthchop_threshold: 0

Macros

[gcode_macro T0]
gcode:
    # Deactivate stepper in my_extruder_stepper
    SYNC_EXTRUDER_MOTION EXTRUDER=extruder1 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=extruder1 MOTION_QUEUE=extruder


[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 extruder0.")}
        T0
      {% elif ext == "extruder1" %}
        {action_respond_info("Switching to extruder1.")}
        T1
      {% else %}
        {action_respond_info("EXTRUDER value being passed.")}
        ACTIVATE_EXTRUDER_BASE EXTRUDER={ext}
      {% endif %}
    {% endif %}

[delayed_gcode activate_default_extruder]
initial_duration: 1
gcode:
    ACTIVATE_EXTRUDER EXTRUDER=extruder

[gcode_macro PARK]
description: Park the head to change tool
gcode:
    M117 Parking Head...
    ##### set defaults #####
    {% set x = params.X|default(-15) %}      #edit to your park position
    {% set y = params.Y|default(0) %}      #edit to your park position
    {% set z = params.Z|default(20)|float %} #edit to your park position
    {% set e = params.E|default(3) %}        #edit to your retract length
    ##### save current x and y position ####
    SAVE_GCODE_STATE NAME=park_state
    ##### calculate save lift position #####
    {% set max_z = printer.toolhead.axis_maximum.z|float %}
    {% set act_z = printer.toolhead.position.z|float %}
    {% set lift_z = z|abs %}
    {% if act_z < (max_z - lift_z) %}
        {% set z_safe = lift_z %}
    {% else %}
        {% set z_safe = max_z - act_z %}
    {% endif %}
    ##### end of definitions #####
    G91
    {% if printer.extruder.can_extrude|lower == 'true' %}
      G1 E-{e} F2100
    {% else %}
      {action_respond_info("Extruder not hot enough")}
    {% endif %}
    {% if "xyz" in printer.toolhead.homed_axes %}    
      G1 Z{z_safe}
      G90
      G1 X{x} Y{y} F6000
    {% else %}
      {action_respond_info("Printer not homed")}
    {% endif %}
    M117 Head Parked...


[gcode_macro FILAMENT_LOAD2]
description: Loads filament from splitter to hot end
gcode =
	M117 LOADING...
	G91
	G1 E140.0 F900
	G4 P900
	G1 E20.0 F150
	G90
    G4 P3000
    M117

[gcode_macro CONTINUE]
description: Continue's printing after tool change
gcode:
    M117 Print Continuing...
    ##### set defaults #####
    {% set speed = params.SPEED|default(120) %}
    ##### end of definitions #####
    RESTORE_GCODE_STATE NAME=park_state MOVE=1 MOVE_SPEED={speed}
    M117

I hope this helps.

1 Like