Best battery solution for powering 18 servos and an Arduino?

Hey, I've really tried to read my way through this problem, but I just can't find a solution.

I am building a hexapod with 18 MG996R servos and an Arduino nano, and I'm planning on using two PCA9685 16 channel servo drivers chained together. However, I don't know a suitable battery (batteries?) solution to power it all. The servos need 6 V, and the Arduino either 5 V or 7-12 V via VIN. Somehow I need to supply two different voltages from the same battery source, which is something I have failed with before (tried powering 2 DC motors and a nano with AA batteries and a power converter, but could only get it to work with a separate 9 V battery for the nano).

I've looked at 6 V (5*1.2V) NiMh 2500 mAh batterypacks, which is the correct voltage for the servos, but would connecting two different servo drivers with the same batterypack work/be viable? On top of this, 6 V needs to be either regulated down to 5 V (LDO? What kind?) or up to 7-12 V for VIN (I suppose the latter is unnecessary) for the Nano. The same pack would then be connected to three different loads. My lacking knowledge in electricity does not tell me if this is a problem or not.

I suppose I could use LiPo batteries aswell, but I have not used them very much and I really only like them for RC-planes since you have to be very careful about leaving it charged/discharged. It would be very nice if the battery solution enabled one to pretty much never worry about how to store the batteries. Having it powered by AA batteries would therefore not be the end of the world, since you could just slap a few in there anytime you feel like booting it up.

If NiMh or AA works, I don't know. Current? How do you make sure the batteries you choose can deliver the right amperage? Basically, I want to know your thoughts on how this problem can be solved.

// Eophex

I’ve looked at 6 V (5*1.2V) NiMh 2500 mAh batterypacks, which is the correct voltage for the servos, but would connecting two different servo drivers with the same batterypack work/be viable? On top of this, 6 V needs to be either regulated down to 5 V (LDO? What kind?)

You can connect as many devices to the batteries, there is not NUMBER limit. However in total they cannot exceed the battery max current.

I would stick with the 6V battery packs and put a diode in series with the Nano 5V in. A 1n4001 will drop about 1/2 a volt (maybe a little more) and bring the 6v into an acceptable range for the Nano.

I suspect your problem in the past was more physical layout of the devices, how they were wired and lack of filtering.

Use a 6v battery to power your servos. You will need an LDO regulator to produce the 5v supply for the Arduino, because 6v does not supply the necessary headroom to make the Arduino's voltage regulator operate properly. LDO regulators which should suit your purpose are available; use the parametric search engine at Mouser or Digi-Key or wherever.

The other important question is current. Have you measured the current demand of your servos? How many of them may be operating simultaneously? You will need to be able to supply the sum of those currents. The total may have a large bearing on your choice of battery.

S.

The stall current of the MG996R servos is around 2.5 Amperes, and they draw that every time they start moving. So for 18 servos, your battery pack should be rated for AT LEAST 30 Amperes, and preferably 40 A at about 6V to handle the surges.

Plan on a continuous running current of between 0.5 and 0.9 A/servo, or at least 12 A total, continuous current draw if the legs are all moving at once.

For NiMH battery packs based on 2500 mAh cells, look for a "C" rating of 15C or higher.

It would be most unwise to power the Arduino from the servo battery pack, as the Arduino would probably be destroyed by electrical noise and voltage spikes.

jremington:
The stall current of the MG996R servos is around 2.5 Amperes, and they draw that every time they start moving. So for 18 servos, your battery pack should be rated for AT LEAST 30 Amperes, and preferably 40 A at about 6V to handle the surges.

This assumes all are subject to startup at the same time. While that may be the case, I chose not to make that assumption.
S.

jremington:
It would be most unwise to power the Arduino from the servo battery pack, as the Arduino would probably be destroyed by electrical noise and voltage spikes.

I think you might consider a separate battery for the Arduino for a different reason. With such a large drain on the servo batteries I expect you will run them down to a very low voltage more than a few times. At that point the Arduino may not operate. By having a separate power source you can maintain control until the servos just can’t move any more.

Now if you can deal with 8Mhz and an external USB programmer you could consider the Pro Mini at 3.3V.

As for the noise, yes it can be an issue even with a separate power source. With careful wiring and some filtering it will work. I’ve had pro Mini’s working on an automotive application. Automotive 12V is very noisy and not friendly to electronic circuits.

NiMH batteries are good but if you are thinking of normal AA NiMH batteries then they will not provide nearly enough current to run 18 large servos. In a hexapod most of the servos will be under load all the time. Perhaps you could split the servos with 9 on each PCA9685 and run two battery packs, one for each PCA9685. That has a better chance. Or if you can get hold of Sub-C or C size cells that might work but they're not easy to find these days.

A good Lipo would be o.k. for current but the voltage is trickier. The MG996R is rated to 7.2V so it may be o.k. with a 7.4V lipo but I've never tried it.

Steve

I chose not to make that assumption.

Wise engineers and hobbyists design for worst case.

jremington:
Wise engineers and hobbyists design for worst case.

Sure, within reason. But you don't put V-rated tire on a car just because it COULD get to 140 mph in neutral on a long incline. I would design for the max number of servos which the code says may be operating at any given time. Otherwise you are potentially adding size, weight, and cost for no reason. And if there is some weird unanticipated fault which turns them on all at once, the battery won't be able to supply the current. So what? It's a fault condition, not normal operation.
S.

Ok, I will probably use one battery for the Nano and another solution for the servoes. I still don't know any smaller way of powering a nano than using a 9V battery, but they don't really survive that long.. What do you guys do?

For the servoes I think I will be using 4 x 3.7 V 2600 mAh 18650 lithium batteries (each rated at 25 A continous draw) to get to 7.4 V, but then step it down (6V?) with a buck-converter since 7.4 V might destroy the servoes(?). Should I put them as 2S2P for all 18 servoes or 2S for 9 servoes and the other 2S for the other 9 servoes?

2S2P: one buck-converter for everything, but all batteries will power all servoes
2 x 2S: two buck-converters in total, but the batteries will be split up in two packs.

If it is possible to harness 5V for the arduino from these specific configurations, I don't know. All I know is that some people have used similar batteries to power 18 servoes for hexapods AS WELL as the microcontroller with a DC-DC converter. How? Which one? No idea..

Edit: Ordered some 5V LDO regulators as recommended! LD1117V50C STMicroelectronics | Mouser Sverige

Eophex:
Ok, I will probably use one battery for the Nano and another solution for the servoes. I still don't know any smaller way of powering a nano than using a 9V battery, but they don't really survive that long.. What do you guys do?

If you plan to power the Arduino separately, you might think about a 4-cell battery of Ni-MH rechargeable AA cells. That will give 6v, sufficient headroom for a 5v LDO regulator. They should last several hours of continuous use. I would lose the rectangular 9v batteries, they are indeed wimpy and best avoided if at all possible. If you're worried about having to wait for a recharge, buy multiple sets of cells and swap fresh ones in as needed.
S.

@srturner:
Ok! I’ll look at some of those batterypacks! However, I’d probably go for a non-rechargable variant to avoid chargers and charging time for all the batteries on the robot
. I suppose 3 x AAA would work aswell? 4.5 V directly into the 5 V input of the arduino? Or will that probably run close to a 9 V battery? And the voltage might drop too far below 4.5 V? In that case, would 4 x AAA into one of the LDO’s do the same thing?

srturner:
If you plan to power the Arduino separately, you might think about a 4-cell battery of Ni-MH rechargeable AA cells. That will give 6v, sufficient headroom for a 5v LDO regulator.

NiMH AAs are 1.2V nominal so 4 of them are 4.8V NOT 6V. They will power a Nano very well with no need for any regulator.

Steve

@slipstick:

Sorry, I meant alkaline 1.5V AAA batteries. Either:

AAA 3S -> 4.5 V into 5V pin

or

AAA 4S -> 6 V into 5V LDO regulator -> 5V pin (however, this might cause problems since the voltage might not be that much greater than 5V after some use?)

Now that I think of it I can also just use a powerbank and connect it to the arduino USB port

The confounding aspect of powering multiple servos is that the servos "conspire" to ensure a worst-case power draw situation.

If the servo power supply is even once overloaded, the servos begin twitching and ignore commands, which means they are all drawing close to the stall current, further overloading the power supply.

If you use a voltage regulator, it also must be able to easily handle the stall current times the number of connected servos. Otherwise it will probably just overheat and shut down, possibly with random restarts, leading to further catastrophic (and embarrassing or funny, depending on your point of view) behavior. Experienced robot designers generally avoid voltage regulators for motors and servos, and use the appropriate battery packs instead.

And yes, be sure to power the Arduino and sensors separately. Don't forget to connect the grounds.

slipstick:
NiMH AAs are 1.2V nominal so 4 of them are 4.8V NOT 6V. They will power a Nano very well with no need for any regulator.

You’re right of course about the nominal NiMH output; for so long I’ve had the mental fixation 4AAs=6v that I failed to account for the difference in NiMH. I really should have known better, having measured the output performance of those cells myself (using an Arduino) in the past… :confused:

S.

Of course, freshly charged NiMH batteries do approach 1.5 V each. :sunglasses:

@jremington:

Oh, that's good to know. I suppose a stepdownconverter that can handle >= 15 A. Another project I read about (same servos, and also 18 of them) got recommended a D24V150F6 (D24V150F6 POLOLU - Converter: step down | Uout: 6V; Uin: 7.2÷40V; 15A; 80÷95%; 43x31.8mm; POLOLU-2882 | TME - Electronic components). I'll se if I can find something similar, and I suppose I really only have to look at the maximum output current? Some DC/DC converters are specified with "max continous output current: 2 A", but I guess that's not good enough? "Max continous output current" has to be at least 15 A, right?

Paul__B:
Of course, freshly charged NiMH batteries do approach 1.5 V each. :sunglasses:

They're usually getting rather old if they do get that high. And of course "1.5V" alkaline batteries often approach 1.65V when brand new.

Tricky isn't it?

Steve

Sigh I might have to order a 5S NiMH pack... I've found serveral at 2500 mAh but I haven't found anything about "C"-ratings. When looking at LiPo:s, it's always specified but seemingly never with NiMH. Would one just assume that it will do the trick?