Capstone: compensate a two-stage op-amp

Compensate a two-stage op-amp so that it meets a phase-margin and bandwidth brief over a range of loads, find out what the textbook route costs, and verify the answer with steps at every load.

Lesson
E6.6
Time
40 min
Runs on
ngspice
Check
5 questions

A two-stage op-amp met 60° of phase margin with the 2 pF load of its datasheet bench. In the product it drove 5 pF of wiring, and a 10 mV step overshot by 26.7 %. The load is part of the loop, so a margin measured at one load holds only at that load.

TransientOne compensation, two loadsOPA-B as a buffer with E6.4's Cc = 1 pF and Rz = 5 kΩ, stepped by 10 mV. Each output is shown as a fraction of its own final step.
  • CL 2 pF
  • CL 5 pF
00.20.40.60.81.01.21.4Fraction of the step00.2 µs0.4 µs0.6 µs0.8 µs1.0 µs1.2 µs1.4 µsTimefinal value00.51.01.5Fraction of the step00.5 µs1.0 µs1.5 µsTimefinal value
  1. Time 121.6 nsCL 2 pF = 1.083 · CL 5 pF = 1.107

    With 2 pF the output peaks at 1.085 of its final value: 8.5 % overshoot, the 60° loop of E6.4.

  2. Time 131.1 nsCL 2 pF = 1.031 · CL 5 pF = 1.264

    With 5 pF the same op-amp peaks at 1.267: 26.7 % overshoot, and it rings before it settles.

Read the plot as a table
TimeCL 2 pFCL 5 pF
0 s1.672 µ1.672 µ
121.6 ns1.0831.107
131.1 ns1.0311.264
200 ns11.017
400 ns11
600 ns11
800 ns11
1 µs11
1.2 µs11
1.4 µs11

Every point is from a run on ngspice 42.

The brief and the worst load

Your task is to compensate OPA-B, the two-stage op-amp of E5.5, as a buffer. The load is anywhere from 1 pF to 5 pF.

RequirementLimitHow it is measured
Phase margin≥ 60° at every load from 1 to 5 pF1 TH / 1 F bench, fu where |T| = 1
Unity-gain frequency fu≥ 10 MHz at every loadthe same run
10 mV step overshoot≤ 10 %closed-loop buffer, transient
Biasthe 20 µA reference and stage one unchangedoperating point

The brief. A 10 mV step stays small enough that the buffer never slews (E5.6).

Start with the compensation of E6.4, Cc = 1 pF and Rz = 5 kΩ, and measure it at three loads. At 1 pF it has 75.3° at 25.29 MHz, at 2 pF 60.1° at 21.43 MHz, and at 5 pF only 41.4° at 15.25 MHz.

The reason is the output pole, p2 ≈ gm6/(2πCL). With gm6 = 393.4 µS it sits near 62.6 MHz at 1 pF and falls to 12.5 MHz at 5 pF, five times lower, while fu falls only from 25.3 to 15.3 MHz. For a two-stage op-amp the heaviest load is the worst case.

A one-stage OTA behaves the other way. Its only high-resistance node is the output, so CL sets its dominant pole (E5.3): more load lowers fu and leaves more margin.

The textbook route and its price

The textbook method cancels the zero with Rz = 1/gm6 and keeps p2 at least 2.2 fu at the worst load. At 5 pF that means fu ≤ 12.5 MHz/2.2 = 5.7 MHz, below the brief. Measure it anyway: Cc = 4 pF with Rz = 2.54 kΩ gives 62.2° at 5.77 MHz. The hand estimate was right.

To raise p2 you need more gm6, which means more second-stage current. Widen M6 and M7 together by 2.5 times (80/1 and 40/1) so the offset rule of E5.5 still holds. Now gm6 = 986.3 µS, so Rz = 1/gm6 ≈ 1.01 kΩ, and Cc = 2 pF gives 61.4° at 11.62 MHz at 5 pF. The supply current rises from 79.54 µA to 141.3 µA: 254 µW instead of 143 µW.

There is a second way, with no extra current. E6.4 showed that Rz above 1/gm6 turns the zero into a left-half-plane zero at 1/(2πCc(Rz − 1/gm6)), which adds phase. Put that zero near the 5 pF output pole and it cancels much of that pole's lag where it matters most.

The compensation method, with the measured numbersArrows show the order of the decisions.
The compensation method, with the measured numbersArrows show the order of the decisions. component Brief 60°, 10 MHz, 1 to 5pF component Worst load 5 pF: p2 near 12.5MHz component Cancel the zero Rz = 1/gm6: 5.77MHz component More current 2.5x stage two: 254uW component Use the zero Rz = 8 k, Cc = 1.75pF component Verify every load, a step, Rz+-20 % findtrytoo slowormeasurecompare
  1. Find the worst case

    The output pole falls with CL, so 5 pF decides the design.

  2. The textbook route

    With the zero cancelled, 60° at 5 pF allows only 5.77 MHz. Doubling the bandwidth needs about 2.5 times the second-stage current.

  3. Use the zero

    A left-half-plane zero near p2 recovers the phase at the original current. Then verify every load, the step, and Rz 20 % off.

Read the diagram as text
  • Brief: 60°, 10 MHz, 1 to 5 pF
  • Worst load: 5 pF: p2 near 12.5 MHz
  • Cancel the zero: Rz = 1/gm6: 5.77 MHz
  • More current: 2.5x stage two: 254 uW
  • Use the zero: Rz = 8 k, Cc = 1.75 pF
  • Verify: every load, a step, Rz +-20 %
  • Brief → Worst load: find
  • Worst load → Cancel the zero: try
  • Cancel the zero → More current: too slow
  • Cancel the zero → Use the zero: or
  • Use the zero → Verify: measure
  • More current → Use the zero: compare

Every number is from the comparison run in the next figure.

AC analysisFour compensations at the worst load, 5 pFThe curve is 180° plus the phase of the loop gain, so at fu (the points) it reads the phase margin directly.
  • E6.4: 1 pF, 5 kΩ
  • textbook: 4 pF, 2.54 kΩ
  • more current
  • zero: 1.75 pF, 8 kΩ
-225°-180°-135°-90°-45°045°90°135°180°Phase + 180°1 kHz10 kHz100 kHz1 MHz10 MHz100 MHz1 GHz10 GHzFrequencybrief: 60°textbook: 62.2° at 5.77 MHzcurrent: 61.4° at 11.62 MHzzero: 72.0° at 12.64 MHzE6.4: 41.4° at 15.25 MHz-270°-180°-90°090°180°Phase + 180°1 kHz100 kHz10 MHz1 GHzFrequencybrief: 60°textbook: 62.2° at 5.77 MHzcurrent: 61.4° at 11.62 MHzzero: 72.0° at 12.64 MHzE6.4: 41.4° at 15.25 MHz
  1. Frequency 5.767 MHzE6.4: 1 pF, 5 kΩ = 64.83° · textbook: 4 pF, 2.54 kΩ = 62.24° · more current = 75.27° · zero: 1.75 pF, 8 kΩ = 79.79°

    The textbook route meets 60° only by crossing at 5.77 MHz, below the 10 MHz brief.

  2. Frequency 11.62 MHzE6.4: 1 pF, 5 kΩ = 47.93° · textbook: 4 pF, 2.54 kΩ = 41.42° · more current = 61.41° · zero: 1.75 pF, 8 kΩ = 72.89°

    With 2.5 times the second-stage current, the same rule crosses at 11.62 MHz with 61.4°.

  3. Frequency 12.64 MHzE6.4: 1 pF, 5 kΩ = 45.85° · textbook: 4 pF, 2.54 kΩ = 38.58° · more current = 59.18° · zero: 1.75 pF, 8 kΩ = 71.99°

    At the original current, the left-half-plane zero lifts the phase near fu: 72.0° at 12.64 MHz.

  4. Frequency 15.25 MHzE6.4: 1 pF, 5 kΩ = 41.38° · textbook: 4 pF, 2.54 kΩ = 32.15° · more current = 53.69° · zero: 1.75 pF, 8 kΩ = 69.92°

    E6.4's compensation crosses at 15.25 MHz with only 41.4°.

Read the plot as a table
FrequencyE6.4: 1 pF, 5 kΩtextbook: 4 pF, 2.54 kΩmore currentzero: 1.75 pF, 8 kΩ
1 kHz156.2°120°139.2°142.7°
10 kHz102.8°93.25°96.58°97.45°
100 kHz90.83°89.82°90.4°90.56°
1 MHz85.39°84.92°87.48°88.14°
5.767 MHz64.83°62.24°75.27°79.79°
10 MHz51.72°46.39°65.1°74.48°
11.62 MHz47.93°41.42°61.41°72.89°
12.64 MHz45.85°38.58°59.18°71.99°
15.25 MHz41.38°32.15°53.69°69.92°
100 MHz9.707°-30.3°-21.95°20.17°
1 GHz-98.72°-114.1°-113.5°-94.42°
10 GHz-168.9°-170.8°-169.1°-168.2°

Every point is from a run on ngspice 42: the four designs at 1, 2 and 5 pF (the table lists all twelve).

The worked answer

With Cc = 1.75 pF and Rz = 8 kΩ the zero sits at 1/(2π·1.75 pF·5.46 kΩ) ≈ 16.7 MHz, just above the 5 pF output pole. The Bode plot shows the design at both ends of the load range. A margin above 90° at the light load means the phase of T at fu is above −90°: the zero has given back more phase than the dominant pole took.

AC analysisThe worked answer at 1 pF and 5 pFLoop gain of the buffer, Cc = 1.75 pF, Rz = 8 kΩ. Gain above, phase below.
  • gain, CL 1 pF
  • gain, CL 5 pF
  • phase, CL 1 pF
  • phase, CL 5 pF
-100 dB-50 dB050 dB100 dBGain-315°-270°-225°-180°-135°-90°-45°Phase10 kHz100 kHz1 MHz10 MHz100 MHz1 GHzFrequency0 dB-100 dB-50 dB050 dB100 dBGain-360°-270°-180°-90°0Phase10 kHz1 MHz100 MHzFrequency0 dB
  1. Frequency 12.64 MHzgain, CL 1 pF = 3.13 dB · gain, CL 5 pF = -0.00111 dB · phase, CL 1 pF = -70.72° · phase, CL 5 pF = -108°

    At 5 pF the gain crosses 0 dB at 12.64 MHz with 72.0° of margin. Without the zero, this load allowed 5.77 MHz.

  2. Frequency 25.66 MHzgain, CL 1 pF = -0.001301 dB · gain, CL 5 pF = -7.151 dB · phase, CL 1 pF = -69.62° · phase, CL 5 pF = -116.8°

    At 1 pF the crossing moves up to 25.66 MHz. Its margin is 110.4°: the zero now sits below fu.

Read the plot as a table
Frequencygain, CL 1 pFgain, CL 5 pFphase, CL 1 pFphase, CL 5 pF
10 kHz63.19 dB63.12 dB-82.45°-82.55°
100 kHz43.26 dB43.19 dB-89.04°-89.44°
1 MHz23.28 dB23.18 dB-87.9°-91.86°
10 MHz4.557 dB2.332 dB-73.16°-105.5°
12.64 MHz3.13 dB-0.00111 dB-70.72°-108°
25.66 MHz-0.001301 dB-7.151 dB-69.62°-116.8°
100 MHz-7.82 dB-22.32 dB-138°-159.8°
1 GHz-42.26 dB-56.19 dB-273.6°-274.4°

Every point is from a run on ngspice 42 (CL = 2 and 3 pF and Rz ±20 % are in the same run; see the table).

TransientThe worked answer, stepped at three loads10 mV steps into the buffer, each output as a fraction of its own final step.
  • CL 1 pF
  • CL 2 pF
  • CL 5 pF
00.20.40.60.81.01.2Fraction of the step00.2 µs0.4 µs0.6 µs0.8 µs1.0 µs1.2 µs1.4 µsTimefinal value00.20.40.60.81.01.2Fraction of the step00.5 µs1.0 µs1.5 µsTimefinal value
  1. Time 144.6 nsCL 1 pF = 0.9525 · CL 2 pF = 0.9633 · CL 5 pF = 1.021

    At 5 pF the output overshoots by 2.1 %. At 1 and 2 pF it never passes its final value.

  2. Time 173.1 nsCL 1 pF = 0.99 · CL 2 pF = 0.9935 · CL 5 pF = 1.004

    Within 1 % of the final value: 62.3 ns after the step at 5 pF, 66.0 ns at 2 pF and 73.1 ns at 1 pF. The light loads approach slowly from below.

Read the plot as a table
TimeCL 1 pFCL 2 pFCL 5 pF
0 s1.672 µ1.672 µ1.672 µ
144.6 ns0.95250.96331.021
173.1 ns0.990.99351.004
200 ns0.99770.99870.9998
400 ns111
600 ns111
800 ns111
1 µs111
1.2 µs111
1.4 µs111

Every point is from a run on ngspice 42.

Compensation1 pF2 pF5 pFSupply
E6.4: 1 pF, 5 kΩ75.3° at 25.29 MHz60.1° at 21.43 MHz41.4° at 15.25 MHz79.54 µA
Textbook: 4 pF, 2.54 kΩ81.4° at 6.37 MHz75.8° at 6.27 MHz62.2° at 5.77 MHz79.54 µA
More current: 2 pF, 1.01 kΩ, M6/M7 ×2.579.3° at 12.70 MHz74.1° at 12.52 MHz61.4° at 11.62 MHz141.3 µA
The zero: 1.75 pF, 8 kΩ110.4° at 25.66 MHz94.9° at 19.39 MHz72.0° at 12.64 MHz79.54 µA

Phase margin and fu of the buffer, from the comparison run; the supply current is one op-amp's, from 1.8 V.

Both the power route and the zero route meet the brief. The zero route costs no current, but it depends on Rz against 1/gm6. With Rz 20 % low (6.4 kΩ) the 5 pF margin falls to 64.9° at 11.63 MHz; 20 % high (9.6 kΩ) it is 77.2°. Both still pass.

It also settles more slowly at light loads. The power route reaches 1 % in 47.4 ns at 1 pF; the zero route takes 73.1 ns, because its zero and the closed-loop pole near it leave a slow tail. If the brief had a settling time, that would decide between them.

More current

XM6 out o1 vdd vdd sky130_fd_pr__pfet_01v8 W=80 L=1
XM7 out nb 0 0 sky130_fd_pr__nfet_01v8 W=40 L=1
RZ o1 z 1.01k
CC z out 2p

pm_power5 = 6.141535e+01 at 5 pF; isup_power = 1.413470e-04.

A left-half-plane zero

XM6 out o1 vdd vdd sky130_fd_pr__pfet_01v8 W=32 L=1
XM7 out nb 0 0 sky130_fd_pr__nfet_01v8 W=16 L=1
RZ o1 z 8k
CC z out 1.75p

pm_zero5 = 7.199262e+01 at 5 pF; isup_zero = 7.954101e-05.

Both from the comparison run, which also gives the other rows of the table.

Asked in interviews
  1. How do you compensate a two-stage op-amp for a range of loads?

    Design at the heaviest load, where the output pole gm6/(2πCL) is lowest, then check the lightest load and a step at each. Here 1 pF + 5 kΩ gave 60.1° at 2 pF and 41.4° at 5 pF.

  2. Why is a one-stage OTA more stable with more load capacitance?

    Its dominant pole is the output node itself, so more CL lowers fu and moves it further from the higher poles. In a two-stage op-amp CL sets the second pole instead, so more load brings it toward fu.

  3. What do you trade when you raise Cc?

    Bandwidth and slew rate: fu ≈ gm1/(2πCc) falls, and the first stage needs longer to charge Cc. The other levers are more second-stage current (power) or a nulling resistor that places a zero, which costs settling time and depends on Rz matching 1/gm6.

Try it

The starter is E6.4's compensation at the 5 pF corner of the brief. Run it: pm and overshoot both fail. Open Plots to see the loop gain and the step.

Now find your own answer. Change cc and rz, then run it again at cl=1p and cl=2p: a design passes only if it passes at every load. The worked answer is one solution, not the only one.

SPICEngspice 42 · simulator service
Edit the netlist, then run it
Expected measurements: fu = 1.525168e+07 pm = 4.139049e+01 v0 = 8.998682e-01 vf = 9.098686e-01

Check yourself

Predict the outputThis netlist measures E6.4's compensation (1 pF, 5 kΩ) as a buffer at CL = 1 pF and at 5 pF. It prints +1 if the phase margin rises from 1 pF to 5 pF and −1 if it falls. Type the line meas prints (format: change = 6.319360e-01).
* OPA-B buffer, C_c = 1 pF and R_z = 5 kOhm, open loop at C_L = 1 pF and 5 pF
.lib sky130 tt
.subckt opab inp inn out vdd cc=1p rz=5k w6=32 w7=16
IB vdd nb 20u
XMB nb nb 0 0 sky130_fd_pr__nfet_01v8 W=8 L=1
XM5 tail nb 0 0 sky130_fd_pr__nfet_01v8 W=8 L=1
XM1 x inn tail 0 sky130_fd_pr__nfet_01v8 W=10 L=1
XM2 o1 inp tail 0 sky130_fd_pr__nfet_01v8 W=10 L=1
XM3 x x vdd vdd sky130_fd_pr__pfet_01v8 W=8 L=1
XM4 o1 x vdd vdd sky130_fd_pr__pfet_01v8 W=8 L=1
XM6 out o1 vdd vdd sky130_fd_pr__pfet_01v8 W={w6} L=1
XM7 out nb 0 0 sky130_fd_pr__nfet_01v8 W={w7} L=1
RZ o1 z {rz}
CC z out {cc}
.ends
VIN in 0 DC 0.9 AC 1
Va vda 0 1.8
Xa in ia oa vda opab cc=1p rz=5k
Ca oa 0 1p
La oa ia 1T
CFa ia 0 1
Vb vdb 0 1.8
Xb in ib ob vdb opab cc=1p rz=5k
Cb ob 0 5p
Lb ob ib 1T
CFb ib 0 1
.save v(oa) v(ob)
.control
ac dec 20 10k 1g
let one = 1+0*vdb(oa)
let ga = vdb(oa)
let gb = vdb(ob)
let pa = 180+180/pi*cph(v(oa))
let pb = 180+180/pi*cph(v(ob))
* step to the first point where each gain has fallen below 0 dB
let ka = 0
while ga[ka] gt 0
let ka = ka+1
end
let kb = 0
while gb[kb] gt 0
let kb = kb+1
end
* +1 if the margin rises from 1 pF to 5 pF, -1 if it falls
let d = pb[kb]-pa[ka]
let s = d/abs(d)*one
meas ac change FIND s AT=1meg
.endc
.end
ConceptWhich of these compensations meets the 60° brief at 1 pF but fails it at 5 pF?
ConceptWhy does a heavier load hurt a two-stage op-amp but help a one-stage OTA?
ConceptRead the table. What does the textbook route (Rz = 1/gm6) need in order to meet 10 MHz at 5 pF?
ConceptThe zero design has 110.4° of margin at 1 pF and yet settles more slowly there than the power design. Why?

Remember

  • A two-stage op-amp is worst at its heaviest load: the output pole gm6/(2πCL) falls toward fu. Design there, then check every load with a step.
  • With the zero cancelled (Rz = 1/gm6), fu ≤ p2/2.2; OPA-B reached only 5.77 MHz at 5 pF, and 10 MHz needed 2.5 times the second-stage current.
  • An Rz above 1/gm6 places a left-half-plane zero near the worst-case output pole: 1.75 pF and 8 kΩ met the brief at the original current.
  • Every route has a price: power, bandwidth, settling time or sensitivity to Rz. Measure each one before you choose.