Phase margin and the step response

Measure the phase margin of an op-amp loop, connect it to the overshoot and settling of a step, and see why a unity-gain buffer is the hardest loop to keep stable.

Lesson
E6.3
Time
35 min
Runs on
ngspice
Check
6 questions

A reference buffer built on the two-stage op-amp OPA-B passed every DC test: 80.8 dB of gain and an output 0.13 mV from its input. A 10 mV step at its input overshot by 48.8 % and took 132 ns to settle within 1 %, and a converter sampling it in that time read the ringing as data.

TransientA 10 mV step into the bufferOPA-B as a unity-gain buffer into 2 pF, compensated with Cc = 1 pF.
  • v(in)
  • v(out)
898 mV900 mV902 mV904 mV906 mV908 mV910 mV912 mV914 mV916 mVVoltage00.2 µs0.4 µs0.6 µs0.8 µs1.0 µs1.2 µs1.4 µsTimepeakwithin 1 %895 mV900 mV905 mV910 mV915 mV920 mVVoltage00.5 µs1.0 µs1.5 µsTimepeakwithin 1 %
  1. Time 124.1 nsv(in) = 910 mV · v(out) = 914.7 mV

    24 ns after the step the output peaks 4.88 mV above its final value: 48.8 % of the 10 mV step.

  2. Time 231.8 nsv(in) = 910 mV · v(out) = 909.8 mV

    At 231.8 ns the output enters a 1 % band around its final value for good, 132 ns after the step.

Read the plot as a table
Timev(in)v(out)
0 s900 mV899.9 mV
124.1 ns910 mV914.7 mV
200 ns910 mV909.9 mV
231.8 ns910 mV909.8 mV
400 ns910 mV909.9 mV
600 ns910 mV909.9 mV
800 ns910 mV909.9 mV
1 µs910 mV909.9 mV
1.2 µs910 mV909.9 mV
1.4 µs910 mV909.9 mV

Measured on ngspice 42: the transient of the lab netlist (Cc = 1 pF, Rz = 0).

The loop was stable, and it still rang. How well a loop settles depends on its phase margin.

Phase margin

A negative-feedback loop subtracts what comes back from what goes in. The loop gain T carries phase shift, and every pole delays the returning signal a little more as the frequency rises. At the frequency where the delay reaches a half-cycle, −180°, the subtraction turns into an addition.

If |T| is still 1 or more there, a signal that goes once around comes back as large as it left, with the same sign. It feeds itself and the loop oscillates. So the place to look is the unity-gain frequency fu, where |T| = 1. The phase margin is how far the phase there is from −180°: PM = 180° + ∠T(fu).

To measure T, open the loop for the AC signal and keep it closed for DC, so the bias stays right. The lab uses the bench of E5: 1 TH from the output to M1's gate and 1 F from that gate to ground. In a buffer the output drives that gate directly, and a gate draws almost no current, so the break changes almost nothing. E6.5 shows when this simple break lies and how to measure T without breaking the loop at all.

AC analysisLoop gain of the buffer, two compensationsT = v(out)/v(in) on the open-loop bench, with Cc = 1 pF alone and with Rz = 5 kΩ in series. Phase is continuous (cph).
  • |T|, 1 pF
  • |T|, 1 pF + 5 kΩ
  • phase, 1 pF
  • phase, 1 pF + 5 kΩ
-100 dB-50 dB050 dB100 dBLoop gain-360°-270°-180°-90°0Phase10 Hz100 Hz1 kHz10 kHz100 kHz1 MHz10 MHz100 MHz1 GHzFrequency|T| = 1−180°fu−180°, 1 pF-100 dB-50 dB050 dB100 dBLoop gain-360°-270°-180°-90°0Phase10 Hz10 kHz10 MHzFrequency|T| = 1−180°fu−180°, 1 pF
  1. Frequency 100 Hz|T|, 1 pF = 80.83 dB · |T|, 1 pF + 5 kΩ = 80.83 dB · phase, 1 pF = -2.493° · phase, 1 pF + 5 kΩ = -2.493°

    At 100 Hz both loops have about 80.8 dB of gain and the phase has barely moved from 0°.

  2. Frequency 20.78 MHz|T|, 1 pF = -0.0005224 dB · |T|, 1 pF + 5 kΩ = 0.3305 dB · phase, 1 pF = -152.7° · phase, 1 pF + 5 kΩ = -119.2°

    With 1 pF alone, |T| = 1 at 20.8 MHz and the phase is −152.7°. The margin to −180° is 27.3°.

  3. Frequency 21.42 MHz|T|, 1 pF = -0.3425 dB · |T|, 1 pF + 5 kΩ = -0.0002361 dB · phase, 1 pF = -154.2° · phase, 1 pF + 5 kΩ = -119.9°

    With 5 kΩ added, |T| = 1 at 21.4 MHz and the phase is −119.9°: a margin of 60.1°.

  4. Frequency 34.12 MHz|T|, 1 pF = -5.845 dB · |T|, 1 pF + 5 kΩ = -5.359 dB · phase, 1 pF = -180° · phase, 1 pF + 5 kΩ = -130.8°

    The 1 pF loop reaches −180° at 34.1 MHz, where |T| is −5.8 dB. That distance below 0 dB is the gain margin.

Read the plot as a table
Frequency|T|, 1 pF|T|, 1 pF + 5 kΩphase, 1 pFphase, 1 pF + 5 kΩ
10 Hz80.84 dB80.84 dB-0.2495°-0.2495°
100 Hz80.83 dB80.83 dB-2.493°-2.493°
1 kHz80.09 dB80.09 dB-23.53°-23.53°
10 kHz67.84 dB67.84 dB-77.1°-77.08°
100 kHz48.06 dB48.06 dB-89.03°-88.85°
1 MHz28.06 dB28.06 dB-93.28°-91.5°
10 MHz7.568 dB7.681 dB-123°-105.7°
20.78 MHz-0.0005224 dB0.3305 dB-152.7°-119.2°
21.42 MHz-0.3425 dB-0.0002361 dB-154.2°-119.9°
34.12 MHz-5.845 dB-5.359 dB-180°-130.8°
100 MHz-18.86 dB-18.89 dB-243°-161.6°
1 GHz-42.45 dB-48.96 dB-309.8°-278.3°

Measured on ngspice 42, 100 points per decade. Why Rz adds phase is E6.4.

Phase margin in the step response

Now close the loop and step it. Five buffers, one per compensation, get the same 10 mV step. The step is small on purpose: the circuit stays linear, and no transistor runs out of current (E5.6 shows what a large step does).

TransientThree compensations, one stepOPA-B buffers into 2 pF: Cc = 1 pF (PM 27.3°), Cc = 2 pF (PM 40.5°), and Cc = 1 pF with Rz = 5 kΩ (PM 60.1°).
  • v(in)
  • PM 27.3°
  • PM 40.5°
  • PM 60.1°
898 mV900 mV902 mV904 mV906 mV908 mV910 mV912 mV914 mV916 mVVoltage00.2 µs0.4 µs0.6 µs0.8 µs1.0 µs1.2 µs1.4 µsTime895 mV900 mV905 mV910 mV915 mV920 mVVoltage00.5 µs1.0 µs1.5 µsTime
  1. Time 121.6 nsv(in) = 910 mV · PM 27.3° = 914.4 mV · PM 40.5° = 908.7 mV · PM 60.1° = 910.7 mV

    PM 60.1° peaks first, at 121.6 ns, only 8.5 % over. It is inside the 1 % band by 134.9 ns.

  2. Time 124.1 nsv(in) = 910 mV · PM 27.3° = 914.7 mV · PM 40.5° = 910.2 mV · PM 60.1° = 910.6 mV

    PM 27.3° peaks at 124.1 ns, 48.8 % over, and rings for another 108 ns.

  3. Time 134.6 nsv(in) = 910 mV · PM 27.3° = 910.6 mV · PM 40.5° = 912.8 mV · PM 60.1° = 910 mV

    PM 40.5° (2 pF) is slower, because doubling Cc cut fu from 20.8 to 12.5 MHz, and it still overshoots 29.9 %.

Read the plot as a table
Timev(in)PM 27.3°PM 40.5°PM 60.1°
0 s900 mV899.9 mV899.9 mV899.9 mV
121.6 ns910 mV914.4 mV908.7 mV910.7 mV
124.1 ns910 mV914.7 mV910.2 mV910.6 mV
134.6 ns910 mV910.6 mV912.8 mV910 mV
200 ns910 mV909.9 mV910.1 mV909.9 mV
400 ns910 mV909.9 mV909.9 mV909.9 mV
600 ns910 mV909.9 mV909.9 mV909.9 mV
800 ns910 mV909.9 mV909.9 mV909.9 mV
1 µs910 mV909.9 mV909.9 mV909.9 mV
1.2 µs910 mV909.9 mV909.9 mV909.9 mV
1.4 µs910 mV909.9 mV909.9 mV909.9 mV

Measured on ngspice 42: 0.5 ns print step, 1.5 µs run.

Name the link. With one dominant pole and one second pole, the closed loop behaves like a second-order system with a damping ratio ζ. Then PM = atan(2ζ/√(√(1 + 4ζ^{4}) − 2ζ^{2})), and the overshoot of a step is e^{−πζ/√(1 − ζ^{2})}. Solve the first for ζ and put it into the second.

Cc, RzfuPhase marginOvershoot measuredSecond-order formulaSettles within 1 %
0.5 pF30.7 MHz15.0°68.2 %66.0 %177 ns
1 pF20.8 MHz27.3°48.8 %45.5 %132 ns
2 pF12.5 MHz40.5°29.9 %28.4 %106 ns
1 pF, 5 kΩ21.4 MHz60.1°8.45 %8.70 %34.9 ns
1 pF, 10 kΩ31.9 MHz74.5°0 %0.03 %37.1 ns

Settling is counted from the step at 100 ns. The formula column uses the measured phase margin.

The formula tracks every measurement within 3.3 points. The real loop has more than two poles and a zero, so it is a model, and a good one. Two rules follow. About 45° rings by about 23 %; 60° overshoots about 9 %. And more margin is not always faster: the 74.5° loop never overshoots, yet settles later than the 60° one. That is why 60-70° is the usual design target.

Why the buffer is the hardest loop

In a buffer the feedback factor is β = 1, so T = A: all of the op-amp's gain goes around the loop. Then |T| crosses 1 at the op-amp's own fu, as high as it can be, where the second pole has added the most lag.

Wire the same op-amp, still with 1 pF alone, as a gain-of-two amplifier with 200 kΩ resistors. Now β = 0.5, |T| reaches 1 at 11.3 MHz instead of 20.8 MHz, and the phase there is −142.6°. The margin rises from 27.3° to 37.4° with no change to the op-amp. A smaller β only moves the crossover down, so the buffer is the case to design for.

This loop is opened between the output and the resistors. Opened at M1's gate, as the buffer was, it reads 52.1°, and that is too high. The gate is now fed through 100 kΩ, and its own capacitance makes a pole there that the gate break removes. A step decides: the same amplifier overshoots by 34.6 %, near the 32 % the second-order relation gives for 37.4° and far from the 16 % it gives for 52.1°. E6.5 measures the difference and shows how to measure T without opening the loop.

Take the compensation away and the margin goes below zero, to −14.9° at fu = 66.2 MHz, and the step no longer settles at all.

TransientNo compensation: the step starts an oscillationOPA-B as a buffer with Cc = 0 (phase margin −14.9°), the same 10 mV step.
  • v(in)
  • v(out)
0.6 V0.7 V0.8 V0.9 V1.0 V1.1 V1.2 V1.3 VVoltage00.2 µs0.4 µs0.6 µs0.8 µs1.0 µsTime0.6 V0.7 V0.8 V0.9 V1.0 V1.1 V1.2 V1.3 VVoltage00.5 µs1.0 µsTime
  1. Time 182.3 nsv(in) = 910 mV · v(out) = 1.099 V

    Each pass around the loop returns more than it took, so the ringing grows. By 182 ns it swings past 1.1 V.

  2. Time 602 nsv(in) = 910 mV · v(out) = 1.211 V

    The growth stops when the transistors reach their large-signal limits. The output swings between 0.714 V and 1.212 V, ten cycles every 348 ns: 28.7 MHz.

Read the plot as a table
Timev(in)v(out)
0 s900 mV899.9 mV
182.3 ns910 mV1.099 V
200 ns910 mV909.1 mV
400 ns910 mV1.091 V
600 ns910 mV1.154 V
602 ns910 mV1.211 V
800 ns910 mV755.3 mV
1 µs910 mV936.8 mV

Measured on ngspice 42: 0.1 ns print step, 1 µs run.

C_c = 1 pF alone

.param cc=1p rz=0

pm = 2.732064e+01, overshoot = 4.877819e+01: rings for 132 ns.

C_c = 1 pF with R_z = 5 kΩ

.param cc=1p rz=5k

pm = 6.008559e+01, overshoot = 8.450893e+00: settled in 34.9 ns.

The lab netlist with two values of Rz, measured on ngspice 42.

Asked in interviews
  1. What is phase margin and why aim for 60°?

    180° plus the phase of the loop gain where |T| = 1. Near 60° a step overshoots about 9 % and settles fastest; much less rings, much more is slower. Here 27.3° gave 48.8 % and 60.1° gave 8.45 %.

  2. Why is a unity-gain buffer the hardest configuration to stabilize?

    With β = 1 all of A is in the loop. So |T| = 1 at the op-amp's highest fu, where the poles add the most lag. With β = 0.5 the same op-amp went from 27.3° to 37.4°.

  3. What is gain margin?

    How far |T| is below 1 at the frequency where its phase reaches −180°. The 1 pF loop has 5.8 dB; with Rz = 5 kΩ it has 24.5 dB. A loop needs both margins positive.

Try it

Run the netlist: the ac analysis gives fu and pm on the open-loop bench, and the tran analysis gives the overshoot (in % of the step) and the time the output last leaves the 1 % band. Open Plots for the loop gain and the step.

Now edit the .param line. Try cc=2p rz=0, then cc=1p rz=5k, then cc=1p rz=10k, and pair each pm with its overshoot before you look at the table above. Last, set cc=0.5p rz=0 and predict the overshoot from the second-order formula first.

SPICEngspice 42 · simulator service
Edit the netlist, then run it
Expected measurements: fu = 2.078342e+07 pm = 2.732064e+01 v0 = 8.998682e-01 vf = 9.098686e-01 overshoot = 4.877819e+01 at= 1.241000e-07 settle = 2.317759e-07

Check yourself

Predict the outputAn ideal amplifier with a gain of 2000 sits in a gain-of-two loop: 1 kΩ and 1 kΩ from the output to ground, the tap fed back to the − input. The loop is opened at the − input with 1 TH and 1 F, and the run prints |v(tap)| for 1 V at the + input. Type the line meas prints (format: t0 = 6.319360e-01).
* an ideal amplifier of gain 2000 in a gain-of-two loop, opened at its - input by 1 TH and 1 F
VIN in 0 dc 0 ac 1
E1 out 0 in inn 2000
RF out tap 1k
RG tap 0 1k
LB tap inn 1T
CB inn 0 1
.control
ac lin 3 10 30
meas ac t0 FIND vm(tap) AT=10
.endc
.end
ConceptRead the step figure. The 2 pF curve starts at 899.9 mV, peaks at 912.9 mV and settles at 909.9 mV. What is its overshoot, and about what phase margin does that suggest?
ConceptOPA-B with Cc = 1 pF has 27.3° of margin as a buffer and 37.4° as a gain-of-two amplifier. What do you expect as a gain-of-ten amplifier (β = 0.1), with resistors small enough to load nothing?
ConceptA loop has a phase margin of 0°. What does that mean?
ConceptA small step into a two-pole loop overshoots by 15 %. About what phase margin does the loop have?
ConceptA loop's phase reaches −180° at 40 MHz, where |T| is −3 dB. A hot corner raises the op-amp's gain by 4 dB at every frequency and leaves the phase alone. What happens to the loop?

Remember

  • Phase margin is 180° plus the phase of the loop gain T where |T| = 1; at 0° or below, the loop oscillates.
  • Measure T with the loop open for AC and closed for DC (1 TH and 1 F where a stiff node drives a gate), and read the phase with cph.
  • For a two-pole loop, overshoot follows from PM: 27.3° gave 48.8 %, 40.5° gave 29.9 %, 60.1° gave 8.45 %.
  • Near 60° a step settles fastest; 74.5° does not overshoot but settles later. 60-70° is the usual target.
  • A buffer (β = 1) is the hardest case: as a gain-of-two amplifier the same op-amp went from 27.3° to 37.4°.