FOSSlab

Chapter 12 of 14 · about 90 min

Exercise: a model with two poles

Your turn. The one-pole model of chapter 10 reproduces the gain, the bandwidth and the offset of the op-amp, but not its phase margin. Add a second pole to it, calibrate it, and repeat the Monte Carlo.

Task 1: a model with two poles

  1. Copy the cell opamp_va to opamp_va2 (right-click > Copy cell…). Copy tb_opamp_va to tb_opamp_va2 the same way.
  2. Edit opamp_va2.va:
    • rename the module to opamp_va2;
    • add a parameter FP2, the frequency of the second pole (Hz);
    • add an internal node n2 that follows n1 through a first-order low-pass filter with its pole at FP2 (gain 1 at DC);
    • make the output follow n2 instead of n1.
    Hint: a resistor r2 from n1 to n2 and a capacitor c2 from n2 to VSS make a pole at 1/(2π·r2·c2). Write the two currents into n2 the way the model writes the currents into n1.
  3. Compile it: Run > Compile Verilog-A (OpenVAF). Fix any error OpenVAF reports (the log is in the window).
  4. Make the testbench use it: in opamp_va2.sym change the template’s model name to opamp_va2_model; in tb_opamp_va2, use the new symbol, and in the NGSPICE block load ../opamp_va2/opamp_va2.osdi and change the model card to
    .param FP2_mean=30e6 FP2_sd=0
    .param FP2_mc=agauss(FP2_mean, FP2_sd, 1)
    .model opamp_va2_model opamp_va2 A0dB={A0dB_mc} GBW={GBW_mc} VOS={VOS_mc} SR=10.6e6 FP2={FP2_mc}
  5. In the Simulation Environment of tb_opamp_va2, Design variables > Read from schematic adds FP2_mean and FP2_sd. Press Run nominal.

Question 1. With GBW = 16.17 MHz and FP2 = 30 MHz, what phase margin and unity-gain frequency does the model give? Why did the unity-gain frequency change, although GBW did not?

Task 2: calibrate the model

For a two-pole amplifier, A(f) = A0 / ((1 + j f/fp1)(1 + j f/fp2)) with A0·fp1 = GBW. Well above fp1:

  • the phase margin is PM = 90° − arctan(UGF / fp2);
  • at the unity-gain frequency |A| = 1, i.e. GBW = UGF · √(1 + (UGF/fp2)²).

Question 2. Find the values of FP2 and GBW that give the transistor-level UGF (16.17 MHz) and phase margin (60.38°). Put them in the design variables (FP2_mean, GBW_mean; scale GBW_sd by the same factor as GBW_mean) and check with Run nominal that the model gives 16.2 MHz and 60.4°.

Task 3: Monte Carlo with the two-pole model

Run the Monte Carlo of tb_opamp_va2 (200 runs, same statistics as in chapter 10, FP2_sd = 0).

Question 3. Fill in this table and add the histograms of the phase margin and of the offset to your report:

Output (200 runs)Transistors (chapter 9)One-pole model (chapter 10)Two-pole model (yours)
Unity-gain frequency16.17 ± 0.228 MHz16.16 ± 0.229 MHz
Phase margin60.38 ± 0.30°89.49 ± 0.008°
Output offset1.72 ± 2.14 mV1.58 ± 2.04 mV

Question 4. Your model’s phase margin varies from run to run although FP2 does not. Where does its spread come from? Does it match the transistors’ σ, and would it if the GBW spread were larger?

Question 5 (optional). In the real op-amp, what sets the second pole? Estimate it from the transistor-level design (gm6, CL, Cc, the capacitance at the first stage’s output) and compare with your calibrated FP2. Which simplification of the model explains the difference? (Hint: the Miller zero.)

What to hand in

  • opamp_va2.va;
  • the answers to questions 1 to 4 (and 5 if you did it), with the table and the two histograms (Terminal in run folder in the Results tab: the files hist_pm.png and hist_vos.png).

Your teacher can open your workspace and run your testbench: keep everything in the library where you made it.