Miller compensation and the right-half-plane zero

Compensate a two-stage op-amp with a capacitor across its second stage, measure how that splits its poles, find the right-half-plane zero it creates, and move the zero with a series resistor.

Lesson
E6.4
Time
30 min
Runs on
ngspice
Check
5 questions

A designer compensating a two-stage op-amp as a buffer measured 27.3° of phase margin with Cc = 1 pF. Doubling Cc raised it only to 40.5° and cut the bandwidth from 20.8 to 12.5 MHz. A colleague put 5 kΩ in series with the 1 pF instead and got 60.1° at 21.4 MHz.

AC analysisLoop phase of OPA-B as a buffer, three compensationsThe phase of the loop gain T. Each point marks fu, where |T| = 1.
  • Cc 1 pF
  • Cc 2 pF
  • Cc 1 pF + Rz 5 kΩ
-360°-315°-270°-225°-180°-135°-90°-45°Phase of T100 kHz1 MHz10 MHz100 MHz1 GHzFrequency−180°: oscillation1 pF: PM 27.3°2 pF: PM 40.5°1 pF + 5 kΩ: PM 60.1°-360°-270°-180°-90°0Phase of T100 kHz10 MHz1 GHzFrequency−180°: oscillation1 pF: PM 27.3°2 pF: PM 40.5°1 pF + 5 kΩ: PM 60.1°
  1. Frequency 12.52 MHzCc 1 pF = -130.6° · Cc 2 pF = -139.5° · Cc 1 pF + Rz 5 kΩ = -109.2°

    With 2 pF the loop gain reaches 1 at 12.52 MHz, where the phase is −139.5°: a margin of 40.5°.

  2. Frequency 20.78 MHzCc 1 pF = -152.7° · Cc 2 pF = -165.8° · Cc 1 pF + Rz 5 kΩ = -119.2°

    With 1 pF alone the crossing is at 20.78 MHz and the phase is −152.7°: a margin of 27.3°.

  3. Frequency 21.43 MHzCc 1 pF = -154.2° · Cc 2 pF = -167.6° · Cc 1 pF + Rz 5 kΩ = -119.9°

    With 5 kΩ in series with the 1 pF the crossing stays near, at 21.43 MHz, and the phase is −119.9°: a margin of 60.1°.

    More context

    The resistor gained 33° and kept the bandwidth; the extra capacitor gained 13° and lost 40 % of it.

Read the plot as a table
FrequencyCc 1 pFCc 2 pFCc 1 pF + Rz 5 kΩ
100 kHz-89.03°-89.76°-88.85°
1 MHz-93.28°-94.11°-91.5°
10 MHz-123°-130.3°-105.7°
12.52 MHz-130.6°-139.5°-109.2°
20.78 MHz-152.7°-165.8°-119.2°
21.43 MHz-154.2°-167.6°-119.9°
100 MHz-243°-255.5°-161.6°
1 GHz-309.8°-311.4°-278.3°

Every point is from a run on ngspice 42: OPA-B on the 1 TH / 1 F bench, CL = 2 pF.

The capacitor carried signal straight to the output, and that path made a zero in the right half plane.

Two poles close together

OPA-B, the two-stage op-amp of E5.5, has two high-resistance nodes: o1, the first stage's output, and out. Each makes a pole at 1/(2πRC), above which the gain falls 20 dB per decade and the phase lags by up to 90°.

OPA-B and its compensation networkCc in series with Rz connects o1 to out, across the second stage M6.
OPA-B and its compensation networkVDD1.8 VIB20 µAMB8/1M38/1M48/1M110/1M210/1M58/1M632/1M716/1Rz​0 to 10 kΩCc​1 pFCL​2 pF− inn+ inpouto1out
  1. Two high-resistance nodes

    o1 is loaded by M2, M4 and M6's gate; out by M6, M7 and CL. Without Cc their poles are close together.

  2. The Miller path

    Cc bridges M6, whose gain is 96.7, so o1 sees Cc(1 + A2): 1 pF acts like 97.7 pF.

  3. M6 becomes a diode

    At high frequency Cc shorts M6's gate to its drain. The output sees about 1/gm6 = 2.54 kΩ, and its pole moves up.

  4. The forward path

    Cc also carries current from o1 straight into out, against M6's current. Where they are equal: a zero.

    jωCc·vo1

  5. R_z

    A series resistor changes that current, and with it where the zero sits.

Read the circuit as text
  • IB current source (20 µA): + → VDD, − → n1
  • MB NMOS transistor (8/1): gate → n1, drain → n1, source → 0
  • M3 PMOS transistor (8/1): gate → n2, source → VDD, drain → n2
  • M4 PMOS transistor (8/1): gate → n2, source → VDD, drain → o1
  • M1 NMOS transistor (10/1): gate → n3, drain → n2, source → n4
  • M2 NMOS transistor (10/1): gate → n5, drain → o1, source → n4
  • M5 NMOS transistor (8/1): gate → n1, drain → n4, source → 0
  • M6 PMOS transistor (32/1): gate → o1, source → VDD, drain → out
  • M7 NMOS transistor (16/1): gate → n1, drain → out, source → 0
  • R_z resistor (0 to 10 kΩ): pin 1 → o1, pin 2 → n6
  • C_c capacitor (1 pF): pin 1 → n6, pin 2 → out
  • C_L capacitor (2 pF): pin 1 → out, pin 2 → 0
  • − inn port: terminal → n3
  • + inp port: terminal → n5
  • out port: terminal → out

OPA-B as E5.5 defines it; W/L in µm. Bodies: NMOS to ground, PMOS to VDD.

Watch Cc on the open-loop Bode plot of E5.5's bench, where 1 TH and 1 F close the loop for DC and open it for AC. For a buffer, the loop gain T is the op-amp's own gain.

AC analysisPole splitting: OPA-B with C_c = 0 and 1 pFGain above, phase below. Rz = 0 and CL = 2 pF in both.
  • gain, Cc 0
  • gain, Cc 1 pF
  • phase, Cc 0
  • phase, Cc 1 pF
-100 dB-50 dB050 dB100 dBGain-360°-270°-180°-90°0Phase10 Hz100 Hz1 kHz10 kHz100 kHz1 MHz10 MHz100 MHz1 GHzFrequency0 dB-100 dB-50 dB050 dB100 dBGain-360°-270°-180°-90°0Phase10 Hz10 kHz10 MHzFrequency0 dB
  1. Frequency 2.292 kHzgain, Cc 0 = 80.84 dB · gain, Cc 1 pF = 77.84 dB · phase, Cc 0 = -0.6459° · phase, Cc 1 pF = -44.94°

    With 1 pF the gain is 3 dB down at 2.292 kHz. Without Cc the first pole sits at 225.3 kHz, 98 times higher.

  2. Frequency 20.79 MHzgain, Cc 0 = 20.4 dB · gain, Cc 1 pF = -0.003816 dB · phase, Cc 0 = -179.8° · phase, Cc 1 pF = -152.7°

    With 1 pF the gain crosses 0 dB at 20.79 MHz, where the phase is −152.7°.

  3. Frequency 66.19 MHzgain, Cc 0 = -0.004216 dB · gain, Cc 1 pF = -13.97 dB · phase, Cc 0 = -194.9° · phase, Cc 1 pF = -219.8°

    Without Cc the gain crosses 0 dB at 66.19 MHz, where the phase is −194.9°. That is past −180°, so a buffer made from it oscillates.

Read the plot as a table
Frequencygain, Cc 0gain, Cc 1 pFphase, Cc 0phase, Cc 1 pF
10 Hz80.84 dB80.84 dB-0.002817°-0.2495°
100 Hz80.84 dB80.83 dB-0.02818°-2.493°
1 kHz80.84 dB80.09 dB-0.2818°-23.53°
2.292 kHz80.84 dB77.84 dB-0.6459°-44.94°
10 kHz80.83 dB67.84 dB-2.816°-77.1°
100 kHz80.07 dB48.06 dB-26.75°-89.03°
1 MHz66.67 dB28.06 dB-106.3°-93.28°
10 MHz33.03 dB7.568 dB-171.1°-123°
20.79 MHz20.4 dB-0.003816 dB-179.8°-152.7°
66.19 MHz-0.004216 dB-13.97 dB-194.9°-219.8°
100 MHz-7.551 dB-18.86 dB-202.8°-243°
1 GHz-46.93 dB-42.45 dB-270.3°-309.8°

Every point is from a run on ngspice 42.

Cc does two things at once, called pole splitting. The Miller effect (E6.1) makes it look like 97.7 pF at o1, which puts the first pole at 2.348 kHz by hand; the run says 2.292 kHz. And at high frequency it turns M6 into a diode, so the output pole rises to about gm6/(2πCL) = 31.3 MHz.

With one dominant pole, the gain reaches 1 at fu ≈ gm1/(2πCc) = 26.2 MHz by hand (gm1 = 164.5 µS). The run crosses at 20.8 MHz: the second pole sits close to fu and pulls the gain down early.

The zero that lags

Follow the signal from o1 to out: M6 turns vo1 into a current gm6vo1 that pulls out the opposite way. Cc carries jωCcvo1 across with the same sign as o1. Where ωCc = gm6 the two cancel: a zero at fz = gm6/(2πCc).

A normal zero raises the gain and leads the phase. This one raises the gain and lags the phase, because the cancelling current has the opposite sign. It is a right-half-plane zero, named for where it sits in the complex s plane: it costs phase like a pole without the roll-off.

To see it alone, drive o1 from an AC source through 1 F; the rest of OPA-B keeps the bias.

AC analysisThe second stage driven alone, with and without C_cvout/vo1: gain above, phase below. Rz = 0, CL = 2 pF.
  • gain, Cc 1 pF
  • gain, Cc 0
  • phase, Cc 1 pF
  • phase, Cc 0
-40 dB-20 dB020 dB40 dB60 dBGain045°90°135°180°225°Phase1 kHz10 kHz100 kHz1 MHz10 MHz100 MHz1 GHzFrequencyphase 45°-40 dB-20 dB020 dB40 dB60 dBGain090°180°270°Phase1 kHz100 kHz10 MHz1 GHzFrequencyphase 45°
  1. Frequency 1 kHzgain, Cc 1 pF = 39.71 dB · gain, Cc 0 = 39.71 dB · phase, Cc 1 pF = 179.7° · phase, Cc 0 = 179.8°

    At 1 kHz the stage gives 39.71 dB and the phase is 179.7°: it inverts.

  2. Frequency 1 MHzgain, Cc 1 pF = 26.11 dB · gain, Cc 0 = 29.37 dB · phase, Cc 1 pF = 101.1° · phase, Cc 0 = 107.7°

    Past the output pole the phase is 101.1° with Cc and 107.7° without. One pole has taken close to 90°.

  3. Frequency 59.54 MHzgain, Cc 1 pF = -6.147 dB · gain, Cc 0 = -5.69 dB · phase, Cc 1 pF = 45° · phase, Cc 0 = 87.24°

    With 1 pF the phase reaches 45° at 59.54 MHz (hand: 62.6 MHz). Without Cc it is still 87.2°.

  4. Frequency 1 GHzgain, Cc 1 pF = -9.083 dB · gain, Cc 0 = -27.54 dB · phase, Cc 1 pF = 3.419° · phase, Cc 0 = 47.49°

    With 1 pF the gain has flattened at −9.08 dB and the phase is 3.4°: out follows o1 through Cc. Without Cc: −27.54 dB and falling.

Read the plot as a table
Frequencygain, Cc 1 pFgain, Cc 0phase, Cc 1 pFphase, Cc 0
1 kHz39.71 dB39.71 dB179.7°179.8°
10 kHz39.7 dB39.7 dB177.3°178.2°
100 kHz38.85 dB39.3 dB154.8°162.6°
1 MHz26.11 dB29.37 dB101.1°107.7°
10 MHz6.421 dB9.787 dB81.62°91.31°
59.54 MHz-6.147 dB-5.69 dB45°87.24°
100 MHz-7.82 dB-10.17 dB30.74°85.04°
1 GHz-9.083 dB-27.54 dB3.419°47.49°

Every point is from a run on ngspice 42.

Now the hook makes sense: doubling Cc lowers fu to 12.5 MHz, but it also halves fz to 31.3 MHz, on top of the output pole. Each costs atan(12.5/31.3) = 21.8°, so by hand PM ≈ 90° − 2 × 21.8° = 46.4°; the run measures 40.5°.

A resistor moves the zero

Put Rz in series with Cc and the zero moves to fz = 1/(2πCc(1/gm6 − Rz)), so Rz = 1/gm6 = 2.54 kΩ sends it to infinity. A larger Rz makes it negative: a left-half-plane zero, which adds phase near fu.

AC analysisLoop phase with C_c = 1 pF and four values of R_zEach point marks fu. CL = 2 pF.
  • Rz 0
  • Rz 2.54 kΩ
  • Rz 5 kΩ
  • Rz 10 kΩ
-330°-300°-270°-240°-210°-180°-150°-120°-90°-60°Phase of T100 kHz1 MHz10 MHz100 MHz1 GHzFrequency−180°0: PM 27.3°2.54 kΩ: PM 45.1°5 kΩ: PM 60.1°10 kΩ: PM 74.5°-360°-315°-270°-225°-180°-135°-90°-45°Phase of T100 kHz10 MHz1 GHzFrequency−180°0: PM 27.3°2.54 kΩ: PM 45.1°5 kΩ: PM 60.1°10 kΩ: PM 74.5°
  1. Frequency 20.33 MHzRz 0 = -151.6° · Rz 2.54 kΩ = -134.9° · Rz 5 kΩ = -118.8° · Rz 10 kΩ = -95.21°

    With Rz = 2.54 kΩ the zero is gone: 45.1° of margin at 20.33 MHz.

  2. Frequency 21.43 MHzRz 0 = -154.2° · Rz 2.54 kΩ = -136.8° · Rz 5 kΩ = -119.9° · Rz 10 kΩ = -96.05°

    With 5 kΩ a left-half-plane zero near 65 MHz lifts the margin to 60.1°.

  3. Frequency 31.89 MHzRz 0 = -176.1° · Rz 2.54 kΩ = -152.2° · Rz 5 kΩ = -129.2° · Rz 10 kΩ = -105.5°

    With 10 kΩ the zero near 21 MHz lifts the gain too, so fu moves up to 31.89 MHz, with 74.5° of margin.

Read the plot as a table
FrequencyRz 0Rz 2.54 kΩRz 5 kΩRz 10 kΩ
100 kHz-89.03°-88.94°-88.85°-88.67°
1 MHz-93.28°-92.38°-91.5°-89.72°
10 MHz-123°-114.2°-105.7°-89.89°
20.33 MHz-151.6°-134.9°-118.8°-95.21°
21.43 MHz-154.2°-136.8°-119.9°-96.05°
31.89 MHz-176.1°-152.2°-129.2°-105.5°
100 MHz-243°-201.6°-161.6°-160.1°
1 GHz-309.8°-293.5°-278.3°-273.1°

Measured on ngspice 42; the table lists all nine copies of the run.

CcRzfuPhase margin
0066.19 MHz−14.9°
0.5 pF030.66 MHz14.9°
1 pF020.79 MHz27.3°
2 pF012.52 MHz40.5°
1 pF2.54 kΩ (1/gm6)20.33 MHz45.1°
1 pF5 kΩ21.43 MHz60.1°
1 pF10 kΩ31.89 MHz74.5°
1 pF15 kΩ49.58 MHz54.1°
1.84 pF2.54 kΩ12.72 MHz61.2°

The last row is the hand design below.

More is not always better: at 15 kΩ the zero sits near 13 MHz and fu runs out to 49.58 MHz. There the higher poles, including one that Rz adds with the capacitance at o1, cut the margin to 54.1°.

The hand design removes the zero and keeps the output pole at 2.2 fu or above, which costs atan(1/2.2) = 24.4°. For OPA-B that gives Cc ≥ 2.2(gm1/gm6)CL = 1.84 pF, with gm read from the operating point. The run gives 61.2° at 12.72 MHz, against about 65° by hand.

More capacitance

RZ o1 z 0
CC z out 2p

pm_c2 = 4.049892e+01 at 12.52 MHz.

The same 1 pF with a nulling resistor

RZ o1 z 5k
CC z out 1p

pm_r5 = 6.008520e+01 at 21.43 MHz.

Both from the table's run.

Asked in interviews
  1. Explain Miller compensation and pole splitting.

    Cc across the second stage looks (1 + A2) times larger at o1, so that pole becomes dominant (225 kHz to 2.3 kHz here). At high frequency it makes M6 a diode, pushing the output pole up toward gm6/CL, and fu ≈ gm1/(2πCc).

  2. Where is the right-half-plane zero, and how do you handle it?

    At gm6/(2πCc), where the current through Cc cancels M6's. Rz = 1/gm6 removes it; a larger Rz turns it into lead. Indirect (Ahuja) compensation breaks the forward path with a buffer instead.

  3. How do you choose Cc?

    Keep the output pole about 2.2 fu or higher: Cc ≥ 2.2(gm1/gm6)CL, zero removed. Then measure at the largest load, since the output pole moves with CL.

Try it

Run it and read fu and pm. rz_null is 1/gm6, the Rz that cancels the zero. fz_hand is the zero from the formula: positive means the right half plane, negative the left. Open Plots to see the gain and phase.

Now fill a table. Set .param cc=1p rz=0, then rz=2.54k, then rz=10k, then cc=2p rz=0, and predict whether pm rises or falls before each run. Finally set cl=5p with cc=1p rz=5k: the output pole moves down, and E6.6 deals with that.

SPICEngspice 42 · simulator service
Edit the netlist, then run it
Expected measurements: a0 = 8.084274e+01 fu = 2.142794e+07 pm = 6.008520e+01 rz_null = 2.542018e+03 p2_hand = 3.130484e+07 fu_hand = 2.617603e+07 fz_hand = -6.475026e+07

Check yourself

Predict the outputThis netlist drives OPA-B's second stage alone: o1 is forced by an AC source through 1 F, Cc = 1 pF, Rz = 0. At 1 kHz the stage inverts. The run prints the sign of the real part of vout/vo1 at 1 GHz: 1 for the same sign as o1, −1 for the opposite. Type the line meas prints (format: sgn = 6.319360e-01).
* OPA-B second stage driven at o1 through 1 F; C_c = 1 pF, R_z = 0, C_L = 2 pF
.lib sky130 tt
VDD vdd 0 1.8
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=32 L=1
XM7 out nb 0 0 sky130_fd_pr__nfet_01v8 W=16 L=1
RZ o1 z 0
CC z out 1p
CL out 0 2p
VIN inp 0 0.9
LF out inn 1T
CF inn 0 1
VAC ac 0 DC 0 AC 1
CD o1 ac 1
.control
ac dec 10 1k 1g
let h = v(out)/v(o1)
* +1 when the output moves with o1, -1 when it moves against it
let s = floor(real(h)/mag(h)+0.5)
meas ac sgn FIND s AT=1g
.endc
.end
ConceptRead the hook plot. What is the phase margin of the Cc = 2 pF loop?
ConceptWhich of these compensation networks across OPA-B's second stage leaves a zero in the right half plane? (1/gm6 = 2.54 kΩ.)
ConceptWhat does pole splitting move, and in which direction?
ConceptA textbook says to choose Cc ≥ 0.22 CL for 60° of phase margin. Why does that rule fail for OPA-B?

Remember

  • Miller compensation splits the poles: Cc across the second stage drops the first-stage pole by about 1 + A2 and lifts the output pole to about gm6/(2πCL); then fu ≈ gm1/(2πCc).
  • Cc also feeds the signal forward. It makes a right-half-plane zero at gm6/(2πCc) that lags the phase like a pole.
  • A series Rz moves the zero to 1/(2πCc(1/gm6 − Rz)): 1/gm6 removes it, a larger value turns it into phase lead, and too large a value pushes fu into the higher poles.
  • Choose Cc ≥ 2.2(gm1/gm6)CL from your own gm values, then measure: OPA-B gave 61.2° with 1.84 pF and Rz = 1/gm6.