# Analyzing RC-circuit with diode

I'm trying to make an explanation for the behavior of the following RC-circuit with a diode pulled up to 12V. The input signal is a square wave alternating from -7V to 12V. My intuition is that the diode pulls up the output to 12V - Vff, and then reflects the input signal at the output offset by that voltage, so that the output is a square wave from 11.4V to 30.4V.

However, I have a hard time solving this mathematically, so help would be appreciated.

simulate this circuit – Schematic created using CircuitLab

Well the lowest voltage on the output cannot be less than 11.3 volts (one diode drop from 12V) and given that your 19 volt p-p square wave attaches itself to the output when the lowest point hits 11.3 volts, the final output has to range from 11.3 volts to 19 volts higher at 30.3 volts.

Virtually same answer as you - just a difference in what I assumed the forward volt drop of the diode to be. Given that the square wave is 50 MHz the 100k pull down resistor might reduce the peak output by around a milli volt or so.

Also no problem with the capacitor at 50MHz - it'll sail straight through. Given that the diode is really fast you won't get much of an issue with the diode's reverse recovery time response.

• Thank you. Yes, I have the right intuitive understanding, and simulations agree, but how do you set up equations and solve this analytically? – Pål-Kristian Engstad Oct 30 '15 at 17:17
• Well why should you? It's solved by looking at it a lot quicker than the maths. – Andy aka Oct 30 '15 at 17:24
• Good point. Now, the reason I am asking is that I tried to do it mathematically, setting up differential equations and such, but failed. I'm hoping someone is willing to show me how it is done! – Pål-Kristian Engstad Oct 30 '15 at 17:29
• You might have problems due to the non-linearity of the diode. – Andy aka Oct 30 '15 at 19:32

As you've seen above, I had the right intuitive understanding of the circuit. However, I guess I wanted a little more rigorous explanation, which I have now worked out, and therefore I will attempt to answer my own question.

The definining equations are the diode equation: $$i_d = F_d(v_d) =I_s e^{v_d/V_T}$$ The capacitor equation: $$i_c = C v_c$$ The resistor equation: $$i_r = v_r / R$$ Current balance: $$i_c + i_d - i_r = 0$$ Voltages: $$v_r = v(t),\quad v_d = 12 - v(t),\quad v_c = v_\text{in}(t) - v(t).$$ This results in the following non-linear differential equation, that can only be solved numerically: $$C \cdot v'(t) - F_d(12-v(t)) + v(t)/R = C\cdot v_\text{in}'(t).$$

However, we can simplify our circuit by approximating the diode with a 0.7V voltage source in series with a virtual switch. The switch is on whenever $$v_d > 0.7V\text{ i.e. when }v<11.3 V.$$ This means that if the voltage v is less than 11.3V it will be forced to 11.3V due to the short between the virtual voltage source and the output node. Therefore, we will assume that v is more than 11.3V from now on.

When the switch is off, we have an open circuit, with a capacitor in series with a resistor. We get $$C v'_\text{in} - C v' = v / R \implies v'(t) + \frac{1}{RC}v(t) = v'_\text{in}(t).$$ We can solve this using Laplace: $$s \cdot V(s) - v(0) + \frac{1}{RC} V(s) = L\{v'_\text{in}(t)\}$$ Or: $$V(s) = \frac{1}{s+1/RC} L\{v'_\text{in}(t)\} + \frac{1}{s+1/RC}v(0)$$

We are interested in fast (1 us) pulses from Vin = -7V to 12V. Assume that $$v_\text{in}(t) = 19 \cdot H_0(t) - 7$$ Then $$v'_\text{in}(t) = 19 \delta(t)$$ So $$L\{v'_\text{in}(t)\} = 19$$ So, with v(0) = 11.3 and RC = 0.1 we get: $$V(s) = \frac{19}{s+10}+\frac{11.3}{s+10} = \frac{30.3}{s+10}$$ Taking the inverse Laplace we get: $$v(t) = 30.3 \cdot e^{-10t},\quad t>0$$ Finally, since we are interest in 1 uS, 10 t will be very small, so we can approximate the exponent with $$e^{-10t} = 1.$$ So, we see that the output is simply a step function that starts at 11.3V and steps up to 30.3V, a difference of 12V + 7V = 19V. By symmetry, when the input goes from 12V to -7V, the output will go from 30.3V back to 11.3V.