Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Battery charger

Status
Not open for further replies.
Thank you very much!
Q1 mosfet is used for charging... I will measure battery voltage, and with PWM turn on Q1 depending on battery voltage. For example if battery voltage is 11V, Q1 will be on 80% duty cylcle (12V) and charging current will be around 1A

I forgot about that Vgs voltage, and i tested on breadbord only for the first cell.
So, now it is ok? I switch every 2N7002 N-CH mosfet with 15V through NPN transistors. So Vgs voltages are 15V for Q4, cca 11V for Q5 and cca 7V for Q3. That should work now? :)
 

Attachments

  • upload_2015-5-24_22-28-45.png
    upload_2015-5-24_22-28-45.png
    67.1 KB · Views: 307
I still think you need charge-current-limiting, as a safety feature in case the PWM fails. Exploding batteries are not a pretty sight :eek:.
When Q6/7/8 turn on, Q3/4/5 turn off.
 
Last edited:
What you are doing is dangerous, and really you should make all the necessary precautions and make sure they work at all times.

First you need to limit the charging to some value, and that means not using PWM, beacus the current peaks must not exceed the limit, and you can´t really achieve that with plain PWM.
Second and maybe more important, you need to limit the voltage on each cell separately to 4.25V or less. This means that the bypass path around the cell must be able to pass ALL the charging current and limit the cell´s voltage at the same time.

Li-pol batteries store huge amounts of energy, and I suggest you treat them with respect they deserve or face the consequences.
 
Would you recommend LM317 for current limiting?
For the voltage limiting, i thing software would do it just fine, because i measure every cell voltage and stop charging when it gets near 4.20V for any of the cells.

Alec_t, are you sure about turning Q's on and off? I think when Q6/Q7/Q8 have Vbe 5V they turn on Q3/Q4/Q5 with Vgs > 5V (7V, 11V, 15V). I need to be sure that nothing but uC (from its own power supply) can turn any mosfet ON
 
i measure every cell voltage and stop charging when it gets near 4.20V for any of the cells.
Because of slight cell capacity differences, that will likely result in two of the cells (of a 3-cell battery) not being fully charged.
I think when Q6/Q7/Q8 have Vbe 5V they turn on Q3/Q4/Q5
No, they don't. E.g, when Q7 is on, the gate of Q4 is close to 0V, so Q4 (which is an N-MOSFET) is off.
 
Last edited:
If cells arent perfectly charged, and by perfectly charged i mean 100% charged, but 95% or something like that, i dont mind. I just want to make simple 3S charger for my electric scooter..

Yep, you are right about transistors then. Maybe i should use 2N7002 N-CH mosfet insted of 2N2222 NPN transistor? As i said, i just want to be completely sure that 68ohm resistor arent balancing cells when i uC doesnt wants to
 
Hello,
You should show the polarity of the battery cells also on the schematic.
Again, the idea is to provide current to the series string and limit the voltage to any single cell to 4.20v or better yet 4.15v. Once any cell voltage gets near that limit some of the current has to be shunted around the cell. Once all the cells have most of the current shunted, the charge cycle is complete. There will be some cells shunted and some not when the charge cycle is taking place.
What i dont see on your schematic however is how you intend to obtain precision shunting action. To shunt 500ma of current (for example) at a voltage of 4.150 volts would require a precise resistor value of 8.300 ohms. Usually this voltage is set with a precision reference not a resistor value, and it may be hard to get the right value for what you need unless you design around this perhaps.
What is the max charge current you intend to use?
 
You should show the polarity of the battery cells also on the schematic.
Cell 0 is GND
Cell 1 is 4.2V when full
Cell 2 is 8.4V when full
Cell 3 is 12.6V when full

To shunt 500ma of current (for example) at a voltage of 4.150 volts would require a precise resistor value of 8.300 ohms.
I didnt explain this part... I would NOT charge and "balance" at the same time. Charing will be in series with current around 2A. When cells get disbalanced, charging will stop and they will get balanced through 1/4W (or maybe 1W) shunt resistors.
Once they are balanced, and cells are below 4.15 od 4.20V, charging will continue
 
Maybe i should use 2N7002 N-CH mosfet insted of 2N2222 NPN transistor?
That won't change the switching function. An N-FET and NPN both turn on with a positive control signal.
How do you propose to introduce the bypassing that Kubeek mentions in post #23? N.b. this bypassing is not the same as balancing. For example, if the middle cell reaches full charge before the others it needs to be bypassed, so that charge current can continue to flow through the other two. When it's bypassed, the voltage at Cell2 and Cell3 will both drop by ~4.2V.
 
Last edited:
How do you propose to introduce the bypassing that Kubeek mentions in post #23?

Why should i be able to pass ALL the charging current? I think its not neccesary because i would charge my battery pack ONLY when all cells are at the same voltage. When they are not, passive balancing will be active
 
Cell 0 is GND
Cell 1 is 4.2V when full
Cell 2 is 8.4V when full
Cell 3 is 12.6V when full


I didnt explain this part... I would NOT charge and "balance" at the same time. Charing will be in series with current around 2A. When cells get disbalanced, charging will stop and they will get balanced through 1/4W (or maybe 1W) shunt resistors.
Once they are balanced, and cells are below 4.15 od 4.20V, charging will continue

Hi,

Polarity means place a + or - where the cell terminal connects on the schematic.
For example:
---------(+)CELL(-)---------(+)CELL(-)------------

Where did you get the idea you would charge in one phase and balance at another time?
If you charge 4 cells in series and cell #2 charges up to 4.15v and the others are at 4.00v, then why would you load the 4.15v cell?
Then, if the cell is really at 4.15v, as soon as you start to charge again (for the other three at 4.00v) the one at 4.15v would trip again right away, so you'd be back to balancing. Therefore the three lower voltage cells would never charge.
Unless you have a different way of explaining this, this wont work.
Normally the cells that charge first are shunt regulated so that they stop charging while letting the other cells charge. The cell at 4.15 will no longer get current through it because the shunt regulator will have shunted all the current around the cell, allowing the other three to get the current but not that one anymore.
Also, you dont want to actually discharge the cell on a regular basis while it is on the charger, because that will shorten the cell life.

The right way to do this is to supply current to all cells in series, and when any one gets near the 4.15v threshold start to shunt (bypass) the current AROUND the cell.
Now if you want to try to switch in a resistor that may work, but that might be too inaccurate. The way a normal charger would work is it would shunt current based on the voltage of the cell, in a non linear fashion. There might be a problem switching in a resistor because you wont be able to tell if the cell is discharging or not, depending on the resistor value (which cant be set as accurately as a voltage reference).

Perhaps you can explain your proposed charging regime in a little more detail.
 
Why should i be able to pass ALL the charging current? I think its not neccesary because i would charge my battery pack ONLY when all cells are at the same voltage. When they are not, passive balancing will be active
You mean that you will balance them first, and then start charging? The problem is that if one of the cells has lower capacity than the others its voltage will grow faster than the others and it will be fully charged first.

Now if I understand what you mean, with your scheme you would stop charging when that cell reaches 4.25V, wait for the cells to be slowly balanced again and then start charging again? Seems like a waste of time.

If you simply limit the voltage on each cell separately with a parallel transistor and make sure that it can dissipate the full charging current, then you will both make sure you cannot overcharge that cell, and that the battery is fully charged afterwards.
 
If you simply limit the voltage on each cell separately with a parallel transistor and make sure that it can dissipate the full charging current

What do you mean with paralallel trasistor? You mean i should charge them in series and when any cell charges to 4.20V, its mosfet turns on and that cell is shorted (bypassed) with resistor that can pass 2A of charging current?
Is that what you were thinking?

If you charge 4 cells in series and cell #2 charges up to 4.15v and the others are at 4.00v, then why would you load the 4.15v cell?
Then, if the cell is really at 4.15v, as soon as you start to charge again (for the other three at 4.00v) the one at 4.15v would trip again right away, so you'd be back to balancing. Therefore the three lower voltage cells would never charge.
Unless you have a different way of explaining this, this wont work.

I meant to charge my battery pack without balancing till any cell gets to 4.15.
Lets say that voltages at that moment are 4.12V, 4.13V, 4.15V.
At the next step i would dissipate cells 2 and 3 energy till their voltages are all 4.12V. Then the charging resumes and when any cell is greater for 0.02V, charging stops and balancig begins.
So after few minutes voltages would be 4.15V, 4.16V, 4.16V. Everything is fine and charging is still ON. Than the first cell charges to 4.17V and first cell is stil 4.15V. Charging is stopped, and balancing is ON till all cells gets to 4.15V.
Something like that... Do you think bypassing is a better solution?
 
What do you mean with paralallel trasistor? You mean i should charge them in series and when any cell charges to 4.20V, its mosfet turns on and that cell is shorted (bypassed) with resistor that can pass 2A of charging current?
Is that what you were thinking?
In rough terms yes. The transistor itself can act as a resistor and ensure that the voltage on that cell is never above the limit, so when the cell reaches 4.20V the transistors open just enough to keep that voltage and thus bypasses the charging current around the cell.
 
In rough terms yes. The transistor itself can act as a resistor and ensure that the voltage on that cell is never above the limit, so when the cell reaches 4.20V the transistors open just enough to keep that voltage and thus bypasses the charging current around the cell.


Hi,

That action is called a "Shunt Regulator". I have been trying to convey that same message :)
 
What do you mean with paralallel trasistor? You mean i should charge them in series and when any cell charges to 4.20V, its mosfet turns on and that cell is shorted (bypassed) with resistor that can pass 2A of charging current?
Is that what you were thinking?



I meant to charge my battery pack without balancing till any cell gets to 4.15.
Lets say that voltages at that moment are 4.12V, 4.13V, 4.15V.
At the next step i would dissipate cells 2 and 3 energy till their voltages are all 4.12V. Then the charging resumes and when any cell is greater for 0.02V, charging stops and balancig begins.
So after few minutes voltages would be 4.15V, 4.16V, 4.16V. Everything is fine and charging is still ON. Than the first cell charges to 4.17V and first cell is stil 4.15V. Charging is stopped, and balancing is ON till all cells gets to 4.15V.
Something like that... Do you think bypassing is a better solution?


Hello again,

That might work, but im not sure that is a good idea, and i am pretty sure that is not the optimum way to charge batteries.

For example, if cell 3 gets up to 4.15v and cell 2 is still at 4.00v, then that means that cell 3 has less innate capacity, and discharging a cell diminishes it's capacity over time, so any cell that reaches a higher voltage first gets some of it's capacity removed so next time it reaches that higher voltage even faster, at least in theory.

How long it takes to make a significant difference is harder to say, but if you could rig it up to shunt regulate at least you would not ever be reducing capacity because you have to discharge a cell, possibly several times, during a charge cycle.

Consider the cell that charges to 4.15 while the others are at 3.8v. You really want to have to discharge a fully charged cell down to a much lower voltage just so you can balance the pack? I really dont think so. The difference in capacity is significant for small voltage changes near the fully charged voltage, although not super significant, but it still does not seem like a good idea to have to discharge a cell by maybe 15 percent just so the pack can be balanced. What if only one cell is 4.00 while the other three are 4.15 ? We really want to have to discharge three cells for the benefit of one cell? I dont think so :)

It's an interesting idea, and would probably work, but it will put undo working stress on the cells in the form of reduced normal charge/discharge cycles. How much more depends on the initial innate cell capacity ratios from cell to cell. Cells that are very well matched to begin with and hold that matching over time probably wont suffer too much, while even moderately different cells could suffer a lot with reduced cycle life.

Another idea would be to switch the cell out completely, while shunting it's position in the chain. That would take two MOSFETs, but could probably be done without requiring any sort of linearized regulation. So the cell gets 'removed' from the circuit and in it's place perhaps a resistor that drops 4.2v at the current charge current level.
 
Last edited:
rascupanamuha,

I have skimmed (rarely a good idea) over the reply posts, and noticed that the only current monitoring you had was in your first circuit - the ACS712. That's a hall-effect based current monitor for relatively high currents, probably wise for the sort of currents required to charge a scooters batteries. It isn't particularly accurate as far as current monitors are, but current accuracy isn't really required for Lithium battery bulk charging. Voltage monitoring however, really does need to be accurate to prevent damage to the batteries.
The only time accurate current sensing is wanted is during the constant voltage phase of the charge, where the termination of charge is determined by the current drawn by the battery. I have seen this value anywhere from 20 down to 5% of 'C' of the battery. If your batteries are say, 3Ah. And you choose 10% as the termination point, you will stop charging once they draw less than 300mA. At that current, your ACS712 doesn't have very good accuracy, but good enough.

As you're using a resistor dividers to scale down he voltages at each node between the batteries, these will need to be at the very least 1%, and your voltage reference for your ADC will need to be 1%, giving a total of 3% accuracy. Ideally, this should be lower, especially for larger batteries.

What is rather worrying is the fact that you don't provide a constant current source, and that you have no current/voltage limiting whatsoever. I would include a fuse, then a P-channel MOSFET, followed by a constant current source, that has its maximum current output set in hardware (analogue circuitry) to a limit. This way your maximum current output is fixed even if your microcontroller resets, or you make a software error, or short the output. The ACS712 can monitor the current, but it should be part of the current limit circuit, rather than just letting the microcontroller handle it. The above is of course powering the entire pack, and is not part of 'balancing'.

Although many have covered the idea of charge balancing (by shunting some current using a transistor and resistor in parallel with each battery, thereby reducing its charge current) I haven't seen the capacity of the battery pack you are charging. Whilst the principles are the same whether its 150mAh, or 15Ah , the currents involved will determine what kind of current sense you need, your MOSFETS, your diodes, resistors etc..

For example a simple LM317 CC supply has limits to just over an amp, and the resistor used would need to be large. A two-transistor CC supply can handle more current (heatsinks!) is cheap and simple, can be turned off etc.. Using a current monitor/sensing IC (with external resistor perhaps) does not 'control' the current, merely measures it - and so you would need to use this output to limit the current via a control element, a MOSFET or transistor.

Of course, it could be you simply excluded that part of your circuit from your posts, in which case you know all this., sorry! Have you broken this down into different parts? the balancing part, the power supply, the microcontroller/interface ?

Whilst its nice to have accurate balancing, I would start off getting a circuit working that can charge one cell. This will involve all of the power stuff, safety checks (you'll want a temperature sensor too..) your voltage measuring accuracy, and algorithm. You can test your software at the same time. Then add another cell in series, raise the power supply, add your charge balancing circuits for each cell, the software etc.. then try 3 cells.

I really can't short short posts can I? :/

BT
 
Hi,

Well it is nice to see someone else who likes to write a lot in this subject area :)
Cant help but voice what you like right?

The way i do mine is i use a switching regulator with added current limit to charge the cell, then use a uC chip to constantly monitor the charge conditions and display voltage and current. So the analog circuit does most of the work and the micro controller just monitors everything.

I have a feeling he wants to do this in a pure digital way, so i suggested switching out the cells one by one as they become charged. I guess if the charge current is 1 amp and the resistance is 4.2 ohms, then the voltage will be approximately 4.2v even though the cell has been switched out, which will probably keep things nice and stable.
If i were to build one of these, i would probably do it that way too as that would save from having to build four shunt regulators.

To the OP:
I would start with a lower charge current, like 300ma to 500ma, and make sure everything works as planned first.

BTW another way i've seen this done is to use zeners across each cell. I dont recommend doing this but this does help to show the concept of what needs to be done if a shunt regulator is employed. As the voltage goes higher the zener begins to conduct and thus stops the cell from charging any more. This illustrates the concept, but the accuracy using a zener is not going to be very good, so instead of a zener an accurate shunt regulator is used and that can be adjusted to better than 1 percent, and it will hold that accuracy over time.
 
First of all i want to say im very glad to see how much you are trying to help me with this battery charger. Thank you so much for that!!

About the battery i have: 8Ah, 12V (3S LiPo battery)
Power supply: 15VDC, 2A

What if only one cell is 4.00 while the other three are 4.15 ? We really want to have to discharge three cells for the benefit of one cell? I dont think so :)
That is true. But i think the biggest difference in cell voltages in my battery pack would be 0.05V after full discharge. I think that if cells of my battery where always balanced (and they were), they cant disblanace very much. Thats my opinion.

As you're using a resistor dividers to scale down he voltages at each node between the batteries, these will need to be at the very least 1%
This is not a problem because i have calibrated my voltage measurement and it is really good now. For example Cell 2 in my schematic has 7.83V, and with 2 10K resistors i get correction factor = 1.944 (2 would be with 2 perfect 10.0000K resistors). So the measurement is not the problem.

What is rather worrying is the fact that you don't provide a constant current source
This is true, but i just wanted to make a very simple balance charger that has dimensions no bigger than 4x8cm. Current i want is not so big, just 2A, even though my battery is 8Ah. I thought maybe i could skip constant voltage charging state so i removed ACS712 for current measurement (cheap, small and simple charger).

I would include a fuse, then a P-channel MOSFET, followed by a constant current source, that has its maximum current output set in hardware (analogue circuitry) to a limit.
Could you please draw and post me a schematics of this part? Also, can i use a for exampe a 0.001oohm resistor as a current sensing? I have never tried that, but it would be very cheap and simple

Using a current monitor/sensing IC (with external resistor perhaps) does not 'control' the current, merely measures it - and so you would need to use this output to limit the current via a control element, a MOSFET or transistor.
Something like this?
**broken link removed**

I really can't short short posts can I? :/
I dont mind, you are very helpful :)

I have a feeling he wants to do this in a pure digital way
To be honest i dont want to do this in pure digital way, i would rather do it in analog way, because it should be as simple as possible, but i dont know how to do it with curren or voltage limiters, so you all may be very helpful to me if you could help me with that :)

PS. I included a few photos: 2 of my last board (i made it yesterday, programmed it today and its now balancing my battery), and the charger board i want to replace (https://www.hobbyking.com/hobbyking/store/__7637__Turnigy_12v_2_3S_Basic_Balance_Charger.html)
 

Attachments

  • 20150525_231056.jpg
    20150525_231056.jpg
    881 KB · Views: 201
  • 20150525_234731.jpg
    20150525_234731.jpg
    581.1 KB · Views: 231
  • 20150526_200431.jpg
    20150526_200431.jpg
    845.1 KB · Views: 241
Charging at 0.25C is sensible, keeps the current down (small components, less heat etc..) but I fear it will take a while. Given losses, you're look at 4-5 hours for constant current , and another 1-2h for constant voltage. The bulk charge will be constant current, which will charge it to around 70-75% of full charge. The constant voltage charge provides the rest. I have seen chargers for multiple cell batteries that skip the constant voltage part though, I have only ever designed chargers for single cells.

Also, your ACS712 measures current, so why would you remove that if you were only using constant current? (unless you already have a constant current supply without a limit on output voltage?).

The current limiter schematic you posted would be fine. You can calculate the value of the resistor R = ~0.7V / I. So for 2A, 0.35R. It will dissipate I^2*R watts, which is 4*0.35 = 1.4W of power. This however, will not limit voltage, but with a 15V supply, and a max charge voltage (for 3 cells) of 12.6, that leaves 2.4V drop. the resistor will drop 0.6-0.7V, the transistor will drop its Vce, so, for 2 AMP that could be up to a volt. Leaving ~2.4 - 1.6V - 0.8V drop left. Might be safe enough. Your micro will have to accurately measure the voltage across each cell and turn on its corresponding shunt transistor, the voltage limit is really just in case things go wrong.

It is fairly straight forward to make a CC/CV supply, just a regulated voltage with current limiting. Or a constant current regulator with voltage limiting. It is preferable to have the former, as the charge current only determines charge time, and cannot harm the battery as long as it is a sensible value. But voltage limit should be 4.2V/cell (assuming its a polymer battery).

You will need analogue to do the bulk of the work. Whilst a microcontroller can measure voltages, turn things on and off, and provide PWM for analogue control, it shouldn't be used as the only way to control things in a feedback loop. What if your micro resets? or there's a brown out? or the oscillator stops? In the case of using a current monitor to your micro's ADC, and using PWM to control the charge current, then should the micro 'freeze' or there is an undefined software state, all of a sudden you could be charging your batteries at a much higher current.

As MrAl said - I will repeat almost his exact words!: best to let the analogue handle the limits, voltages and currents, and have the micro just 'monitor' things (measuring voltage of each cell, charging current, and displaying results). Of course the micro can turn things on and off, and be used to control the balancing, but be aware that things can go wrong with this approach and destroy a cell (therefore, the whole pack).

Using an micro with an ADC rather than a comparator, *can* be more accurate (assuming the comparator uses crap resistors, and the ADC has a good reference) but the digital approach requires you to actively read the voltage and do something about it. An analogue comparator is 'automatic', passive, and 'dumb'. This is why so much analogue still exists in safety-critical applications - unless the basic components fail, they will do just one job, but do it well, forever.

Also notice the 'hobbyking' charger only has two 2.2 ohm power resistors. As it charges 3 cells, you only need to shunt two of them, once those two batteries are shunted, the circuit just see's one battery with two series resistors. The last battery to be charged doesn't need shunting, because then you would have just 3 resistors in series - wasting power, not charging anything.

Although I don't really want to see the software, I would be interested in the algorithm you're using, if you have a flow chart, or just basic psuedo-code

Couple of links for cell balancing:
http://www.zajic.cz/omezovac/omezovac.htm
across each battery: http://www.zajic.cz/omezovac/omez sch.jpg

Note that charging at 2A, the transistor/resistor across each cell will have to dissipate 4.2x2 = 8.4(!!) watts. I guess that is where your algorithm comes in, occasionally shunting a battery that has a higher voltage to bring it back in line, so no cell is being shunted for a long time.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top