Hi, I'm making a 2 axis(slide/Pan) camera slider, I'm running 2 stepper motors, 1 for each axis using the AccelStepper library. Is it possible to have acceleration and deceleration when running 2 motors at the same time? Multistepper library doesn't support acceleration and using "RunToNewPosition" in AccelStepper does not allow 2 motors to run at the same time. If anyone can give me a solution to this problem I will be really appreciated.
Learn a bit more and do it yourself.
What is acceleration? dV/dt.
The change of velocity with respect to time. If you set the velocity at 1, wait 1ms then increase by one, and continue to do this until you reach the desired velocity, you have just accelerated. And you didn't need somebody else's code to do it!
If you need co-ordinated movement between the two motors (like in a CNC project) where one motor moves (say) 123 steps in the same time that another move 768 steps you need to use Multistepper - which, as you say, does not use acceleration.
However if one motor can finish its move before the other you can use Accelstepper with acceleration.
If you want co-ordinated movement with acceleration then you need to write your own code. It's not very difficult. The code in this link should get you started. If you set the acceleration for the fastest motor then you can "slave" the other motors from that.
...R
Robin2:
However if one motor can finish its move before the other you can use Accelstepper with acceleration....R
Can I manually set the different speed to each motor to make it finish at the same time? if yes, which command do I have to use to run both motors at the same time?
thank you
botasky:
Can I manually set the different speed to each motor to make it finish at the same time? if yes, which command do I have to use to run both motors at the same time?
With the Accelstepper library you can certainly set different speeds for motors but the library cannot guarantee that the two movements will finish at the exact same time. You will need to experiment to see if the behaviour is good enough for your project. You have not told us what level of precision you require.
As for which command to use, I suggest you study and try the examples that come with the AccelStepper library and read the very good documentation.
If there is something specific that you don't understand then let us know and we will try to help.
...R