PDA

View Full Version : Dave's BMS Project



DaveAK
18 March 2011, 1250
Yeah, I know, another project started when none of the others have even been completed. But it keeps me off the streets. I like posting these threads beacuse you guys are great at knocking ideas around with.

Anyway, I've just ordered a couple of Linear Technology LTC6803-3 chips which will do a pretty full BMS implementation. My aim is to build a 24 cell BMS for around $5/cell which will have the following features:

Fully programmable voltage set points for HVC and LVC.
Cell balancing.
Temperature monitoring.
Individual cell voltage reporting.
SPI interface to microcontroller.
Lots of pretty flashing LEDs. Or maybe not.

I'm looking for something that's a step up from my MiniBMS, (which I have no real complaints with), but for half the price. Since I'm doing it myself I'll be able to integrate it with my bike MCU and charger. This particular chip covers everything needed in a BMS as far as I can tell.

The Linear chip itself has these features:

Measures Up to 12 Battery Cells in Series
Stackable Architecture
Supports Multiple Battery Chemistries and Supercapacitors
Serial Interface Daisy Chains to Adjacent Devices
0.25% Maximum Total Measurement Error
Engineered for ISO26262 Compliant Systems
13ms to Measure All Cells in a System
Passive Cell Balancing:
Integrated Cell Balancing MOSFETs
Ability to Drive External Balancing MOSFETs
Onboard Temperature Sensor and Thermistor Inputs
1MHz Serial Interface with Packet Error Checking
Safe with Random Connection of Cells
Built-In Self Tests
Delta-Sigma Converter With Built-In Noise Filter
Open-Wire Connection Fault Detection
12μA Standby Mode Supply Current

The applications listed on the datasheet:

Electric and Hybrid Electric Vehicles
High Power Portable Equipment
Backup Battery Systems
Electric Bicycles, Motorcycles, Scooters

Sounds like a winner to me, right? :)

Skeezmour
18 March 2011, 1310
Sounds great but since we build these things in fairly large volume just the board cost per cell can easily hit $1-2 per cell. The 50ma shunting is ok for little packs otherwise you wind up adding mosfets that can easily be $3 each. Still havn't loaded the board, tested it, paid for your time or covered your risk costs.

In the interest of keeping the streets safe with you off them I'm going to cheer you on :).

The LTC guys are nice to work with.

DaveAK
18 March 2011, 1324
Sounds great but since we build these things in fairly large volume just the board cost per cell can easily hit $1-2 per cell. The 50ma shunting is ok for little packs otherwise you wind up adding mosfets that can easily be $3 each. Still havn't loaded the board, tested it, paid for your time or covered your risk costs.

In the interest of keeping the streets safe with you off them I'm going to cheer you on :).

The LTC guys are nice to work with.
Oh, I'm looking at $5/cell just in parts. Not looking to sell at that price. It's strictly a DIY project, otherwise I'd be buying one from you. :)

I'm going to use external balancing. Not sure what exactly though. Probably keep it simple and use a MOSFET and resistor. I like the idea of doing charge shuttling, but I think this will add unnecessary cost and complication for very little gain. Got some other ideas rattling around in my head that I need to look at more closely as well.

jpanichella
18 March 2011, 1407
Aw bummer, I got all excited with the idea of a 5 dollar a cell BMS for all of us.

DaveAK
18 March 2011, 1446
Aw bummer, I got all excited with the idea of a 5 dollar a cell BMS for all of us.
Well, if it goes according to plan then you could build your own from any design that I come up with. :)

DaveAK
18 March 2011, 1544
First thought: During normal operation you wouldn't be expecting to balance more than a couple of cells by more than a small amount.

I'm thinking that I should design this for normal operation with minimal balancing capabilities, rather than putting in components that rarely get used. If, for example, you wanted to use this to balance the pack initially, when it might be far out of balance then a time penalty would be a fair trade off.

BaldBruce
18 March 2011, 1936
Just keep safety in the forefront of your design. First rule of a BMS is that it should do no harm! Fuse everything. Assume that a connection will fail and expose your system to unplanned voltages. Size your components to withstand the worst case you can concieve and then add some safety margin for those things you didn't think of. Keep reminding yourself that Li batteries are pretty safe, but they make a really nice fuel source if you do happen to light them....:O

Good luck and I'll be cheering for you!

DaveAK
18 March 2011, 1951
OK, so charge shuttling with one or more capacitors is my plan right now. Subject to change of course. :D

Question: If I have a cell at 3.6V and one at 3.4V that I want to balance I charge the capacitor up from cell A and then connect it to cell B which is at a lower voltage and it will discharge, but only down to 3.4V right? Then when I reconnect to cell A the capacitor is already at 3.4V so I only have to do a small charge and repeat the cycle.


The control electronics close the proper switches to charge capacitor C across cell B1. Once the capacitor is charged, the switches are opened. The switches are then closed to connect capacitor C across cell B2. The capacitor then delivers charge to B2 based on the differential of voltage between B1 and B2 (Eq.1).

Eq.1 Charge ? 1/2*CVB1^2 ? 1/2*CVB2^2

The capacitor is then connected in the same manner across B3, B4,…,Bn, B1,… The highest charged cells will charge C and the lowest charged cells will take charge from C. In this way, the charge of the most charged cells are distributed to the least charged cells. The only electronic controls needed for this method is a fixed switching sequence to open and close the proper switches.

A variation on the 'flying capacitor' method is intelligently select which cells to balance. In this way, the capacitor can be charged from the highest cell and selectively discharged to the lowest cell. This method can dramatically reduce the time to charge balance the cells, especially if the highest and lowest charged cells are on the opposite ends of the pack. Additional controls are necessary to detect and select the target cells.
What do you reckon those ? marks in the equation are supposed to be? This came from a PDF and I'm thinking the symbols used didn't print to the PDF properly. Anyway, I plan to use the variation to pick and choose the cells I balance.

BaldBruce
18 March 2011, 2007
equals
formula for the charge stored in the capacitor is Q=1/2*C*V^2
and is being moved accross different batteries. As the voltage is different on each battery, the capacitor will either take in charge or deliver it. The equation shows you that at the instant of connection, the charge is constant, C is a constant and therfore, the voltage will change.

DaveAK
18 March 2011, 2014
equals
formula for the charge stored in the capacitor is Q=1/2*C*V^2
and is being moved accross different batteries. As the voltage is different on each battery, the capacitor will either take in charge or deliver it. The equation shows you that at the instant of connection, the charge is constant, C is a constant and therfore, the voltage will change.
Thanks. :o

podolefsky
18 March 2011, 2220
Question: If I have a cell at 3.6V and one at 3.4V that I want to balance I charge the capacitor up from cell A and then connect it to cell B which is at a lower voltage and it will discharge, but only down to 3.4V right? Then when I reconnect to cell A the capacitor is already at 3.4V so I only have to do a small charge and repeat the cycle.

This will be so cool! I really want to see a charge shuttle balancer working.

I 2nd Bruce, safety is #1, especially when playing with capacitors. They are capable of charging and discharging very quickly. You might want to be careful and pre-charge the capacitor when you first hook it up. It will pull as much current as it can until it hits 3.6V...it could possibly exceed 100W, which could literally blow up the capacitor. If you put a 1k Ohm resistor in series to pre-charge, then you should be OK after that.

In answer to your question: yup, you got it. Only small thing I'd add is that it will end up a bit above 3.4V (since it just charged cell B), and then a bit below 3.6V for cell A.

DaveAK
19 March 2011, 1013
I've been working with these online tools:

Charging: http://hyperphysics.phy-astr.gsu.edu/hbase/electric/capchg.html#c1

Discharging: http://hyperphysics.phy-astr.gsu.edu/hbase/electric/capdis.html#c2

Using R=10ohm and C=1000uF just to get a feel for things. So I can calculate the amount of charge I'm shuttling, and the time charging/discharging the capacitor will take. But how do I determine the amount of charge in a cell so that I can subtract it from one and add it to the other? Can't seem to find that online yet. Has to be a function of voltage and capacity in Ah I would guess. Should be able to work it out from first principles, but I'd rather take the easy way out and have someone tell me. :D

Well, while I've been typing all that I think I'm half way to figuring it out. :) From the charging calculator I can see that Qmax is measure in uC. I know that 1C=1A*1s. I know that my cells are 60Ah=(60*3600)C. But how does that relate to one cell being at 3.6V and one at 3.4V and ending up with both at 3.5V? Even the assumption that they'll end up at 3.5V could be wrong since we're talking charge not voltage.

Back to the research. :D

DaveAK
19 March 2011, 1021
Also while I'm updating this thread here are my ideas on possible balancing algorithms:

1. No cell to be over x volts.
2. No cell to be under y volts.
3. Vmax - Vmin to be less than z volts.
4. Any suitable permutation of the three principles above.

With this in mind balancing a pack could be a seldom initiated event, and only act on a minimum of cells.

DaveAK
19 March 2011, 1029
Just keep safety in the forefront of your design. First rule of a BMS is that it should do no harm! Fuse everything. Assume that a connection will fail and expose your system to unplanned voltages. Size your components to withstand the worst case you can concieve and then add some safety margin for those things you didn't think of. Keep reminding yourself that Li batteries are pretty safe, but they make a really nice fuel source if you do happen to light them....:O

Good luck and I'll be cheering for you!
Sorry, I missed this yesterday. Anyway, the datasheet has a whole section on FMEA and mitigation. I haven't fully studied it, but you can be assured I will.

podolefsky
19 March 2011, 1120
I've been working with these online tools:

Charging: http://hyperphysics.phy-astr.gsu.edu/hbase/electric/capchg.html#c1

Discharging: http://hyperphysics.phy-astr.gsu.edu/hbase/electric/capdis.html#c2

Using R=10ohm and C=1000uF just to get a feel for things. So I can calculate the amount of charge I'm shuttling, and the time charging/discharging the capacitor will take. But how do I determine the amount of charge in a cell so that I can subtract it from one and add it to the other? Can't seem to find that online yet. Has to be a function of voltage and capacity in Ah I would guess. Should be able to work it out from first principles, but I'd rather take the easy way out and have someone tell me. :D

Well, while I've been typing all that I think I'm half way to figuring it out. :) From the charging calculator I can see that Qmax is measure in uC. I know that 1C=1A*1s. I know that my cells are 60Ah=(60*3600)C. But how does that relate to one cell being at 3.6V and one at 3.4V and ending up with both at 3.5V? Even the assumption that they'll end up at 3.5V could be wrong since we're talking charge not voltage.

Back to the research. :D

Dave,

I'm thinking about how to spell out what you need to know, without too many unnecessary details. Hyperphysics is a great resource, and generally accurate as far as I've seen.

While I'm working that out, have a go at this sim (http://phet.colorado.edu/en/simulation/capacitor-lab). It's one I designed about capacitors. It will (hopefully) give you a basic idea of what is physically going on inside a capacitor.

podolefsky
19 March 2011, 1145
Well, while I've been typing all that I think I'm half way to figuring it out. :) From the charging calculator I can see that Qmax is measure in uC. I know that 1C=1A*1s. I know that my cells are 60Ah=(60*3600)C. But how does that relate to one cell being at 3.6V and one at 3.4V and ending up with both at 3.5V? Even the assumption that they'll end up at 3.5V could be wrong since we're talking charge not voltage.

Here's how I would think about it. A battery has total energy V*Ah = kWh. So if they are both exactly 60Ah, then the 3.6V cell is holding 216 kWh, and the 3.4 is holding 204. So you need to transfer 6 kWh from the higher cell to the lower cell. Then both cells will be at 3.5V, just as you said.

But...this isn't quite right. The reason the cells are out of balance is probably because they aren't both exactly 60 Ah.

So really there will be a lot of guess work. The factor R*C is the time it will take for the capacitor to charge or discharge the bulk of it's capacity. I think a good method would be to let the cap charge for a time R*C, then move to a smaller cell and discharge for the same time. Just keep rotating around and eventually all the cells will be balanced. You're not going to balance two cells in one charge / discharge cycle because the amount of charge you have to move will be HUGE compared to how much the capacitor can hold.

Make sense? Kinda sorta?

DaveAK
19 March 2011, 1216
Make sense? Kinda sorta?
Absolutely. This is exactly as I understood it, and I was indeed going to cycle in the fashion you mentioned. What I was hoping for was some way to at least estimate the time it would take to balance cells that had a given voltage difference. So the capacitor takes a fraction of the charge from A and dumps it into B, and repeats. I know the charge in the capacitor, and the time it takes to charge/discharge, but what fraction of the charge in the cells is in the capacitor? Does that make better sense of what I was trying to ask?

I happen to have a 10R resistor and a 1000uF capacitor in my box of goodies. I also have a couple of spare cells and some sundry items that I can use to actually test it out tomorrow if all goes well with my project for today which is microcontrollering my DIY charger. I wish I could get a job doing this ****. It's just too much fun. :D

podolefsky
19 March 2011, 1314
formula for the charge stored in the capacitor is Q=1/2*C*V^2

I just noticed, I don't think that's right: it's U = 1/2 C V^2, where U is the energy stored in the capacitor (in Joules). The stored charge is Q = CV.

lugnut
19 March 2011, 1421
Here's how I would think about it. A battery has total energy V*Ah = kWh. So if they are both exactly 60Ah, then the 3.6V cell is holding 216 kWh,

You're off by 1000 :-)

podolefsky
19 March 2011, 1423
Absolutely. This is exactly as I understood it, and I was indeed going to cycle in the fashion you mentioned. What I was hoping for was some way to at least estimate the time it would take to balance cells that had a given voltage difference. So the capacitor takes a fraction of the charge from A and dumps it into B, and repeats. I know the charge in the capacitor, and the time it takes to charge/discharge, but what fraction of the charge in the cells is in the capacitor? Does that make better sense of what I was trying to ask?

I happen to have a 10R resistor and a 1000uF capacitor in my box of goodies. I also have a couple of spare cells and some sundry items that I can use to actually test it out tomorrow if all goes well with my project for today which is microcontrollering my DIY charger. I wish I could get a job doing this ****. It's just too much fun. :D

Yup, now I see what you are asking (I think). I've been wracking my brain about this, and it turns out to be a non-trivial problem... :(

The cells may be rated at 60 Ah, but that's not actually how much charge is in each cell (which is related to why they are unbalanced). You can get a rough estimate of how much charge is in the capacitor compared to each battery, but that's not really the number you want. What you want is the charge in the capacitor compared to the *difference* in charge between the batteries. That is hard to estimate because you don't know whether the imbalance is due to different battery capacities, different internal resistance, or something else.

The other problem is that the voltage on a lithium battery isn't a linear function of total charge, so I'm not sure how to calculate the charge that needs to be moved based on voltage difference.


So here's a possible solution. Warning: lots of math below. I'm just including this so someone else can check my reasoning and tell me where I screwed up.

I would think about this in terms of energy. The energy stored in a battery is:

U_batt = V*Ah*3600 = energy in Joules (3600 is to convert hours to sec).

So assuming both batteries are the same Ah (say 60) the energy difference is:

delta_U = Ah*3600*(V_a - V_b)

where a and b are the higher and lower voltage cells. You need to move 1/2 of this difference from cell a to cell b so that they are equal:

U_diff = 1/2 * Ah * 3600 * (V_a - V_b)

Now, the energy stored in a capacitor is:

U_cap = 1/2 * C * V^2

If you charge the cap on cell a and discharge on cell b, then the energy you moved is:

U_moved = 1/2 * C * (V_a^2 - V_b^2)

If the capacitor is completely charged on cell a, and completely discharged on cell b, then the total number of cycles you need is:

#cycles = U_diff / U_moved

The charge on the capacitor depends on the time it is connected, but we can pretty much assume that after 3 RC time constants, it is 95% charged. Let's just use that. So...

Total_time = #cycles * 3 * RC = U_diff / U_moved * 3 * RC

= 3*RC * Ah * 3600 * (V_a - V_b) / (C * (V_a^2 - V_b^2)

= 3 * R * Ah * 3600 / (V_a + V_b)

That should be your equation...you might wonder, what happened to C? Yeah, it cancelled out, but this equation still makes sense I think. Remember that I = V/R, so it is basically saying that the time is roughly what it would take if you connected the batteries directly to each other through a resistor until they equaled out. The thing I'm hung up on is why it is V_a + V_b on the bottom, rather than V_a - V_b...this is where I need someone else to check over this (since it's Saturday and you all have nothing else to do, right?)

podolefsky
19 March 2011, 1427
You're off by 1000 :-)

Doh! Can't argue with lugnut on that one...

DaveAK
19 March 2011, 1502
Thanks Noah. Glad you're up to the challenge on this, but ...... :D

I'm following you up to U_moved. Then I think something goes awry because as you transfer the energy V_a and V_b converge. Also, will the capacitor completely discharge when connected to cell b?

Anyway, you might be correct as for all I know about this stuff, but your solution gives me 260 hours to balance two 60Ah cells at 3.6V and 3.4V using a 10R resistor. This resistor was picked at random and gives a max charge current of 0.36A. If I want to keep the current under 3.0A which is the rating of the FETs I chose then I could use a 1R5 resistor for a time of just 38 hrs. :) This makes sense to me as I can see that the resistor would set the charging current. That fixes R, and if you change C then you'll get a quicker time to charge a smaller capacitor, or longer time for a larger one, but all that does is change the cycle time proportionally to the charge being transfered.

So either this isn't a practical approach, or we need to fine tune the equations.

podolefsky
19 March 2011, 1546
Thanks Noah. Glad you're up to the challenge on this, but ...... :D

I'm following you up to U_moved. Then I think something goes awry because as you transfer the energy V_a and V_b converge. Also, will the capacitor completely discharge when connected to cell b?

Anyway, you might be correct as for all I know about this stuff, but your solution gives me 260 hours to balance two 60Ah cells at 3.6V and 3.4V using a 10R resistor. This resistor was picked at random and gives a max charge current of 0.36A. If I want to keep the current under 3.0A which is the rating of the FETs I chose then I could use a 1R5 resistor for a time of just 38 hrs. :) This makes sense to me as I can see that the resistor would set the charging current. That fixes R, and if you change C then you'll get a quicker time to charge a smaller capacitor, or longer time for a larger one, but all that does is change the cycle time proportionally to the charge being transfered.

So either this isn't a practical approach, or we need to fine tune the equations.

Yeah, I thought of that after I posted - the battery voltages will converge. That makes it a non-linear problem...meaning calculus. Yuck.

...back to the pencil and paper for a while. It might actually be easiest to do this computationally...but if there is an analytic solution, it would be cool to figure it out.

podolefsky
19 March 2011, 1604
OK, here's the problem that I see, and why this can't be done from first principles.

If you knew that one battery had stored 62 Ah, and the other had stored 58 Ah, then you could figure out how long it would take to transfer 2 Ah of charge so that they both sat at 60 Ah. But, we don't know Ah, we know voltage...so the question is: what is the relationship between voltage and charge stored (in Ah) for a lithium battery?

You could just say that at full charge (say 3.65V) it has 60 Ah, and at full discharge (say 2.8V) it has 0 Ah. (I know that there is still charge in there, which is why it's at 2.8V, but we're talking about the amount of charge added from 2.8 to 3.65 V). Then it would be simple...but the relationship between voltage and Ah isn't linear like this.

So I don't think this brute force method will work. We need some clever way of modeling the system that doesn't depend on us knowing how much charge we need to move ahead of time.

Hmmm......

DaveAK
19 March 2011, 1614
This is why I dropped out of school three times. :D Seriously though, if I hadn't dropped out then maybe I could figure this out myself. I actually enjoyed calculus, at a high school level at least. But that was many years ago.

Thanks for your help on this. Just remember that the end goal is an awesomely cool charge shuttling BMS. :D

podolefsky
19 March 2011, 1645
OK, last ditch effort. What if we think about it like this: imagine that instead of using a capacitor to shuttle the charge, we just connect the two batteries with a resistor in between so that the higher V battery charges the lower V battery. We can figure out the max current:

I_max = (V_a - V_b) / R = delta_V / R

If delta_V = 0.2V and R = 1000 Ohm, then I_max = 0.2 mA. Now how long would it take to charge a battery from 3.4V to 3.5V using 0.2 mA? I don't know, let's just take a guess.

To take a 60 Ah battery from 2.8V to 3.65V at 0.2 mA would take 60 Ah / 0.0002 A = 300000 h. Luckily, we only need to do 0.1V, which could be 60 / (3.65 - 2.8) * 0.1 = 7 Ah. So good, it will only take 35000 h. :D

If you use a 1 Ohm resistor instead, it will cut the time down to 35 h. But that's a lower bound I think, since the current will go down as the voltages converge.

Hopefully this order-of-magnitude estimate is way off...at this point, I'd say do some test runs with 2 batteries and an RC circuit and see what happens.

DaveAK
19 March 2011, 1846
I think you're right and I'm going to have to set up a test bed for this. Just thinking out loud on this though, I think the balancing capability is going to be restricted by the current, just like charging is. This means suitably sized components. Now I know Ed charges his cells individually with 2A chargers, and I would assume that he's putting in more than 0.1V in less than 35 hours.

Nuts & Volts
19 March 2011, 1929
I think you're right and I'm going to have to set up a test bed for this. Just thinking out loud on this though, I think the balancing capability is going to be restricted by the current, just like charging is. This means suitably sized components. Now I know Ed charges his cells individually with 2A chargers, and I would assume that he's putting in more than 0.1V in less than 35 hours.

I think you want to make it work so that when you charge that cap from battery A you only go to about 90% full on the cap. Then when you discharge the cap into battery B you only charge battery B to 90% from the capacitor. This way you optimize balancing time. The last 10-20% of equalizing the capacitor with both batteries will have very low currents due to the lower difference in voltage. This means a longer time to charge. So just determine how long you want to allow your cap to charge and discharge, and then calculate the number of cycles needed to balance the cells.

Now I think it is trivial to actually calculate the exact balancing time, but fun to think about. Its tricky in multiple ways. As the cap is charged from battery A, you can use your RC time constant to figure out time to charge the cap, but you have to keep in mind that battery A voltage will drop at some rate which is not easily quantified. I think Noah was pointing this out earlier. This same trend will exist when you charge battery B from the cap, but the battery voltage increases. In both causes it seems like the behavior of the battery will actually decrease the amount of time because the cap will equalize with the battery voltage quicker. The simple RC equations used earlier only work with constant voltage sources

This all make sense? I guess all i really did was summarize everything already stated, but whatever :)

DaveAK
19 March 2011, 2007
I'll do the tests at 2 & 3RC which equate to about 86% and 95% respectively to see what difference there might be. RC will be 1 millisecond. Here's the test setup:

924

Tell me if it's going to blow up. :D I'm not familiar with MOSFETs yet, so I don't know if I've got them right.

Process will go something like this:

Assume voltage of G1 > voltage of G2.

Record G1_V and G2_V

Start with Q1 and Q2 open.

Close Q1, charge C1, open Q1.

Close Q2, discharge C1, open Q2.

Measure and compare G1_V and G2_V.

If G1_V - G2_V > 0.05V then repeat.

Calculate rate of energy transfer.

Celebrate if less than 35 hours. :)

podolefsky
19 March 2011, 2025
This all make sense? I guess all i really did was summarize everything already stated, but whatever :)

Yeah, but you said it in only 2 short paragraphs. Nicely done. ;)

podolefsky
19 March 2011, 2049
I'll do the tests at 2 & 3RC which equate to about 86% and 95% respectively to see what difference there might be. RC will be 1 millisecond. Here's the test setup:

924

Tell me if it's going to blow up. :D I'm not familiar with MOSFETs yet, so I don't know if I've got them right.

To my knowledge it looks good. I agree with N&V, the last 10-20% of charging will just waste time. Between 2-3*RC is a good place to start. I think the power dissipated in R1 should be OK. Just wear safety glasses...

Couple of questions (for my own knowledge):

- How will you measure the cell voltages? Is this part of the circuit, or just manually for now?

- Looks like you have zeners across the MOSFETs. What do these do?

DaveAK
19 March 2011, 2106
To my knowledge it looks good. I agree with N&V, the last 10-20% of charging will just waste time. Between 2-3*RC is a good place to start. I think the power dissipated in R1 should be OK. Just wear safety glasses...
Hmmm. Didn't consider that. Not sure of the wattage of these resistors. What should they be? VI=13W and that's a big resistor!


Couple of questions (for my own knowledge):

- How will you measure the cell voltages? Is this part of the circuit, or just manually for now?
I forgot to show analog inputs to the Arduino that will measure the voltages of each cell. That way it will be fully automatic. I'll have a display of progress so I know when to give up.


- Looks like you have zeners across the MOSFETs. What do these do?
They came with the symbol I used. :D I've no idea what they're supposed to do. I won't be adding them. Looking at the datasheet they might be internal.

podolefsky
19 March 2011, 2141
Hmmm. Didn't consider that. Not sure of the wattage of these resistors. What should they be? VI=13W and that's a big resistor!

Power should be less than delta_V^2 / R. If the cap is charged to G1_V, then connected to G2, then delta_V will be at most G1_V - G2_V. Since G1 and G2 will always be within 1V, power should be <0.1W (I think R1 = 10 Ohm?) Should be fine.

DaveAK
19 March 2011, 2149
Power should be less than delta_V^2 / R. If the cap is charged to G1_V, then connected to G2, then delta_V will be at most G1_V - G2_V. Since G1 and G2 will always be within 1V, power should be <0.1W (I think R1 = 10 Ohm?) Should be fine.
Cool. I'm charging the cells up right now and tomorrow I'll give this a go and see what happens. What could possibly go wrong? :D

podolefsky
19 March 2011, 2157
What could possibly go wrong? :D

Famous last words. Good luck!

Back to Jedi...time to get that deflector shield down for the 500th time.

Nuts & Volts
19 March 2011, 2206
Yeah, but you said it in only 2 short paragraphs. Nicely done. ;)

I more just wanted to get the thoughts written done to see if my reasoning was good.

Dave looks like good logic. I think the circuit is good. Im curious, what are R3 and R4 for, pull down resistors?

BaldBruce
19 March 2011, 2207
Dave, I think you are kinda missing the point of the original capacitor shuttle system. It's original concept was not to take all the energy from the highest battery and deliver it to the lowest individual and then proceed to the next highest pair. Not saying that this is not a valid methodology, just that the original idea was to balance all the cells to the exact same voltgae by "quickly" moving the capacitor in parralel from each cell in the string to every succesive cell. As the capacitor is moved accross these sucsesive cells, it will eventually even out all the voltages by taking in or giving up its' stored energy. (Noah - I guess I should be more careful with the word charge. I understand the physics diffference, but to most people they are using the terms interchangeably to mean work.) By using an inductor in series with the capacitor, you can limit the rate of change of the current into or out of the capacitor without the large losses of a resistor, By moving on to the next cell quickly, you limit the peak current that is reached. Clearer or did I muddy the water some more??

The "zener" you are refering to is the body diode and acts like a regular diode. This parasitic diode thet is presnrt in every FET. Always draw it in to remember to analyze your circuit when that pesky diode will conduct from drain to source. Some MOSFETs also have a zener on the gate to protect them from overvoltage, but most do not.

podolefsky
19 March 2011, 2224
Dave, I think you are kinda missing the point of the original capacitor shuttle system. It's original concept was not to take all the energy from the highest battery and deliver it to the lowest individual and then proceed to the next highest pair. Not saying that this is not a valid methodology, just that the original idea was to balance all the cells to the exact same voltgae by "quickly" moving the capacitor in parralel from each cell in the string to every succesive cell. As the capacitor is moved accross these sucsesive cells, it will eventually even out all the voltages by taking in or giving up its' stored energy. (Noah - I guess I should be more careful with the word charge. I understand the physics diffference, but to most people they are using the terms interchangeably to mean work.) By using an inductor in series with the capacitor, you can limit the rate of change of the current into or out of the capacitor without the large losses of a resistor, By moving on to the next cell quickly, you limit the peak current that is reached. Clearer or did I muddy the water some more??

The "zener" you are refering to is the body diode and acts like a regular diode. This parasitic diode thet is presnrt in every FET. Always draw it in to remember to analyze your circuit when that pesky diode will conduct from drain to source. Some MOSFETs also have a zener on the gate to protect them from overvoltage, but most do not.

Charge, energy...it's all just moving stuff around.

I might have posted this before, but just for reference this paper (http://focus.ti.com/download/trng/docs/seminar/Topic%202%20-%20Battery%20Cell%20Balancing%20-%20What%20to%20Balance%20and%20How.pdf) discusses various balancing methods (including charge shuttle).

DaveAK
20 March 2011, 0947
Bruce, charge shuttling is transferring charge from one cell to another, there's nothing that says they have to be adjacent cells is there? The paper that Noah linked to references a paper that I was basing this on. It goes through several balancing scenarios, and just after the one that you describe there's this paragraph:


A variation on the 'flying capacitor' method is intelligently select which cells to balance. In this way, the capacitor can be charged from the highest cell and selectively discharged to the lowest cell. This method can dramatically reduce the time to charge balance the cells, especially if the highest and lowest charged cells are on the opposite ends of the pack. Additional controls are necessary to detect and select the target cells.

My assumption is that in a moderately healthy pack then only one or two cells are going to be out of balance. It's these cells that I want to concentrate my efforts on. In a traditional shunting BMS every cell has a shunt resistor that might never get used. In the charge shuttling scenario you describe, which is a traditional method and has its advantages, the charge gets moved through all cells from high to low, instead of just directly from the highest to the lowest.

One feature of this chip is the ability to individually switch the balance circuit, whatever it may be. The datasheet actually shows a shunt resistor for each cell, but I'm going to use it to selectively switch the high and low cells. Everything I need is available in the chip itself, (ADC etc.), so there's no additional requirements.

At least, that's the plan .... :)

Oh, and as for the MOSFETs, did I get them the right way round?

BaldBruce
20 March 2011, 2134
Read that paper quite awhile ago Noah. It is mostly out of date now. A good primer though.

Dave. Your MOSFET circuit has some issues I think. Lets say the battery on the left has more voltage than the battery on the right to start with. In order to turn on and keep it on a MOSFET needs a gate voltage several volts higher than it's source connection. Look up the Vgs spec of the data sheet for your particular FET and add that to the battery voltage to find out if your control circuit has a high enough voltage to even turn it on. When Q1 does turn on it will charge up the capcitor in ~ 3 *R*C time or until it reaches the point where the parasitic diode of Q2 will automatically start conducting and dump energy into the battery on the right. This is why is is improtant that the batterries are less than 1 volt apart to start with or the sneaky diode will conduct whether you command Q2 on or not. Same logic apples to turning Q2 on. You need the gate voltage to be high enough above the source pin to get it to turn on. This is one reason alot of people put the MOSFETs on the ground reference side, so that they take a smaller and easier to provide voltage to turn on.

I'll also warn you right now, you need two switches for every cell to make this work for more than a two cell system and the isolation switches are the reason this is challenging to implement.
My 2 cents.

DaveAK
20 March 2011, 2224
Thanks for the input Bruce, it's much appreciated. Firstly though, what's life without a challenge? :D I really know very little about MOSFETs, so that's the first challenge!

So my biggest question is, can I get this simple test circuit to work? All I'm aiming for is some rough data as to how long it might take to balance two cells.

1. The cell voltages will be less than 1V in difference.
2. I can change the MOSFETs to the GND side, but I only have two available to test with.
3. Datasheet says Absolute Max Vgs is 10V, but in the specifications section it says Vgs(th) Min 1V, Max 2V.
4. My control signal is 5V. If my batteries are less than 4V, (which they will be as they're LiFePO4), this satisfies the min, but not the max. With the MOSFETs on the GND reference this puts it above the max, but below the absolute rating, right? I could reduce the control signal with a voltgae divider though I suppose.

So can I get this to work with the few components I have?

DaveAK
21 March 2011, 0839
Also want to mention that the paper I'm basing this on says you need n+5 switches, which makes sense to me. The datasheet for the LTC6803 shows P-channel MOSFETs for switching the balance resistors. Haven't figured out a schematic for this yet, but I'll be basing it off this information.

DaveAK
21 March 2011, 1259
I think I'm going to move the balancing circuit to a separate board. This way I can get the voltage measuring side completed and running alongside my MiniBMS. I then have the option of either developing a shunting or a shuttling circuit, or both and determining which works best.

The LTC6803 provides input for two temperature inputs, but can be multiplexed up to eight using the two available GPIO pins. I think I'll be needing these GPIO pins for my charge shuttling, although that might require three pins. In that case I'd take them from the MCU. So how many temperature inputs per 12 cells do you think is useful? Would thermistors or diodes be better? Is location of hot spot important or not? What's the consensus of opinion? :)

DaveAK
21 March 2011, 2012
OK, to get this test circuit to work I'm going to need a couple more FETs. I'll stop by the Shack tomorrow night and see what they've got, otherwise this will have to go on the back burner until my next Mouser or SparkFun order. Of course, I just put in a Mouser order yesterday. :rolleyes:

DaveAK
21 March 2011, 2254
I've been on this all evening and just can't figure out how to make it work on a breadboard. Seems to me a couple of P-channel FETs together with the N-channel ones might help, but I've no idea how to get Vgs < 0V. Anything I try to tie into GND just ends up tying both cells together in parallel. Time to call it quits before my head explodes. :)

DaveAK
22 March 2011, 1132
Quick question. If I use a cell to charge a capacitor current flows in the direction of the +ve cell termianl to the +ve capacitor terminal until they're at equal potential, right? If I replace the cell with one that has a lower potential than the now charged capacitor does the current flow in the opposite direction, i.e now from cap +ve to cell +ve?

May seem like a dumb question, but I'm pretty dumb when it comes to this stuff and I'd like to be less dumb. :D

Nuts & Volts
22 March 2011, 1138
Wire them in parallel. They will equalize similiar to how a parallel string on cells does. Now I think you need a resistor in series to control the amount of current allowed to flow between the two.

So yes i believe + to + and - to -. I think the resistor goes between the +'s??

DaveAK
22 March 2011, 1207
Wire them in parallel. They will equalize similiar to how a parallel string on cells does. Now I think you need a resistor in series to control the amount of current allowed to flow between the two.

So yes i believe + to + and - to -. I think the resistor goes between the +'s??
I'm not actually trying to balance two cells in this fashion, I'm just trying to figure out the theory. I know I can parallel cells and have them balance, but I'm working on the charge shuttling idea and just need confirmation of the direction of current flow from high cell to capacitor, and then from capacitor to low cell.

Actually I'm sure it does what I expect, just like the current is reversed in charging the pack vs. discharging it through the controller. Thinking of a two capacitor design and was hoping to use diodes to control current flow, but I don't think it's going to work as I envision it. Will need to draw something up later, but I'm pretty sure it's back to MOSFETs.

podolefsky
22 March 2011, 1225
Wire them in parallel. They will equalize similiar to how a parallel string on cells does. Now I think you need a resistor in series to control the amount of current allowed to flow between the two.

So yes i believe + to + and - to -. I think the resistor goes between the +'s??

That's right. Current will flow from the higher potential to the lower, whether the higher happens to be the battery or the cap at any one time. So which ever end of the cap was connected to G1+ should be then connected to G2+...and so on.

A resistor might be necessary to keep the charge / discharge rate below the cap power rating, but it will also waste a little energy (I^2*R through the resistor).The resistor can go anywhere in the circuit, between the two + ends or - ends.

BaldBruce
22 March 2011, 1427
926

Here is a quick two FET system I think you were trying to make.
Turn on Q1 to charge capacitor through the current limiting resistor. Turn off Q1. Turn on Q2 to dump charge into the second battery.

Just make sure you don't turn on both FETs at the same time as you have no current limit in that discharge path! You will let the smoke out of something if you do that.....
Which gets me to fuses. Put two in. One on each cell to protect from really making a mess:O

Bruce

DaveAK
22 March 2011, 1450
Thanks Bruce! Looks to be exactly what I need.

Couple of quick questions.

R1, R2 and C1 are internal to the battery? These are for modelling purposes I presume?

V2 and V5 - what are these? Is this my control input for the MOSFET gates? Not familiar with that symbol, but it looks like it could be representing a waveform.

Q1 and Q2 are N-channel, right? So 0V off, 5V on. My current logic never has both pins high, but I'll put in something more robust just to be safe, and a couple of fuses in the circuit itself of course. :)

I think one of my iterations looked a lot like this, but I went around in circles so many times I had to give up!

BaldBruce
22 March 2011, 1611
Yes, the rectangle on each side are for simulating the batteries. Only used for simulation.

V2 and V5 are function generators to simulate the 5 volt switching input from your BMS.

You are completely correct on Q1 and Q2.....

One schematic you shared earlier had the exact premise, just neede to move the FETs to where you could easily drive them.....

DaveAK
22 March 2011, 1628
Cool! I'll grab a couple of fuses on the way home from work tonight and then we'll be in business. I have two cells ready to go with a 0.3V difference. My program is written and ready to record results.

Better see if I can find my fire extinguisher first. :D

Nuts & Volts
22 March 2011, 1749
Better see if I can find my fire extinguisher first. :D

Sign of a good time!! :) hehe

DaveAK
22 March 2011, 2202
Well totally inconclusive first run. Most of the time was spent tweaking the setup, so I have no reliable figures yet. The ADC on the Arduino was completely useless, probably because of noise in the circuit that I wasn't doing anything to remove. I'll fix that tomorrow. I also hooked up my silly scope to see what that told me, which was very little.

The numbers I did get was that it took 20 minutes to drop the high cell by 70mV, which increased the low cell by just 5mV. In one of the papers I read it did say there would be a loss of efficiency due to switching loses and other stuff, but hopefully I can improve on this!!!! If not then it will be back to shunt balancing - maybe.

DaveAK
23 March 2011, 1234
Is there a way to calculate how long it should take to discharge a cell through a known resistance? I'm also going to experiment with a shunt resistor from one of my spare MiniBMS cell modules.

Nuts & Volts
23 March 2011, 1240
V=I*R V=3.2 & R=10, so I=0.32A

Time = Capacity/I Capacity=10Ah & I=0.32A, so time=31.25 hrs

Your V and R may change so I may change. This will vary your time, but this is a good estimator. :)

podolefsky
23 March 2011, 1242
Is there a way to calculate how long it should take to discharge a cell through a known resistance? I'm also going to experiment with a shunt resistor from one of my spare MiniBMS cell modules.

If it's lithium then you can get a good estimate by assuming the voltage is constant over most of the discharge, say 3.2V down to 80% DOD. Then you have:

I = V/R

and

time = Ah / I = Ah*R / V

As long as your resistor is >10 Ohm or so, you can ignore the battery internal resistance.

podolefsky
23 March 2011, 1243
V=I*R V=3.2 & R=10, so I=0.32A

Time = Capacity/I Capacity=10Ah & I=0.32A, so time=31.25 hrs

Your V and R may change so I may change. This will vary your time, but this is a good estimator. :)

Oh! Beat me by 1 min!

DaveAK
23 March 2011, 1245
Sometimes I just need to think a little more before I ask questions. :o I figured half of this out, but never even thought of the cell in terms of Ah. Thanks for slapping me 'round the head. :D

Nuts & Volts
23 March 2011, 1252
Oh! Beat me by 1 min!

hehehe :) and no problem dave, a good palm to the forehead is always needed every once and awhile

magicsmoke
23 March 2011, 1522
Dave, I haven't really thought this through, but have a think about standing the charged capacitor on top of the cell that charged it.
i.e. Charge from HI cell, stand on top of HI cell and discharge into LO cell. This will give you a much higher potential and should allow you to discharge a full cap's amount of charge. You mustn't let this free run or it'll overcharge, but monitoring via your a2d and switching off should catch it.

Rob

DaveAK
23 March 2011, 1537
What do you mean by "stand on top of"? Leave it connected to high cell when discharging in to low cell? Isn't this just equivalent to having the cells in parallel?

Or do you mean put it in series with high cell and have double the voltage available to charge low cell? Interesting idea. Would the capacitor discharge fully before the low cell blew up though? :D I'm a big fan of new ideas, but this one might be beyond my grasp. :)

magicsmoke
23 March 2011, 1545
Yeah, put it in series. The double voltage shouldn't be a problem, a) 'cause it's for a brief moment while the cap discharges and b) 'cause the 'chemical' voltage of the cell being charged can only increase by receiving charge. Each individual transfer of charge from the cap is nowhere near enough to raise it appreciably.

DaveAK
23 March 2011, 1552
OK, I'll have to give some thought to the switching scenarios but it sounds like an interesting idea. If you get the full capacitor charge dumped every time this has to be a huge improvement.

DaveAK
23 March 2011, 2002
So here are the initial numbers:

Start | Stop | Difference

3.666 | 3.602 | -0.064 | Arduino
3.583 | 3.583 | +0.000

3.33 | 3.32 | -0.01 | Scope
3.24 | 3.27 | +0.03

3.498 | 3.426 | -0.072 | DVM
3.329 | 3.333 | +0.004

Time taken: 24.7 mins.

So while the three different measurement sets give varying confidence levels from none to not very much the results were consistent with yesterday. Going by the DVM readings I'm taking 70mv from the high cell and putting 5mv in to the low cell in 25 mins.

DaveAK
23 March 2011, 2303
Above post was run at 3RC, this following one was run at 2RC. It's not a fair comparison though because before the first run the cells had been allowed to rest after charging. This next run was fresh off the charger.

Start | Stop | Difference

3.565 | 3.396 | -0.169 | DVM
3.306 | 3.320 | +0.014

Time taken: 2hrs!!! Tomorrow I'll let the cells rest before running this one again. :) Doesn't really look like this is very efficient though. After my next run I'm going to try a resistor based discharge with a 4R7 5W resistor.

DaveAK
24 March 2011, 1207
More results:

Start | Stop | Difference

3.490 | 3.431 | -0.059 | DVM
3.320 | 3.324 | +0.004

Time taken: 1hr

Same set up as last run, (2RC), but without surface charge.

majorpayne
18 April 2011, 0806
Wow just read this thread, really interesting.

Wondering if you've done anymore work on this, or did you go back to the shunt idea?

DaveAK
18 April 2011, 1422
Wow just read this thread, really interesting.

Wondering if you've done anymore work on this, or did you go back to the shunt idea?
I had to switch priorities, but I'm halfway to getting the circuit I want designed. When I get chance to get back to it I'm going to have a go at etching my own boards. I'm then going to make up a shunt version and a shuttling version and compare them side by side. These very rough tests I've done don't seem to show any great benefit to using capacitors, but I really want to give Rob's idea a shot of switching the capacitor to series during discharge.

sparky_mark
18 April 2011, 1523
To save yourself the hassle involved in etching, have you ever thought about using a CNC machine to engrave your PCBs? I only ask because I've just bought myself a second-hand Roland desktop engraving/CNC machine.

I'm in the process of cleaning it and getting it set up in my garage, but once I've done that I'll be looking at using it to create circuit boards and maybe machining parts out of acrylic. Once I've got the software workflow sorted out I'm hoping to offer a PCB machining/drilling service out to fellow hobbyists.

First off I'll need to get an idea of what everybody is using to create their designs, then I'll look to see what software I'll need. Roland do have some free engraving and machining software on their website which I've recently downloaded, and I'll start experimenting as soon as my machine is set up. I'll also take a look at the free version of Eagle to see if I can integrate it with the Roland software.

Do let me know if you would like to make use of my machine at some point. I can't give an exact time scale as to when it will be set up and working due to work commitments, and I'll need to work out the software workflow and experiment with creating a few simple circuits.

DaveAK
18 April 2011, 1956
I actually built a small CNC with the idea of milling PCBs. Never got it fully set up though. Right now my garage is a mess and I don't have anywhere to set it up and try again. It did come in handy to mill my motor mount though. I don't think the etching will be too much of a hassle. At least I hope not.