1

schematic

simulate this circuit – Schematic created using CircuitLab

For the above circuit I want to know if there is a formula that can give me the capacitor voltage as a function of time. I'm not interested in developing or deriving such a formula myself; I just want to know if such a formula already exists.

In this circuit what we know is the amplitude, frequency of the source, the resistor value and the capacitor value, diode is as it is (Vf). Because of the tau value is so big I don't want to run the simulator everytime to calculate the total charge time so a formula would help so much.

Elliot Alderson
  • 31,192
  • 5
  • 29
  • 67
GNY
  • 41
  • 4
  • 2
    To reach the exact value takes infinite time. – Andy aka Apr 27 '22 at 13:02
  • @devnull let's say I want to calculate the total charge time that it takes to charge to the %90 percent of the source , Is there a formula for this ? The fact that is that I want to calculate it with a formula without using a simulator or pc . – GNY Apr 27 '22 at 13:07
  • @Andyaka how about the time it needs to reach the %90 percent of the source ? You have a mathematical approach or formula ? – GNY Apr 27 '22 at 13:08
  • 1
    Why don't you run a simulation and observe the current and capacitor voltage? This might give you some ideas of how you could represent the charging time mathematically. Please also explain why you **care** about this...if you explain what you are actually trying to do then someone may have an alternate solution. – Elliot Alderson Apr 27 '22 at 13:43
  • 2
    @ElliotAlderson what if I don't have a simulator or maybe the battery of my pc is down or I'm away from the PC , can I not want to know how to calculate it with a pencil , paper and a calculator with a formula ? I simply care if there is a "mathematical expression of the time that it takes the capacitor to charge of to its x percent" .. Simply "care this " simply ... – GNY Apr 27 '22 at 13:52
  • 3
    @All - We continue to get flags on comments which don't respond to the specific question here. The OP wants to understand if there is a mathematical approach or formula to *calculate* this and *does not* want to run a simulator each time. Therefore comments which just say to run a simulator come across as unhelpful (even passive-aggressive) since they are deliberately ignoring the constraint in the question. Please don't do that. Those comments are being counted and deleted. Remember: You don't have to comment, so either be *constructive & friendly* or don't comment. Thanks. – SamGibson Apr 27 '22 at 14:31
  • 2
    At a first attempt, I considered \$\tau = P2RC\$, where P is the [universal parabolic constant](https://en.wikipedia.org/wiki/List_of_mathematical_constants), however this isn't holing true for different values. The answer will have a non-linear component in it. – rdtsc Apr 27 '22 at 15:49
  • 3
    Do you want to consider an ideal diode (e.g. zero ON resistance, or some finite, *fixed* value), or a (quasi-)real case? If it's the former then it's a simple matter of an RC time constant, 1-exp(-t/tau); if it's the latter then you'll end up with a [LambertW function](https://en.wikipedia.org/wiki/Lambert_W_function) (see [this post from jonk](https://electronics.stackexchange.com/a/565393/95619), for example). – a concerned citizen Apr 27 '22 at 17:50
  • 1
    The time for the level of charge @95 % can be calculated by R1*C1*25 (in most cases). – Antonio51 Apr 27 '22 at 21:09
  • This circuit is non-linear and doesn't look analytical to me. It is not conducive to hand calculations, particulary because the RC time constants that you stated you are working with are very long compared to the frequency of your source which spreads the charge out amongst multiple cycles, each with a different starting voltage and starting time within the half cycle picking up after the previous. It feels like to solve it cleanly by hand you need to artificially decrease the source frequency so the charge finishes in one cycle and rescale that across multiple faster cycles with "dead time". – DKNguyen Apr 28 '22 at 04:53
  • 1
    @Antonio51 , Could you please explain a bit more where this R1*C1*25 approach comes from ? – GNY Apr 28 '22 at 05:54
  • Very empirical... We can consider that the circuit is a charge pump. The capacitor charges in successive cycles where its voltage gradually increases. After several simulations...I found that the 95% time was quite "constant" and could be obtained by this "approximate" formula. It is "constant" even if the sinusoid starts with another initial phase. – Antonio51 Apr 28 '22 at 06:03
  • 1
    @Antonio51 , Once again , I would really appreciate if you could explain where it comes from , because it almost approximates to what spice outputs . – GNY Apr 28 '22 at 06:33
  • @GNY Would it be correct to assume that the goal here is to obtain an approximation similar to the equation for ripple given the capacitance and load current? Something that provides a rough estimate, which allows you to choose between a 1mF or 100uF capacitor and it does not matter if it is 10% or 20% off? – devnull Apr 28 '22 at 11:21
  • @devnull I was only curious about how Antonio51 come up with R*C*25 approximation , the main goal of course is having an expression and getting theoretical certain values. – GNY Apr 29 '22 at 04:34
  • Correcting a little. From my picture, if **tau=R*C=1**, then the **"intercept"** point at **level 95 %** is in fact **27**. I said roughly 25, because then, it is easy to multiply by 100 and divide by 4 the value of tau. – Antonio51 Apr 29 '22 at 06:49

2 Answers2

2

Whenever V1 is above V(C1)-0.7V (approximately), the capacitor charges, according to the following differential equation:

$$ \frac{{\rm d}Q}{{\rm d}t} = \frac{V_R}{R}, $$

where \$Q\$ is the charge on the capacitor, and \$V_R\$ is the voltage across the resistor. The resistor acts as a voltage-to-current converter, and the capacitor acts as an integrator for that current. Since \$C=Q/V_C\$, \$V_R \approx V_1- V_C-0.7{\rm\ V}\$, and \$V_1(t)=A\sin(\omega t)\$, we get

$$ RC^{-1}\frac{{\rm d}V_C}{{\rm d}t} = A\sin(\omega t) - V_C - 0.7{\rm\ V}. $$

This differential equation would have to be integrated for each time period when \$V_1>V_C\$. Since it is linear in \$R/C\$, you can solve it once, e.g. by simulation, for \$R=C=1\$, and then rescale the solution for any R and C you want. If the diode is assumed to be ideal, i.e. with \$V_F=0\$, the solution is linear in \$A\$ as well, and of course it scales with time according to \$\omega\$. So you really can just stick it into CircuitLab, set \$R=C=A=1\$, get a plot, and then just change the units on the time and voltage scale, and the solution will be valid. Play with it by changing R, C and A, and look how the plot will change. You'll immediately know how to rescale the prototypical plot :)

Here's the prototypical circuit:

schematic

simulate this circuit – Schematic created using CircuitLab

And here is its voltage-vs-time plot:

enter image description here

The time units get multiplied by the values of R and C, e.g. the right hand side of the plot is at 30s. With R=10, C=1, it'd be 300s. With R=1, C=0.2F, it'd be 6s. The voltage scales linearly with amplitude of the sine wave, e.g. for 100V, the asymptote is at 100V, not 1V. Easy, right?

And then you can fit a polynomial or any other function of your liking to this plot and see what comes out :)

  • @Kubahasn'tforgottenmonica thanks for your approach , when I try to solve the equation I get Vc(t) = integral(Asin(wt)*e^t*dt)/e^t . At this stage I have to accumulate the 't' values for the conditions V1(t)>Vc(t) , am I correct ? – GNY Apr 28 '22 at 05:45
  • 1
    @GNY And remember that the charging time during each half wave decreases as the capacitor charges, so the integration interval is not constant. – Elliot Alderson Apr 28 '22 at 09:33
  • @GNY There's no closed form solution to this because it has to be integrated over discrete time intervals and then summed. It's a hybrid continuous-discrete problem. So you can just simulate it once, plot out \$V_C(t)\$, for C=R=A=1, and then just rescale it. The voltage scales with R. Time scales inversely to C, i.e. if C is doubled, the time units are doubled as well, and so on. Back in the days when SPICE was a luxury, you'd plot this on a chart recorder, stick it in your notebook, and rescale as needed. Handy. – Kuba hasn't forgotten Monica Apr 28 '22 at 12:01
  • *"then you can fit a polynomial or any other function"* Like one based on a logarithm.. ;) Under certain premises (voltage large enough so that even 5% of it is much more than the diode voltage drop; series resistance large enough compared to the diode, many charge cycles due to RC >> 1/Hz etc). That's it: a good and quick estimate. – devnull Apr 28 '22 at 12:16
  • @gny I never said you said that. What I did say was you seem to be under that impression from your request for a pre-cooked calculation to be done by hand. Maybe not "simple and basic" so much as "stripped down enough to be a canned problem" or "cannable" if you will. Sort of like manufactured problems that just happen to have tidy solutions for teaching purposes. – DKNguyen Apr 28 '22 at 13:17
  • 2
    @All - Due to multiple flags here, we've had to delete *yet more* comments e.g. due to people creating "strawman" arguments, and attacking the OP's question through those. And then other people have got angry about that injustice. *Please* [be nice ... be welcoming and patient](/help/behavior), as the site rules require *everyone* to be. Don't try to guess intent. If something is important to know then *ask* - don't *assume* and then criticise based on that assumption. Don't misquote people. Don't criticise the question in a way that feels personal, see the [CoC](/help/conduct). Thanks. – SamGibson Apr 28 '22 at 13:33
1

As @Kuba hasn't forgotten Monica stated, it is a recurrent equation, so the solution is also recurrent. Calculating is possible, but "longest" ... And recurrent equation can't always be "reduced" to a simple easy equation.

EDIT: The "solution" can't be reduced to an exponential equation.
Updated picture with "nearest" exponential function.
In the beginning, it is quasi exponential (until 50% ok, but can't justify -until now- the exponent), but after it diverges quickly.

Note: as the amplitude of the sinusoid is "big", one can forget the diode, except that it locks the charge.

So, I made a simulation ...
You have also the "answer" for any "%" charge.

enter image description here

Antonio51
  • 11,004
  • 1
  • 7
  • 20
  • Thanks for the effort by the way . Which simulator program is that ? – GNY Apr 28 '22 at 06:39
  • 1
    Free simulator microcap v12, http://www.spectrum-soft.com/download/mc12cd.zip – Antonio51 Apr 28 '22 at 06:41
  • 2
    @Antonio51 Now that you have the simulation set up, can you tell the OP and the rest of us how long it takes to run if we, say, change the capacitor value? Does it take longer than the time needed to calculate the result by hand from a differential equation? I'm betting the simulation is faster and the OP's objection to simulation is disingenuous. – Elliot Alderson Apr 28 '22 at 09:31
  • Between loading file (after drawing it :-) ), slowly changing values, running on i7 Intel Core takes 10 s? For a newbie, it should take a bit "longer". Note that axes are adapted automatically with the use of microcap text "litteral" instructions and embedded "calculators". – Antonio51 Apr 28 '22 at 13:08