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
- Copy the cell
opamp_vatoopamp_va2(right-click > Copy cell…). Copytb_opamp_vatotb_opamp_va2the same way. - 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
n2that followsn1through a first-order low-pass filter with its pole at FP2 (gain 1 at DC); - make the output follow
n2instead ofn1.
- rename the module to
- Compile it: Run > Compile Verilog-A (OpenVAF). Fix any error OpenVAF reports (the log is in the window).
- Make the testbench use it: in
opamp_va2.symchange the template’s model name toopamp_va2_model; intb_opamp_va2, use the new symbol, and in the NGSPICE block load../opamp_va2/opamp_va2.osdiand 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} - In the Simulation Environment of
tb_opamp_va2, Design variables > Read from schematic addsFP2_meanandFP2_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 frequency | 16.17 ± 0.228 MHz | 16.16 ± 0.229 MHz | |
| Phase margin | 60.38 ± 0.30° | 89.49 ± 0.008° | |
| Output offset | 1.72 ± 2.14 mV | 1.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.pngandhist_vos.png).
Your teacher can open your workspace and run your testbench: keep everything in the library where you made it.
