A PIC based Battery Management System

fechter said:
They make optocouplers that last as long as a typical LED. Practically forever.

To do a switched capacitor sampling, you'd need two optoFETs for each cell, a bus with a sampling capacitor across it, and a pair of switches to the ADC input. You would need to be darn sure that there was some dead time between switches (break before make).

I like the simplicity.

A hardware method to insure `break before make' would be good form. Some things shouldn't be trusted to MCU.

Where do I find an optoFET?

Richard
 
fechter said:
[...]
Hmm... ATtiny13's are like less than $1.00 ea. Optocouplers might cost about the same.
Actually, I think single cell MPU's could 'communicate' one way, not really needing a bus.

You still need some way to control the shunts on each cell too.

Consider how much can be achieved with NO communication. Autonomous cells.

Richard
 
rf said:
fechter said:
[...]
Hmm... ATtiny13's are like less than $1.00 ea. Optocouplers might cost about the same.
Actually, I think single cell MPU's could 'communicate' one way, not really needing a bus.

You still need some way to control the shunts on each cell too.

Consider how much can be achieved with NO communication. Autonomous cells.

Richard

I'm thinking the same thing. Big cell counts become a problem one way or another - need mux, high voltages, high-pin count MCU...

How about this:
- One MCU for 4S pack (14.4V LiIon or 13.2V LiFePo). Those are dropin replacements for SLA 12V bricks!
- External components are just resistors + balancing FETs, power cutoff FET
- For communication all you must have is LED that you observe visually. Red led - problem. Take the 12V pack out and then use non isolated serial bus to talk to it to downlod all info.

Such bricks could be chained in serial or parallel to give any config you like 24V, 36V, 48V...
 
One thing that was not discussed here is the current limiting (as opposed to over-current cutoff).

That would be very very nice feature, for example when running different battery types in parallel.

- Simplest option - fuse. I'll be using one just in case. Once blown, need to open the hood :)
- Current sense resistor + ADC + IRFB4110 to cutoff the pack. Again this is cutoff, not limiting
- Linear regulator circuit (something along the lines of LM317). Extra current is dumped as heat. That would let the magic smoke out for sure.

- Chopper regulator. If we Know the inductance of the load PWM through IRFB4110 and that's it. But in general case we don't know...

- Buck converter. Needs big inductor... I'm searching for cirquit examples for this but they're mostly to vague and I'd rather not re-invent the bicycle here :)

Any other ideas? Can this be done with "flying capacitor"?

Having regulator is nice also because you can have regulated/programmable voltage/current out! I could set my battery to be 36V 20A on slow days and 48V 40A some other days :) Maybe this is going too far..

Another thing that buck converter can do is to charge the pack. If you have it in the pack itself you can use any unregulated power supply to charge..

Bellow is excerpt from AVR451 (reference battery charger design from Atmel) for 40V 5A buck converter:
http://www.atmel.com/dyn/resources/prod_documents/doc8088.pdf

View attachment buck_regulator.png
 
rf said:
Where do I find an optoFET?

Richard

Here's an example:
http://pewa.panasonic.com/pcsd/product/pmos/pdf_cat/aqy21_eh.pdf
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=255-1435-5-ND

They are called solid state relays in DigiKey.

Single cell processors can't be completely autonomous unless each cell has a series FET to do the LVC and charge current limiting. I really don't like the idea of needing that many FETs in series with the load. But they could send "simple" signals that could be interfaced to analog circuits.
 
Parts there:

FQD11P06 is 60V 9.4A P-FET. $1 (single) $0.5 (quantity)
SLF12575 is 220 uH inductor, $3.5 (single) $1 (quantity)
STPS1045 is Shottky diode, 10A, 45V, 0.84V forward $0.86 (single) 0.3 (quantity)
Capacitors 8x 10uF, $0.24 (single) $0.12 (quantity)

Why use 4 capacitors instead of 1? 100uF capacitor is same size (2mm longer) and same price?
 
fechter said:
Single cell processors can't be completely autonomous unless each cell has a series FET to do the LVC and charge current limiting. I really don't like the idea of needing that many FETs in series with the load. But they could send "simple" signals that could be interfaced to analog circuits.

Could you please describe the LVC for an autonomous cell in more detail?

Richard
 
For each cell to work autonomously, it would need a way to disconnect the power when the voltage got too low. This is usually done by putting a FET in series that opens when you hit the limit. If you stack 16 cells, for example, you'd need 16 FETs in series (one on each cell). That's a lot of resistance loss, not to mention expense, heat generation, and possibility of future failure. KISS.

It generally makes more sense, reduces losses and cost if there is only one FET switch for the entire string (or no FET at all). If the LVC interfaces with the controller throttle or brake input, it can cut the power using the controller.

When the voltage gets too high, the shunt must be activated. A cell unit can do this by itself, but if the shunt becomes unable to hold the voltage down, the charging current needs to be reduced. Again, you could have a series FET for each unit that starts to throttle back the charge current, but you'd need one for each cell. These could get pretty hot too.
The signal to reduce charging current really needs to get sent to the charger or a circuit that drops the current on the whole string.

You could possibly justify a cutoff for every 4 or 6 cells and break the pack into "bite sized chunks" so a single MPU can handle the voltage measurement without MUX and you could possibly drive the shunts without optocouplers. Then you could stack as many of these chunks as necessary to build the pack. It would be worthwhile to "do the math" on the FET losses. Not really different than putting a bunch of factory DeWalt packs in series.

Why don't we reverse engineer one of those? I think somebody already did that. I hear they sort of suck, but maybe that could be fixed with better software.

A chain is no stronger than its weakest link. I just don't like the idea of having anything other than copper between the batteries and my controller when I'm running high power. :twisted:
 
Here's what I've seen for reverse engineered bms.
http://web.mit.edu/ruddman/Public/Robot/DeWalt/1C2T7291.JPG
http://web.mit.edu/ruddman/Public/Robot/DeWalt/DeWalt%20Board.GIF

It's only partial...
 
I'm sure you've all been waiting to see some violence and destruction unleashed upon cells, so here it comes! :twisted:

4 fully charged Nimh cells individually monitored:
View attachment cells.png

Current and temperature of the load (I thought load is more interesting as cells barely got warm):


Observations:
- Note how cell 3 dies after 10 minutes, and is reversed! That should short it out internally. I've stopped the test after cell 2 also got reversed. Note how cell2 recovers when current is cut, but cell 3 does not.
- Not all Nimh cells are created equal! Sanyo cells were quite happy and delivered rated 2Ah while at 1C. Those cells (Power2000, marketed as 2.7Ah!) drop bellow 1V at 1C when fully charged.
- Cell matching is crucial if individual cell voltages are not monitored. This reversal thing probably happened many times when i was using them.
 
tomv said:
Current and temperature of the load (I thought load is more interesting as cells barely got warm)
Temps were collected at the case of each cell?
:?:

edit: ok I see you measured load temp... it would be interesting to know estimated internal temps of the cells, based on the case temps.
 
Cell #3 certainly doesn't look happy. I suspect many a Nimh pack has been prematurely destroyed by cell reversals. A good BMS seems like it would help any chemistry.
 
fechter said:
For each cell to work autonomously, it would need a way to disconnect the power when the voltage got too low. This is usually done by putting a FET in series that opens when you hit the limit. If you stack 16 cells, for example, you'd need 16 FETs in series (one on each cell). That's a lot of resistance loss, not to mention expense, heat generation, and possibility of future failure. KISS.

I agree that connecting anything other that thick wire between cells is a bad thing. What if you hung a bypass alongside a faultering cell? A zero-ohm wire in parallel to take the load and make the cell 'disappear' from the circuit. (With diode to keep from shorting out that cell.)

Is there no way to make that work?

I think I read that the Killacycle A123-powered drag bike did something like that. But perhaps they were being overly generous with funds.


fechter said:
[...]
When the voltage gets too high, the shunt must be activated. A cell unit can do this by itself, but if the shunt becomes unable to hold the voltage down, the charging current needs to be reduced. Again, you could have a series FET for each unit that starts to throttle back the charge current, but you'd need one for each cell. These could get pretty hot too.
The signal to reduce charging current really needs to get sent to the charger or a circuit that drops the current on the whole string.

Was thinking maybe the charger itself could be made slightly smarter instead, to recognize when it needed to throttle back or shut off.

fechter said:
You could possibly justify a cutoff for every 4 or 6 cells and break the pack into "bite sized chunks" so a single MPU can handle the voltage measurement without MUX and you could possibly drive the shunts without optocouplers. Then you could stack as many of these chunks as necessary to build the pack. It would be worthwhile to "do the math" on the FET losses. Not really different than putting a bunch of factory DeWalt packs in series.

Hopefully a whole lot different than DeWalt BMSes. Those are garbage. Not being able to recover from simple imbalances or handle any appreciable load makes them worthless -- even for the tools they're meant for. Charge a pack, then discharge a single cell and the DeWalt BMS will never be able to balance the pack again until you manually recharge that cell. Junk.

A somewhat general purpose BMS that can only handle one tenth the power of the cells it manages is pretty sad.

fechter said:
A chain is no stronger than its weakest link. I just don't like the idea of having anything other than copper between the batteries and my controller when I'm running high power. :twisted:

I agree. A123 cells are particularly poorly served by interconnects other than thick copper. Especially when four tiny cells can start a car without breaking a sweat. Manage that!

Richard
 
rf said:
I agree that connecting anything other that thick wire between cells is a bad thing. What if you hung a bypass alongside a faultering cell? A zero-ohm wire in parallel to take the load and make the cell 'disappear' from the circuit. (With diode to keep from shorting out that cell.)

Is there no way to make that work?

Hmm... I don't think so. You could switch a wire across a cell when it gets down to zero volts to prevent it from being reversed. That might be helpful in some cases, but we don't want the voltage to get that low ever. I can't think of any way to 'bypass' a cell without puting a switch in series with it.

Geez.... we just need smarter battery chemistry that takes care of itself.
 
fechter said:
rf said:
I agree that connecting anything other that thick wire between cells is a bad thing. What if you hung a bypass alongside a faultering cell? A zero-ohm wire in parallel to take the load and make the cell 'disappear' from the circuit. (With diode to keep from shorting out that cell.)

Is there no way to make that work?

Hmm... I don't think so. You could switch a wire across a cell when it gets down to zero volts to prevent it from being reversed. That might be helpful in some cases, but we don't want the voltage to get that low ever. I can't think of any way to 'bypass' a cell without puting a switch in series with it.

Rats. Was thinking since we're using a shunt to reduce charge voltage, perhaps we could do the same thing to reduce discharge from the cell. We wouldn't need to bypass the cell entirely. If we started early, and dialed in the shunt as cell voltage began to approach it's cutoff voltage, perhaps we could milk more power from all the cells. (Hmm. Probably not appropriate in an autonomous-cell implementation.)

I need to find out how the Killacycle folks do it.

fechter said:
Geez.... we just need smarter battery chemistry that takes care of itself.

That's right! Anyone have plans for a small naquita generator?

Richard
 
If Cost Did Not Matter

If you didn't care how much things cost and wanted to get perfect cell performance you can always do the "Distributed Pulse Width Modulation" technique where every cell is controlled by two very strong FET's so that the cell is either online or offline. You then control the FET's with the PIC.

:arrow: Hey, I just had a thought...

This automatically solves voltage measurement! 8)

When the cell is offline you measure across it... no "Common Mode Voltage" to worry about.

How's that for cool... no "Common Mode Voltage" worries! :p

Cells that are not connected in series are easy to manage.


And if you save all the money on the other now unnecessary components the FET's don't seem so expensive anymore.

The PIC does all the logic of control and could even possibly control current limiting just by using math... and don't forget that now you don't need to buy a controller... that's at least $50 right there...


I know it's pretty scary to have to part with the controller because we all take that as a given, but by getting rid of it we also save the 5% losses that it introduces. (which are actually not "lost" but "moved" to the cells)
 

Attachments

  • DPWM Diagram.gif
    DPWM Diagram.gif
    2.8 KB · Views: 3,220
safe said:
The PIC does all the logic of control and could even possibly control current limiting just by using math... and don't forget that now you don't need to buy a controller... that's at least $50 right there...

It could get pretty complicated if you want to run a brushless motor. I hate complicated.

Money does matter. It's really the whole point of this thread.

Another possible topology (and this is way off track) would be to use switched capacitor charge pumps or something that resembles a high current version of Power Cheq to keep all the cells at the same voltage regardless of their condition. Then you only need one LVC and a CC-CV charger for the whole pack. This would compensate for weak cells and maximize the energy you could get out of a pack.
 
fechter said:
It could get pretty complicated if you want to run a brushless motor. I hate complicated.
Software can be nearly infinitely complex... that's why it's great stuff. The trick is knowing how to model things so that you can test your theories as you go. You use the old "divide and conquer" approach to everything. There are software projects that go into the millions of lines of code... this is really, really trivial compared to the projects I've been involved with before.

If an architecture could be arrived at then an online "Open Source" software development project could take place. After about a year of fooling around with it we would likely (collectively) have all the software figured out.

:shock: Do not fear complexity... that is the realm of software. (software people love math problems)


And I think if you subtract the price of the controller it would pay for the FET's because that's more or less all a controller is anyway... a bunch of FET's...

The Big Concept

The big concept is that if you divide all the cells into individual units with the FET's you FINALLY solve the problem of measuring the cell voltage directly. It's soooooooo simple that you don't need voltage dividers or anything, you just measure directly as long as the FET's are closed.

:arrow: This is the first truly "new" solution to a problem we have been banging our heads against for the whole thread...


business_cartoon_5084.gif
 
fechter said:
safe said:
The PIC does all the logic of control and could even possibly control current limiting just by using math... and don't forget that now you don't need to buy a controller... that's at least $50 right there...

It could get pretty complicated if you want to run a brushless motor. I hate complicated.

Money does matter. It's really the whole point of this thread.

Another possible topology (and this is way off track) would be to use switched capacitor charge pumps or something that resembles a high current version of Power Cheq to keep all the cells at the same voltage regardless of their condition. Then you only need one LVC and a CC-CV charger for the whole pack. This would compensate for weak cells and maximize the energy you could get out of a pack.

Actually, I think you might be on the right track here, if it can be done without using too much real estate. Even if you do sort out how to effectively use one, or more, microprocessors to measure cell voltages, you still have to sort out the heat issues associated with using balancing shunts, whether you use power transistors, FETs and/or power resistors. In true "Catch 22" fashion, you can limit the current the shunts bypass, which cuts down the heat, but that increases the time the shunts need to be on in order to balance the cells, which means more heat. The "bucket-brigade" idea of using capacitors to shuttle current back and forth between neighboring cells, would seem to solve the heat problem, but I don't know how big these caps would have to be to make this work in a high-power pack. In any case, I certainly think pursuing this approach is completely relevant to this thread, as you would need a PIC, or equivalent, I think, to control the process.

-- Gary
 
GGoodrum said:
In true "Catch 22" fashion, you can limit the current the shunts bypass, which cuts down the heat, but that increases the time the shunts need to be on in order to balance the cells, which means more heat.
The answer is to not balance at all. You wouldn't need to... because the whole idea of balancing was a "hack" in the first place that was trying to work around the fact that the cells don't finish or charge at exactly the same rate. With each cell in either an "online" or "offline" state it doesn't need shunting at all. Well... I suppose what I call "offline" is in effect sort of like shunting but not exactly. The idea is to use FET's to redirect the series current around cells that are no longer eligible to participate. So during charging the full cell gets avoided and during discharge the empty one is avoided. When all the cells are empty then you are done.... no need for a high level controller based cutoff.

I had thought of this idea before using conventional components, but the PIC seems like a great way to do it. Why not? If you are going to completely flip things upside down why not use the PIC in the process.

Capacitors could work too...
 
Here's what the "big boys" apparently use:
http://www.mpoweruk.com/bms.htm
Interesting stuff in there. The objectives of the BMS are well stated.

I was remembering this circuit from over a year ago:
http://endless-sphere.com/forums/viewtopic.php?f=14&t=229&hilit=+open+source+battery
View attachment 1
This will shuttle charge from one cell to the next one, but only made for pairs of cells.
You could cascade them for multiple cells the same way a PowerCheq is used.

What if you expanded the topology to many cells?
When one cell gets too high, the FET starts switching at high frequency (50% duty cycle or so) and dumps energy into the inductors. When the switch opens, the stored charge has to go somewhere.

The cell on the end can dump charge to the others for sure, but I'm not sure what happens to the ones in the middle?
Inductive charge pump multi.jpg
 
Here's some info about the KillaCycle. Fastest electric drag bike. Uses A123 cells.

http://www.ciciora.com/EV/KillacycleSurfaceMountBMS.pdf

Says they use LM1990 differential amps for monitoring individual cells. The pack is close to 400 volts total. Haven't been able to find the LM1990. Sounds similar to the INA117 that `safe' found a while back.

Richard
 
MAXIM's :idea: of a Smart Battery

http://www.maxim-ic.com/appnotes.cfm/an_pk/680

E28Fig01.gif
 
Smart Battery Forums

sbs_logox.gif


http://sbs-forum.org

Smart Battery Data Specification, version 1.1
http://sbs-forum.org/specs/sbdat110.pdf

smbus.gif


http://www.smbus.org

System Management Bus (SMBus) Specification, version 2.
http://www.smbus.org/specs/smbus20.pdf

:arrow: My comment:

Most of these specs were completed in and around 1995-2000.

Also, it's a "Pay-Per-View" forum, so you can read their specs, but not see the forum that (once) developed it. If nothing else the spec is a good document to start with and if it's not too hard to be compatible then it would be wise to develop any software to be backwardly compatible with it.


I might propose that we initiate a looooong, slooooow, thread elsewhere that starts at the beginning of the Smart Battery Data Specification and goes through each element of it after having our own (free) discussion. We don't need to be part of their Pay-Per-View forum if we have their spec to look at. If we spent a year going over all the ideas we would all be masters of it eventually. Given the way things are going that might translate into a high paying job for some of us if we want it. 8)
 
The switched inductor arrangement above may or may not work as shown. If two cell units are cascaded, then it would certainly work, but it takes twice as many FETs. In this arrangement, you can choose which direction to pump the charge. This would be the same arrangement used by the PowerCheq in a long string.

Inductive Charge Pump 3.jpg
 
Back
Top