Pages: [1]   Go Down
Author Topic: Power issues on robot platform  (Read 935 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I'm currently working on a robot project, using this set-up:

I wrote a simple sketch that tells the DC motors to drive continuously forward until the IR sensor detects an object. Then it drives one side of the motor backward and holds the other still for half a second, to make the platform do a backwards turn. Then it re-checks the IR sensor status. If all is clear it continues forward.

This is all working great when powered by a 9V power adapter, but when I power it from the batteries I have two types of problems:
1) the robot drives forward, detects something, backs off, then stalls (code execution seems to have stopped completely, as an indicator LED I added to signal object detection from the IR sensor stays off, yet the board still seems te be powered as signaled by the green power LED).
2) the robot keeps detecting objects in the IR sensor, even though there are no objects in sight. This leads to the robot backing up continuously.
When I attach external power the problems do not occur (even connecting the USB cable with the batteries connected as well solves these problems).

I have a strong feeling these problems come from the batteries not being able to supply enough power, leading to code crashing (problem 1) and noise on the board (problem 2). As this is the first robot I build (and the first time I drive motors) I am not sure about this. I would like to hear your opinion on this, and if you have any suggestion (should I increase the battery pack? or drive the motors from another power source? anything else?).

Also I would like to hear what I can expect as to operation duration with this set-up. Should I be happy with 15 minutes, or should the batteries last for hours?

All help is very much appreciated.

Kind regards,
Vincent
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5551
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well - first off, with 5 NiMH cells, you only have 1.2 volts per cell (at approx 2500 mAH) - so 6 volts; this is not really enough to supply proper power to the Arduino via the barrel jack or VIN, both of which go thru the regulator. This regulator (7805 equivalent) is -not- an LDO (low dropout), and so requires a certain amount of voltage over and above its regulation voltage of 5 volts - which is really about 7 volts (7.5 to be sure).

When you plug in the USB - USB provides regulated 5 volts, and this connection bypasses the regulator - thus things work OK. When you use the 9 volt power supply, this is above the 7.5 volts needed by the regulator so it works ok.

First thing to try then would be to use a larger battery. I would go with an 8 cell pack, to give you 9.6 volts. If you need the 6 volts for the motors (likely, given the platform you are using), you'll need to customize the pack to tap off at the 9.6 volts.

An alternative would be to leave the pack as-is, but tap off of 4 cells (for 4.8 volts), and use that to go into the +5V line on the Arduino - which bypasses the regulator (note that you MUST BE CERTAIN OF YOUR POLARITY FOR THE CONNECTIONS - failure to do so will release the Arduino's magic smoke). 4.8 volts is within the voltage level the ATMega can use.

That would be the first thing to try. You shouldn't have any or much problem with signal noise or whatnot from the motors since you aren't using any kind of custom electronics or such; unless the shields and such are poorly designed. If you do suspect noise, you can always add some small noise-suppression capacitors across the motor leads at the base of the motor.

As far as the run-time is concerned - each of those motors draw a max of about 2.8 amps (when stalled); frankly, your h-bridge, which is L298-based - is undersized, depending on how you have the four motors of that platform wired. For these motors, I probably would've gone for one h-bridge (in bridged-mode) per motor to be safe - but you could probably get away with running two motors per board, as long as they weren't both locked up, and you had a good heatsink on the chip (more than the PCB-based sink). Fortunately, the L298 has thermal and current-overload protection...

With those kinds of motor specs - if you split the difference between no-load and stalled on those motors (which I believe are these: http://www.robotshop.com/dfrobot-6v-180-rpm-micro-dc-geared-motor-with-back-shaft.html), you get about 1.3 amps per motor. I'd say given the mAH of the battery here (2500 mAH - approximately) - you are lucky to get 15 minutes. That pack is kinda undersized.
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First of all, thank you very much for your rapid and extensive reply. This is very much appreciated and really shows the great community that is behind the Arduino platform smiley

Then as to your reply: you make some excellent points. I was thinking and thought that perhaps I could also add a second battery pack and use that just to power the DC motors as a dedicated power source, correct? This would also prevent the board from crashing when power is low and the robot can still go on and scan the room, etc. although from a static position. Or am I wrong on this?

I'm happy to have a better understanding about powering the Arduino board, but I must say I am bit disappointed by the runtime I can expect from this power source. The point is that the batteries need about 18 hours of charging time, after which I can power the robot for 15 minutes. Hardly enough to map the entire room as I first imagined (I also bought a 180 degrees servo, ultra sonar sensor, a digital compas and Xbee shield + module; I don't really see regular NiMH batteries powering that all together for longer than a few minutes).

Are there any other options I could look into? Perhaps a li-ion battery? Does that provide a longer running time, or at least a shorter charging time? Are there any other options?

Also, is it possible to charge the batteries (or the li-ion if that's a good option to use) while they are connected to the Arduino? Using something like this: http://www.sparkfun.com/products/674 ?

Well, thanks again for your time. Very much appreciated smiley

Kind regards,
Vincent
Logged

Offline Offline
God Member
*****
Karma: 4
Posts: 813
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The power drain comes not from the Arduino, but from the propulsion motors. You will need a much bigger battery pack. Li-Ion batteries are great. LiFePo4 batteries are good too, slightly less power dense, but much less dangerous chemistry.

Go search for battery packs online. Not only is the voltage important, but also the capacity (in mAh). If you hook batteries in series to boost the voltage, the mAh of the entire chain is the same as the lowest of the included batteries. If you hook batteries in parallel, you keep the voltage the same, but boost the mAh to the sum of the included batteries.

To start out, compare something like this: http://www.amazon.com/12VPK4-5A-Li-Ion-Rechargeable-Battery-Charger/dp/B0053TF0B2/ref=sr_1_3?s=electronics&ie=UTF8&qid=1329169669&sr=1-3
Note that "amps" is a dumb specification -- I _think_ that means "amp-hours" so 4.5 "amps" means "4500 mAh" but I could be wrong.

If you can "unlock" the signals needed for power tool batteries or laptop batteries, there are some good values to be had in that space. Else you can build your own packs straight from cells -- a 2400 mAh 3.7V LiPoly cell will run $8-10 in bulk.
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5551
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

To select the right battery, you need to have a solid understanding of what an "amp hour" is.

Simply put, it is the ability of a battery to output one amp, for one hour.

One amp hour (1 AH/Ah) is equal to 1000 milli amp hours (ie, 1000 mAH or mAh).

If you have a device that pulls 1 amp, and your battery is a 1 AH battery - in an ideal state you could power that device for 1 hour.

If your device pulls 2 amps - you can power it with the 1 AH battery for 30 minutes.

Whereas if the device only pulls .5 amp (500 mA) - you could power it with the 1 AH battery for 2 hours.

Do you see and understand how that works? If not - re-read the above, and do the math. You might also google on "amp hour calculation" and similar phrases to find tutorial and such (you might also google for my handle and "amp hour" or similar - I have made similar postings about this here in the past, some quite lengthy and detailed).

Now - the above is all under "ideal" conditions - conditions that don't actually exist in real life. For instance, as you use the battery, it heats up. If you look up the spec-sheet for the battery (or for the cells in the battery - whichever the case is) - you will find temperature de-rating graphs, which basically give the capacity that the cell/battery can deliver for a particular temperature range; as the battery heats up, the de-rating changes.

You also can't drain a battery to "zero" (at least without damaging it) - so there's that. There are also a ton of other factors (internal resistance and such) that come into play. In short, while a battery may be rated as "2500 mAH" - you will be lucky to see 60-70 percent of that in the "real world". So - you want to size your battery larger.

Of course - this will cause the battery to weigh more - which will cause you to use more current, which will make to need a battery with a longer run-time - and round-n-round ya go! The bane of robotics, unfortunately...

You might find that for your application - that no battery will give you what you want or need (or if one exists, you won't be able to afford it, or it is only a prototype).

But first - you need to know what you need - you need to know your total current consumption (if you want to be detailed, you'll want your "idle" current consumption, average current consumption, and loaded current consumption - and time periods you think you'll be in each level). Once you know that, you can figure out what size of a battery you'll need.

For instance - if your total current consumption was 2 amps, and you were always using 2 amps - and you wanted 10 hours of run time, you'd probably want to look at a 30-40 amp-hour battery (ie: 2 amps multiplied by 10 hours, doubled). That would be a fairly hefty battery, btw...

You can also see from the above a little of what electric-car designers have to deal with...
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A big thank you to the both of you. Based on your suggestions I did some additional research and I think I Lithium-ion batteries are the way to go for me. They offer a (relatively) low charging time, yet have the density to power the robot for at least some time. Luckily, one of my business clients is a battery wholesaler, so I think getting the right battery shouldn't be much of a problem.

The only (major) drawback I can think of is the danger of damaging the cells (I've seen quite some interesting videos of exploding batteries today smiley-wink. How do you handle this? From what I understand most of these battery packs have some sort of protection against under-charging or over-charging. Is it safe to rely on this? Or do I need to build in some extra protection that cuts off the power when below or above this threshold? Is this the same method that is used in the batteries of my laptop for example?

Then I would like to share a wild idea I had: I'm not sure if it's feasible at all, but would it be (theoretically) possible to program the robot to return to a specific location for a recharge when battery power drops below 10%? I was thinking about creating a charging station that the robot tries to find using its compas and IR receivers (the base would need to send out an IR signal that the robot can pick up to align itself correctly). Then the robot slowly drives into the charging station, connecting the battery pack to the loader using a regular barrel jack connector. Of course the robot needs to be perfectly aligned. From the software-side I think it's doable (I'm a software guy, quite new to all this hardware stuff smiley, but what are your thoughts? Would be pretty cool to have a self-supporting rover driving around the office smiley

Kind regards,
Vincent
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5551
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A big thank you to the both of you. Based on your suggestions I did some additional research and I think I Lithium-ion batteries are the way to go for me. They offer a (relatively) low charging time, yet have the density to power the robot for at least some time. Luckily, one of my business clients is a battery wholesaler, so I think getting the right battery shouldn't be much of a problem.

The only (major) drawback I can think of is the danger of damaging the cells (I've seen quite some interesting videos of exploding batteries today smiley-wink. How do you handle this? From what I understand most of these battery packs have some sort of protection against under-charging or over-charging. Is it safe to rely on this? Or do I need to build in some extra protection that cuts off the power when below or above this threshold? Is this the same method that is used in the batteries of my laptop for example?

Leave the design of lithium battery chargers to experts: Don't try to roll your own design. Instead, find a proven and capable design (maybe your buddy can help you find one) - or use an existing off-the-shelf charger to charge the battery pack. Otherwise, you definitely will be risking a fire.

Then I would like to share a wild idea I had: I'm not sure if it's feasible at all, but would it be (theoretically) possible to program the robot to return to a specific location for a recharge when battery power drops below 10%? I was thinking about creating a charging station that the robot tries to find using its compas and IR receivers (the base would need to send out an IR signal that the robot can pick up to align itself correctly). Then the robot slowly drives into the charging station, connecting the battery pack to the loader using a regular barrel jack connector. Of course the robot needs to be perfectly aligned. From the software-side I think it's doable (I'm a software guy, quite new to all this hardware stuff smiley, but what are your thoughts? Would be pretty cool to have a self-supporting rover driving around the office smiley

This is possible - but once again, consult the experts. Check out how iRobot designed the Roomba's charging station. Note that it doesn't use a barrel jack to "plug in". Also note the fact that the Roomba is round. This means that the robot can get close to the base, ram into it, then "wiggle" back and forth to seat the contacts on the underside of the robot with the contacts on the base. Do some research on how others have attempted to solve this issue over the decades as well (people have been working on "self-charging" robot designs for over 50 years - take advantage of their hard work, and quit trying to reinvent the wheel).
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Pages: [1]   Go Up
Jump to: