C2 · Lesson 19 · Second-order lab
RLC step responses in every damping regime, measuring overshoot and settling, designing for a target, and finding Q from a sweep or a ring-down, in Python
Lessons 15 to 18 described second-order circuits with three numbers, , ζ and Q, and formulas for overshoot, settling and bandwidth. Engineers check those formulas against waveforms: they measure an overshoot off a scope trace, read Q from how fast ringing dies, and adjust a resistor until a response meets its spec. In this lab you'll write the exact step response for every damping regime, measure it the way a scope would, design a resistor by bisection, and extract Q two independent ways.
- The curve is a series RLC's capacitor voltage for a 1 V step, normalized to the natural frequency, for the damping ratio on the slider.
- Below ζ = 1 it overshoots and rings; at ζ = 1 it rises as fast as it can without overshoot; above 1 it creeps up.
- The readouts give the overshoot formula's value and the rule-of-thumb 2% settling time, . Step 2 measures both from samples.
Predict
A series RLC has ζ = 0.5. How does its measured 2% settling time compare with the rule of thumb ?
Within a few percent: for ζ = 0.5 and = 1000 rad/s the rule gives 8.0 ms, and the response last leaves the ±2% band at 8.08 ms. The rule comes from the envelope reaching 2%, which is ; the oscillation's phase decides exactly when the last crossing happens.
Name it
The step response, three ways
For a series RLC driven by a unit step from rest, with and , the capacitor voltage is:
- underdamped (ζ < 1): , with ;
- critical (ζ = 1): ;
- overdamped (ζ > 1): , with .
Measuring like a scope
From samples: overshoot is the peak minus the final value, as a fraction; the 2% settling time is the last time the response is more than 2% from final. Both should match the formulas, and about .
Designing to a target
Inverting the overshoot formula gives , and then . A bisection on R that simulates and measures does the same without the algebra, which is how you'd tune a real circuit, or one with no formula.
Q two ways
For a parallel RLC, Q is the center frequency over the half-power bandwidth, and equals . From ringing, successive peaks shrink by the logarithmic decrement , and for light damping. A sweep and a ring-down should agree.
Worked example
A series RLC has L = 10 mH, C = 100 nF and R = 20 Ω. How much does its step response overshoot, and what if R is raised to critical damping?
Show the solution
- Damping ratio.
- Overshoot. so it swings to 1.905 V for a 1 V step, ringing at about 5 kHz.
- Critical damping. It needs and then the response never overshoots.
- How fast it gets there. At (31.6 µs) it has reached = 0.264 of the way, the fastest approach possible without crossing the final value.
Answer with 20 Ω the overshoot is 0.905 of the step (1.905 V for a 1 V step); with R raised to the critical 632 Ω, there is no overshoot at all.
Worked example
Choose R for 10% overshoot with L = 10 mH and C = 100 nF.
Show the solution
- Log of the overshoot.
- Damping ratio.
- Resistance.
- Check by simulation. A bisection that simulates the response and measures its overshoot lands on the same 374 Ω.
- With standard parts. You'd fit 390 Ω and get 8.5%, or add a smaller resistor in series to trim it.
Answer R = 374 Ω; the standard 390 Ω gives 8.5%.
Worked example
A ringing waveform's peaks are 1.000, 0.933, 0.871 and 0.813 V. What's the Q?
Show the solution
- Ratio of successive peaks. Each ratio is close to 1.072.
- Logarithmic decrement.
- Q.
- A better estimate. Averaging over many peaks, by fitting a line to the logarithm of the peak heights, beats using one pair.
- Cross-check. The same Q measured as center frequency over bandwidth in a sweep should agree, a useful check that the circuit really is second order.
Answer Q is about 45.
Check
Step 1. Write rlc_step(R, L, C, t) returning the capacitor voltage of a series RLC for a 1 V step from rest, at the times in array t, for any damping.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 2. Write measure(t, v, final) returning (overshoot, settle): the overshoot as a fraction of final, and the last time |v − final| exceeds 2% of final (the time after that sample).
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 3. Write r_for_overshoot(L, C, target) returning the series resistance that gives the target overshoot fraction, by bisection on R using simulated responses and your measure-style overshoot.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 4. Write parallel_q(R, L, C) returning Q = center frequency ÷ half-power bandwidth, found by sweeping the parallel RLC's impedance magnitude on a fine grid around resonance.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 5. Write ringdown_q(t, v) returning Q from a ringing record: take each cycle's peak as the largest sample between successive upward zero crossings, fit a line to the logarithm of the peak heights against cycle number, and use with δ the decrement per cycle.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
A series RLC has L = 1 mH, C = 10 nF and R = 50 Ω.
(a)
What's ζ?
(b)
How much does its step response overshoot?
Check
What damping ratio gives 5% overshoot?
Check
Two successive peaks of a ringing waveform are 1 and 0.9 V. About what's the Q?
Check
A second-order response has ζ = 0.5 and = 1 krad/s. Roughly how long does it take to settle within 2%?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
Explain why
Why can Q be measured either from a frequency sweep or from a ring-down, and why should they agree?
Q describes one property of a resonator, how much energy it stores compared with how much it loses per cycle. In the frequency domain, that ratio sets how narrow the resonance peak is: a resonator that loses little per cycle responds strongly only very near its natural frequency, so the half-power bandwidth is . In the time domain, the same loss per cycle sets how quickly free oscillations die: each cycle the amplitude shrinks by a fixed fraction, about . Both measurements read the same energy balance, so for a true second-order circuit they agree. If they don't, the circuit has more than one resonance, or its losses depend on amplitude.
Practice
Keep practicing
6 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.