PDA

View Full Version : Uninterrupted hot swap Lipo battery with other DC source.



billyzelsnack
01-14-2010, 12:16 PM
My robot runs Linux and it takes amount a minute to reboot. It's also probably not a good idea to instantly remove power from a Linux machine.

What I want to be able to do is to have my robot powered via a DC power brick source, but be able to detach from the that DC source whenever I put my robot on the floor. Since my battery is a Lipo it's not exactly trivial to build a charger, so I'm fine ( and feel better ) with having charging a separate commercial charger.

So kinda like what you would do with a laptop. You can have it plugged into the wall, but if you want you can unplug it and run off the battery.

Any ideas?

One idea I had was to just have my Lipo charger ( Cellpro 4S ) plugged into the battery balance connector while at my desk. The idea being that the robot would run off of battery power at all times, but the charger could charge the battery faster than the robot would drain it ( my main CPU only pulls 5 watts. ) I'm wondering if this will dramatically lower battery life or maybe it's just not a good idea to do such things in general.

JonHylands
01-14-2010, 01:10 PM
I'm working on just such a board, and should have it ready sometime in the next few weeks. It will do the auto-disconnect, and it will also have an on-board Lipo voltage monitor that will cut off the battery if the voltage gets too low.

I'm planning on selling the board, so I'll let you know when its ready...

- Jon

billyzelsnack
01-14-2010, 02:32 PM
Another thing I'm looking to do is to have the ( separate ) ability to toggle power to the AX-12 bus. Idle current on the 18 AX-12's current is like 0.5 amp which is annoying. That'd also be useful to reset the AX-12's after they decide to stop working and need to be reset.

Adam
01-14-2010, 02:54 PM
Any chance the board will support the cutoff for two packs? I want to use a 3S for my dynamixel bus, and use another 2S with a regulator for electronics...

JonHylands
01-14-2010, 03:16 PM
Any chance the board will support the cutoff for two packs? I want to use a 3S for my dynamixel bus, and use another 2S with a regulator for electronics...

No, this board will just handle one pack, plus wall power. There's no reason you can't power your electronics using the main battery, as long as you use a switching regulator. Even if you just use a linear regulator (like the Arbotix does), it will work fine - it just gets hot, and wastes a small amount of power that way.

- Jon

JonHylands
01-14-2010, 03:18 PM
Another thing I'm looking to do is to have the ( separate ) ability to toggle power to the AX-12 bus. Idle current on the 18 AX-12's current is like 0.5 amp which is annoying. That'd also be useful to reset the AX-12's after they decide to stop working and need to be reset.

I typically put one of my power switches on the power line going to the bus plugs, so I can power cycle the bus whenever I want, and keep it off if I'm just doing processor-level stuff.

I've heard that you can reset the AX-12's in software when they stop working, by disabling and then re-enabling torque. I haven't tried this myself yet, so I can't say for certain that it works.

- Jon

badcommandorfilename
01-15-2010, 05:06 PM
I don't know what microcontroller you are using, but many popular hobby boards (PIC18xx, AVRs) have a brown-out detect interrupt.

If you configure it correctly, it will use the A2D peripheral to monitor the voltage on the V++ node and trigger an interrupt if it drops below a threshold. You generally have a few microseconds before the board actually dies, which is just enough time to save some critical data - or in your case, switch to an alternate power source.

You mentioned that you had linux installed, so it's possible you've surrendered control to the low level hardware and this might not be as easy as it sounds for you. However, all you would have to do is set up a simple mosfet/transistor pair switch connected to one of your output pins. Just drive the pin low for battery mode and high for power pack mode.

A little extra circuitry/logic can even enable you to recharge the battery when the robot is plugged in!

I posted a short guide to recharging batteries with an AVR here (http://buildtherobot.blogspot.com/2009/12/son-of-voltron.html), but you'll have to look elsewhere to find out about the brown out detect interrupt if your board has one.

billyzelsnack
01-17-2010, 01:02 AM
I've heard that you can reset the AX-12's in software when they stop working, by disabling and then re-enabling torque. I haven't tried this myself yet, so I can't say for certain that it works.

It says in the docs that it'll recover after enabling torque again, but it's not working for me. I have keys setup to disable/enable torque at any time and when I get the shutdown.. toggling torque on and off obviously is working for all the other servos, but not for the one that is shutdown.

billyzelsnack
01-17-2010, 01:03 AM
However, all you would have to do is set up a simple mosfet/transistor pair switch connected to one of your output pins. Just drive the pin low for battery mode and high for power pack mode.

I might give this a go at some point. I'll report back any success with it.

JonHylands
01-17-2010, 08:32 AM
I might give this a go at some point. I'll report back any success with it.

Its not that simple. That might stop the battery from powering the circuit, but wall power will still feed directly to the battery in that case (MOSFETs are only one-way).

Having wall power hooked up to your Lipo batteries would be a very big no-no...

- Jon

billyzelsnack
01-17-2010, 10:48 AM
Its not that simple. That might stop the battery from powering the circuit, but wall power will still feed directly to the battery in that case (MOSFETs are only one-way).

Having wall power hooked up to your Lipo batteries would be a very big no-no...


I really only need both plugged in long enough for me to swap the power source. I doubt it'd damage anything since the voltages are the same, but I guess we're talking Lipos here.

billyzelsnack
01-27-2010, 05:54 PM
Here is what the rcgroups kids had to say about the safety of the idea..

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

darrellt
01-28-2010, 01:22 AM
I was having trouble with micro-controller resets due to my Castle BEC regulator not being able to handle my peak current draw. I installed a Ultra Capacitor array on the regulated side of the circuit to ride out the peak demands. This had the side effect that the robot would run after the battery was disconnected for about 30 seconds. I believe I used 3 4.5f caps in series to get the voltage rating high enough. If you used a SPDT switch even a .1f should be plenty of power for the instant one pole is opened but the other is not yet closed.


And you are wise to baby your lipos. They blow up more often then a concrete truck in Tikrit.

billyzelsnack
01-28-2010, 11:33 AM
I am having the same power surge problem with micro-controller resets on sudden heavy use of servos ( my AX12 servos are not powered by the BEC output, but from BEC input. ) Did you put your caps on the input or the output of the BEC? I was planning on putting two 16V 3300uF caps ( same thing in the Bioloid CM-5 ) on the inputs of my BEC. Now I am questioning that if the BEC is the real problem.

btw. This same problem also happens with fancy newer RC receivers. You can even by a commercially made capacitor solution!
http://www.horizonhobby.com/Products/Default.aspx?ProdID=SPM1600

darrellt
01-29-2010, 01:46 AM
I put the array on the output side of the BEC (regulated side). I was running all my servos on the output side, so I needed a lot of capacitance. You might be able to get away with less. The two things to be careful about with ultracaps: 1. Don't ever over-voltage them, even a little. 2. They typically have a fairly significant internal resistance compared to regular capacitors, so they can only supply so many amps. The plus side of this is that it won't turn into a tiny arc-welder when you accidentally short it with your screwdriver.

MikeG
01-29-2010, 07:01 AM
Would this circuit work for hot swapping batteries? It's not the most elegant solution.
http://share.agaverobotics.com/images/forums/batteryswapcircuit.gif

JonHylands
01-29-2010, 06:34 PM
It probably won't, because the switch will have a certain amount of time where it is "off" in between.

My power board is pretty much ready to go - I have the last prototype sitting on my desk right now, and will be building it and testing it next week. It will need a week or so of beta testing, and then I'll start selling it after that if all goes well...

- Jon

MikeG
01-29-2010, 07:13 PM
Jon, that's what the cap is for.

JonHylands
01-29-2010, 09:07 PM
Yeah, I guess if you had enough capacitance, it might work. If your circuit draws a lot of power, you're going to need a huge amount to cover it.

- Jon

badcommandorfilename
01-30-2010, 02:37 AM
If you're worried about the switch switching too slowly, you could use a solid state relay. That will take your transition time from milliseconds to nanoseconds.

Of course, you'd need to trigger *that* somehow, which means you might have to use a debouncer or some kind of digital timer. You could use one of the output pins on your board.

kamondelious
01-31-2010, 09:50 AM
Hey Jon,

How's your new board coming along? What do you estimate it's final dimensions & weight are going to be?

Seems to me like it meets billyzelsnack's original requirement nicely. :D

For me, I'm looking at using two 11.1V 2200mAh 25C LiPo's to get a longer runtime for Snoopy. If I was to use two of your new boards with their power-out lines connected in parallel with a barrel plug on the ends. Then connect that to the Bioloid USB Bus board I'm getting, do you see there being any issues? My guess is that it will come down to how many amps the Bus board can handle before the fuse blows. I'm sure I read what it was rated at somewhere, but can't seem to find it at the moment.

Cheers!

JonHylands
01-31-2010, 10:21 AM
I have the (hopefully) last prototype board sitting in front of me (bare PCB). I'm going to populate it on Tuesday (once my new parts come in), and if it works, then I'll get the final ones made.

If you're going to use two batteries, you should probably just hook the batteries up in parallel and feed them into one power board. I don't know if the two boards idea would work - you might end up with wall power from one hooked directly to the battery on the other (if their charge levels were uneven).

The fuse on the power board is a standard automotive blade type fuse, and you can run a 10-amp fuse there with no issues. If you're using one of my USB boards with the power board, you can remove the brown fuse and short out the fuse holder with a wire, or just leave the fuse in (its only rated for 5 amps, though).

The power board is 1.75" x 1.75", with a #4-40 hole on each corner, 1.5" between hole centers.

- Jon

kamondelious
01-31-2010, 11:12 AM
Ahhh delightfully tiny! That's not going to weight much. I can weight it when I get one (or two). I just picked up a digital pocket scale so I could start weighing everything on Snoopy to get/maintain as accurate of a measurement as I can.

My reasoning behind the 2 boards was so that I could readily hot-swap out one at a time without downtime. With the option of running off an AC adapter if needed.

I suppose I could easily make a little bridge board to do the parallel connection with a couple diodes on it to prevent reverse direction power flow between the 2 power boards.

Thanks!

:D

JonHylands
01-31-2010, 11:17 AM
The whole point behind this board is so you can hot-swap batteries by plugging in wall power, unplug the battery, and replug a second battery.

- Jon

kamondelious
01-31-2010, 11:54 AM
Indeed.

Even if I'm looking at a lighter 8C 3S now, my mounting options are limited. I don't want to go above the waist because I have enough stuff mounted up there already. Going lower is better from a COG point of view, but also requires even distribution. My plan is to mount the batteries on the sides of the legs at about knee level as this seems like the best location for mounting and not obstruct any DOF. This poses a bit of a requirement on me to use 2 batteries or at least see how feasible it is.

But of course you're right just having the 2 LiPo's in parallel via a T-plug, or something, going into the powerboard would be simpler and lighter.

Thanks Jon!

:D

kamondelious
02-16-2010, 11:48 AM
Hey billyzelsnack,

Did you come up with a solution you plan to run with? If so, what is it?

Currently, I'm going to go with my 2 new LiPo's running in parallel, hooked up to Jon's Bioloid Bus interface. I'll be powering everything off of the Bioloid Bus, so that's all I need for power supply. Next I plan to get Jon's power board and put that between the LiPo's and the Bus Interface board. That will give me the option of swapping off either battery when they are low, or just wall plugging and swapping both out at once. I also picked up a couple LiPo alarms, I couldn't find anything that did a cutoff, and will have those hooked up at runtime so I know when the batteries are running low.

Cheers!

:D

billyzelsnack
02-16-2010, 12:15 PM
The slideshow at the start of this video shows what I ended up with..
YouTube- New CPU case with all innards

Basically it's just two power jacks wired in parallel. I chose jacks that are compatible with the Bioloid power brick. I found the jacks and plugs in my junk electronics boxes. It is a pretty common size, but the wire gauge is completely random. I did find a few that were 18ga.

One mistake I made when building it was not making sure to space the jacks far enough part. I just put them flush against each other which is not quite enough since the plugs are so wide.

I'd prefer a solution like Jon is making, but I just don't have the space to spare. What I want to make in the future is a slim custom board that runs the width of the case that has everything mounted on it. Power, dynamixel interface, AX-12 connectors, fan control relay ( that I still need to add ), voltage regulator, rc servo connectors, gyros, accelerometers, etc.

billyzelsnack
02-16-2010, 12:21 PM
As for cutoff.. Just read the voltages from the servos and play an alarm sound if they are too low. I've actually put espeak into the code and it can literally tell me that the battery is getting low or is too low! haha.

4mem8
02-16-2010, 02:45 PM
Hi John, love to get hold of a couple of those auto detect boards, do you have a price for them, are they just boards and i install components [which is ok] or are they finished product? thanks.

JonHylands
02-16-2010, 03:05 PM
They should be on sale within two weeks from now. I will be selling the fully populated board for $75. There are a lot of surface mount parts on this board design, including many 0603 passives (caps & resistors).

- Jon

kamondelious
03-01-2010, 09:35 AM
I've heard that you can reset the AX-12's in software when they stop working, by disabling and then re-enabling torque. I haven't tried this myself yet, so I can't say for certain that it works.

- Jon

I tested this out tonight. The max torque gets set to 0, which is why you "lose" movement. All you need to do is set the max torque on the AX-12 in order to regain control of it. You probably want to check the current position, load & temp before doing so, maybe even set a new goal position, as the AX-12 will go straight to it's goal position once max torque is reset.

Cheers!

:D

billyzelsnack
03-01-2010, 09:54 AM
Oh excellent. I was just fiddling with torque enable.

Robert
03-09-2010, 05:12 PM
Is there some big problem with just using a pair of diodes? Just size the diodes appropriately to handle the current demand, while still having an acceptable voltage drop.

http://www.annoyingrob.com/Phidgets/batt_isolator.JPG

billyzelsnack
03-09-2010, 06:20 PM
The diodes prevent the power sources from attempting to "charge" each other?

JonHylands
03-09-2010, 06:23 PM
Yes, there is a problem with using Diodes. The voltage drop can be a significant problem in some circumstances. In our Brainbot robot, using a Diode pair (with 0.4 volt drop) has a noticable effect on available battery capacity. It also wastes power through heat.

The most annoying problem, though, is you can't use a wall power supply properly. Most 12 volt battery packs have a fully charged voltage somewhat higher than 12.0 volts. I have a 17 amp 12 volt wall power supply that I use to power Brainbot while it is on the bench. When I use that, I have to unplug all the batteries, because the diode pair chooses the source that is a higher voltage rather than the source I "want" it to choose.

My aux. power board (which is now available) solves all of these issues...

- Jon

abachrac
04-17-2011, 11:26 AM
Jon, did you complete the power board that you were talking about?

I would be interested in purchasing one, but have not been able to find a link.

thanks!

msprague
04-17-2011, 03:04 PM
I haven't been able to find a link to Jon's board either, but I did run across this when looks interesting:
http://www.mini-box.com/Y-PWR-Hot-Swap-Load-Sharing-Controller

michael

billyzelsnack
04-17-2011, 08:52 PM
That looks very interesting.

tician
04-17-2011, 09:30 PM
Not sure if I'd buy one, but here is Jon's board (http://www.huvrobotics.com/shop/index.php?_a=viewProd&productId=7).

abachrac
04-18-2011, 09:56 AM
I haven't been able to find a link to Jon's board either, but I did run across this when looks interesting:
http://www.mini-box.com/Y-PWR-Hot-Swap-Load-Sharing-Controller

michael

thanks for the info! That looks very useful!!