Capacitive voltage divider with half wave rectified voltage

WBahn

Joined Mar 31, 2012
29,978
Ah, I think I see something you might not have taken into account.

You equated the charge coming through R1 when the diode is conducting to the charge going through R2 when the diode is not conducting. But charge is flowing through R2 even when the diode is conducting, hence not all of the charge coming through R1 is charging the capacitor since some of it is going straight out R2.
 

Tesla23

Joined May 10, 2009
542
Ah, I think I see something you might not have taken into account.

You equated the charge coming through R1 when the diode is conducting to the charge going through R2 when the diode is not conducting. But charge is flowing through R2 even when the diode is conducting, hence not all of the charge coming through R1 is charging the capacitor since some of it is going straight out R2.
It's interesting that the expression for the charge added to C when the diode conducts is independent of R2. I checked this a couple of times as when all the R2 terms cancelled I though I'd made a mistake. Think of it like this, if R2 is infinite then the current is simply the voltage across R1, if R2 = R1 then the thevenin source has half the voltage through half the impedance, and so the current is the same. I don't think this is where the error is.
 
Hello again,

I had to go out for a while but when i got back i threw this little program together to perform the numerical solution. As you can see, it's fairly simple. I figured i better post this in a new post rather than the previous one with the analytical approach because it is a little larger with the program code.

Here is the program, and the solutions, one for every second up to 10 seconds, are shown in the inset in the attachment. They came out very close to the simulation, hard to tell apart. The diode used was a high quality Zetex Schottky diode rather than a run of the mill rectifier so the voltage drop is much lower than normal, about 0.1v with a slight curve to it. Here we assume it has a constant 0.1 volt drop for all appropriate time points.

Program:
Code:
--11/24/2015 MrAl
--
--Program description:
--Calculate voltage across cap numerically for the rectified input sine.


include misc.e --contains the 'sleep' function used far below

constant pi=3.1415926535897932384626433832795

atom X1,h,R1,R2,C,t,w,f,Vpk --declare variables, Note: X1 is cap voltage

--set constants and calculate w:
R1=8000
R2=2000
C=470e-6
Vpk=12
f=50
w=2*pi*f

--set the time interval:
h=0.00001 --the time increment, we keep this small


--declare the input wave function:
function E(atom t)
  return Vpk*sin(w*t) --the input voltage wave
end function


--declare the calculations for the derivatives and solutions:
procedure CalcNext()
  atom x,Et

  Et=E(t)-0.1 --subtract 0.1 volt for Zetex high quality Schottky diode as rectifier

  if X1<Et then
  x=-X1/(C*R2)-X1/(C*R1)+Et/(C*R1) --derivative when cap voltage is less than input voltage
  else
  x=-X1/(C*R2) --derivative when cap voltage is greater than input voltage
  end if

  X1=X1+h*x --simple numerical method, first order
end procedure


t=0  --Starting the solution at t=0
X1=0  --with cap voltage equal to zero at t=0 .

for k=1 to 1000000 do
  t=t+h
  CalcNext() --calculate next solution at new time t
  if k/100000=floor(k/100000) then --only print solutions for every second
  printf(1,"t=%04.1f  Vc=%f  \n",{t,X1}) --print the time t and the new cap voltage X1
  end if
end for

sleep(3600) --keep text display showing for one hour so we can view it and copy it
Why have you changed R1 to 8000 ohms? Why not stick with the 6000 ohms as it was in post #1?
 
I did a simulation with MicroCap and a 1N4004 diode. I see a .606 volt drop across the diode at the peak of the input voltage. I think the diode drop is more likely to be on the low side of the usual approximation because the load is such a high resistance. I used .6 V rather than .7 V in my calculations. The simulated steady state average voltage across the capacitor was 1.018 volts. The ripple voltage was 13 mV P-P.

Since the TS wants the average voltage after a long time, the problem can be attacked on a steady state basis.

It's important (as WBahn noted) to not subtract the diode drop from the 12 volts before it's applied to the diode. Here's a graphic showing the difference. The blue curve shows an 11.4 volt RMS sine wave, and the red curve shows the result of the loss of .6 volts through the diode:

P1.png

What we need to do is find the area under the red curve which is what we see at the output of the diode. It simplifies the calculations to calculate this area in two pieces. There's a long narrow rectangular piece just above the x-axis, and a sinusoidal piece above that rectangle. The rectangular piece is the average voltage across the capacitor, which is just what we see at the output of the diode when the diode is not conducting (ignoring ripple on the capacitor):

P2.png '

Formulating the integrand for the sinusoidal piece we get the following result for its area, using a 600 mV diode drop. The somewhat complicated limits are a result of the fact that the voltage out of the diode is offset from the input sine wave which perturbs the timing. I am ignoring the ripple voltage across the capacitor because it's so small.

P3.png

Now add the area of the rectangular part. Then multiplication by the voltage divider ratio (1/4), and by 1/2 to account for the fact that this is half wave rectification, gives a value that should be equal to the average voltage across the capacitor. I've used the variable "avg" for that voltage. The symbol "%" represents the previous large expression resulting from the integration. Finally a numeric solver finds the value of "avg":

P4.png

My simulation got 1.018 volts, and the foregoing calculation gets 1.01554 volts.

If I change R1 to 8000 ohms, as MrAl did in post #16, and change the diode drop to .1 volts, I get an average capacitor voltage of .839577 volts.
 
Last edited:

MrAl

Joined Jun 17, 2014
11,389
Why have you changed R1 to 8000 ohms? Why not stick with the 6000 ohms as it was in post #1?
Hi,

Very simple: Lately i have been seeing 6's as 8's if i am tired and dont look close enough :)
So i changed it to 8 because i thought it was an 8. Thanks for catching that.
But i think you also made a typo in your last post where you state "If i change R1 to 10000 ohms as MrAl did..."
I think you meant to say 8000 ohms too. No problem here though.

The results of the first order simple numerical approach using the program given previously with the 6000 ohms instead of the 8000 ohm were:
t=01.0 Vc=0.762837
t=02.0 Vc=0.984965
t=03.0 Vc=1.049819
t=04.0 Vc=1.068769
t=05.0 Vc=1.074308
t=06.0 Vc=1.075927
t=07.0 Vc=1.076400
t=08.0 Vc=1.076539
t=09.0 Vc=1.076579
t=10.0 Vc=1.076591

The thing i always liked about numerical approaches like that is that there is very little math abstraction, so the chances of making a mistake (other than a stupid one) are reduced.
Be aware however that the above set does not show the ripple at all.
The average after 1000 seconds came out to be 1.0824 volts.
The simulation had shown a peak of 1.088v and valley of 1.074v with a midpoint of 1.081v. The ripple was pretty much triangular with slightly rounded peaks and valleys.
The diode voltage was also measured and found to be around 0.1v with the peak very slightly above that and points somewhat to the left and right of the peaks reached below that (a rounded top due to the changing dynamics of the diode) so 0.1v was used in the numerical approach. The diode curve can be substituted for the 0.1v constant drop in the program, but it didnt seem necessary.

The purely analytical technique is interesting because it creates a test bed we can use to measure the accuracy of other methods. It's much harder to calculate though because of the changing quantities.

The charge balance idea is interesting too and i would think would work when the output is fairly constant.
 
Last edited:
Fixed the typo.

The simulation had shown a peak of 1.088v and valley of 1.074v with a midpoint of 1.081v. The ripple was pretty much triangular with slightly rounded peaks and valleys.
The diode voltage was also measured and found to be around 0.1v with the peak very slightly above that and points somewhat to the left and right of the peaks reached below that (a rounded top due to the changing dynamics of the diode) so 0.1v was used in the numerical approach. The diode curve can be substituted for the 0.1v constant drop in the program, but it didnt seem necessary.

The purely analytical technique is interesting because it creates a test bed we can use to measure the accuracy of other methods. It's much harder to calculate though because of the changing quantities.

The charge balance idea is interesting too and i would think would work when the output is fairly constant.
With a diode drop of a constant .1 volt, and R1 equal to 6000 ohms, the method I described in post #24 gives a value of 1.0814 volts.
 

Tesla23

Joined May 10, 2009
542
I have done this two different ways and get different results. WBahn's and The Electrician's way is, I think, clearly correct. The transcendental equation I get from it is

\(\phi = \frac{2sin(\phi/2) - 2\pi\frac{R_1}{R_2}(cos(\phi/2)-V_D/V_S)}{cos(\phi/2)}\)

where \(\phi\) is the conduction angle in radians, and

\(V_O = V_S cos(\phi/2) - V_D\)

solving this I get
Vd Vo
0.4 1.0419
0.5 1.0288
0.6 1.0186
0.7 1.0024

which agree well with The Electrician's and WBahn's results.

What I don't understand is why my initial method gives different results. There I balanced the charge on the capacitor, when the diode was conducting the capacitor is being fed from a thevenin network with voltage

\(\frac{R_2}{R_1 + R_2}(V_S cos(\omega t) - V_D)\)

through a resistance

\(\frac{R_1R_2}{R_1+R_2}\)

If you do this, you get the relationship between the output voltage and the conduction angle as

\(V_O = \frac{R_2}{R_1+R_2}(V_S cos(\phi/2) - V_D)\)

and a different answer! When D is conducting, I can clearly replace everything but C with my equivalent circuit, but somehow it gives the wrong conduction angle.

OK - on previewing the post I see the problem, I am using my thevenin circuit to calculate the conduction period ending when the current into the capacitor is zero, not the current through R1. So I am missing part of the diode conduction period. Please ignore the equations in my earlier post.
 

MrAl

Joined Jun 17, 2014
11,389
Hello again,

Nice to see those other approaches here, very interesting and informative.

I finally got back to the purely analytical approach, and got through one charge cycle and one discharge cycle but before i do more i want to make sure i am applying the equations correctly. I have to look back in my notes for the full wave case to do that. In the mean time, the two results are:

{0.009966338259,0.0268994088,1e-16} charge
{0.02003358573,0.02661288601,1e-18} discharge

The first entry in each is the time t that the period for that mode ended, the second is the capacitor voltage at the end of the period for that mode, and the third entry is the approximate error limit of the time entry with a max about 10 times the value shown.

So the first charge period goes from the point where the sine equals the diode voltage (not shown, approximately zero) to the time t=0.009966, and at that time the voltage is about 0.026788v.
The cap then starts to discharge, and at time t=0.020033 the end of the discharge period is reached and the voltage is close to 0.026613 volts.

There was a difference in voltage from the simulation though, of about 500uv, which is probably caused by the assumption that the diode is a constant 0.1v drop at all times. The differences in the time points however are very very small, too hard to see.

Note that although the equations are all analytic now, a numerical solver is still required to solve for the mode transition times because there appears to be no analytical solution to the equalities that have to be solved during the process.
 
Top