Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: corrado33 on April 21, 2010, 09:07:59 AM

Title: How to wire batteries so they don't have to be removed to charge
Post by: corrado33 on April 21, 2010, 09:07:59 AM
So I was wondering something today.  This may be a really easy to answer or not so.  My question is, if you have batteries in an enclosed robot, and put a plug or something on the outside to plug in a charger, do the rest of the things connected to the battery affect the charging?  For example, in an enclosed robot, I think it'd be a lot easier to simply include a plug on the outside of the body rather than to take the batteries out every time you want to charge them.  Would you need any specific wiring to achieve this?  I guess you could just use two switches to cut off the power and ground, so the batteries aren't connected to anything else.  Of course your bot would probably have a switch to cut off the + side, but I don't know if anything connected to the ground would affect charging.  If anyone understands what I'm trying to say, please let me know if my thinking is correct or not...
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: z.s.tar.gz on April 21, 2010, 11:09:36 AM
The simplest way is to have a toggle switch connected between the battery positive and whatever circuit you're using.

Just turn the switch off and it's like you aren't connected to the electronics anymore which is pretty much the same as taking the batteries out.

Just remember to turn it back on when you're done =P

edit: you can have a switch that disconnects ground too but it really doesn't matter. (Ground is ground after all)
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: waltr on April 21, 2010, 11:24:47 AM
Yep, a SPDT (Single Pole Double Throw) switch is the easiest method.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: madsci1016 on April 21, 2010, 11:59:47 AM
My SAGAR robot has an external battery plug that is just connected to the battery bus by a 3 Amp fuse. The fuse is there just in case something shorts the external plug. I can work on SAGAR as it charges, no need to turn it off.

I'm sure there some 'better safe then sorry' wisdom to disconnecting the robot electronics while it charged, but I have never had any issues. And the fuse would protect against fire workscreated by an external short, and my batteries are internally protected for 6A max per pack; then they open circuit to protect themselves.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: osama on April 21, 2010, 11:19:45 PM
waltr, your idea appeals to me. I want to make an addition, it would be good if you used a double-pole relay to disconnect the battery from electronics automatically as soon as you plug it into the mains  ;).
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: cyberfish on April 22, 2010, 02:51:07 AM
Batteries typically raise quite a bit in voltage as they are being charged, which may or may not matter depending on your circuit.

Also, most NiMH chargers do constant current (instead of constant voltage, because the charging curve for NiMH is very flat). I'm not sure about implications of this. PROBABLY fine if your circuit draws negligible current.

Leaving the ground connected is perfectly fine.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: Admin on April 22, 2010, 03:08:11 AM
If you don't turn your robot off while recharging, don't connect any other mains-powered electronics to your robot (like a USB cable, an oscilloscope, etc).

The reason is because all these devices then become connected (ground loop), but they *might* not use the same voltage for ground (ground does NOT need to be 0v). In effect, you'll create a short and something will fry.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: z.s.tar.gz on April 22, 2010, 05:25:52 AM
Huh. Didn't think of that.

As for your whole "automatic off" switch, remember that the simplest answer is often the correct one.
If you still want to do it anyways, I recommend looking into some power transistors.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: Admin on April 22, 2010, 05:42:27 AM
The Related Topics just suggested this:
http://www.societyofrobots.com/robotforum/index.php?topic=9993.0 (http://www.societyofrobots.com/robotforum/index.php?topic=9993.0)


Oh and I forgot to mention in my last post that you can measure the grounds with a multimeter to see if there is a voltage difference. If ground to ground voltage is zero, then it'll be fine.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: nottoooily on April 22, 2010, 05:47:24 AM
Or how about one of those sockets like walkmans use for headphones. It disconnects the other thing (robot) when the plug is inserted.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: waltr on April 22, 2010, 08:05:40 AM
Or how about one of those sockets like walkmans use for headphones. It disconnects the other thing (robot) when the plug is inserted.
Be careful with these as they can short the tip to ring during insertion. They really are not recommended as a power connection.

There are coax type power connectors with the same feature. Check:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=CP-202B-ND (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=CP-202B-ND)
as an example.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: Soeren on April 22, 2010, 08:50:26 AM
Hi,

[...
]The reason is because all these devices then become connected (ground loop), but they *might* not use the same voltage for ground (ground does NOT need to be 0v). In effect, you'll create a short and something will fry.
A ground loop will only have effect on sensitive measuring amplifiers and such - and only while the loop exists.

Ground is allways 0V, unless you have very different set of legal regulations in the US, as the Ground (Earth) is connected to Neutral (the 0V reference) at the power station.

Sure there can be a difference, but then either Earth or Neutral is defective and needs a fix (it's usually the Earth resistance that is getting too high. I don't recall the exact max. resistance value of the Earth (and it might differ between US and Europe), but it's quite low and there are regulated test procedures.


A sad side effect for those missing Ground/Earth in their outlet:
Metal cabinet PCs running from a non-earthed outlet will be at 115V potential, due to the two small caps in the PSU going from Earth to Phase and Neutral respectively, thereby creating a voltage divider with half of the 230VAC on the box - lots of people have killed their sound card and/or HiFi trying to connect those two "Earths" (115VAC is a slight tad too much into a mic- or line amp ;D)
If no Earth exists in your outlets, it's a very wise thing to cut the two offending caps.

Even if you have loads of separate circuits where the Phase and Neutral are going through circuit breakers and H(P)FI relays, the Earth is allways connected (or you get in trouble with the Man).
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: madsci1016 on April 22, 2010, 08:54:52 AM
Ahh, ground loops. The most often cited (and least ever confirmed) reason for electronics failures. Young electronics engineers (and I'm one of them, and it's happen to me already) will usually get laughed at from the veterans the first time we mention the problem could be a ground loop. (On a side note, also be prepared to get laughed at the first time you blame multi-path to an RF engineer.) It's the 'easy answer' to unexplained failure.

Admin is right, it can happen and it's better to be safe then sorry, especially if you are one of those measure twice kind of people.

IMHO, modern switching power supplies and electronics are less likely to have a ground loop with each other. I have been tying AC powered DC equipment together for a decade and never had an issue, but it is a possibility. I'm ok with frying something every once in a while, so to stop and check every time is a waste of time for me.

Think about it, just as bad as charging your robot while it's connected to your computer , so is powering your robot from a DC bench supply and have your computer connected to it. So, the only safe answer is to ALWAYS run off battery when it's connected to your computer. This isn't acceptable for me.

If you wanted to be able to work on your robot while it charged but still be safe, maybe fuse both VCC and GND wires from your charger? Admin seems to be a less reckless engineer as I, so he would be a better source for safety advice.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: madsci1016 on April 22, 2010, 09:02:45 AM
the Earth is allways connected (or you get in trouble with the Man).

Lol, I ended up wiring half of my parents house addition when I was in high school. The part I wired passed inspection, the part the electrician wired didn't. I ended up fixing his work.

I knew ground loop was a big problem is sound systems (4 years of being technical director, over 1000 hours behind a sound board), I didn't think it was a huge problem other other systems. (Maybe that's why they laughed at me at work )

Soeren, correct me if i'm wrong, but the scenario I can think of is an old/cheap DC power supply, with no ground wire, plugged into an outlet with a poor (floating or high resistance) neutral, could end up causing trouble if it finds a better path through the DC side.

Quote
Ground is allways 0V, unless you have very different set of legal regulations in the US, as the Ground (Earth) is connected to Neutral (the 0V reference) at the power station.

Actually, In the US each house has it's own ground spike for GND, and each power pole outside our house has a ground spike for Neutral (and neutral is run between the poles as well), as well as a ground spike for neutral return at the nearest transformer station. The power between the power station and the transformer stations is 3-phase, no neutral return.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: Soeren on April 22, 2010, 09:25:01 AM
Hi,

[...] a plug or something on the outside to plug in a charger,
Better put a charger on-board, so it can monitor the battery properly and connect up with AC after the transformer (No need for large electrolytic caps if only used for charging, just fit the small caps that's needed to stop oscillation.


I guess you could just use two switches to cut off the power and ground,
I'll chime in with the rest and assure you that it plenty to break the positive line... But...

I'll say stick to the thought of two switches anyway and the reason is two fold:
(Pretty cheap insurance against sleepy bloopers while 'bot'in' around).
For the connector, very few outperforms the 3 pole XLR connector used for professional audio. They're locking connectors, so won't work themselves loose and fall out.
For smaller 'bots, with a modest current demand, RCA connectors is the cheapest, mini.XLR semi expensive and for Lemo connectors, you almost need to take out a mortgage.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: Cristi_Neagu on April 22, 2010, 09:37:52 AM
Sure there can be a difference, but then either Earth or Neutral is defective and needs a fix (it's usually the Earth resistance that is getting too high. I don't recall the exact max. resistance value of the Earth (and it might differ between US and Europe), but it's quite low and there are regulated test procedures.

I honestly can't say if you are being sarcastic or not ???

Metal cabinet PCs running from a non-earthed outlet will be at 115V potential

The wiring in my apartment building isn't grounded, so if i touch my computer case, it gets "sticky" because of the high voltage. I have a tv tuner, and i ground my computer case through the tv cable. When handling the cable, i have to make sure not to touch the case... I did that once... Won't happen again ;D
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: Soeren on April 22, 2010, 09:39:39 AM
Hi,

IMHO, modern switching power supplies and electronics are less likely to have a ground loop with each other. I have been tying AC powered DC equipment together for a decade and never had an issue, but it is a possibility. I'm ok with frying something every once in a while, so to stop and check every time is a waste of time for me.
What if the user is your grandma who happens to lean on her radiator while fiddling with your design?   :(
Never mind if a bit of hardware dies, that can be cured, but unless you have a defibrillator ready, granny will be a little harder to de-zombiefy

Ground loops is only a real problem with sensitive amps and the like, the rest should be dealt with if it's keeping to the EMC directive (which should remove the chance of ground loops as well, if adhered to).
And if at all available, use the Ground in the outlet.


Think about it, just as bad as charging your robot while it's connected to your computer , so is powering your robot from a DC bench supply and have your computer connected to it. So, the only safe answer is to ALWAYS run off battery when it's connected to your computer. This isn't acceptable for me.

If you wanted to be able to work on your robot while it charged but still be safe, maybe fuse both VCC and GND wires from your charger? Admin seems to be a less reckless engineer as I, so he would be a better source for safety advice.
Don't fuse the ground plane,
If it's imperative to work on the powered robot while charging, the charger circuit just have to be protected against putting out too much voltage (or too much current for that matter). A soft start (and end) won't go amiss either.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: madsci1016 on April 22, 2010, 09:52:12 AM
What if the user is your grandma who happens to lean on her radiator while fiddling with your design?   :(
Never mind if a bit of hardware dies, that can be cured, but unless you have a defibrillator ready, granny will be a little harder to de-zombiefy

Lol, no radiators in Florida, and we have already built the zombie fences. I'm guessing you mean there's a chance to create a path to ground and shock someone, but I don't understand how having the charger and laptop connected to my robot creates more of a chance of this happening then just the charger or laptop alone. Care to enlighten me?

Quote
If it's imperative to work on the powered robot while charging, the charger circuit just have to be protected against putting out too much voltage (or too much current for that matter). A soft start (and end) won't go amiss either.

My charger is a smart Li-Ion charger protected against over/under voltage and over current. And my batteries themselves are protected for over current and over/under voltage, and my electronics are fused and are all switching regulated with high/low voltage shutoff. I would be surprised if I ever have a disaster involving my power system.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: Soeren on April 22, 2010, 10:04:32 AM
Hi,

Soeren, correct me if i'm wrong, but the scenario I can think of is an old/cheap DC power supply, with no ground wire, plugged into an outlet with a poor (floating or high resistance) neutral, could end up causing trouble if it finds a better path through the DC side.
I can't think of any serious chance of damage either, if all is wired up correctly and the mains to the charger transformer is made robust and secure.
That said, I hope there's nobody reading this that aspires to a Darwin Award, 'cause if you really try hard, anything will break.


[...] at the nearest transformer station.
That's likely the one I was thinking of, we call it a "cross field" (directly translated), but I am not sure of the correct term for it so I cheated ;D  - they're the last stop before the consumer.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: Admin on April 22, 2010, 10:21:21 AM
Quote
Ground is allways 0V, unless you have very different set of legal regulations in the US, as the Ground (Earth) is connected to Neutral (the 0V reference) at the power station.
If your circuit has only one ground source, mathematically you consider it 0V.

However voltage is a potential difference between two points. A single point, such as ground alone, can't have a voltage.  If you have two different grounds that aren't shorted, they can potentially have a voltage difference between them. The ground on a battery will never be Earth ground unless they are shorted together.

The output ground of the battery charger isn't guaranteed to have a 0V difference with Earth ground. If its 1V higher, and you short it with Earth ground, you have a bad ground loop. A robot isn't physically connected to the Earth (at least not the mobile type), so the Earth ground and the robot ground can technically be thousands of volts different.

I had a ground loop short once . . . confused the heck out of me . . . I can't remember exactly what I was doing as it was a few years ago, but my memory seems to suggest a USB cable, a power supply, an mcu, and an oscope were involved.

As for fuses, they won't save a sensitive circuit from frying before the fuse blows. I only use them if the consequences of a short/accident is dangerous (for example, if I used large Lipo batteries near a swimming pool).
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: madsci1016 on April 22, 2010, 10:34:11 AM
The output ground of the battery charger isn't guaranteed to have a 0V difference with Earth ground. If its 1V higher, and you short it with Earth ground, you have a bad ground loop.

M gut tells me if you have the DC side of a power supply, the GND and VCC are both 'floating' with respect to the earth ground. Once you tie earth ground to DC GND, both rails are no longer floating, DC GND is earth gnd, and VCC is +5V (or whatever the output voltage is) higher then earth ground. 

What exactly would 'hold' the DC GND (and VCC - vout) higher than the earth ground and conduct current?

In your example where you had a short, I can imagine a +/- DC supply that tied DC ground and earth ground together, and if you tied the shield (0V reference) of the o-scope to the -VCC rail to measure reference voltage from there, you would create a short between -VCC and GND through the o-scope.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: corrado33 on April 22, 2010, 04:52:18 PM
Ummm.... I'm just gunna switch off both the power and GND whenever I'm charging the batteries... Then I avoid having to comprehend all of what you guys just said...  And, better to be safe than sorry. 

And I don't really want to put a charger on board for two reasons... space, and I already have a really nice battery charger that I'd like to use. 

What about simple power connectors?  (You know, the ones that are in the back of almost every router/switch/external hard drive.  The ones that have a positive center and negative outside.) 
(http://www.seeedstudio.com/depot/images/product/terminalfemale1.jpg)
What do you guys have against those?  I know they don't lock in, but I've never seen one fall out accidentally. 
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: cyberfish on April 22, 2010, 04:53:16 PM
There is absolutely nothing wrong with leaving the ground connected. Just put a switch on the + line.
Title: Re: How to wire batteries so they don't have to be removed to charge
Post by: Soeren on April 23, 2010, 08:29:29 PM
Hi,

Ummm.... I'm just gunna switch off both the power and GND whenever I'm charging the batteries...
Well, at least it won't hurt anything, but 2 switches will add substantially to the safety, whether you use single or double pole switches.


And I don't really want to put a charger on board for two reasons... space, and I already have a really nice battery charger that I'd like to use. 
OK then, but keep wires as short as possible, while maintaining a safe wiring.
If your charger is of the type that needs to touch the battery (for temperature sensing) it will be a problem though.


What about simple power connectors?  (You know, the ones that are in the back of almost every router/switch/external hard drive.  The ones that have a positive center and negative outside.) 
[Snip pic]
What do you guys have against those?  I know they don't lock in, but I've never seen one fall out accidentally. 
Locking is just one thing, robustness is even more important and the ability to mount it very stable.
If you're contemplating something the size of the $50 'bot, I can see why you shy away from a full size XLR, but when you get beyond 20 lbs, they're not particularly dominating and the sockets (which should allways be male at the "receiving end" is very easy to mount in a rock stable manner,. due to their mounting holes.
You would need the 2 middle types in this photo:
(http://www.knowledgerush.com/wiki_image/6/60/XLR3.jpg)
The female connector goes on the charger lead and the male socket goes on the 'bot, to avoid accidentally shorting the charger.
With XLR connectors, the ground pin is a bit longer, to make sure it makes connection first, that way, no voltages will ever be floating (doesn't matter much for a charger, but sometimes crucial in audio engineering.

Common DC connectors, besides the fact that I hate them since they are void of any kind of standards, so they come in numerous combinations of outer and inner diameter, so you never have just the one you need and to make it even worse, some even swap polarity to have positive voltage on the outside, is hard to find sockets for that is easy to mount well and good. Best option if you wanna follow that route, is to get sockets for wiring mount (for making extension leads), of the type that has the shell screwed on, then find a nut that can be used instead and mount it through some part of whatever you wrap around your finished 'bot.

As to not falling out... Just you live a little longer, then you will experience DC connectors sliding out, whether it's your router that suddenly loses power, or one of your peripherals going dead. But for short term like charging, it may not be that much of a problem.

When considering stuff like this, an important parameter is the possible damage that can arise worst case and here it's you having to wait for maybe an hour or two to play around with your 'bot - no life is at stake, so yes, it's easy being a perfectionist when other people are gonna do the work and pay the bills, but I'm sure you will survive using a DC connector - but oh, the feeling of quality cannot be described or put a price on, it just lifts your mood for a long time after you plugged in a Real ConnectorTM  ;D