Constant Current Constant Voltage Battery Charger

crutschow

Joined Mar 14, 2008
38,529
I change the LT1084 to LM338 as a replacement. I intended to charge 12V battery with 1A current. Why does the voltage drop massively from 12V supply to 3V on the output?
Because the circuit output is adjusted for 3V.
You need to change the resistor R4 so that the REF voltage is 2.5V at the desired output voltage.
But you can't charge a 12V battery with a 12V source.
You need a voltage at least 2V above the maximum desired charge voltage.
 

MrAl

Joined Jun 17, 2014
13,711
Hello,

My name is Aiman. My focus research area is on Battery chargers. I would like to know the part for Constant Current charging. As i have done a sample circuit for the CC-CV battery charger system.

I have conducted a few testing and simulation for the circuit but did not achieve CC-CV profile in the simulation. I am going to charge a 3.7V 3A 5000mAh battery. The charging mechanism should be CC then CV during the end of the charging. I'm using LM317 component to achieve constant current source circuit. TL431A acts a temperature compensated variable or adjustable Zener diode.

The input voltage is 12V and my consent is for constant current at 3A, can anyone share with me how to make it constant at 3A.

I am very happy if you can share with me tips or fundamentals for Constant Current Charging/battery charger.
Hello there,

Constant current charging means regulating the output current from a power supply rather than regulating the output voltage. Except for stability in some circuits, that's the only difference. There are several ways to regulate the output current.

Your circuit does not look like it is drawn correctly and the parts are not chosen well enough to provide the kind of current levels you want to use to charge the battery. For one, you are using a linear voltage regulator, which is going to dissipate a LOT of power while it is charging the (nearly) 4 volt battery. With 12v in and 4v out and at 3 amps, the linear regulator would be dissipating 24 watts, which requires a pretty big heat sink. It may be a little bit less than that, but it will still be significant. This is one reason why I like the comment about using a switching type regulator rather than a linear regulator. The switching type regulator will dissipate a lot less power itself while still charging the battery effectively. It is a sort of similar circuit too, and I've already used the LM2576 switching regulator for this very purpose. In fact, to charge at 1 amp you don't even need a heatsink. At 3 amps you probably do, but it will be much smaller, and the whole circuit would be much more efficient. You can also have a wider input voltage range.

Another thing to think about is that although the voltage specification for charging the 4.2v max Li-ion cell is 4.200 volts, the current spec can be varied without damaging anything. If you want 3 amps output, then if you regulate between 2.5 amps and 3.5 amps you will still get good results. What this means is that the voltage regulation has to be very accurate (1 percent) the current regulation does not have to be very accurate at all, as long as it is somewhat close to what you want. This means you have a lot more flexibility with the current regulation circuit. It does mean that you should have a circuit that can measure the current though, and limit the output of the regulator. You also do not want to have to depend on a resistor in series with the battery to do that limiting because then that resistor has to dissipate a lot of power. You want to use feedback just like for the voltage regulation, it just does not have to be as accurate.

There are some other little issues that come up when charging Li-ion batteries that are concerned with the damage to the battery or damaging the battery.
1. If the battery voltage is below 2.5 volts it is a good idea to charge with a lighter current level until it comes up to 2.5 volts. In some cases the battery voltage might be 0.000 volts and then you have to make a decision whether to even use the battery or not. A battery that has been discharged down to 0.000 volts may be already damaged.
2. As voltage regulation takes over after the current regulation phase, there is a certain current level where the charging should be terminated completely. That means no more charging should take place. That current level is considered to be C/20. Some chargers have an automatic shutoff for this mode of operation. That's to protect the battery from damage also.
3. The life of the battery will last much longer if you only charge to 80 percent or 85 percent. Some cell phones already implement this limit so the battery can last longer. You still get a decent about of power from the battery before it is discharged.
4. This ties in with #3. If you limit the max voltage to something less than the max of 4.2 volts, the battery lasts longer. That is what happens when you only charge to 80 percent or 85 percent of the maximum charge.
5. There are now Li-ion cells that can be charged to 4.35 volts instead of 4.2 volts. You have to be sure you have that kind of higher capacity cell before you charge to 4.35 volts though. If you do that with a 4.2 volt max cell, you could end up with big problems.
6. In higher quality chargers, the temperature of the cell is monitored and it limits the current if the temperature gets too high. It does not have to shut off completely, it just has to lower the current level. This is because the internal resistance and/or the contact resistance can cause the cell to overheat and cause big problems. By limiting the current it actually regulates the temperature, not the current, which keeps the temperature at a reasonable level. This adds a third regulation phase in addition to voltage and current regulation, if it becomes necessary during the charging of the cell. You can also test the battery as it is being charged to make sure it is not overheating, but that requires a more sophisticated circuit.

In my LM2576 charger, I limit current with a simple transistor and resistor. The resistor senses the current and the transistor fools the voltage feedback into cutting back when the current gets too high. I do not implement #2 above though because I never let the cell charge for too long anyway, and toward the end of charge the current level goes down slowly. I just manually terminate the charging so it can't charge anymore. I also only charge at 1 amp which is safe for the cells I use and prolongs their life.
 

Thread Starter

Arcan3

Joined Nov 19, 2024
28
Because the circuit output is adjusted for 3V.
You need to change the resistor R4 so that the REF voltage is 2.5V at the desired output voltage.
But you can't charge a 12V battery with a 12V source.
You need a voltage at least 2V above the maximum desired charge voltage.
hi crutschow,

I have been trying to simulate with 15V supply voltage and adjust the value of R4 to observe the output voltage. Up until 3K ohm resister R4 the profile seems to be in good condition, however further decrease the value of R4 seems to change the profile of the CC-CV method there. My previous senior's CC-CV circuit achieved 48V from 54V supply which is 12% decrement from supply voltage. is there any solution for this or i would just need to increase the supply voltage?

1734586437409.png
Figure 1: adjusted R4 to 3K ohm

1734586490211.png
Figure 2 : adjusted R4 to 2K ohm​
 

MrAl

Joined Jun 17, 2014
13,711
hi crutschow,

I have been trying to simulate with 15V supply voltage and adjust the value of R4 to observe the output voltage. Up until 3K ohm resister R4 the profile seems to be in good condition, however further decrease the value of R4 seems to change the profile of the CC-CV method there. My previous senior's CC-CV circuit achieved 48V from 54V supply which is 12% decrement from supply voltage. is there any solution for this or i would just need to increase the supply voltage?

View attachment 338393
Figure 1: adjusted R4 to 3K ohm

View attachment 338394
Figure 2 : adjusted R4 to 2K ohm​
You can add an initial voltage condition to the 'battery' (C1) to simulate a battery that is not completely discharged before the charging starts. For a regular Li-ion cell that would be about 2.5 volts for example. The charging current would then take it from 2.5v up to 4.2v for example as time progressed. The charge time is dependent on what value you use for the capacitor and how high the charge current is.

Since the cell would be considered completely discharged when at 2.5v (or around there), you would calculate the required value for C1 based on the voltage going from 2.5v up to 4.2v, and how much charge is accumulated over that time period.
If we start with the definition of the capacitor:
dv/dt=i/C
then solve for C:
C=(3600*dt*i)/dv
this gives us a picture of what we need.
We know what dv is because it has to go from 2.5 to 4.2, so it is 1.7 volts.
We would assume what 'i' is also, so we can calculate what dt is knowing the ampere hour rating of the battery.
The AH of the battery would be dt*i, because we terminate when the time period 'dt' has expired.
This means if we had a 10AH battery we would have:
10=dt*i
and if i=2 amps then:
dt=5 hours.
Now we know dt too, so back to:
C=(3600*dt*i)/dv
and use dt=5 and i=2 and dv=1.7 and we get:
C=21176 Farads.

So following this procedure you can calculate what capacitor value you need for C1 given your battery size.
It's entirely possible that 100 Farads would work, but it's good to check that based on the charge current and the voltage difference between fully charged and discharged completely for the battery you intend to use.

There is a more accurate calculation due to the equivalent series resistance in series with the battery, because near maybe the last 1/4 of the total charge time period the current starts to drop lower and lower. That means it actually takes longer to charge than the simpler calculation would show. It's not super difficult, but it ends up having an exponential part which does not matter a lot for a simple simulation.
 
Last edited:

Thread Starter

Arcan3

Joined Nov 19, 2024
28
You can add an initial voltage condition to the 'battery' (C1) to simulate a battery that is not completely discharged before the charging starts. For a regular Li-ion cell that would be about 2.5 volts for example. The charging current would then take it from 2.5v up to 4.2v for example as time progressed. The charge time is dependent on what value you use for the capacitor and how high the charge current is.

Since the cell would be considered completely discharged when at 2.5v (or around there), you would calculate the required value for C1 based on the voltage going from 2.5v up to 4.2v, and how much charge is accumulated over that time period.
If we start with the definition of the capacitor:
dv/dt=i/C
then solve for C:
C=(dt*i)/dv
this gives us a picture of what we need.
We know what dv is because it has to go from 2.5 to 4.2, so it is 1.7 volts.
We would assume what 'i' is also, so we can calculate what dt is knowing the ampere hour rating of the battery.
The AH of the battery would be dt*i, because we terminate when the time period 'dt' has expired.
This means if we had a 10AH battery we would have:
10=dt*i
and if i=2 amps then:
dt=5 hours.
Now we know dt too, so back to:
C=(dt*i)/dv
and use dt=5 and i=2 and dv=1.7 and we get:
C=5.88 Farads.

Since you already picked the capacitor, we can investigate what ampere hour battery size that is.
Based on the 4.2v Li-ion cell again, we would have:
100=(dt*2)/dv
and again with dv=1.7v we have:
100=(dt*2)/1.7
and solving for dt we get:
dt=85 hours
Since the current example is 2 amps, that means the battery would be rated for:
170 ampere hours.
Note it does not matter what the charge current is for this calculation because if it was higher then dt would be lower by the same factor, so we'd still get 170 ampere hours.

So following this procedure you can calculate what capacitor value you need for C1 given your battery size.
It's entirely possible that 100 Farads would work, but it's good to check that based on the charge current and the voltage difference between fully charged and discharged completely for the battery you intend to use.
Note that we do not use the fully charged voltage of the battery alone which in this case would have been 4.2 volts. That would lead to a charge time of 210 hours rather than just 85 hours.

There is a more accurate calculation due to the equivalent series resistance in series with the battery, because near maybe the last 1/4 of the total charge time period the current starts to drop lower and lower. That means it actually takes longer to charge than the simpler calculation would show. It's not super difficult, but it ends up having an exponential part which does not matter a lot for a simple simulation.
Hi Mr AI,

Let say i want to charge 12V 6 cells in series with 5200mAH.

Nominal Voltage: 3.7 V/6 cell = 22.2V
Fully Charged Voltage: 4.2 V/6 cells = 25.2V
Cut-off Voltage: 2.5 V/6 cells=15.0 V

dv = 10.2V
dt = 510 hours
C=2/50=0.04Farads=40,000μF

Does using 100F capacitor will not optimize my charging circuit as it will need to take a longer time to charge the capacitor to the near supply voltage?
 

MrAl

Joined Jun 17, 2014
13,711
Hi Mr AI,

Let say i want to charge 12V 6 cells in series with 5200mAH.

Nominal Voltage: 3.7 V/6 cell = 22.2V
Fully Charged Voltage: 4.2 V/6 cells = 25.2V
Cut-off Voltage: 2.5 V/6 cells=15.0 V

dv = 10.2V
dt = 510 hours
C=2/50=0.04Farads=40,000μF

Does using 100F capacitor will not optimize my charging circuit as it will need to take a longer time to charge the capacitor to the near supply voltage?
Hi,

I'm sorry I forgot to include the conversion factor for hours to seconds when calculating the capacitor value in my previous post. The value of the cap with 'dt' in hours and 'i' in amps and 'dv' in volts and 'C' in Farads would be:
C=(3600*dt*i)/dv

and if we set dt*i=5.2 we end up with:
C=3600*5.2/dv

and with dv=10.2 we have:
C=3600*5.2/10.2
which then leads to:
C=1835 Farads

However, this is the simpler calculation. If we want a more exact result we have to include the battery series resistance Rs, and then we have to also know the initial charge current i0. This leads to an expression like this for the last phase of charging:
vC=i0*Rs*(1-e^(-t/(Rs*C)))+Vout-i0*Rs

In the calculation for C though we then have to change 'dv' to a smaller value which would mean we subtract i0*Rs. That extra voltage then is shown as vC above when the capacitor charges during that last constant voltage phase.

If you'd like to see an example I can write one up a bit later.
 
Last edited:

Thread Starter

Arcan3

Joined Nov 19, 2024
28
Hi,

I'm sorry I forgot to include the conversion factor for hours to seconds when calculating the capacitor value in my previous post. The value of the cap with 'dt' in hours and 'i' in amps and 'dv' in volts and 'C' in Farads would be:
C=(3600*dt*i)/dv

and if we set dt*t=5.2 we end up with:
C=3600*5.2/dv

and with dv=10.2 we have:
C=3600*5.2/10.2
which then leads to:
C=1835 Farads

However, this is the simpler calculation. If we want a more exact result we have to include the battery series resistance Rs, and then we have to also know the initial charge current i0. This leads to an expression like this for the last phase of charging:
vC=i0*Rs*(1-e^(-t/(Rs*C)))+Vout-i0*Rs

In the calculation for C though we then have to change 'dv' to a smaller value which would mean we subtract i0*Rs. That extra voltage then is shown as vC above when the capacitor charges during that last constant voltage phase.

If you'd like to see an example I can write one up a bit later.
hi Mr AI

i would love to know an example from that. however does it concerning if i did not use the correct value of the capacitor?
 

Thread Starter

Arcan3

Joined Nov 19, 2024
28
Look at the output voltage.
You are not simulating until the end of the charge.
Increase you simulation time to 300 seconds.

View attachment 338396
hi crutschow,

Currently, I am constructing and simulating this circuit physically. How does i know the output current and voltage of my circuit and how does i know that my circuit achieved CC-CV. last week I did a test and connect a multimeter in parallel to the Rbat and got no value of current. As for the voltage, i get 0.3 mV which is very small.
 

crutschow

Joined Mar 14, 2008
38,529
How does i know the output current and voltage of my circuit and how does i know that my circuit achieved CC-CV.
You can measure the voltage across R1 to determine the current using Ohm's law (if the voltage ≈1.24V it's in the CC mode, if <1.24V it's in the CV mode), and you can measure the voltage across the battery to determine its state of charge.
 

MrAl

Joined Jun 17, 2014
13,711
hi Mr AI

i would love to know an example from that. however does it concerning if i did not use the correct value of the capacitor?
Hi,

Not sure what you are asking here. If you do not choose the correct capacitor you do not get results that match up well with real life, however, almost any capacitor value will give you insight into how this works.

There are two phases as you know, the constant current and the constant voltage. During the constant current the main behavior is due to a capacitor being charged by a constant current, which means the result is a ramp up in voltage (see Eric's simulation plots).
The second phase kicks in when the output voltage of the regulator minus the electrical current times the battery ESR equals the currently existing internal capacitor voltage. Then the capacitor is being charged with a voltage source through a resistor, and the well known exponential behavior takes over:
Vc=Vc(0)+dv(0)*(1-e^-(t/RC))
and without getting too deep into it that just means that the voltage now becomes a curve up rather than just a ramp up. There may be a way to improve that too though (more about that at a later date).
Because of the two different phases, there may be an ideal charging current that leads to maximum efficiency. Maybe we could look into that too later.

I have yet to write up an example, but I think I can do that today. I like to revisit this stuff now and then for my own experience too because then I remember how it all works too. When I worked in the industry, battery chargers were one of my favorite design activities.
 

crutschow

Joined Mar 14, 2008
38,529
Here's the sim showing the voltage across R4 (yellow trace):
It stays at about 1.24V during the CC charge, and then drops going to the CV charge.

1734711072757.png
 

MrAl

Joined Jun 17, 2014
13,711
hi Mr AI

i would love to know an example from that. however does it concerning if i did not use the correct value of the capacitor?
Hello again,

Here are some design formulae that will get you started. I'll post the formulae and then what the variables are.

Of course first we want to calculate the capacitance we would use in the simulations:
C=(3600*AHr)/(Vmax-Vmin)

then the time spent in the exponential phase of the charge cycle:
texp=(C*R*log((i0*R)/(Vout-Vmax)))/3600

then finally the total ampere hour charge:
AHrTotal=((Vout-Vmax)*(R*C-R*C*e^(-texp/(C*R))))/R+AHr

Also:
AHrTotal2=(AHr*(i0*R*log((i0*R)/(Vout-Vmax))-Vmin+Vc0))/(i0*(Vc0-Vmin))

where
AHr is the ampere hour capacity of the battery before a correction factor is applied (for example 5.2AH),
Vmin is the minimum voltage of the battery before charging (such as 2.5 volts),
Vmax is the maximum voltage we will allow the battery to charge up to (such as 4.15 volts for a 4.2 volt Li-ion cell),
Vout is the output of the charger with no load (typically 4.2v for Li-ion),
R is the battery series resistance in Ohms,
C is the capacitor value in Farads,
i0 is the initial charge current, which is what the charger would be set for, for the constant current phase of the charge cycle,
texp is the time spent in the exponential part of the charge cycle in seconds,
AHrTotal is the total charge put into the battery, before considering the charge acceptance,
AHrTotal2 is another way to calculate the total AH charge in one single formula.

4.15 volts is a typical voltage limit, but you can go higher if you like. 4.16v would help to ensure that any poor measurements of the final voltage are not off by more than 1 percent, going higher you should have good measuring equipment.

AHrTotal helps keep track of the total charge including the exponential part.
texp lets you calculate the charge time when the battery is being charged during the exponential phase of the charge cycle, that's something that is interesting to look at when you allow higher Vmax voltages as the time gets longer and longer the higher you set Vmax for. The time for the constant current phase is tcc=((Vc0-Vmin)*C)/i0.
The total time for charging is tc=texp+tcc.

It should be noted that the AHrTotal will come out higher than the original AHr setting because of the exponential part of the charge cycle. You can apply a correction factor to the chosen AHr to get closer to the total charge for the battery:
AHr_new=(AHr/AHrTotal)*AHr^2

then go back and calculate a new capacitor value, which will be slightly less than the original.

There are some formulae which can calculate everything at once, but they get a bit longer.

Example:
4.2v Li-ion cell (Vout), 1 amp constant charge current (i0), terminal voltage 4.15v (Vmax), series resistance R=0.1 Ohms, lowest discharged voltage of 2.5v (Vmin).
Using the formula for AHrTotal2 we get:
5.425 ampere hours.
You use the formula for C to get the value of the capacitor in Farads.
Applying a charge acceptance factor of 0.95 we end up with:
5.154 ampere hours.
 

Thread Starter

Arcan3

Joined Nov 19, 2024
28
Here's the sim showing the voltage across R4 (yellow trace):
It stays at about 1.24V during the CC charge, and then drops going to the CV charge.

View attachment 338526
Hi Crutschow,

Thank you for the simulation provided. I have been changing the values for the resistors, potentiometers and the value of capacitor C1 in order to obtain 12V output voltage. Can you have a look at my circuit and comment if there is something wrong with my circuit?
1735042282396.png
 

Attachments

Thread Starter

Arcan3

Joined Nov 19, 2024
28
The voltage across R1 is V(out)-V(Bat), not just V(out).
Try plotting that function.
Hi Crutschow,

This is the result i got from the simulation of my circuit. Does it mean that it will constantly charge 2.5V in CC and then going to CV. Can you explain how to determine the state of charge by determining the voltage across the battery?
1735263827850.png
 

Attachments

Top