How to command 2 steppers simultaneously

Hello,

Sorry for my bad english.

I want to control 2 steppers motor (Altazimutal telescope control, for sideral tracking).

But both stepper will have different speed, and must move simultaneously

For exemple :
Stepper 1 : 200 steps / minutes
and simultaneously
Stepper 2 : 350 steps / minutes

If I understand well, “step” commande of the Stepper library can’t be used, because this function is blocking, so I can’t command 2de stepper while the 1rst one is moving.

To you have code example to do that ?

Thanks !!

Fred.

It would be easier to offer useful advice if you post the code you have tried.

If you want to do something like move stepperA 123 steps in the same time that stepperB moves 97 steps you probably need to manage the process without using any of the libraries. The way I do this is to figure out how many microseconds (usecs) are required for each step and move each motor after the appropriate number of usecs have elapsed using the same technique as is used with millis() in the second example in this simple stepper code.

Post a link to the datasheet for your stepper motors and tell us waht stepper driver board you are using.

You may also find some useful stuff in stepper motor basics

...R

Make a for loop inside for loop

first the make a for loop for the stepper witch has to do 350 steps and then inside it put a for loop for the stepper that makes 200 steps other than that I cant help you the arduino's microcontroller cant multy task unfortunately

Use AccelStepper library - so long as you call the run() methods for each motor frequenrtly (ie. inside loop()) you can set moves going whenever you want and monitor them too...

MikeLemon: Make a for loop inside for loop

first the make a for loop for the stepper witch has to do 350 steps and then inside it put a for loop for the stepper that makes 200 steps other than that I cant help you the arduino's microcontroller cant multy task unfortunately

That will no achieve the desired result at all.