Go Down

Topic: 10 stepper motors & Arudino Mega (Read 2451 times) previous topic - next topic

TonyStark

I am building a functional Iron Man suit.

I have successfully designed and built the repulsors and arc reactor, and the entire circuit is voice controlled using VRBot.  I have also mounted a WaveShield on the unit, to hear responses from "Jarvis".  However, the next step involves moving pieces of the armor using stepper motors.  I have never worked with any kind of motor on a circuit before, so I'm really at the mercy of this forum for answers.

I need to control 10 stepper motors, most of which need to rotate 180 degrees one way, and then back again at the next command.  I've looked at the MotorShield from Adafruit, and it only allows for 2 stepper motors.  Also, I am using a 5V power source (lithium ion).

So, my first question is, what type of stepper motor can I use with the Arduino Mega?  I'm looking at ordering them from Abra Electronics (since I live in Canada) - click on the motors link, than stepper motors, and it will bring up four options, but I'm not sure which ones suit my needs.  Also, if none of those seem like what I need, I'm not opposed to ordering from Digikey or something similar.  Most of the armor pieces won't require a lot of torque to move, but a few might, and all of the motors I've found exceed 500mA (I think the max current allowed per pin on the Mega is 40mA or 50mA?)

Second question, how do I mount something to the drive shaft?  I'm using plastic gears, so I can't really screw into the side...  Super glue?  I hope it's not a stupid question, lol.

Any help here would be greatly appreciated.  If I have to design my own board, a schematic would greatly help me, as I'm still fairly new to microcontrollers and related hardware.

On a side note, does anyone have a good website where I can easily learn how to Multiplex/Charlieplex?  I've read that this is the most effective way to run 7 LEDs in parallel, and not exceed the max current draw on one pin.

Thanks so much in advance for your help.

TonyStark

ru

If they 'only' need to turn 180 degrees, then why not use servos?

You can get ones with decent torque, and they're easy to control from the Arduino (note, you'll obviously need a chunky PSU for them).

I don't know how many you can drive from a Mega, so that's worth checking too.

graymalkin

#2
Aug 05, 2010, 02:53 am Last Edit: Aug 05, 2010, 02:55 am by Gray_Malkin Reason: 1
Epoxy and hot glue are great glues, or heavy duty velco, but it might not be accurate.

Also, can't an arduino mega control as many servos as it has PWM ports? I'm sure that was 16...

Also, 0.5 amp motors to move a piece of plastic/metal seems hugely excessive, if you were to use a motor, couldn't you use a smaller motor and some gearing, you'd get a nice motion that way too, less sharp.

(still think servos are your best bet though, as ru said )

TonyStark

Hey Richard,

Thanks for the detailed response.  I am making a full-scale functional Iron Man suit.

I'll admit, I'm pretty aware that I've approached some aspects of this costume in a backwards manner.  I must also admit I'm fairly new to electronics and circuit design.

However, for some things (ie. the helmet and mask), the design of the costume determined the gears, torque, force etc.  I have yet to measure these values, but I will before I select which motors I need.

I chose the Arduino Mega because at the very least it's going to control the lights and sounds of the suit, and if I need another microcontroller/power source for the motors, I can do that.

The current battery I'm using to power the Arduino Mega is here: http://www.liquidware.com/shop/show/BPM/ - I have the 2200 mAh.  Again, if I need to build a separate system for the motors, I'm happy to do so, which ever is easiest.  I'm looking at ordering servos/stepper motors from this website: http://www.robotshop.ca

After some research, I'm realizing I don't necessarily need stepper motors to control these pieces.  Hobby servos might be powerful enough for some of my purposes, but I won't really know until I measure the torque required for each mechanism.  I'm also going to use at least two linear actuators instead of motors, so that should be a little simpler for those mechanisms.

As for the gears, I'm using Lego Technic, as it's lightweight, durable, cheap, and easy to change if my design doesn't work.  The motors I'm using won't be designed to be compatible with Lego, so I was just wondering if anyone had any suggestions.

I'll do the measurements for each mechanism, and than post it here.  It's looking like I'm going to have to design my own PCB to control the range of motors here, and have a designated power source and microcontroller for it.  This is something I'm definitely going to need help with, because I'm not even sure where I would begin.  Once I know which motors/servos/actuators I'll be using, perhaps I can message you Richard, and get some info on designing this circuit.  If you can suggest an easier (and hopefully, cheaper) method, I'm all ears.  Thanks for your patience with my newbieness.

TonyStark


TonyStark

#5
Aug 09, 2010, 05:53 pm Last Edit: Aug 09, 2010, 05:54 pm by ry84 Reason: 1
hee hee, or this one?  http://www.robotshop.ca/pololu-usb-16-servo-controller.html


Which of these would be easiest to manipulate/connect with an Arduino?

ru

Why use a servo controller at all?  Can't you control them directly from the Arduino, as mentioned previously?

TonyStark

I had originally wanted to do that, but don't I run the risk of drawing too much current from the battery, and then damaging the Arduino?

If I used a servo controller, couldn't I just use an external power source (say, a 5600 mAh remote control car battery) ?

Which method is safer/easier/cheaper?

ru

You'd still power the servos from the secondary source; the only connection to the Arduino would be the control pins (and linking the 0V connections).  :)

TonyStark

Quote
Controlling servos has nothing to do with drawing current from the controller.


It would if I was running them directly from the microcontroller, correct?

BKnight760

#10
Aug 27, 2010, 07:41 am Last Edit: Aug 27, 2010, 07:50 am by BKnight760 Reason: 1
You are right, you don't want to power the any motors from your Arduino board.  You'd be likely to burn out some components by drawing too much current from the board itself.  So you'll need an external power supply.  For my motors, I use a generic DC power adapter that I plug into the wall.  (You can get cheap ones from a second-hand store for $1-$2... otherwise they're $12+ each)  Just check the specs which are printed on the outside of the casing to make sure of the voltage and current they supply.

You can get simple transistors to act as very fast switches to power your motors.  Basically, you connect your external DC power supply voltage and ground to the outer two pins of the transistor and the middle is the control line from the Arduino.  By sending a PWM signal on the control line, it turns on and off the power very quickly to move the motor.

A nice neat package is the NTE1749 or equivalent  (~$15).  It's a 4-channel H-Bridge.  Basically it powers 4 different control lines, as found on most stepper motors.  You may be able to find a different model with more channels or a cheaper one to suit your needs, but this is the one I use.

Your limitation here would be that you need 4 control lines for each stepper motor.  The Arduino doesn't have 40 digital output pins as you would need to run 10 stepper motors.  Servos commonly use less control lines, so that would probably be a safer bet.  But I'd still check how many you require before you buy anything.

As for the drive shaft question.  I've done a bit of robotics with legos myself, and ran into the same question.  Turns out there's a very good method for mounting gears to drive shafts.  Check out the robotics --> motors section of sparkfun's website.  (or google "universal mounting hub")  It's a round metal hub that connects to the drive shaft with a set screw.  The hub has other screw holes that you can use to connect your lego gears.  The holes work very nicely because the lego gears also have holes that match up pretty well.

You can do pretty much the same thing with whatever plastic gears you can find at a hobby shop.  Just get one that connects to the drive shaft (many have pressure fitting gears), and then you can drill holes in the plastic gear, and then use small nuts/bolts to connect the lego gear you want.  That solution works well as a gear adapter for cheap.

In essence, the ATMEGA168 / 328 microcontrollers are fast enough (16-20 Mhz) to control 10 steppers and lights and such, but the difficulty would be getting them all connected to the microcontroller.  You could do some multiplexing and resolve that issue, and easily connect the 10 motors, and use a few pins (4) to address which motor you want.  Though, multiplexing would cause it so you wouldn't be able to control all of the multiplexed devices at the same time... just one at a time.  All that would take is a few AND/OR/NOR/XOR gate chips which are cheap, and do a bit of digital logic.

I think you could do what you want with an Arduino Mega, just requires some imagination / ingenuity... which from your project description sounds like you have plenty of.

Jonathan Oxer

Quote
I am making a full-scale functional Iron Man suit.


[glow]Boggle[/glow]

I can't believe nobody in this thread has yet done the obvious thing and demanded photos!
--
Jon

retxed68

Haha I was going to ask! I wonder what the suit looks like :p

retxed68

Andrew

Quote
I am making a full-scale functional Iron Man suit.


For some definitions of "functional".

Andrew

Grumpy_Mike

Quote
I can't believe nobody in this thread has yet done the obvious thing and demanded photos!


If he is only thinking about making it I assume there are no photos yet.

Go Up