S251 of 55
0 XP
  1. Hook
  2. Predict
  3. Name it
  4. Check
  5. Explain

S2 · Lesson 51 · Analog design lab

From specifications to transconductances, currents, gain and a verified phase margin

Lesson 20 gave the two-stage op amp's design equations. In practice designers script them: a short program turns specifications (gain-bandwidth, load, phase margin, gm/ID choices) into transconductances, currents, gain and slew rate, then checks the result's stability numerically instead of trusting the quick estimate. In this lab you'll write that script: the sizing, an exact phase-margin calculation from the poles and zero, and a search for the nulling resistor that meets a phase-margin target.

Predict

A two-stage op amp's quick estimate gives 60° of phase margin with the right-half-plane zero ignored. Where does the exact margin, with the zero included, land?

Name it

The sizing equations

From lesson 20, with Cc=rcCL and p2=kωu:

  • gm1=2πGBWCc, gm6=k2πGBWCL
  • I1=gm1/(gm/ID)1 per input transistor, I6=gm6/(gm/ID)6
  • A0=(gm/ID)12λ⋅(gm/ID)62λ, SR=2I1/Cc

The open-loop gain

With ωu=2πGBW, p1=ωu/A0, p2=gm6/CL and the zero at z=1Cc(1/gm6−Rz) (positive: right half plane):

|A|=A01+(ω/z)2(1+(ω/p1)2)(1+(ω/p2)2),∠A=−arctan⁡ωp1−arctan⁡ωp2−arctan⁡ωz

A negative z (left half plane) gives phase lead automatically through the sign of the arctangent. With no zero, use z = ∞.

Phase margin

Find the crossover |A(ωc)|=1 by bisection on ln⁡ω between p1 and 100ωu, then PM=180°+∠A(ωc).

What you'll write

  1. size_two_stage(GBW, CL, k=2.2, cc_ratio=0.4, gmid1=15, gmid6=10, lam=0.1): return a dict with keys Cc, gm1, gm6, I1, I6, A0, SR (SI units).
  2. phase_margin(A0, wu, p2, z=math.inf): the exact phase margin in degrees.
  3. rz_for_pm(target, A0, wu, p2, gm6, Cc): the smallest Rz (Ω, between 0 and 1 MΩ) whose phase margin reaches the target, by bisection.

Worked example

Size an op amp for 30 MHz into 5 pF with the defaults, and find its phase margin with and without the zero.

Show the solution
  1. Compensation and transconductances. With the defaults, Cc = 2 pF, gm1 = 0.377 mS and gm6 = 2.07 mS.
  2. Currents, gain and slew rate. I1 = 25.1 µA, I6 = 207 µA, A0 = 3750 and SR = 25.1 V/µs.
  3. Poles. ωu/2π = 30 MHz and p2/2π = 66 MHz.
  4. With Rz = 0. The zero sits at gm6/Cc (165 MHz), and the exact margin is 57.4°.
  5. With Rz=1/gm6. That's 482 Ω, and the margin is 67.3°.
  6. Reaching 70°. It takes Rz = 620 Ω, which moves the zero into the left half plane.

Answer the phase margin is 57.4° with the zero (Rz = 0) and 67.3° without it (Rz = 482 Ω).

Worked example

Why check the phase margin numerically instead of using 90° − arctan(ωu/p2)?

Show the solution
  1. What the estimate assumes. The quick estimate assumes the crossover is at ωu and ignores the zero.
  2. The estimate. With p2=2.2ωu it gives 90°−arctan⁡12.2=65.6°
  3. Exact, without the zero. The exact crossover, a little below ωu, gives 67.3°.
  4. Exact, with the zero. With the right-half-plane zero the exact answer is 57.4°: the estimate would have been 8° optimistic.
  5. The cost of checking. The numerical check costs a few lines and removes the guesswork.

Answer the quick estimate gives 65.6°, but the exact margin is 67.3° without the zero and 57.4° with it, so with the zero the estimate would have been 8° optimistic.

Check

Step 1. Write size_two_stage(...) returning the dict of design values.

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 phase_margin(A0, wu, p2, z=math.inf).

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 rz_for_pm(target, A0, wu, p2, gm6, Cc).

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

For GBW = 50 MHz into 1 pF with Cc = 0.5·CL, what gm1 does the input pair need?

Write units the way you normally would: 1.5 mS, 1500 µS and 0.0015 S are the same answer.

Check

With gm6 = 1 mS, Cc = 1 pF and Rz = 0.2 kΩ, where's the zero (positive means right half plane)?

Write units the way you normally would: 1.5 MHz, 1500 kHz and 0.0015 GHz are the same answer.

Check

What's the quick-estimate phase margin for p2 = 2.2ωu (no zero)?

Explain why

Why is a numerical phase-margin check worth writing, when the design equations already target a margin?

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.