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.
- Cc 1 pF
- Cc 2 pF
- Cc 1 pF + Rz 5 kΩ
- 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°.
- 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°.
- 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
| Frequency | Cc 1 pF | Cc 2 pF | Cc 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°.
- 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.
- The Miller path
Cc bridges M6, whose gain is 96.7, so o1 sees Cc(1 + A2): 1 pF acts like 97.7 pF.
- 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.
- 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
- 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.
- gain, Cc 0
- gain, Cc 1 pF
- phase, Cc 0
- phase, Cc 1 pF
- 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.
- 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°.
- 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
| Frequency | gain, Cc 0 | gain, Cc 1 pF | phase, Cc 0 | phase, Cc 1 pF |
|---|---|---|---|---|
| 10 Hz | 80.84 dB | 80.84 dB | -0.002817° | -0.2495° |
| 100 Hz | 80.84 dB | 80.83 dB | -0.02818° | -2.493° |
| 1 kHz | 80.84 dB | 80.09 dB | -0.2818° | -23.53° |
| 2.292 kHz | 80.84 dB | 77.84 dB | -0.6459° | -44.94° |
| 10 kHz | 80.83 dB | 67.84 dB | -2.816° | -77.1° |
| 100 kHz | 80.07 dB | 48.06 dB | -26.75° | -89.03° |
| 1 MHz | 66.67 dB | 28.06 dB | -106.3° | -93.28° |
| 10 MHz | 33.03 dB | 7.568 dB | -171.1° | -123° |
| 20.79 MHz | 20.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.
- gain, Cc 1 pF
- gain, Cc 0
- phase, Cc 1 pF
- phase, Cc 0
- 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.
- 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°.
- 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°.
- 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
| Frequency | gain, Cc 1 pF | gain, Cc 0 | phase, Cc 1 pF | phase, Cc 0 |
|---|---|---|---|---|
| 1 kHz | 39.71 dB | 39.71 dB | 179.7° | 179.8° |
| 10 kHz | 39.7 dB | 39.7 dB | 177.3° | 178.2° |
| 100 kHz | 38.85 dB | 39.3 dB | 154.8° | 162.6° |
| 1 MHz | 26.11 dB | 29.37 dB | 101.1° | 107.7° |
| 10 MHz | 6.421 dB | 9.787 dB | 81.62° | 91.31° |
| 59.54 MHz | -6.147 dB | -5.69 dB | 45° | 87.24° |
| 100 MHz | -7.82 dB | -10.17 dB | 30.74° | 85.04° |
| 1 GHz | -9.083 dB | -27.54 dB | 3.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.
- Rz 0
- Rz 2.54 kΩ
- Rz 5 kΩ
- Rz 10 kΩ
- 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.
- 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°.
- 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
| Frequency | Rz 0 | Rz 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.
| Cc | Rz | fu | Phase margin |
|---|---|---|---|
| 0 | 0 | 66.19 MHz | −14.9° |
| 0.5 pF | 0 | 30.66 MHz | 14.9° |
| 1 pF | 0 | 20.79 MHz | 27.3° |
| 2 pF | 0 | 12.52 MHz | 40.5° |
| 1 pF | 2.54 kΩ (1/gm6) | 20.33 MHz | 45.1° |
| 1 pF | 5 kΩ | 21.43 MHz | 60.1° |
| 1 pF | 10 kΩ | 31.89 MHz | 74.5° |
| 1 pF | 15 kΩ | 49.58 MHz | 54.1° |
| 1.84 pF | 2.54 kΩ | 12.72 MHz | 61.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
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).
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.
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.
Run the netlist to draw its plots here.
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+07Check yourself
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.