Pages: [1] 2 3   Go Down
Author Topic: Arduino with 12 servos  (Read 3632 times)
0 Members and 1 Guest are viewing this topic.
Buenos Aires
Offline Offline
Full Member
***
Karma: 0
Posts: 208
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am planning to use my Duemilanove with 12 servos (which should be possible?). I am a noob when it comes to Arduino and electronics but I have come to understand that in order to do so I must feed the servos with an external power source. Is this correct? If so then can I just connect them directly to a battery or do I need to build a power circuit (voltage regulator, capacitors etc.)? If so how do I do that most efficiently? Like what capacitors to use etc.? Perhaps a circuit diagram..? smiley

I also realized that the cables will get quite messy with the current pin setup on the board, so I wanna make a mini servo shield that turns my Duemilanove into a sort of RoboDuino.

http://www.curiousinventor.com/kits/roboduino

So (with the help of a class mate) I will make a PCB with pins on them, on one side to plug into Duemilanoves I/O's + Ground, and on the other side having tripple pins (signal, power, ground) for the servos.

Here is a quick and dirty drawing:

http://www.uploadgeek.com/share-3730_4A98A137.html

I understand that the external ground must be connected to the Arduino ground, right?


Is this a viable idea at all?


.......smiley-small. Aniss
Logged

Rural Arizona
Offline Offline
Edison Member
*
Karma: 7
Posts: 1711
Incorrigible tinkerer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The servos are designed to run off batteries,  so powering them from one will be fine,  as long as you pick the right voltage (e.g., 4 or 5 NiMH cells in series).

Yes, you need to connect the grounds.

If you're going to have many servos moving simultaneously,  make sure the power traces on that PCB are nice and fat,  especially if they're "heavy duty" models:  people are often surprised by how much current they can draw.

Make sure you research people's experience with running many servos at once,  because you'll need to use the software-generated servo output library.  I've only used a couple at a time,  so I don't know whether there might be surprises for you running 12.

Ran
Logged

Buenos Aires
Offline Offline
Full Member
***
Karma: 0
Posts: 208
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the input smiley

And yes I am researching as much as I can about running a lot of servos from 1 Arduino. This guy seem to have done it without too many problems:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1192268788/0

About the "software-generated servo output library"..are you sure that is the case? Since the recent (2009.07.25) release of Arduino software version 0017 this should no longer be necesary:

http://arduino.cc/en/Main/ReleaseNotes

Quote
* Replaced the Servo library with one (MegaServo) by Michael Margolis. Supports up to 12 servos on most Arduino boards and 48 on the Mega.

Or?.....

And yes I was planning to power it with 4 AA NimH batteries (1.2v each). But while building and programming it (the robot) I thought it would be prudent to power the servos with an ac/dc adapter like for example:

http://www.seeedstudio.com/depot/wall-adapter-power-supply-65vdc-2a-p-413.html

So it seems I have to make some kind of power circuit anyway. I've been researcing on that a bit and it seems I have to use a voltage regulator and 2-3 capacitors (sometimes more or less?). But the circuits I've seen are typically used to power homemade Arduino boards. Powering 12 servos is somewhat different.

So I wanna ask if anyone knows a good setup for powering 12 of these servos:

http://www.seeedstudio.com/depot/towerpro-airplane-9g-sg90-mini-servo-p-448.html

What kind of capacitors should I use? And how many? How should I build this circuit to get a good result?

Is it even necesary to build this circuit or is an ac/dc adapter stable enough to connect directly to the servos?
« Last Edit: August 29, 2009, 12:03:26 pm by Aniss » Logged

Michigan, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For that size servo you will need at least 500ma per servo for a peak load of 6A. I hooked a couple of mine up and ran them at full load @6V on a servo test board I have. :exclamation I would recommend using batteries for the servos unless you have a power supply capable of handling the necessary current plus some for safety.
Logged

Buenos Aires
Offline Offline
Full Member
***
Karma: 0
Posts: 208
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the input..

Using battery during the entire bulding/programming process is something I would VERY much like to avoid. So if I can buy an adapter that supplies the necesary current I will do that.

I just need to be sure WHAT to buy.

You say I need 500mA (=0.5A) for each servo? Therefore 0.5A x 12 = 6A (plus some for safety). So if I buy an adapter that suplies 8A - 12A (4.8v-6v) I should be good to go?

No voltage regulator or anything necesary?
Logged

Rural Arizona
Offline Offline
Edison Member
*
Karma: 7
Posts: 1711
Incorrigible tinkerer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
For that size servo you will need at least 500ma per servo
Are you sure about that?  That seems high for a 9g "sub-micro":  it's more like what I've seen on standard-sized ones.  But I haven't tried "stress-testing" them at absolute maximum loads,  so maybe that's the difference.

Aniss:  to properly pick your power supply,  you really need to consider what your system will be doing with the servos in action.  If you're only going to be moving one or two at a time,  you can get away with a much lower current rating.  If you're building something like a robotic arm,  that will be doing complex motions while holding a load,  you need to make sure you can power most/all of the servos simultaneously.

Since you're planning on a 4-cell NiMH pack,  you should look for a 5V supply,  so the system will work much the same way on the bench as it will in "real life".

You should get a regulated supply (and switching supplies are regulated),  because unregulated supply outputs vary hugely depending on how much current you're drawing from them.

In your position,  I'd go looking for a surplus 5V supply,  either linear or switcher,  that's rated for a lot more current than you expect to need.  That will avoid unpleasant surprises (like smoke  ;D),  and leave you with something you can use to power future projects when this one is done.

Ran
Logged

Buenos Aires
Offline Offline
Full Member
***
Karma: 0
Posts: 208
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I definately plan to avoid smoke and the likes smiley

About the TowerPro peak current draw:

I believe I've read that the peak current draw of a STANDARD sized servo is around 1A. I've also read that these small servos draws quite a lot of power relative to their size, so perhaps 500mA isn't so far off anyway?

However I haven't so far found anything precise about this particular servo's peak current draw. But I did read that a guy tested the pretty much identical servo HXT900 and measured a peak current draw of 750mA:

http://www.rcgroups.com/forums/showthread.php?t=828495

I read elsewhere that the AVERAGE current draw of that same servo is 550mA:

http://www.hobbycity.com/hobbycity/store/uh_viewItem.asp?idProduct=662

BUT...I also remember having read that it was only 250mA (don't remember where though)...

Anyway I'm a bit confused. I'll do more research later. All inputs are still highly appreciated smiley

And about the robot:

It's a walking/balancing robot and it would be nice if I could move (up to) all servos at once. It's gonna be VERY light. I plan to use plastic and tape whenever possible in it's construction. Still there will be SOME load due to the robot's body weight, but I don't intent to let it carry a lot.


Aniss
Logged

Buenos Aires
Offline Offline
Full Member
***
Karma: 0
Posts: 208
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah here is where I read that the HXT900 peak current draw is 250mA:

http://www.rcgroups.com/forums/showthread.php?t=828495

...Just to add to the confusion. :S


And about the adapters:

 I've been googling them quite a bit and it seems that it's hard to find much higher than 6mA like this one:

http://www.directron.com/ky05072.html

And even that's a bit expensive. I was hoping for a somewhat cheaper solution, since I live in Argentina and electronics are more expensive here. I actually paid 47 us$ for my Duemilanove board (for example). smiley-sad

Anyway 6A may not even be nearly enough???
« Last Edit: August 30, 2009, 11:14:04 am by Aniss » Logged

Buenos Aires
Offline Offline
Full Member
***
Karma: 0
Posts: 208
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok here is a follow up on my research...

A french guy tested 164 servos thoroughly and made a windows application. Unfortunately it's in french. However he also tested the TowerPro SG90.

The program can be found here:

http://www.teaser.fr/~osegouin/aeromode/servos.phtml

Click the link saying: "Téléchargez le programme et la base de donnée V2.2 de Mai 2007" at the bottom of the page to download the program (if you're interested).

Here is a screendump of the program showing the data for the TowerPro SG90:



With my limited knowledge of servos and poor french I have deducted that the SG90 will draw max. 700 mA at 5V and 835mA at 6V.

However it also seems that the general performance of the servos increase a lot when running 6V?! Didn't know that either..learning a lot these days smiley

I looked up some of the words I didn't understand:

Couple = torque
Vitesse = speed

But I could not figure out what this means: "Tps de positionement (moy)"?!

However it has to do with speed/positioning and the performance running 6V is almost double than when running 5V (78% vs. 42%). Perhaps something I should consider too?!

Anyway I'll end up running 5/6V and 12A (or something).

So know I wanna ask:

1) Is that at lot of current for a PCB (even with extra fat lines as Ran suggested earlier)?

2) How will the Arduino board react to 12A (perhaps 6V) when I connect the two grounds?

3) Could it damage the servos (if for example only one servos is connected will it be "overfed")?

4) Other posible problems due to this setup?

5) Should I choose 5V or 6V...pros and cons?

6) Any good shopping suggestions for 5-6V 12A adapters (tried to look for a surplus one like Ran said but couldn't find anything suitable)?
« Last Edit: August 30, 2009, 02:32:21 pm by Aniss » Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6250
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

700ma is with a torque of almost 500gm cm, at half that torque the current drops in half. You may want to factor in what the average load on all your servos will be.

1. fat pcb traces should be ok for these servos

2. The Servo current will not be flowing through the arduino board .

3. no (as long as the power supply is regulated so the voltage never goes higher than 6 volts)


5 volts gives faster performance and more torque at the cost of shorter servo life

6. I would guess that you won't actually need 12A for those servos.  You could use a surplus computer power supply for testing and see how much actual current you need.  A search on google should turn up a number of articles that explain how to turn on old computer supply into a high current 5v bench supply.


“Tps de positionement (moy)” is Average Positioning Time
Logged

Buenos Aires
Offline Offline
Full Member
***
Karma: 0
Posts: 208
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot for the info, mem!! smiley-grin

I am aware that the 12A is the THEORITICAL MAXIMUM plus quite a bit. And that's the point. I wanna be well on the safe side. It's impossible to predict the actual servo load in all situations, but I figure that there may be situations where the robot gets stuck and stalls on (up to) all servos. So 12A sounded like a safe bet.

But I'm intrigued by your suggestion to build my own power supply from a cheap computer power supply and I checked the net for examples. It doesn't look TOO hard even for a noob like me. And they are extremely cheap and some are even quite sexy:



http://www.excesssolutions.com/cgi-bin/item/ES2311

And I found several articles about the subject. In particular these seem thorough:

http://www.wikihow.com/Convert-a-Computer-ATX-Power-Supply-to-a-Lab-Power-Supply

http://web2.murraystate.edu/andy.batts/ps/powersupply.htm

But if I go through the trouble to build one of those it would be to have a permanent solution.

And perhaps it is just a bit too powerfull (seemingly minimum 145W), and therefore needs a fan. Perhaps I would be better of with a similar cheap'n'dirty solution: I could buy a "raw" supply like one of these with a max output closer to my actual needs and maybe avoid the fan?:



http://shop.iiic.hk.cn/index.php?main_page=product_info&products_id=3326&zenid=6hjjvodva2m66f6u44tpsmevv7



http://www.excesssolutions.com/cgi-bin/item/ES5078



http://www.powersupplydepot.com/productview.asp?product=17432+PS

But perhaps I'm just supposed to add the fan myself? I'm not sure at which currents the fan becomes necesary. Though I did find this one on the net:



http://www.trademart.in/product-JLTA251_jlt017.html

...Which would kinda be the optimal solution. And it shows that it IS possible to run 5V/12A WITHOUT a fan involved. Only I haven't been able to find anyone who actually sells these things ....


Anyway thanks for all the input Ran, kmackaero and mem....  smiley
« Last Edit: August 30, 2009, 10:32:21 pm by Aniss » Logged

Landskrona
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Google is your mother's friend
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i probably missing something now, but the Duemilanove only have 6 PWM = controlling 6 servos.
but as i said, i probably missed something out :smiley
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6250
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i probably missing something now, but the Duemilanove only have 6 PWM = controlling 6 servos.
but as i said, i probably missed something out
The Pulse Position Modulation (PPM) signals required for driving (up to 12) servos is produced using  one of the Arduino hardware timers. Pulse Width Modulation  (PWM) is not used in the latest Servo library code.

There is more detail on servo signals in this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1232572239
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6250
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Aniss, the 8 amp Metapo power supply for $14.95 from powersupplydepot.com is what I would go for. This is a switching supply so will not dissipate very much heat and I would think that you will not need a fan.

8 amps should be more than enough current. Servos draw current in pulses and the latest Servo library spreads these out so the average current will be much less (perhaps half for your servos) than the total theoretical peak. I would guess that if each of your servos does draw 700 ma peak, the actual current drain will be under 5 amps.
Logged

Rural Arizona
Offline Offline
Edison Member
*
Karma: 7
Posts: 1711
Incorrigible tinkerer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After looking at this page,  I can see that my testing setup was not good for catching peak currents,  so my estimates are low because I was seeing something closer to average values.

It appears (to be confirmed) that I had a misunderstanding of how RC servos work:  I thought the motor would come on continuously until it reached the target position,  but the waveforms on the above page suggest that that's not true.

If it's true that the motor is only being "pulsed" in sync with the servo signal,  you could reduce the peak demand by changing the phasing of the servo pulses.  E.g.,  by starting the servo pulses for the first six at the 0mS point in the cycle,  and the other 6 at the 25mS point,  you could cut the peak demand in half.

I did a little google research trying to confirm/disprove this,  but didn't have any luck.  I may have to build an improved test setup and check it out myself.

Ran
Logged

Pages: [1] 2 3   Go Up
Jump to: