Monday, 13 July 2015

Battery charging circuitry part 2 - Relay driver & protection

To get the relays to automagically energise on connection with the battery charger, a small switching circuit needed to be drafted up. 

Below is the switching schematic, jiggled around a bit for simulation.

There's probably no point getting too carried away explaining how the thing works in detail. However basically if no power is connected (V1), the FET is off, nothing can energise the relays, and the battery holds in the normal "serial" state. Once power is connected, there's a small delay/debounce, and the relays flick the battery pack into "parallel charging mode".

I soldered the thing up from bits and bobs lying around the lab. It's pretty bloody rough.

While this set-up tested fine on the bench-top supply, I ran into trouble with actual batteries. It turns out that the order in which the relays are connected (SW1 and SW2) is critical. If connected the wrong way around, the bottom battery pack shorts, the internal battery pack protection kicks in, and the SW1 relay doesn't have enough energy to break. 

The scribbling above is an attempt to explain what happens when SW2 turns off first. 
Protection is as crucial for safe circuit operation as is it is for safe sex with a stranger. Without it, all sorts of bad things can happen (usually fires) - especially when lithium battery packs are involved. There's a few types of protection schemes which are common in low-medium voltage electronics: Over-current, over-voltage, reverse polarity, and ESD.

Over-current protection on the battery pack is provided by fuses. These are really simple devices that simply burn out, and cut the circuit if the current through them exceeds their rating. On the battery pack there is a fuse on the charging input, and one of the motor output. 

The charge and motor side fuse ratings are rough guesses at the moment. The motor side fuse protection is in addition to the internal over-current protection provided by the individuals cells. It's like the electronic equivalent of "double bagging".

Over-voltage protection is also provided by the individual cells in the pack. Additionally I have also fitted 27V zener diodes on both halves of the pack. These things basically start conducting (and limiting the voltage) once the voltage across them goes over their rated threshold.

The zener diode can be seen hanging out on top of the taped bit of veroboard.

If the individual cells didn't have their own over-voltage protection, I'd use something more robust such as a crowbar circuit. The other (and probably more important) function these diodes serve is to suppress the voltage spikes which occur the the relays are released, and are otherwise known as flyback diodes. I mentioned this problem in the previous post, but in short:

Before flyback diode added
After flyback diode added
As can be seen there's no nasty spike on the top of the waveform.

While I'm still unsure of the final pack configuration, I rigged up some preliminary battery looms out of veroboard and terminal headers. This allows me to fiddle around the the pack configuration without getting out the soldering iron as much. Once that's nailed down I'll get rid of the veroboard and direct solder the packs up.

The finished (for now) prototype power pack
So that's it for now. My motor and controller have recently arrived, so I'll publish a post on part sourcing once everything is sorted. 

Till next time!