Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Arduino + stepper motors
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Arduino + stepper motors

by mahuro on Tue Feb 17, 2009 10:32 am

Hi All,

Does anyone knows, how many stepper motors can be controlled (driven) from a single Arduino board ?????????????????????????????????????????????????????????????????????????????????????????????????????????

I am working on a project where I would need to control about 9 steppers. I know the number of steppers per board is limited, but how many ??????????????

Also can anyone give me an oppinion on this: if one board can only control some steppers, could I use zigbee to get the boards to talk to each other and sync stepper movement ???

Many thanks for your help guys.

Mahuro
mahuro
 
Posts: 21
Joined: Tue Feb 17, 2009 10:25 am

Re: Arduino + stepper motors

by DMerriman on Tue Feb 17, 2009 12:52 pm

Theoretically, you could control 4 motors directly with an Arduino - but it's not something that I'd like to try, myself. Driving them isn't going to happen unless they're pretty dang small motors -- you simply aren't going to get the current in/out of an Arduino I/O pin for that.

As for controlling the steppers, are you simply wanting to control whether they're running or not, or trying to sync them step-for-step? Two entirely different propositions, I assure you!

I can't speak to Zigbee usefulness in this case.

An alternative might be to consider using something like the serial stepper motor controllers from e-Lab (http://www.elabinc.com/); I don't know of any reason that an Arduino TTL-level serial I/O (once it's disconnected from USB) couldn't talk to several of these chips for basic on/off and direction control. These chips even allow you to sync steps across several devices by sharing a master clock.

Hope this helps...
DMerriman
 
Posts: 7
Joined: Sun Feb 15, 2009 3:30 pm

Re: Arduino + stepper motors

by adafruit_support_bill on Tue Feb 17, 2009 7:35 pm

The Adafruit Motor Shield will control 2 steppers and is very reasonably priced. If you want to expand beyond that with multiple Arduinos, I2C is probably a better (and cheaper) solution than Zigbee. (unless you need the wireless capability)

As DMerriman says, trying to do step-for-step synchronization with distributed controllers would be a problem.

adafruit_support_bill
 
Posts: 78630
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino + stepper motors

by nemesisrobot on Wed Feb 18, 2009 6:10 pm

It's possible to control bipolar/unipolar steppers with two wires instead of four using a neat trick w/ 2 NPN transistors and a L293D (same one used in the Adafruit Motor Shield) or pin compatible dual H-bridge, so you could increase the number or servos that way.

wiring diagram
http://arduino.cc/en/Reference/StepperBipolarCircuit
further information
http://www.tigoe.net/pcomp/code/categor ... owiring/51

Also, just like the Motor shield, you could always use a shift register to control your h-bridges, instead of directly through the arduino i/o pins.

[edit] forgot link :lol:
nemesisrobot
 
Posts: 25
Joined: Tue Jan 01, 2008 3:27 am

Re: Arduino + stepper motors

by mahuro on Fri Feb 20, 2009 8:12 am

Many thanks All. Very usefull insightful tips.

My main ppurpose is to sync the movement, as I could use a external source to feed them (drive them)...

I found these:

http://www.cncgeeker.com/

Could you give an opinion on them, please ??

Many thanks for your time.
mahuro
 
Posts: 21
Joined: Tue Feb 17, 2009 10:25 am

Re: Arduino + stepper motors

by -NKT- on Sat Feb 21, 2009 3:43 am

Unless you know something that isn't on this website, I don't see anything capable of running/controlling 9 motors?

They have a 4 and 5 motor controller, but I doubt you'll simply hook the two together. However, if you can run 4 motors in one way and the other 5 in another, without them being critically close timing-wise, you will be fine (for example, 4 motors drive the robot that brings in the next sheet and removes the cut parts, while the 5 controls the cutter and such - you can wait until one is done before they have to interact.) For a 9 axis arm or something, it's probably not going to work.

If you are just looking to send control pulses to a set of driver boards (like the 4 and 5 axis control boards do here) then you might be fine, assuming you just want to send 2 wires for each control board. You've got 13 I/O pins, so you'd want to break those out with another board to get your 18, but that's a handful of logic gates. (There might be a better way?) If it is just one wire you need, then you have 9 outputs.

Really, it depends a lot on what you are trying to do?
-NKT-
 
Posts: 19
Joined: Sun Feb 08, 2009 4:34 pm

Re: Arduino + stepper motors

by g7nbp on Sat Feb 21, 2009 5:34 pm

As others have commented probably the best way to get round the pin count on arduino is i2c bus (see wikipedia for a general explanation of i2c) essentially for 2 wires plus 5V and ground (and a couple of resistors!) you get almost limitless amounts of connectivity to devices that can talk using i2c.

Specific to your question have a look at http://www.byvac.co.uk/bv/bv4213.htm

its a motor / stepper controller that you talk to using i2c. (there are others)

Usual caveats apply - I have no connection with ByVac, other than being a long standing repeat customer.

hth

chris w.
g7nbp
 
Posts: 8
Joined: Sat Feb 21, 2009 5:26 pm

Re: Arduino + stepper motors

by -NKT- on Sat Feb 21, 2009 6:38 pm

I'd be interested to see how this would work in a robot (for example) setting where rapid and fine microstepping of multiple axes is going to be required. I don't think that you'll be able to have all the axes working at the right time and speed if constant control is needed, especially if you are wanting a software only I2C. Latency might well be an issue, and if one servo decides to hang up and clock stretch for a while, your other axes will not be properly controlled, especially if they are telling the step counts back in "real time" - you'll have to be careful with the design!
-NKT-
 
Posts: 19
Joined: Sun Feb 08, 2009 4:34 pm

Re: Arduino + stepper motors

by g7nbp on Sat Feb 21, 2009 6:49 pm

i2c bus runs at anything up th a few MHz in its superfast mode - though 400KHz is the normal bus speed. Ive not done any tests with the arduino 2 wire libs to get an upper speed figure, but see no reason why it shouldnt cope with sub microsecond responses. Remember i2c bus was developed for inter-IC commincation (hence the name i2c) on complex boards used in just about everything these days - eg PCs, digital TV tuners etc where speed is an issue.

Another comment to make is, if its critical, dont rely on pulse counting to give absolute feedback as far as position goes, add in an absolute encoder to the servo loop - that way it doesnt matter how many clicks you miss when you next poll you know exactly where you are.

The i2c board I mentioned also has the advantage of being semi-autonimous in that you can tell it how many steps to make then leave it to get on with it and get an interrupt when it has completed:

--8<--- snip---
Command Stepper
0x20 Step Continuous
0x21Step Stop
0x22 Step number of steps
0x23 Set step parameters (4 bytes)
0x24 Read step parameters ( up to 6 bytes)

As well as the above commands there is an output pin shown as /EOS above that will go low when the number of steps have reached zero. This can be monitored by the host.

-->8----
g7nbp
 
Posts: 8
Joined: Sat Feb 21, 2009 5:26 pm

Re: Arduino + stepper motors

by karlgg on Wed Feb 25, 2009 5:05 am

Try not to use "servo" and "stepper motor" interchangeably... A servo is a device (in our case, usually a motor) with a feedback loop, a stepper motor is just a type of motor. As mentioned above, you have to check position/movement with some sort of sensor/encoder when using steppers, if absolute position or speed is required.
I think I am, therefore I am... I think.

karlgg
 
Posts: 212
Joined: Sat Dec 27, 2008 2:41 pm
Location: Anthony, NM

Re: Arduino + stepper motors

by g7nbp on Wed Feb 25, 2009 11:20 am

karlgg wrote:Try not to use "servo" and "stepper motor" interchangeably... A servo is a device (in our case, usually a motor) with a feedback loop, a stepper motor is just a type of motor. As mentioned above, you have to check position/movement with some sort of sensor/encoder when using steppers, if absolute position or speed is required.



Yes, this is indeed a wise point to differentiate. I thought it at the time but didn't quite type it as I thought it... the missing word in there was complete

the phrase I should have typed was

"add in an absolute encoder to complete the servo loop"

Typically for the sort of stuff Im building we have complex requirements - very fast slewing speed... but then sub seconds of arc accuracy of fine movement tracking. In these instances steppers are part of a "servo system" in that abs encoders provide hi-speed servo slewing position data (thus closing the loop), with the steppers running flat out until the servo position is within a degree or so of where we need to be. Once we are close and decelerate we then pulse count and re-check the abs enc every few milli seconds as this provides better accuracy than we can normally get from a 12 bit encoder.

A long winded way of saying that steppers can be part of a servo system - but no - they are not the same thing.
Last edited by g7nbp on Thu Feb 26, 2009 2:32 pm, edited 1 time in total.
g7nbp
 
Posts: 8
Joined: Sat Feb 21, 2009 5:26 pm

Re: Arduino + stepper motors

by karlgg on Wed Feb 25, 2009 2:21 pm

That was more for NKT, who seemed to use the terms interchangeably. At least you only used servo in the context of having feedback. :)
I think I am, therefore I am... I think.

karlgg
 
Posts: 212
Joined: Sat Dec 27, 2008 2:41 pm
Location: Anthony, NM

Please be positive and constructive with your questions and comments.