Is it possible to launch g-code in parallel?

Good afternoon everyone! I have encountered a task in my project where I need to run multiple G-code commands in parallel (for example, there are 14 stepper motors, divided into 7 groups of 2 motors each, and each group should operate independently of the others, starting their operation at the same time).
I understand that Klipper does not support simultaneous execution of multiple G-code commands, but I would like to ask knowledgeable people if there is any possibility to implement such functionality using Klipper.
Are there options for writing my own script in extras, or can something be changed in the current files to enable this capability, or can a plugin be used?
Please let me know!
Thank you in advance for your help!

I am also interested in this functionality

1 Like

Don’t knpw the usecase, but MANUAL_STEPPER are able to do something like this.

In the project, there are 14 stepper motors, all of which are already defined using MANUAL_STEPPER. The project specifically requires the ability to run multiple groups of motors (for which the logic is defined in G-code) in parallel.

Over time, I have come to the conclusion that to create such functionality, it is necessary to dig into Klippy and either rewrite the logic of the current modules or write my own plugin.

SYNC=0 does not help?

This is an exemple from my DIY MMU which loads the filament into the exruder gear. To get the filament loaded the MMU gear and the extruder gear must get run together.

[gcode_macro TRY_LOAD_FILAMENT_IN_EXTRUDER]
gcode:
    {% if printer["filament_switch_sensor ir_sensor"].filament_detected == False %}
    M118 Try loading ....
        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 %}

using it in macros can be a challenge, because the way how the macros are evalueted is not designed to build statemachines from it. So it is also possibel to create own extensions to put it into python, if SYNC=0 is a possible solution.

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