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.

How to calculate the value of a smoothing capacitor

Status
Not open for further replies.
Hi again,

tvtech:
Yeah it has been very interesting to do this and look at the solutions. We can also have a practical thing come out of all this soon, which should satisfy the non-theory lovers :)

Ratch:
Yes that looks good, and also nicely illustrates how straight that exponential really is when we do a practical circuit.

Electrician:


You reading my mind? :)
i was just about to do something like that, and also, it would be kind of cool to come up with a formula to express the ratio of the full wave case capacitor to the half wave case capacitor. This would tell us and others what benefit we can get from going to full wave as opposed to half wave. Then we could obtain an estimate for this ratio, that would be a really practical thing (since many people want and even need that kind of solution).

So who's up for it?

I don't know, I am falling in lust with graphs. I like the BIG picture. Keep in mind that a there are two diode voltage drops with a four diode bridge. One pair for the positive excursion, and a pair for the negative excursion. If you use a center tap transformer, then only two diodes are needed, and only one diode voltage drop will reduce the voltage.

Ratch
 
You reading my mind? :)
i was just about to do something like that, and also, it would be kind of cool to come up with a formula to express the ratio of the full wave case capacitor to the half wave case capacitor. This would tell us and others what benefit we can get from going to full wave as opposed to half wave. Then we could obtain an estimate for this ratio, that would be a really practical thing (since many people want and even need that kind of solution).

So who's up for it?

What do you get for the cap value for the full wave case with the delay and amplitude corrections applied?
 
Hi,

Ratch:
Yes graphs can be so helpful, and i usually like to graph a function before searching for a zero so that i can get an idea where it is.

Electrician:
Oh i didnt do that yet, but the difference would just be in Ratch's formula right?
Instead of (2*pi-acos(K))/w that would have to be decreased by pi/w i guess. I'll have to check this though.
So we'd subtract the already found solution for the little time delay from that instead. Or solve for that longer time using -sin(w*t) instead of sin(w*t) or something like that. I'll look at this next, thanks.

BTW, here's something for you guys to think about :)

Since, and as Electrician noted, a repetitive waveform has voltages that repeat every cycle, regardless where we look, i chose to look at the peak of the first wave bump, and call that zero time. This makes the input sinusoid:
cos(w*t)

instead of sin(w*t), although it may not matter in the long run if we adjust things later, but i'll use the cosine form for now.

So we know the voltage across the resistor is:
cos(w*t)

and the voltage across the cap is:
cos(w*t)

so the current in the resistor is:
Ir=cos(w*t)/R

and the current in the capacitor is:
Ic=C*dv/dt=C*d(cos(w*t))/dt=-w*sin(w*t)

so you see where this is going...the sum of the two currents, which is the source current, is:
Is=Ir+Ic

which of course equals:
cos(w*t)/R-w*C*sin(w*t)

and if you havent figured this out already, we set this equal to zero to find the time delay t:
cos(w*t)/R-w*C*sin(w*t)=0

The solution is easy because sin/cos is tan, so we get the same (equivalent) expression for the time again:
t=atan(1/(w*R*C))/w

[LATER]
When i solve:
-cos(t)=K

i get:
(pi-acos(K))/2/pi

so this would lead to:
t_long=(pi-acos(K)/w

for our use. So this is just Ratch's formula with pi subtracted:
(2*pi-acos(K)-pi)/w

I'll check it over though.

[LATER LATER]
I get 6.72418986e-5 for C with the full wave.
 
Last edited:
Hi,

BTW, here's something for you guys to think about :)

Since, and as Electrician noted, a repetitive waveform has voltages that repeat every cycle, regardless where we look, i chose to look at the peak of the first wave bump, and call that zero time. This makes the input sinusoid:
cos(w*t)

instead of sin(w*t), although it may not matter in the long run if we adjust things later, but i'll use the cosine form for now.

So we know the voltage across the resistor is:
cos(w*t)

Only during the time the power source is energizing the capacitor. The rest of the time the capacitor is feeding the resistor current.

and the voltage across the cap is:
cos(w*t)

Same answer as above. The power source stops feeding the resistor cos(wt) when its voltage drops below the cap voltage.

so the current in the resistor is:
Ir=cos(w*t)/R

Same answer as above. See graph below.

and the current in the capacitor is:
Ic=C*dv/dt=C*d(cos(w*t))/dt=-w*sin(w*t)

Only during the time the power source is feeding the resistor and capacitor.

so you see where this is going...the sum of the two currents, which is the source current, is:
Is=Ir+Ic

There are periods of time when the source current is not supplying current to either the cap or resistor. Yet the resistor is constantly receiving current from either the capacitor or power supply.

which of course equals:
cos(w*t)/R-w*C*sin(w*t)

and if you havent figured this out already, we set this equal to zero to find the time delay t:
cos(w*t)/R-w*C*sin(w*t)=0

The solution is easy because sin/cos is tan, so we get the same (equivalent) expression for the time again:
t=atan(1/(w*R*C))/w

I can't figure out what you are calculating.

MrAl1.JPG


OK, the above graph shows what is happening. The blue line is the current present in the resistor and the orange line is the current supplied by the capacitor. The current of the resistor follows the voltage of the capacitor most of the time until the source voltage kicks in and raises the current to its max value. The current leaving the cap is dependent on the capacity value and the rate of voltage change. At about 7.15 msec, the power supply takes over and the current from the cap drops rapidly from a negative value to zero while the power supply takes over supplying current to the resistor and energizea the capacitor. So the power supply only supplies current from 7.15 msec to 8.25 msec as shown by the graph.

Ratch
 
Hi again Ratch,

Only during the time the power source is energizing the capacitor. The rest of the time the capacitor is feeding the resistor current.

Disagree totally. The waveform is periodic regardless what is conducting. That means if you look at the wave at 0.001 seconds, then again at 0.001+1/60 seconds, the voltage will be exactly the same. In fact, that is the definition of periodic: v(t)=v(t+Tp) always.

Same answer as above. The power source stops feeding the resistor cos(wt) when its voltage drops below the cap voltage.
Yes of course, that is what we are looking for with this equation.


Only during the time the power source is feeding the resistor and capacitor.

There are periods of time when the source current is not supplying current to either the cap or resistor. Yet the resistor is constantly receiving current from either the capacitor or power supply.

I can't figure out what you are calculating.

It is again the time from the peak of the cosine wave (or sine wave) to the start of the discharge of the cap. That is the small time delay (we're calling it small because it is usually smaller than the time for the discharge, but that's not a necessity). That isnt too hard to calculate as you can see, and the time from the peak to the end of discharge isnt too hard to calculate, so by subtracting we get the actual time the capacitor is discharging, and by using the time delay itself we can calculate the coefficient k for k*e^(-t/RC) which is the true discharge curve.
Didnt you notice that this comes out to the same time delay that Electrician obtained using Laplace Transforms?
There are also a couple other ways to prove that this result and Electrician's result are accurate. So we've done it both ways now: once using Laplace and once working strictly in the time domain, and in both cases we come up with the same result.
Note that we dont have to calculate the ENTIRE time that the cap is being controlled by the source, because the time between the end of discharge and the peak is uninteresting and that is because the cap is controlled only by the source so has to free will to change the waveshape until some time after the peak. If for some reason you do want to know that time though, simply subtract the entire time we found from a full cycle:
Tp-T=1/60-T

and that will tell you the time from the start of charge to the end of charge, for what it's worth.
T=yourformula-smalltimedelayfoundabove

View attachment 93166

OK, the above graph shows what is happening. The blue line is the current present in the resistor and the orange line is the current supplied by the capacitor. The current of the resistor follows the voltage of the capacitor most of the time until the source voltage kicks in and raises the current to its max value. The current leaving the cap is dependent on the capacity value and the rate of voltage change. At about 7.15 msec, the power supply takes over and the current from the cap drops rapidly from a negative value to zero while the power supply takes over supplying current to the resistor and energizea the capacitor. So the power supply only supplies current from 7.15 msec to 8.25 msec as shown by the graph.

Ratch
We are calculating exact values here. But i could compare the results to your graphical results if you like?

BTW, what value cap do you come up with for the full wave case?
I was hoping to find a relationship between the half wave case and the full wave case, as to the size of the capacitor required to get a certain ripple result.
 
Hi again Ratch,



Disagree totally. The waveform is periodic regardless what is conducting. That means if you look at the wave at 0.001 seconds, then again at 0.001+1/60 seconds, the voltage will be exactly the same. In fact, that is the definition of periodic: v(t)=v(t+Tp) always.

Yes of course, I was only looking at one period


Yes of course, that is what we are looking for with this equation.

You implied that voltage across the cap is cos(w*t). It is for a short time, but not during the whole period.


It is again the time from the peak of the cosine wave (or sine wave) to the start of the discharge of the cap. That is the small time delay (we're calling it small because it is usually smaller than the time for the discharge, but that's not a necessity). That isnt too hard to calculate as you can see, and the time from the peak to the end of discharge isnt too hard to calculate, so by subtracting we get the actual time the capacitor is discharging, and by using the time delay itself we can calculate the coefficient k for k*e^(-t/RC) which is the true discharge curve.
Didnt you notice that this comes out to the same time delay that Electrician obtained using Laplace Transforms?
There are also a couple other ways to prove that this result and Electrician's result are accurate. So we've done it both ways now: once using Laplace and once working strictly in the time domain, and in both cases we come up with the same result.
Note that we dont have to calculate the ENTIRE time that the cap is being controlled by the source, because the time between the end of discharge and the peak is uninteresting and that is because the cap is controlled only by the source so has to free will to change the waveshape until some time after the peak. If for some reason you do want to know that time though, simply subtract the entire time we found from a full cycle:
Tp-T=1/60-T

and that will tell you the time from the start of charge to the end of charge, for what it's worth.
T=yourformula-smalltimedelayfoundabove


We are calculating exact values here. But i could compare the results to your graphical results if you like?

As before, I am ignoring the insignificant time from the peak of the voltage source until the cap starts de-energizing. Compared to the time of the total period, it is small. Especially if the ripple is small.

BTW, what value cap do you come up with for the full wave case?

I got 55 uf for my full-wave example and 120 uf for the half-wave example.

I was hoping to find a relationship between the half wave case and the full wave case, as to the size of the capacitor required to get a certain ripple result.

For which case, center-tapped transformer (two diodes) or non-center-tapped (4 diode bridge)? Furthermore, it is easily observed that the higher the input voltage, the less significant is the diode voltage drop.

Ratch
 
You implied that voltage across the cap is cos(w*t). It is for a short time, but not during the whole period.
Yes it is only for solving the time problem.

As before, I am ignoring the insignificant time from the peak of the voltage source until the cap starts de-energizing. Compared to the time of the total period, it is small. Especially if the ripple is small.
And especially not if the ripple is large :)
For example, if C=1uf the delay period is around 3.2ms, which is almost the entire quarter period of 4.16667ms. So we'd see a large part of the sinusoid before we saw the discharge curve start.

I got 55 uf for my full-wave example and 120 uf for the half-wave example.
Those values sound too low. Previously you got 146.8uf for the cap for half wave, using your own formula. What happened?

For which case, center-tapped transformer (two diodes) or non-center-tapped (4 diode bridge)? Furthermore, it is easily observed that the higher the input voltage, the less significant is the diode voltage drop.
Ratch

We are still using ideal diode(s). If you want to use diodes with a voltage drop then that's an entirely different paradigm. We might as well consider ESR too then, and some line resistance, or diode spice model.
 
[LATER LATER]
I get 6.72418986e-5 for C with the full wave.

This is exactly correct; I forgot to apply the amplitude correction in my previous result. Here's the computation:

filt7-png.93168


The ratio of the approximate half wave formula to the approximate full wave formula is a constant of about 2.1676, independent of the value of K.
 

Attachments

  • Filt7.png
    Filt7.png
    15 KB · Views: 818
Yes it is only for solving the time problem.


And especially not if the ripple is large :)

I will see it on my graph and note it.

For example, if C=1uf the delay period is around 3.2ms, which is almost the entire quarter period of 4.16667ms. So we'd see a large part of the sinusoid before we saw the discharge curve start.

That's right, it's all revealed on the green curve below. But who would use such a ridiculously low cap for this example?
MrAl2.JPG


Those values sound too low. Previously you got 146.8uf for the cap for half wave, using your own formula. What happened?

The first calculation was not for the last example.

We are still using ideal diode(s). If you want to use diodes with a voltage drop then that's an entirely different paradigm. We might as well consider ESR too then, and some line resistance, or diode spice model.
It is hard to ignore diode voltage drop when the source voltage is low. In my last example 0.7 volts is a significant part of 3.0 volts.

In conclusion, I am a graph person when dealing with tricky waveforms. Once the graph is plotted, then it is much easier to magnify an area of interest on the graph if necessary.

Ratch
 

Attachments

  • upload_2015-7-3_14-1-57.png
    upload_2015-7-3_14-1-57.png
    24.3 KB · Views: 197
This is exactly correct; I forgot to apply the amplitude correction in my previous result. Here's the computation:

filt7-png.93168


The ratio of the approximate half wave formula to the approximate full wave formula is a constant of about 2.1676, independent of the value of K.

Notice that for my last example I got a C of 120 uf for a half-wave and 55 uf for a full-wave. That is 120/55 = 2.18 v.s. your calculation of 2.17 .

Ratch
 
I don't know, I am falling in lust with graphs. I like the BIG picture.

Ratch

Why don't you analyze on SPICE and FALSTAD and compare results to get a bigger picture and a second opinion. Assume 200Vp ac 50 Hz 1Kohm 100uF

then plot the error for each method for Vmin / Vmax which may be more important for SMPS or LDO's etc.
 
Why don't you analyze on SPICE and FALSTAD and compare results to get a bigger picture and a second opinion. Assume 200Vp ac 50 Hz 1Kohm 100uF

then plot the error for each method for Vmin / Vmax which may be more important for SMPS or LDO's etc.

That would be like performing a calculation on two or more different calculators to see if they all give the same answer. Same with graphing programs. Of course they are going to give the same answer if the identical inputs are made. The uncertainly is whether the inputs are correct, and no amount of multiple runs are going to determine that.

Ratch
 
This is exactly correct; I forgot to apply the amplitude correction in my previous result. Here's the computation:

filt7-png.93168


The ratio of the approximate half wave formula to the approximate full wave formula is a constant of about 2.1676, independent of the value of K.

Hi there Electrician,

Oh that's good, so our results match which is good to know.

I do have to differ a little on the constant however, if we allow K to go down to say 0.5, which should be allowed. I think it varies a little too much to call it an actual constant. The reason i think this is because the start time delay (which i dont want to call 'small' anymore because that is misleading) is the same for both half and full wave cases, so the full wave gets cut more than the half wave percentage-time wise with decreasing capacitor value. That, and the fact that it is an exponential to begin with.
 
Hello again,

Ratch:
The entire periodic steady state current waveform is given by:
Is(t)=K*sqrt(1/(w^2*R^2*C^2)+1)*e^(-t/(R*C))*(u(t-(2*pi*n)/w)-u(t-n*T-T))+
sin(w*(t-T+(2*pi)/w))*(u(t-(2*pi*n)/w)-u(t-T-(2*pi*n)/w-(2*pi)/w))

where 't' is time and T is the accurate charge time given previously and 'n' is any cycle number (1,2,3,...N), and this is considered analytical.
You can see why i hesitate to publish these kinds of solutions.
 
Last edited:
That would be like performing a calculation on two or more different calculators to see if they all give the same answer. Same with graphing programs. Of course they are going to give the same answer if the identical inputs are made. The uncertainly is whether the inputs are correct, and no amount of multiple runs are going to determine that.

Ratch
But the inputs can have real values for caps, like ESR and Vf @1A for diodes . Without these, your false assumptions will ignore I square R rise in caps when the current rises 20x Avg during peak charge for 5% ripple. Voltage. Each component can be scope for VI to confirm calculations. Even true RMS power calculations or VAR. and coupling factor and turns ratio for xfmrs..... Etc etc. Falstad even has programmable
LED characteristics and colour.

Your model is too simple to be accurate.

But electronics is a small part of his list. https://www.falstad.com
 
Last edited:
I do have to differ a little on the constant however, if we allow K to go down to say 0.5, which should be allowed. I think it varies a little too much to call it an actual constant.

What I said in post #88 is: "The ratio of the approximate half wave formula to the approximate full wave formula is a constant of about 2.1676, independent of the value of K." I was not referring to the results from "exact" computations where the delay and amplitude adjustment are taken into account.

The approximate formulas I'm referring to are the ones I've given earlier:
filt8-png.93177


The ratio of results from those two formulas is a constant for all K.
 

Attachments

  • filt8.png
    filt8.png
    6.8 KB · Views: 544
Fairchild uses the similar but different approach that I use computing duty cycle of charge time. The duty cycles of half and full wave are computed for the fill cycle instead of half cycle, which looks wrong, because 30% for half wave and 15% pulsed twice is about the same time total ON time per sine cycle, hmmm....

They use an efficiency estimate instead of ESR and use RMS inputs instead of peak.

Comments?
3810583800_1435969457.jpg
 
But the inputs can have real values for caps, like ESR and Vf @1A for diodes . Without these, your false assumptions will ignore I square R rise in caps when the current rises 20x Avg during peak charge for 5% ripple. Voltage. Each component can be scope for VI to confirm calculations. Even true RMS power calculations or VAR. and coupling factor and turns ratio for xfmrs..... Etc etc. Falstad even has programmable
LED characteristics and colour.

Your model is too simple to be accurate.

But electronics is a small part of his list. https://www.falstad.com

My assumptions are not false. They might not be comprehensive, but they are not false. If necessary, I could include other factors into the plot.

Ratch
 
Hello again,

Tony, Ratch:
Yes they are using efficiency probably because that is an important issue with power supplies. So they gear it to allow a viewpoint with respect to efficiency so the designer has simple control over that.
What we were doing here was more geared toward smoothness of output, without too much regard for efficiency and other practical matters. That paper does deserve looking over though, of course.

Electrician:
What I said in post #88 is: "The ratio of the approximate half wave formula to the approximate full wave formula is a constant of about 2.1676, independent of the value of K." I was not referring to the results from "exact" computations where the delay and amplitude adjustment are taken into account.

The approximate formulas I'm referring to are the ones I've given earlier:
filt8-png.93177


The ratio of results from those two formulas is a constant for all K.

Oh ok, that makes a lot more sense now :)

Here is a plot of the actual ratio from our more intense calculations. This shows the ratio C(FullWave)/C(HalfWave) for K ranging from 0.2 to 0.95, and a 3d view for f(K,R) would show a 3d curved sheet with that plotted function as the generating function, swept horizontally along R with zero slope. So this plot should be good for any R. Might want to check it over though just in case i made a mistake.
 
Here is a plot of the actual ratio from our more intense calculations. This shows the ratio C(FullWave)/C(HalfWave) for K ranging from 0.2 to 0.95, and a 3d view for f(K,R) would show a 3d curved sheet with that plotted function as the generating function, swept horizontally along R with zero slope. So this plot should be good for any R. Might want to check it over though just in case i made a mistake.

I don't see any plots. Here's what I get for the ratio C(FullWave)/C(HalfWave) for K ranging from 0.2 to 0.95:
filt9-png.93182
 

Attachments

  • filt9.png
    filt9.png
    4.9 KB · Views: 767
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top