A problem for people who love math [calculating component values in an electrical circuit]

I am designing a circuit that requires a resistance value to be calculated (or measured).
Measuring it would be pretty simple, but I would like to know if the value can be calculated.

Given an 60Hz AC input at 480v, charging a capacitor of value C, through resistance R, how long does it take to develop voltage V across the capacitor, starting at 0 volts (for both the initial voltage across the capacitor, and the AC supply voltage.

If this was DC, it would be simple:
VC= Vs (1 -e(t/RC))

But - this is not DC - it’s an AC sinusoidal waveform, so the voltage across the RC circuit is always changing. My math skills were never that great, and this looks like a job for an Integral, which is more than I have in me right now.

Anyone want to give it a shot?

My first thought is to measure the phase angle between the voltage and current, or the power factor. From this, and knowing the value of the capacitor, you should be able to back-calculate the value of the resistor.

Hey, @Bob_Blaylock, this one should be easy for you, being an electrician with an associate’s in electronics. :slight_smile:

One thing that might not be clear:
I’m only interested in 1/2 of the wave. Let’s just consider the positive half for now.
The circuit will use both polarities, but they should be symmetrical, so it can be assumed that the capacitor always starts at 0 volts when the input voltage is also 0.

Seems like a pretty tricky differential equation to me. There’s no guarantee the capacitor will reach any particular state of charge at all, since it will discharge when the voltage starts going down and then into the negative.

Also, I don’t think it’s true that the capacitor will be at zero when the voltage is zero. There will be a phase shift on the capacitor voltage.

It’s not clear to me that this is true. I’d expect there to be a phase difference, which means they cross zero at different times.

I’d used to be able to solve this sort of equation in my sleep. It’s basically “guess” a sine wave and check that it satisfies the differential equation.

(Ninja’d.)

The capacitor gets discharged when it reaches voltage V, and stays shorted until the input voltage goes to 0 (or close to it). For this application, a few volts (instead of 0) on the capacitor are OK.

Moderator Note

I have updated the title to more clearly indicate the topic. Please use descriptive titles.

I’m now at a loss of what your circuit actually is. What’s shorting the capacitor?

Well, if my math is correct, then

R = -1/(2 π f C tan(φ)), where

φ = phase angle of voltage - phase angle of current
C = capacitance of capacitor (F)
f = frequency (Hz)

A DIAC or SIDAC.

I don’t think we need the instantaneous voltage across the cap.
The impedance is 1\over j \omega C where \omega = 2\pi f
So given a known f (60 Hz), and a known C, the impedance is known.
Then (guessing the cap and resistor are in series) measure the RMS voltage across one and from there you can calculate R.

Brian

No, that won’t work.
This is not a classic phase-shift circuit.
The easiest way to think about this is a half-sinusoid charging a capacitor C through resistance R.
The voltage across the RC starts at 0 at t = 0, and then sinusoidally rises to 340V at t = 4.17mS, then starts to fall, reaching 0 at t = 8.33mS. Note that the capacitor might continue to charge even as the voltage is falling, if the resistance is large enough.

I’m interested in calculating the voltage across the capacitor for any time t ( 0 < t < 8.33mS), or, even better, the time t when the voltage across the capacitor is V.

Those who are familiar with electronics might recognize this circuit as a classic TRIAC light dimmer, although I am not using it for this purpose. I need to chop 480V to something more reasonable to feed to another device

Ah, I misunderstood. Is this of any help?

https://www.electronics-tutorials.ws/accircuits/series-circuit.html

Brian

Oops, hold on…

As the voltage is increasing at t = 0, start a timer. Sample the current using an ADC. Keep sampling the current as the voltage goes up, then down. When the current goes to zero, stop the timer.

Let’s say the current goes to zero at t = 0.005 seconds. In seconds, the phase difference is 0.008333 s - 0.005 s = 0.003333 s. In degrees, the phase difference is φ = -(0.003333)(360)/0.016667 = -72 degrees = -1.257 radians.

Let’s say the capacitor has a capacitance of 10 μF. The resistance of the series resistor would be:

R = -1/(2 π f C tan(φ)).

R = -1/( 2 π (60) (10E-6) tan(-1.257) )

R = 86.2 Ω

That’s back-of-the-napkin, and I can’t guarantee there’s not a math mistake. Hopefully someone can check my math.

I don’t think this is correct.
Think of it this way:
With R = 0, the capacitor voltage will track the input voltage essentially perfectly.
With R = infinity, the capacitor voltage will always stay at zero.
With R = some large value, the capacitor voltage will rise during the entire half-cycle, reaching its maximum just before the input voltage goes to zero, at t = 8.33mS. In this case, the maximum voltage the capacitor reaches is very low.

It is fairly complicated, and it does involve differential equations. The solution (the voltage across the capacitor as a function of time) has two parts, a transient response (due to the turn-on of the un-energized circuit) and a steady-state response (the sinusiodal output after the transient has died off). Here is a good step-by-step derivation of the solution using Laplace transforms to solve the differential equation:

Thanks for that.
I suspect that I could prototype my circuit with a potentiometer and use an oscilloscope to measure the voltage much easier than attempt to understand all that math…

Without watching the video:
Current through a capacitor is I=C\frac{dV}{dt}. And through a resistor is I=\frac{V}{R}. So we can formulate the diffeq (with y as the cap voltage) as:
Cy' = (V sin(t) - y) / R
(V is peak voltage here, not RMS)

My diffeq abilities were pretty bad even in college, and are worse now. But I plugged it into a solver and got:
y=\dfrac{v\,\sin\left(x\right)}{{c}^{2}\,{r}^{2}+1}-\dfrac{c\,r\,v\,\cos\left(x\right)}{{c}^{2}\,{r}^{2}+1}+\dfrac{C}{{e}^{\frac{x}{c\,r}}}
(big-C is the constant of integration here, not capacitance)

Looks basically reasonable on Desmos:

You’ll have to tweak the sliders to compute C such that y(0)=0.