Sync Manual Stepper and Extruder

Basic Information:

Printer Model: Ender 5
MCU / Printerboard: BTT SKR mini E3 + Creality Ender 3 MCU

I am developing a MMU for my printer that will use 5 additional extruders to pass filament up to the single print head/extruder combo

I have found out how to add the extra Steppers via
[manual_stepper loader]
step_pin: zboard: PB1
dir_pin: ! zboard: PB0
enable_pin: ! zboard: PD6
microsteps: 16
rotation_distance: 33.683

And i can move the stepper via this command:

MANUAL_STEPPER STEPPER=loader MOVE=400 SPEED=100

However during the loading/unloading phase there will be times
when the loader stepper and the extruder stepper need to move
at the same time.

From what i have gleaned from reddit posts and an experiment i did etc. it doesnt seem like
i can just use a command like:
G1 E15 Loader15 F3000

it would appear that i have to sync the motors with something like:
SYNC_EXTRUDER_MOTION EXTRUDER=extruder MOTION_QUEUE=loader

when i use this command i get error
‘loader’ is not a valid extruder

if i then change my config to define my loader stepper as an extruder
[extruder1]
step_pin: zboard: PB1
dir_pin: ! zboard: PB0
enable_pin: ! zboard: PD6
microsteps: 16
rotation_distance: 33.683

klipper then wants me to input a temp sensor. which i dont want to do as i would like to use the
stepper when the hot end is cold

i would really appreciate some pointers. please feel free to spoon feed me
my previous experience was some very basic stuff with arduino. so i am
finding jinga challeging

thanks

Dan

So I found sort of a work around.

I configured the second stepper previously called loader as

[extruder1]
max_extrude_only_distance: 100.0
step_pin: zboard: PB1
dir_pin: ! zboard: PB0
enable_pin: ! zboard: PD6
microsteps: 16
rotation_distance: 33.683
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: zboard: PD5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: zboard: PA7
control: pid
pid_Kp: 21.527
pid_Ki: 1.063
pid_Kd: 108.982
min_temp: 0
max_temp: 250
min_extrude_temp:5

Annoyingly klipper seems to ignore min_extrude_temp:5 and stick with default of 170. So I plugged in a 270ohm resistor and now it shows 240 all the time. Which although annoying is effective.

Then I had to write the following macros

[gcode_macro SYNC]
gcode:
SYNC_EXTRUDER_MOTION EXTRUDER=extruder1 MOTION_QUEUE=extruder

[gcode_macro DESYNC]
gcode:
SYNC_EXTRUDER_MOTION EXTRUDER=extruder1 MOTION_QUEUE=“”

[gcode_macro T0]
gcode:
ACTIVATE_EXTRUDER EXTRUDER=extruder

[gcode_macro T1]
gcode:
ACTIVATE_EXTRUDER EXTRUDER=extruder1

With these you can sync them up and drive them with command like

SYNC
M83
G1 E10 F600

And it will drive them both at same time. Or desync then and use them independently.

The limitation of this method is that you can’t use them at the same time doing different things i.e. in a non synced state… which thinking about it I guess is a limitation of CNC machines in general.

I would really love to know if there is a cleaner way to achieve this, without the resistor etc ?

You might want to cross check with GitHub - moggieuk/Happy-Hare: MMU software driver for Klipper (ERCF, Tradrack, Prusa) and @moggieuk
They are doing a lot of work in this area.

Ok so the DESYNC doesn’t work for some reason

As soon as the steppers are synced. I forever lose the ability to control extruder1 (the additional stepper independently.

Any ideas?

I’ll have a look at what there doing. It’s difficult because I am very inexperienced with coding and I find they often use advanced functions of the programming language to achieve 3-4 lines of my code with one command that is unreadable to the novice.

this is what I do with a common MMU. This leads gear and the extruder stepper are running 5mm at the same time. (relative extrusion of course)

[gcode_macro TRY_LOAD_FILAMENT_IN_EXTRUDER]
gcode:
    {% if printer["filament_switch_sensor ir_sensor"].filament_detected == False %}
        M118 Loading Filament...
        MANUAL_STEPPER STEPPER=gear_stepper MOVE=5 SPEED=10 SET_POSITION=0 SYNC=0
        G1 E5 F600
		MANUAL_STEPPER STEPPER=gear_stepper SYNC=1
        MANUAL_STEPPER STEPPER=gear_stepper SET_POSITION=0
		M400
		G4 P1000
    {% endif %}
	

and the config part of gear stepper:

[manual_stepper gear_stepper]
step_pin: mmboard:ar26
dir_pin: !mmboard:ar28
enable_pin: !mmboard:ar24
step_distance: .00606
velocity: 20
accel: 1000
endstop_pin: ^mmboard:ar2 # PINDA X+

Thank you for posting this.

I will try your syntax for the Sync=0, Sync=1

I tried using that command but had it set up differently

Generally if you have a stepper motor that you want to be able to synchronize to an extruder you would use an extruder_stepper config section: Configuration reference - Klipper documentation . You could then synchronize and unsynchronize that stepper to the extruder using SYNC_EXTRUDER_MOTION commands. If you want to move the motor manually it is possible to enable a force_move config section ( Configuration reference - Klipper documentation ) and use a FORCE_MOVE command.

Hope that helps.

-Kevin

1 Like

In addition you may want to look at the Belay sensor by Annex Engineering to assist in keeping the motors synced and keeping rotation_distance balanced on the loader to alleviate possible drifting out of sync.
Annex-Engineering/Belay: A sensor for FFF 3D printers for keeping a secondary extruder in sync with the primary extruder, with an accompanying Klipper module (github.com)

1 Like

Thank you Kevin

Can you think of anyway to disable the “extruder_stepper” so that it is actually off.

I am multiplexing the stepper driver via relays to the separate extruder motors. From what I have read there is a risk that I will destroy the driver as the motor is momentarily disconnected.

I have tried:

SET_STEPPER_ENABLE STEPPER=<config_name> ENABLE=[0|1]

But it does not seem to work on “extruder_stepper”

I have looked and Belay looks great for my needs. I am hoping to integrate that now. Thank you for pointing that out!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.