C652 of 57
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

C6 · Lesson 52 · Op-amp design lab

From specifications to currents and a capacitor, and back again

Lesson 41's design procedure is a chain of small formulas, and chains of formulas belong in code: once they're functions, you can try a dozen designs in a second and see what each specification costs. In this lab you'll write a function that predicts a two-stage op amp's gain, bandwidth, phase margin and slew rate from its currents and capacitors, a function that runs the design procedure from a specification, and a search that finds the smallest compensation capacitor giving a required phase margin.

  • The two-stage op amp's phase margin and gain-bandwidth against its compensation capacitor, for the design of lesson 41 (20 µA tail, 100 µA output stage, 0.2 V overdrives, 10 pF load).
  • More Cc means more margin but less bandwidth. The readouts give both at the slider's value.
  • Find the smallest Cc that still gives 60°: that's the fastest stable design.

Predict

For that op amp, what is the smallest Cc that gives 60° of phase margin?

Name it

Performance from the design

For tail current I5, second-stage current I7, overdrives vOV1 (input pair) and vOV6 (output device), equal λ, compensation Cc and load CL:

gm1=I5vOV1gm6=2I7vOV6A0=1λvOV1⋅1λvOV6
GBW=gm12πCcf2=gm62πCLSR=min⁡(I5Cc,I7CL+Cc)

and the phase margin from the two-pole crossover of lesson 39, fc=f2(1+4(GBW/f2)2−1)/2, PM = 90°−arctan⁡(fc/f2).

Design from the specification

Given GBW, SR and CL, with gm6=kgm1 (k ≈ 10) and vOV6 chosen:

  1. Cc=2.2CL/k;
  2. I5=SR⋅Cc;
  3. gm1=2πGBWCc, so vOV1=I5/gm1;
  4. gm6=kgm1, so I7=gm6vOV6/2.

Searching

Phase margin rises steadily with Cc, so bisection on Cc (in log space, between 1 fF and 1 nF) finds the smallest value that meets a margin.

Worked example

Predict the performance of lesson 41's design: 20 µA, 100 µA, 0.2 V overdrives, λ = 0.05 V⁻¹, Cc = 2.2 pF, CL = 10 pF.

Show the solution
  1. DC gain. A0 = 80 dB.
  2. Gain-bandwidth and second pole. GBW = 7.23 MHz and f2 = 15.9 MHz.
  3. Phase margin. The exact crossover is 6.7 MHz, so PM = 67.3°. The quick estimate with crossover at GBW gave 66°.
  4. Slew rate. SR=min⁡(9.1,8.2)=8.2V/μs

Answer 80 dB of gain, GBW = 7.23 MHz, a phase margin of 67.3° and a slew rate of 8.2 V/µs.

Worked example

Design for GBW = 10 MHz and SR = 10 V/µs into 5 pF, with k = 10 and vOV6 = 0.2 V.

Show the solution
  1. Compensation capacitor. Cc = 1.1 pF.
  2. Tail current. I5 = 11 µA.
  3. Input stage. gm1 = 69.1 µS, so vOV1 = 0.16 V.
  4. Output stage. gm6 = 0.691 mS, so I7 = 69 µA.
  5. Total current. 11 + 69 = 80 µA.

Answer Cc = 1.1 pF, I5 = 11 µA, vOV1 = 0.16 V and I7 = 69 µA, 80 µA in total.

Check

A two-stage op amp has a 10 µA tail, input overdrive 0.1 V and Cc = 5 pF. What is its GBW?

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

Check

Its output device carries 50 µA at 0.15 V of overdrive, into 20 pF. Where is the second pole?

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

Check

Write performance(I5, I7, vov1, vov6, lam, Cc, CL) returning a dict with A0_db, GBW (Hz), f2 (Hz), pm (degrees, from the exact two-pole crossover) and sr (V/s).

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

Check

Write design(GBW, SR, CL, k=10, vov6=0.2) returning a dict with Cc, I5, gm1, vov1, gm6 and I7, following the four steps.

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

Check

Write min_cc(I5, I7, vov1, vov6, lam, CL, pm=60): the smallest Cc giving at least pm degrees, by bisection on log⁡Cc between 1 fF and 1 nF (200 steps), using your performance.

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

Explain why

Why does a design procedure fix Cc first, before any currents?

Practice

Keep practicing

5 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.