RL Circuits and the General First-Order Method
A solenoid valve is switched off and a node that sat at is suddenly at , more than the supply, and of the opposite sign. Nothing is broken: an inductor is keeping its current flowing. RL circuits behave exactly like RC circuits with current and voltage swapped, and once you have seen both you can solve any circuit with one capacitor or one inductor in three numbers: the initial value, the final value and the time constant. This lesson builds that general first-order method and applies it to switching and to pulse trains.
The RL step
An inductor in series with , switched onto a DC source at , obeys KVL:
The current rises as and the inductor voltage falls as . Note the time constant is : a larger resistance makes an RL circuit faster, the opposite of RC. Units: .
The general method
Every quantity in a circuit with one storage element (and resistors and DC sources) obeys the same first-order ODE, so every quantity has the same form after a switching event at :
Three steps:
- Initial value . Find the storage element's state just before the switch, or , usually from the old DC steady state (capacitor open, inductor short). That state is continuous, so it is also the value at . Any other quantity at follows by treating the capacitor as a voltage source or the inductor as a current source .
- Final value : the new DC steady state.
- Time constant: or , where is the resistance seen from the element's terminals in the new circuit with independent sources zeroed (Thevenin and Norton Equivalents).
The same applies to every voltage and current in the circuit after that switching event; only the initial and final values differ.
Worked example: switching off an inductive branch
Given: the circuit above. The switch has been closed for a long time and opens at .
Find: and for , and where the stored energy goes.
Solve. Before (), the inductor is a short, so R3 is in parallel with R2: , total :
After, the source is disconnected. The inductor current continues down through R3 and L and returns up through R2, so the loop resistance is :
The same current flows upward through R2, so :
The stored energy is shared in proportion to resistance: in R2 and in R3.
Check: jumps from to while stays at : the inductor current is continuous, node voltages are not. The size of the jump scales with R2: had R2 been (a "harmless" high-value bleeder), would be about ( rises to ). That is the inductive kick of Inductors in Circuits.
Closing the switch again gives a different time constant: the inductor then sees , so , and rises from back to .
The lab below has the same decaying loop: in decaying through ( sets ). At it reads and , 36.8 % of the start.
Pulse trains
Drive an RC circuit with a square wave and the general method applies to every edge, each one starting from where the last ended. When the half period is long compared with , the output reaches both levels; when it is short, the capacitor never catches up and settles into a steady-state ripple between and . For a to square wave with 50 % duty and half period , let . Matching the end of the high half to the start of the low half gives
Their average is , the square wave's average: a slow RC circuit acts as an averager, the idea behind turning PWM into an analog voltage.
With and , : the output settles between and after a few periods. Slide to and the output follows the square wave; slide it to () and the ripple shrinks below peak-to-peak ( in the periodic steady state), while the average is still climbing towards (about at the end of the window).
In Python: one function for every first-order transient
import numpy as np
def first_order(x0, xinf, tau, t):
return xinf + (x0 - xinf) * np.exp(-t / tau)
# switching example
L, R1, R2, R3, V = 0.1, 30.0, 60.0, 20.0, 12.0
Rp = R2 * R3 / (R2 + R3)
iL0 = V / (R1 + Rp) * Rp / R3
tau_off = L / (R3 + R2)
tau_on = L / (R3 + R1 * R2 / (R1 + R2))
print(f"iL(0-) = {iL0:.3f} A, tau_off = {tau_off*1e3:.2f} ms, tau_on = {tau_on*1e3:.2f} ms")
for t in [0, 0.5e-3, 1.25e-3, 5e-3]:
iL = first_order(iL0, 0.0, tau_off, t)
print(f"t = {t*1e3:4.2f} ms: iL = {iL*1e3:6.1f} mA, va = {-R2*iL:7.3f} V")
print(f"|va| below 1 V after {tau_off*np.log(12/1)*1e3:.2f} ms")
# pulse train: simulate edge by edge, compare with the closed form
Vp, tau, Th = 5.0, 1e-3, 0.5e-3
v = 0.0
for k in range(20):
v = first_order(v, Vp, tau, Th); vmax = v
v = first_order(v, 0.0, tau, Th); vmin = v
a = np.exp(-Th / tau)
print(f"after 20 periods: {vmin:.4f} V to {vmax:.4f} V")
print(f"closed form: {a*Vp/(1+a):.4f} V to {Vp/(1+a):.4f} V")iL(0-) = 0.200 A, tau_off = 1.25 ms, tau_on = 2.50 ms
t = 0.00 ms: iL = 200.0 mA, va = -12.000 V
t = 0.50 ms: iL = 134.1 mA, va = -8.044 V
t = 1.25 ms: iL = 73.6 mA, va = -4.415 V
t = 5.00 ms: iL = 3.7 mA, va = -0.220 V
|va| below 1 V after 3.11 ms
after 20 periods: 1.8877 V to 3.1123 V
closed form: 1.8877 V to 3.1123 V
Guided lab: an RL time constant and its kick
Hand calculation. A inductor (winding resistance about ; measure it) in series with , driven by a to , square wave from a generator with output: , , final current .
Simulation. In the netlist lab: V1 in 0 PULSE(0 5 0 1u 1u 0.5m 1m), R1 in a 160, L1 a 0 10m, transient to .
What you would measure. Scope across the resistor (at the grounded end): the current rises and falls exponentially with . The inductor voltage, the difference of the two channels, jumps to on the rising edge and to about on the falling edge: here the generator gives the current a path, so no kick. Expect within (inductor tolerance and its resistance).
Hazards and safe setup. Low-voltage signals. If you instead switch a DC bench supply into a coil with a switch or transistor, fit a flyback diode first; without one, opening the switch produces a spike limited only by stray capacitance and arcing. Keep the supply current limit at about twice the expected coil current.
Pitfalls
- Using the old circuit for . The time constant belongs to the circuit after the switch.
- Assuming node voltages are continuous. Only and are. Compute other values from the circuit at .
- RL intuition from RC. In RL, larger means smaller .
- Pulse trains from the wrong start. The first few periods differ from the steady ripple; the closed form is for the periodic steady state.
Practice
- In the worked example, the switch closes again at (when ). Write after that.
- An RL circuit with and is connected to . How long until the current reaches ?
- A to PWM at 50 % feeds an RC filter with at . Estimate the ripple.
Answer
- , final , : .
- Final , : .
- , : peak-to-peak around .
Test yourself
The time constant of an RL circuit with and is…
In the general first-order method, the time constant is computed from…
- the circuit before the switching event
- the circuit after the switching event, sources zeroed, seen from the storage element
- the largest resistor in the circuit
- the initial and final values
Right after a switch opens, which quantity is guaranteed to equal its value just before?
- every node voltage
- the inductor current
- the inductor voltage
- the resistor currents
An RC circuit with much longer than the period of a 0 to 5 V, 50 % square wave settles to…
- a 0 to 5 V square wave
- a small ripple around 2.5 V
- a small ripple around 5 V
- zero