I am trying to do a project where i need to move the stepper motors parallely (they are not connected to same driver and of different steps) so i can reduce my overall cycle time
all the suggestions are welcome.
till now am moving one stepper motor at a time
example: xaxis(50);
yaxis(60);
zaxis(80);
i need to be able to move all three independently
ie if i give xaxis(50); it should not be stuck there until it completes but it should move on and do yaxis(60)
and then zaxis(80)
xaxis(50) , yaxis(60),zaxis(80) will be functions with loops that exits out on reaching the position
Is it possible to do it with interrupts?
If so please give me an example
You have not posted the code you have been trying so I don't know what problem you have had.
If you want to move several steppers at the same time at different speeds but WITHOUT the requirement that they all stop at the same time then the process is very straightforward. The simplest thing is probably to use the AccelStepper library which has the non-blocking run() command.
Alternatively write your own code to cause each step to happen after an appropriate amount of time using millis() or micros() to achieve non-blocking timing. See the second example in this Simple Stepper Code
If you want all of the motors to move through different distances in the same time then things are a little more complex. You need to work out the time for the longest move and then allocate step-intervals for all the other motors so that, for example, one motor makes 237 steps in the same time that another makes 1073 steps. The MultiStepper version of AccelStepper can do that for you - but it does not use acceleration.
Robin2:
You have not posted the code you have been trying so I don't know what problem you have had.
If you want to move several steppers at the same time at different speeds but WITHOUT the requirement that they all stop at the same time then the process is very straightforward. The simplest thing is probably to use the AccelStepper library which has the non-blocking run() command.
Alternatively write your own code to cause each step to happen after an appropriate amount of time using millis() or micros() to achieve non-blocking timing. See the second example in this Simple Stepper Code
If you want all of the motors to move through different distances in the same time then things are a little more complex. You need to work out the time for the longest move and then allocate step-intervals for all the other motors so that, for example, one motor makes 237 steps in the same time that another makes 1073 steps. The MultiStepper version of AccelStepper can do that for you - but it does not use acceleration.