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

I think it’s correct.

Start a timer when the voltage is at zero and rising. Sample the current. (One idea is to sample the voltage across the resistor, and simply look for 0 V.) When the current goes to zero, stop the timer.

Let’s say the current goes to zero 0.005 seconds after the voltage crosses through 0 V. In seconds, the phase difference is 0.008333 s - 0.005 s = 0.003333 s. In terms of angle, 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 Ω

I also used LTspice to simulate the circuit, and the current goes to zero at… 0.005 seconds, exactly as predicted:

Do your simulation with R - 1MΩ and C = .1 µF, tell me what the voltage on C is at t = 8mS.

That video makes a meal of the math, IMO. It can be (somewhat?) more straightforward.

Let V_c(t) be the instantaneous voltage across the capacitor. Let V_s(t) be the source voltage, which has the form:

V_s(t) = V_0\sin(2\pi f t)

with V_0 a constant (the peak source voltage).

The stored charge Q and capacitance C are related by Q=CV_c. The voltage across the resistance R is V_r=IR = \frac{dQ}{dt}R. Requiring the voltage drop around the full loop to be zero thus yields:

V_s(t) = \frac{dV_c}{dt}RC + V_c(t)

This is a first order non-homogeneous linear differential equation. As noted above, the solution will be the sum of the steady-state driven behavior and the transient behavior of an undriven RC circuit. The steady-state behavior could be solved using complex impedances or directly by ansatz. To do the latter, plug the particular solution

V_{c,1}=A\sin(2\pi ft+\phi)

into the differential equation and solve for A and \phi by requiring the solution to work for all times. You’ll get A=\frac{V_0}{\sqrt{1+(2\pi fRC)^2}} and \phi=\tan^{-1}(-2\pi fRC).

The transient solution (found when V_s(t) is set to zero) is just the usual exponential RC decay with a to-be-found amplitude B:

V_{c,2}=B e^{\frac{-t}{RC}} .

Add these together and use your initial condition of V_c(0)=0 to find B:

B=-A\sin \phi .

For tidiness, define \alpha\equiv 2\pi f RC. Then putting it all together yields:

\frac{V_c(t)}{V_0} = \frac{1}{\sqrt{1+\alpha^2}}\sin(\frac{\alpha}{RC}t + \tan^{-1}(-\alpha))+\frac{\alpha}{1+\alpha^2}e^{\frac{-t}{RC}} .

For these values, I get 0.051 times the peak source voltage at 8 mS. Will be interesting to see if @Crafter_Man’s SPICE simulation concurs. I didn’t go through my math with a fine-toothed comb.

I’m back-calculating the resistance per the OP. At any rate:

Let’s say the current goes to zero at t = 0.00826 seconds. In seconds, the phase difference is 0.008333 s - 0.00826 s = 0.00007035 s. In degrees, the phase difference is φ = -(0.00007035)(360)/0.016667 = -1.520 degrees = -0.0265 radians.

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

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

R = -1/( 2 π (60) (0.1E-6) tan(-0.0265) )

R = 1 MΩ

I also used LTspice to simulate the circuit, and the current goes to zero at 0.00826 seconds:

My graph-and-check version gets 0.222 times peak source voltage at 8 ms, or ~150 V (but I’m trusting the solver here).

In steady state, the voltage across the capacitor acts as the output of a low pass filter, so for the suggested values of f = 60 Hz and 1/(RC) = 10 Hz, I’d expect more attenuation even in the transient regime.

For what it’s worth, here is a graph of my solution using the suggested values:

Imgur

showing the transition from transient behavior to steady-state behavior. And here’s a zoom in on the first couple of oscillations:

Imgur

Yeah, pretty sure I screwed up my time variable. In fact I know I did–that sin(t) needs to be sin(60 \cdot 2 \pi \cdot t). I guess I was thinking I could just scale later, but that doesn’t work. I’ll try it again later with fixed units.

I think it’s mostly ok otherwise, though. The (sin(t) - RC*cos(t)) just another way of getting the phase shift. Both solutions are a phase-shifted sinusoid plus an exponential decay, as one would expect.

I recall a time when my lab partner and I were scratching our heads trying to figure out why our answer was off. We finally realized we forgot to multiply (or divide) by 2 \pi
So from then on when working on a problem we would say "do we need to use 2 \pi?
(Even when it wasn’t relevant…)
Brian

Related: there’s a maxim in computer graphics that you should always make an even number of sign errors.

I appreciate all the answers.
I’ll have to play with some of the equations and graphers later, when I have some time.
One thing I would like to point out, though: For this application, I’m only interested in the time from the first zero-crossing to the next, i.e. - the first positive half-wave. The voltage across C during this time period is all that matters to me (since the circuit gets reset when the voltage across C reaches some arbitrary V).

Fixed my formula and I get the same (0.0508, but close enough). The Desmos plot looks much more like yours now:

The capacitor voltage reaches its maximum at very nearly the zero crossing (at 8.2 ms vs. 8.33 ms). The resistance is so high that it never charges up much and therefore the source voltage is higher than the cap voltage until nearly the very end.

That sounds correct.
Now, I need to use the formula to calculate what resistance is required for the capacitor to reach, say, 28V at time = 7mS (I’ll need to get this time more exactly, but this is the idea).

Looks like t somewhere between 6 and 6.5 mS would be perfect.
6mS gives an instantaneous voltage of 261v, 6.5mS is 216v

For what R and C values? It was never clear to me what items were fixed and what were adjustable in your setup. (Just asking so that you can have another set of eyes on the math. For the R and C values quoted in various posts above, you won’t get anywhere close to 200 V on the capacitor ever.)

Let’s assume that the C value is fixed at .1µF, and R is completely adjustable.
The “trip” voltage across C is going to be close to 28V.
I need it to reach that voltage after 6mS , but not longer than 6.5mS (although there is some leeway in those values).

If R ended up being too small (like, under 100KΩ), I could decrease C. A small R would mean more power dissipation, so I’d want to increase it (R, that is).

Here’s what I get:

For 1.0 MΩ, 0.1 µF: V_c at 6 ms is 28.8 V and at 6.5 ms is 31.0 V,

For 1.1 MΩ, 0.1 µF: V_c at 6 ms is 26.2 V and at 6.5 ms is 28.3 V,

And you’ll be dumping about a quarter watt in the resistor.

(Edit: To add the obvious, the level of precision quoted is assuming idealizations elsewhere. Realities of the switching circuits may be relevant.)

That’s great!
When I prototype it, I’ll measure the actual voltages and see how close it gets.