I have an assignment to implement a battery balancing simulator. I am assuming a two-step linear discharge curve for the battery. For this assignment i will only consider the discharge cycle. I want to use a simple algorithm that balances based on voltage difference between the batteries, such that if the difference is more than a specified threshold the battery with lower voltage is switched off. But when i calculate the current sourced from each battery the battery with the maximum voltage supplies all the current and other batteries receive current even when the difference is below threshold. It makes sense that this would happen but then how does a battery pack work if there is a minor difference in the voltages in the batteries and the cell with highest voltage supplies all the current? Any suggestions on how can i improve the algorihtm is also welcome. Thanks.

But when i calculate the current sourced from each battery the battery with the maximum voltage supplies all the current and other batteries receive current even when the difference is below threshold.

Click to expand...

You have nothing in your circuit to define a threshold.
Welcome to AAC!

If randomly selected, you will need a comparator to determine if the voltage difference exceeds the threshold or not. If you were happy with a fixed threshold of about 0.6V to 0.7V you could use NPN or PNP transistors to switch the battery on/off. However, with a voltage difference as great as that the batteries would not be balanced properly. Ideally there should be only a few mV difference in their voltages.

Are you trying to compare the voltages of the batteries pair-wize? If so, you have three pairs.

If A>C and B>C, then obviously you should be taking the load from B????

Because internal resistance of the battery carrying the load causes the output voltage to drop the instant a load is connected, then that screws up the comparison, so you will be building an oscillator...

Are you trying to compare the voltages of the batteries pair-wize? If so, you have three pairs.

If A>C and B>C, then obviously you should be taking the load from B????

Because internal resistance of the battery carrying the load causes the output voltage to drop the instant a load is connected, then that screws up the comparison, so you will be building an oscillator...

Click to expand...

I have to write a program that switches the batteries on and off to keep them balanced. For that i'm using a battery balancing algorithm which switches off a battery if its voltage drops below a specified theshold when compared to other batteries. Ideally as Alec mentioned above the difference should be in mV. In this scenario the battery with the highest voltages ends up sourcing all the current for load and charging other batteries. Is this also the case with real battery packs? Because i thought batteries were connected in parallel to share the current load which doesn't seem to be happening.

Those three resistors in series with the three switches, are they representing Ri of the respective batteries?

If they are NOT, you can sample the Voltage drop across them representing the current supplied by each battery. The battery would be "isolated" from the load, making the determination of which battery is truly lower than the other two.

Those three resistors in series with the three switches, are they representing Ri of the respective batteries?

If they are NOT, you can sample the Voltage drop across them representing the current supplied by each battery. The battery would be "isolated" from the load, making the determination of which battery is truly lower than the other two.

I have to write a program that switches the batteries on and off to keep them balanced. For that i'm using a battery balancing algorithm which switches off a battery if its voltage drops below a specified theshold when compared to other batteries. Ideally as Alec mentioned above the difference should be in mV. In this scenario the battery with the highest voltages ends up sourcing all the current for load and charging other batteries. Is this also the case with real battery packs? Because i thought batteries were connected in parallel to share the current load which doesn't seem to be happening.

Click to expand...

Batteries are connected in lots of different configurations for lots of different reasons. I had a dual battery system in my truck, in part so that I could run comms all night long out in the field with the truck engine off and not have to worry about draining both batteries so that I couldn't start the truck in the morning. But I also needed to power some basic things, such as the clock and the control circuits for the battery isolators, continuously regardless of which battery was at the higher state of charge and without letting one battery drain the other, so I simply put a diode in series with each battery to that circuit. Yes, I lost some power across the diode, but that was acceptable and it worked perfectly.

It seems like one thing you might be looking to do is have more than one battery engaged at a time so as to get the higher total current draw possible from the paralleled configuration. If so, then what you probably need is a way of monitoring the current direction in each battery (assuming you don't want to use a diode -- but you can get very low voltage drop "diodes") and shutting off batteries that are back feeding.