Time constant of a circuit involving resistors, capacitors ... and diodes - Page 1
Forum section: electronics / beginners

author: drdm
author_rank: Contributor
timestamp: July 15, 2024, 04:35:59 pm
content: Hello all,I came across an issue that I seem to be stuck on.I am trying to calculate the time constant of the attached circuit, but I don't know how to approach the problem.I want to find the voltage of OUT at a given time after the PNP is switched.Obviously I can simulate it on LTSpice, but i also need an equation.If I had only resistors the RC time constant is obvious - C1*(R1||R2||R3||R4). But the diodes throw me off. How do theyaffect the equivalent resistance of the circuit while charging the cap and how can I derive it in an equation?Any hints will be most welcome!

author: PGPG
author_rank: Frequent Contributor
timestamp: July 15, 2024, 06:14:58 pm
content: I've just registered to EEVblog. Don't know how to work here - for example when I started reply I see only your text, but not your schematic.Everything depends on what diode model you want to use.If these are ideal diodes with 0V drop on them then they conduct at once and you have circuit like there were no diodes.Next model you can use is the diode that start conduct at specified voltage. Then a question - these are germanium or silicon diodes?If silicon then assumed voltage will depend on expected current. But we don't know R. If current will be low (below 1mA) I would assume 0.6V as a moment when diode starts conduct. For higher currents 0.65V and for close to 1A may be 0.7V. I will use Ud as a symbol for voltage when diode starts conduct.At the beginning with time constant RC/2 capacitor is loaded from 0V to 5V. But when voltage reaches Ud it starts to be loaded from Vd with RC/3 time constant toward end voltage (10+Ud)/3. Then when voltage reaches 2Ud it starts to be loaded with time constant RC/4 toward end voltage (10+3Ud)/4.If you want to use nonlinear diode model then it is easier to use Spice

author: TimFox
author_rank: Super Contributor
timestamp: July 15, 2024, 06:18:02 pm
content: Since the currents are not linear functions of the voltages, the term "timeconstant" is not applicable.Instead, you need to write (or graph) the output vs. time for different applied voltages as a family of curves.A SPICE simulation is probably the practicable approach.

author: MrAl
author_rank: Super Contributor
timestamp: July 16, 2024, 04:11:30 am
content: Quote from: drdm on July 15, 2024, 04:35:59 pmHello there,Diode circuits can be very interesting, but they do present some problems that we do not see with perfectly linear circuits.One way of looking at this is that they create a change in topology based on the voltage across them at the time. In solving this kind of circuit we have to solve for voltage values and also time values. The time would refer to the time each diode turns 'on' or 'off' if we think of them as perfect switches. The other way to do it is to use a more advanced model for each diode, the exponential model. The perfect switch model will give you some idea what is happening overall though so let's look at that for a minute.Each diode has a forward voltage Vd associated with it let's call it 0.65 volts for now. As the voltage exceeds that voltage the diode turns on, and as the voltage goes below that the diode turns off. We'll say that the diode turns on at Vd=0.65 volts but after it turns on we'll call that zero volts. So what happens now.When the transistor turns on for the first time the capacitor has zero volts across it, and R2, R3, R4 and associated diodes also have zero volts across them. That means no diode turns on yet. That leaves just R1 and R2 in the circuit along with C1. The time constant for now would be C1 with R1 and R2 in parallel. In the notation R1|R2 for R1 in parallel with R2, that would be T=C1*(R1|R2). That is until the voltage across C1 becomes 0.65 volts.Once that voltage gets to 0.65 volts, R3 gets switched into the circuit. That puts another resistor in parallel: R1|R2|R3. R4 is still out of the circuit. This means the time constant would be T=C1*(R1|R2|R3). Once the voltage across C1 gets to twice 0.65v, R4 would switch into the circuit so the time constant would now be T=C1*(R1|R2|R3|R4). We also have to consider the voltage divider effects though which would mean there would be a different ratio as each diode switched into the circuit.So this condition would exist for some time until the transistor turns off, and then the starting time constant would be T=C1*(R2|R3|R4) because R1 is no longer in the circuit, and then after D2 and D3 turn off T=C1*(R2|R3) and then finally T=C1*R2 until the voltage falls to zero.That is just a rough estimate of what happens. In reality we do not lose the voltage across each diode so that contributes to the resistance in that branch. If we call the dynamic resistance of each diode r(D) then the branch with R3 has resistance R3+r(D) and the branch with R4 has resistance R4+2*r(D).This can give you some idea what is happening, but to get a better solution we would just solve for the times the diode turns on and then just assume a change of topology. When we assume a change of topology, that means we take the final conditions of the previous topology and apply that as the initial conditions to the new topology. That gives us a good solution.The first topology would be with R1, C1, and R2. We would then solve for the voltage across the diodes. Since D1 turns 'on' first, then next topology would involve R1, C1, R2, and R3 along with the voltage across D1. As the voltage rises more, the next topology would involve all the parts R1, C1, R2, R3 with D1 voltage drop, and R4 with D2 and D3 voltage drops. When the transistor turns off, the topology remains the same except for R1 which is no longer in the circuit. We then solve for the diode voltages again and switch topologies in the reverse order.When we assume a forward voltage drop for each diode as it turns on, that means we place an ideal voltage source in series with that diode. When the diode is off, we replace it with an open circuit (or allow r(D) to go to infinity).This gives us a decent approximation to what happens.One extra thing here is you have to know how to handle circuits with capacitors that have initial values like the initial voltage across the capacitor. That's because you have to be able to apply the final conditions of one topology to initial conditions of the new topology once the diode turns on. In the case where we say that diode D1 turns on at 0.65 volts, that would mean the next topology would have to start with the capacitor voltage at 0.65 volts not zero volts, and that makes it a little different than usual. The only way to use the concept of a time constant then is to subtract the initial voltage of the cap, solve that, then later add that back to the cap voltage. It can be a little tricky. The math expression for a charging cap without an initial condition would look like this:Vc=E*(1-e^(-t/RC))but with initial voltage v0 would look like this:Vc=(E-v0)*(1-e^(-t/RC))+v0where you can see the initial voltage v0 being subtracted from E (the source) and then added back after the multiplication.This might be a little more than you want to get into right now.To show this in a clearer way, if we define:K=1-e^(-t/RC)then with zero initial condition we have:Vc=E*Kand with a non zero initial condiction we have:Vc=(E-v0)*K+v0Moving forward...Now we can look at adjustments to make it even better. The first is we could place another resistor in series with each voltage source we use to represent the forward voltage of each diode. That gives the diode a more linear characteristic and that's a decent upgrade to the diode model which is used in different cases.To get better than that, we would add a few other things, but ultimately replacing the diode with an exponential model allows the diode to actually look like a real diode. The only problem is the equations get much harder to solve by hand. Even with math software it can get tricky.So there you have an overview of finding solutions to circuits with diodes in them. To make it clearer it would wise to start with just one diode (like D1) and remove R4 and D2 and D3 for now. Once you find out how this works with one diode, you can take it to any number of diodes.This reminds me a lot of those sine shaper circuits that use diodes. They take a triangle wave input and shape it into a pseudo sine wave.