Multipe Stpper Motor with Arduino (Uno or Mega).

I have one question Regarding the Multiple (At least 5) Stepper motor with Arduino.
The goal is ….
Each motor should be independent.
Speed can be increase and decrease at any time without any kind of effect on the
Other motor.
Before I already try using the class but I face problem of timing. Second I can not use the
Sparkfun AutoDriver because Nema 23 need minimum 4.2A.
Some motor are Nema 17 and some are Nema 23.
So the time was the big issue. Because I am also reading the serial in the loop
And I also need some calculation and also controlling the other input and output.
So because of all this I cannot generate the proper signal.

So please give me some advice.
Last two days I google a lot. Then I found some information that I can achieve with TI Launchpad using timers.
Now I have Arduino Mega so is this possible that use the timers and generate the Signal on Arduino mega.
I saw timer interrupt can help me. Kindly please give me any library where I can manage all the
5 timers. Or please give me advice.
Can you please also look that timer interrupt method is good or not for generating the signal with different frequency.

Thank you

There is no reason in principle why you should not be able to control several stepper motors from an Arduino. It will be easiest if you use a specialized stepper driver that just requires step and direction signals from the Arduino - i.e. two I/O pins per motor.

You may run into problems with multiple motors if the total number of steps per second (for all motors combined) is beyond the processing capability of the Arduino.

There is (I hope) a lot of background info in Stepper Motor Basics - including the process for selecting motors and drivers.

...R

thank you for your reply.

i have stepper motors and also driver.
i am using Nema 17 with Drv8825 COntroller. and Nema 23 with DM840 controller.

yes you are write i need only Two wires for Each Motor.
one is Pulse pin and direction pin.

For the Pulse pin i need Square wave with some frequency.

for one motor every think is ok...but for more then one motor its little bit tricky.

i don't want that i move just one motor and then wait when it will finish to start the Second motor.

i like to move every motor independently means i like to stop any motor at any time without disturbing the other motor.

to Achieve this goal i try to implement the Arduino microsecond time according to the frequency of the each motor..
but the process is not so fast that why i get trouble in timing signal.

i need a guide line that how i can use the interrupt and timer to generate the Signal on each Port.
if some one give me some info About Timer implementation in mega board.
Mega have 5 Timer so i am interested to use the Timers.

Thank you

atifbuitms:
For the Pulse pin i need Square wave with some frequency.

I think it is best not to think of it as a square wave.

You need a sequence of short pulses (about 10 µsecs wide) and the interval between the pulses determines the speed of the motor.

This Simple Stepper Code illustrates the concept. The second example - which uses millis() and micros() for timing - could be extended to several separate motors. I have an Arduino controlling 3 motors on my small lathe.

Tell us how many steps per second you require for each motor before deciding how to generate the pulses.

...R