Hi all,
I'm very new to the Arduino world, and therefore a complete noob, so apologies for any inane questions I may ask.
I have a project I am working that has the Arduino as it's core.
I need to drive 2 stepper motors simultaneously, but I can't find any libraries for this. (When I say "I", I mean my friend who is doing all the programming)
The premise is as follows;
Through remote control, I need to be able to control 2 stepper motors, both togther and independantly.
The remote is an off-the-shelf low volume transmitter and receiver.
The receiver is an IR to RS232 converter. I'm then using an RS232/TTL converter from Sparkfun and connecting it to the Arduino.
I'm using the Arduino Duemilanove. The motor drivers are Leadshine DCS303's and the motors are leadshine DCM50202A's
If anyone has, or knows of a library that can help us with simultaneous motor drives, that'd be awesome!
I have a schematic in PDF if it's of any use to anyone.
The short answer is you can't do it on 2 pins as the pins will be triggered one by one.
this usually does not matter as the time difference is so small that it can be considered simultaneous.
But if you absolutly want the motors turn on together within 1/16000000 of a second, you can use 3 loops
1 loop to drive both motors together, the motors will be controlled by same stepper driver
2 loops that drive each motor independently.
this approach requires 3 stepper drivers for 2 motors
and 1/3 more pins on the arduino (step dir, microstep?, step)x3'
[edit]Well in reality 50% more pins, as 50% more than 2 is 3 ;)[/edit]
David
Hi David,
thanks for the response!
I had intended to use 4 pins (2 pins per driver)
Pin 7 for dir, 10 for pulse on driver A, and 8 for direction and 9 for pulse on driver B.
With such a small time difference, that's no worries at all, I can very easily live with that!
I want to keep the actual motor driving independant anyway, because I want each motor to be able to be individually "jogged" to fix a position after installation that may differ from our "factory" preset.
Do you know of any library samples that show multiple motor drives?
The problem we seem to be having is that each function in the code has to complete before the next function is called. I'm sure there's a very simple solution, but we're both very new to the Arduino board.