run two stepper motor at the same time with different speeds
-
Hi,
I want to run two stepper motor at the same time with different speeds (F) in the same command. How can I do it?Adi
-
@adistr it's not the answer, but depending on what your use case is, a solution may be to use a gear attached to the stepper and use stepper's rotation as one rotation and gear's as the other. This would assure that they are in sync as additonal advantage.
-
@adistr said in run two stepper motor at the same time with different speeds:
Hi,
I want to run two stepper motor at the same time with different speeds (F) in the same command. How can I do it?Adi
Define "speed". You cannot have two different F parameters but you can get different stepper behavior if you tell the firmware a "lie".
Imagine that you do this with two identical steppers on axes A and B:
M92 A100 B200
Frederick
-
@adistr You can do this easily by performing a 2D move using the G1 code.
Imagine you have one motor connected to the "X" motor driver and another connected to the "Y" motor driver.
Then, if you move 100 steps in X and 50 steps in Y, since the Duet firmware wants to keep the motors coordinated and wants to draw a straight line, it will step the Y motor at half the speed as the X motor and they sill stop at the same time.
If you are not driving an actual 3D printer, you might want to use the G91 command at the beginning of your motions to set "relative" motion mode.
Then you can do:
G1 x100 Y50
G1 X100 Y50
G1 X100 Y50
And your motors will move each time.If you use G90 "Absolute" mode your first G1 X100 Y50 will move the motors to 100 and 50 and all the other G1 X100 Y50 commands won't move the motors at all since the machine is already at X=100 Y=50 so there's no move to be done.
Give it a try and tell us a little more about what you are building!
-
I think you'll have to wait for firmware 3.5 which aims to implement independent motion systems.
-
@adistr have you tried playing with the steprates / u-step settings in the config?
in theory you could give one motor assignment twice as many u-steps as the other and it should more 2x as fast if the same deg/step as the other motor.