Lab 6

The VCO and the PLL Loop

Part A runs Chapter 11's LC VCO in ngspice: its oscillation frequency, amplitude and current, its tuning range over the capacitor bank and the varactor, and the Q of its tank element by element. Part B closes the loop of Chapter 12 around it in python-control, from the loop filter's component values to the margins, the step response and the phase-noise budget at the LO.

  • Simulate an LC oscillator from start-up to steady state and measure its frequency, amplitude, supply current and tuning gain from transients.
  • Split a tank’s losses into its elements with small-signal analyses and add them with Eq. (11.4).
  • Build a charge-pump PLL’s loop gain from component values as python-control transfer functions, and read its crossover, phase margin, closed-loop peaking and step response.
  • Shape every noise source of the synthesizer through the loop, refer the result to the LO and integrate the jitter.
  • Check both parts against Chapters 11 and 12, and say which numbers depend on which.
Contents
Lab 6 at a glance  
Goal Part A: the course VCO’s frequency, amplitude, tuning and tank Q from your own ngspice runs. Part B: the course PLL’s margins, closed-loop behaviour and phase-noise budget from python-control.
Chapters Chapter 11 (Sections 11.2, 11.3, 11.5 and 11.8, Table 11.2); Chapter 12 (Sections 12.2–12.4 and 12.7, Worked example 12.1, Table 12.2)
Time 2 × 3 hours, one session per part
Files tools/labs/lab6/: vco_lab.py (Part A), pll_lab.py (Part B); they import tools/figs/_ch11_vco.py, tools/figs/_ch07_inductor.py and tools/figs/ch12_pll_noise.py, and read ch11_numbers.json, ch12_numbers.json and ch13_numbers.json in tools/figs/
Run time Part A: tune about 50 s, tank under a second; Part B: about 4 s in all

Hand calculation

Part A. The course VCO (Figure 11.3) resonates Chapter 7’s L3 spiral, 1.98 nH, with a differential tank capacitance of 537 fF and draws a tail current of 0.6 mA.

  1. Frequency. Compute \(f_0 = 1/(2\pi\sqrt{LC})\).
  2. Tank Q. At bank code 8 the elements are: the spiral, Q = 17.8; the bank, 81.0 fF with Q = 21.6; the varactor, 76.1 fF with Q = 98.3; the fixed MIM pair, 276 fF with Q = 394; the divider input, 7.6 fF with Q = 12.2. Add them with Eq. (11.4) and give \(Q_{tank}\) and \(R_p = Q_{tank}/(\omega_0C)\).
  3. Amplitude. Evaluate Eq. (11.5) for the complementary pair, \(V_A \approx (4/\pi)IR_p\).
  4. Tuning gain. The varactor’s steepest small-signal slope is 39.7 fF/V (Worked example 11.2). Evaluate Eq. (11.7) for the peak \(K_{VCO}\).

Part B. The loop has \(f_{ref}\) = 40 MHz, \(N\) = 122, \(I_{CP}\) = 100 µA and \(K_{VCO}\) = 131 MHz/V, the centre of the 103–167 MHz/V that the loop sees after the band calibration of Section 11.8, designed for \(f_u\) = 400 kHz and PM = 60°.

  1. Filter shape. Eq. (12.4) gives \(b = \tan\left[(\mathrm{PM} + 90°)/2\right]\), a zero at \(f_u/b\) and a combined pole near \(bf_u\). Evaluate them, and the sibling course’s estimate \(R_1 \approx N\omega_u/(I_{CP}K_{VCO})\).
  2. In-band reference noise. The TCXO’s floor is −147 dBc/Hz at 40 MHz. What is it at the 4.88 GHz VCO inside the loop bandwidth, and at the 2.44 GHz LO?

Steps, Part A: the VCO

Work in tools/labs/lab6. Inside the container run the commands as shown; from your own computer, put ../common/iic.sh in front of each (Lab 0).

  1. Transients.

    cd /foss/designs/rfic-design/tools/labs/lab6
    python3 vco_lab.py tune               # from your computer: ../common/iic.sh python3 vco_lab.py tune
    

    The script writes out/vco_tune.cir and runs ngspice -b on it. The circuit lines come from vco_lines() of tools/figs/_ch11_vco.py: the complementary pair (M1–M4 as eight RF instances each), the tail mirror with its RC filter, the L3 spiral as its EM-fitted π model, the varactor XV, the four bank bits (XB…, the switches XS… and their gate and bias sources Vg0–Vg3, Vb0–Vb3), the fixed MIM pair and the divider’s input, and a 10 fC current kick Ikick that starts the oscillation. The .control block runs seven transients: one of 40 ns at the design point (code 8, \(V_{tune}\) = 0.6 V), then 20 ns each at codes 0, 8 and 15 with \(V_{tune}\) = 0 and 1.2 V. Before each tran it changes the bank switches and the tuning voltage with alter, and after it wrdata writes out/vco_c<code>_v<V>.txt. set num_threads=1 keeps ngspice to one thread, which is faster when other jobs share the machine. For each run the script takes the zero crossings of \(v_{outp} - v_{outn}\) in the last 10 ns (design point) or 8 ns, and prints the frequency, the differential peak amplitude, the output common mode and the supply current, then the coverage and the mean \(K_{VCO}\) of each code over 0–1.2 V.

  2. The tank, element by element.

    python3 vco_lab.py tank
    

    out/vco_tank.cir holds each tank element on its own, the spiral, the varactor, the bank at code 8, the MIM pair and the divider input, each with both nodes held at the oscillator’s common mode (0.739 V, from step 1) through 1 GΩ and driven by a 1 A differential ac current at the oscillation frequency of step 1. The voltage across each element is its impedance. The script turns it into a conductance \(G\) and a susceptance \(B\), gives each element’s Q and share of the losses, and Eq. (11.4) as \(Q_{tank} = -B_L/\sum G\), \(R_p = 1/\sum G\) and \(C = -B_L/\omega_0\), the capacitance that resonates the spiral at \(f_0\), transistors included.

  3. Figure. python3 vco_lab.py all runs both steps, stores the numbers under vco in lab_numbers.json and draws Figure L6.1 into out/.

Two panels. (a) Differential output voltage against time from 0 to 12 nanoseconds: after the kick the oscillation grows exponentially, its envelope drawn in orange, and settles at about 0.78 volts after 5 to 6 nanoseconds; a note gives 4.868 gigahertz, 0.784 volts peak and 0.639 milliamperes. (b) Frequency against tuning voltage for codes 0, 8 and 15: code 0 from 5.09 to 5.22 gigahertz, code 8 from 4.83 through 4.87 at 0.6 volts to 4.95 gigahertz, code 15 from 4.63 to 4.74 gigahertz; a shaded band marks the course band from 4.802 to 4.962 gigahertz.
Figure L6.1. The course VCO starts in about 5 ns and its bank and varactor cover the course band with room on both sides. Lab 6, Part A (ngspice, tt, 27 °C). (a) Start-up from the 10 fC kick at code 8, Vtune = 0.6 V. (b) Oscillation frequency at the seven points of step 1, joined by straight lines; shaded: the course band, 4.802–4.962 GHz.

Steps, Part B: the PLL loop

  1. The loop in python-control.

    python3 pll_lab.py loop
    

    pll_lab.py reads the components of the third-order filter from tools/figs/ch12_numbers.json (those of Worked example 12.1: \(R_1\) = 24.5 kΩ, \(C_1\) = 60.0 pF, \(C_2\) = 2.35 pF, \(R_3\) = 19.0 kΩ, \(C_3\) = 1.21 pF) and the calibrated \(K_{VCO}\) range, 103–167 MHz/V, from the same file; it designs for the range’s geometric centre, 131 MHz/V, not for the 96.9 MHz/V mean that step 1 measures at code 8. Its function loop(), written with python-control [180], is the heart of the lab:

    import control as ct
    s = ct.tf("s")
    YA = C2*s + C1*s/(1 + R1*C1*s)                        # node A: C2 and the R1-C1 branch
    Z = 1/((YA + C3*s/(1 + R3*C3*s))*(1 + R3*C3*s))       # V_B / I_CP, Eq. (12.2)
    G = ICP*KVCO*Z/(N*s)                                  # loop gain, Eq. (12.1)
    H = ct.feedback(G, 1)                                 # reference phase -> divided phase
    E = ct.feedback(1, G)                                 # VCO phase noise -> output
    gm, pm, wcg, wcp = ct.margin(G)                       # crossover wcp (rad/s) and phase margin
    ct.step_info(H)                                       # overshoot, settling time
    

    The step prints \(f_u\) and the phase margin, the same for \(K_{VCO}\) 30 % low and high with the filter fixed, the zero and poles of \(Z(s)\) from ct.zeros() and ct.poles(), \(\vert Z\vert\) at \(f_{ref}\), the peaking of \(H\) and of \(1/(1+G)\), and the response of the divided phase to a step of the reference phase: its overshoot, and the time after which it stays within 2 % and within 0.1 %. For a linear loop the same response describes the VCO frequency after a step of the channel, so the 0.1 % time is a lock time.

  2. The noise budget.

    python3 pll_lab.py noise
    

    First it runs out/cp_noise.cir, Chapter 12’s charge pump with both sources on and its output held at 0.6 V (cp_netlist() of the chapter script), through an ngspice noise analysis, and turns the output noise current into its duty-cycled effective value for a 0.5 ns reset pulse per 25 ns, Eq. (12.10). Then it shapes every source with the transfer functions of step 4, Eqs. (12.6)–(12.9): the TCXO (datasheet points of Section 12.3 [208]), the retimed divider (57.3 fs per edge, the chapter’s assumption) and the charge pump through \(NH\); the thermal noise of \(R_1\) and \(R_3\) through the filter’s noise transimpedances and \(2\pi K_{VCO}/s \cdot 1/(1+G)\); and the VCO through \(1/(1+G)\). The VCO’s free-running noise is Chapter 11’s simulated curve (pn.sim_curve in ch11_numbers.json, every noise source, 1/f³ corner 254 kHz), scaled from 4.868 to 4.880 GHz. Everything is divided by four for the LO, the divide-by-two’s floor (−158.1 dBc/Hz, Chapter 13) is added, and the jitter is integrated from 10 kHz to 10 MHz with Eq. (12.11).

  3. Figures. python3 pll_lab.py all runs both steps, stores the numbers under pll in lab_numbers.json and draws Figure L6.2 and Figure L6.3 into out/.

Two panels. (a) Against frequency from 1 kilohertz to 300 megahertz: the loop-gain magnitude falls at 40 dB per decade, flattens around 100 kilohertz, crosses 0 dB at 400 kilohertz and falls steeply above; the closed-loop H is flat at 0 dB with a small peak and falls above 1 megahertz; 1 over 1 plus G rises from far below to 0 dB with a small peak near 1 megahertz. On a second axis the phase of G rises from minus 180 to a peak of minus 120 degrees at 400 kilohertz, marked f u 400 kilohertz, PM 60.0 degrees, and falls to minus 270. (b) Divided phase over the reference phase step against time from 0 to 8 microseconds: it rises to a peak of 1.19 at 1.3 microseconds, labelled overshoot 18.7 per cent, and settles to within 2 per cent after 3.84 microseconds.
Figure L6.2. The course loop crosses over at 400 kHz with 60° of phase margin and settles in a few microseconds. Lab 6, Part B, python-control with the components of Worked example 12.1 (N = 122, ICP = 100 µA, KVCO = 131 MHz/V). (a) Loop gain G, closed loop H = G/(1 + G) and 1/(1 + G), and the phase of G. (b) Step response of H: the divided phase after a step of the reference phase; shaded: ±2 %.
Phase noise at the LO in dBc per hertz against offset from 1 kilohertz to 100 megahertz for every source: the reference flat near minus 110 from 10 to 300 kilohertz, the charge pump flat near minus 111, R1 and R3 band-pass curves peaking near minus 113, the divider near minus 137, the VCO rising from minus 132 at 1 kilohertz to a broad peak near minus 109 at 100 to 300 kilohertz and following the free-running VCO above 1 megahertz. The total, a thick black line, is near minus 96 at 1 kilohertz, minus 106 at 10 kilohertz, about minus 104 around 200 kilohertz, minus 113.0 at 1 megahertz, labelled, below a red triangle marking the specification of minus 110, and falls to about minus 157 at 100 megahertz.
Figure L6.3. Shaped by the loop, six sources add up to −113.0 dBc/Hz at 1 MHz, 3.0 dB inside the specification. Lab 6, Part B: each source's contribution at the 2.44 GHz LO through its transfer function, the total with the divide-by-two's floor, and the free-running VCO divided by two (dotted). Integer-N, fu = 400 kHz.

Checkpoint

Table L6.1. Lab 6, Part A: the course VCO (SG13G2, tt, 27 °C; code 8, Vtune = 0.6 V unless stated). Tolerance: ±1 in the last digit shown, except where stated.

Quantity Lab 6 Chapter 11
Hand calculation: \(f_0\); \(Q_{tank}\), \(R_p\) (Eq. 11.4) 4.88 GHz; 14.9, 907 Ω  
Hand calculation: \(V_A\) (Eq. 11.5); peak \(K_{VCO}\) (Eq. 11.7) 0.692 V; 180 MHz/V 0.692 V; 180 MHz/V
Frequency at the design point 4.868 GHz 4.868 GHz (Table 11.2)
Differential peak amplitude; per side; output common mode 0.784 V; 0.392 V; 0.739 V 0.784 V; 0.392 V; 0.739 V
Supply current, power 0.639 mA, 0.766 mW 0.639 mA, 0.766 mW
Coverage: code 15 at 0 V to code 0 at 1.2 V 4.633–5.224 GHz 4.633–5.224 GHz
Band of codes 0 / 8 / 15 over 0–1.2 V 136 / 116 / 103 MHz 136 / 116 / 103 MHz
Mean \(K_{VCO}\), codes 0 / 8 / 15 113 / 96.9 / 85.6 MHz/V 113 / 96.9 / 85.6 MHz/V
Amplitude over the seven points 0.745–0.861 V 0.744–0.861 V (all tt points)
Tank: \(Q_{tank}\), \(R_p\), \(C\) (differential) 14.9, 906 Ω, 537 fF 14.9, 906 Ω, 537 fF
Q of spiral / bank / varactor / MIM / divider input 17.8 / 21.6 / 98.3 / 394 / 12.2 17.8 / 21.6 / 98.3 / 394 / 12.2
Share of the losses: spiral / bank (±0.5 points) 83.8 / 10.4 % 84 / 10 %

Table L6.2. Lab 6, Part B: the course PLL (fref = 40 MHz, N = 122, ICP = 100 µA, KVCO = 131 MHz/V, third-order filter of Worked example 12.1). Phase noise in dBc/Hz at the 2.44 GHz LO; jitter from 10 kHz to 10 MHz. Tolerance: ±1 in the last digit shown, except where stated.

Quantity Lab 6 Chapter 12
Hand calculation: \(b\); zero; combined pole; \(R_1\) estimate 3.73; 107 kHz; 1.49 MHz; 23.4 kΩ 3.73; 107 kHz; 1.49 MHz; 23.4 kΩ
Hand calculation: TCXO floor in band, at the VCO / at the LO −105.3 / −111.3 dBc/Hz −105.3 / −111.3 dBc/Hz
\(f_u\), phase margin (ct.margin) 399 kHz, 60.0° 400 kHz, 60.0°
\(K_{VCO}\) = 103 / 167 MHz/V (the calibrated range): \(f_u\), PM 322 kHz, 59.4° / 496 kHz, 59.4° 323 kHz, 59.4° / 496 kHz, 59.4°
Zero; poles of \(Z(s)\) (±0.1 MHz for the second pole) 108 kHz; 1.75 MHz, 11.61 MHz 108 kHz; 1.75 MHz, 11.6 MHz
\(\vert Z\vert\) at 40 MHz 281 Ω 282 Ω
Peaking of \(NH\) / of \(1/(1+G)\) 1.72 / 1.77 dB 1.72 dB
Step response: overshoot; peak time 18.7 %; 1.30 µs 18.7 % (Section 12.6)
Step response: within 2 % / within 0.1 % after 3.84 / 6.48 µs  
Charge pump, both on: white noise, flicker corner 6.74 pA/√Hz, 93.1 kHz 6.74 pA/√Hz, 93.1 kHz
TCXO: 100 kHz / 1 MHz / 10 MHz; jitter −110.1 / −118.8 / −157.0; 236 fs −110.1 / −118.8 / −157.0; 236 fs (Table 12.2)
Charge pump −110.5 / −119.2 / −157.4; 223 fs −110.5 / −119.2 / −157.4; 223 fs
R1 −115.2 / −120.6 / −158.8; 171 fs −115.2 / −120.6 / −158.7; 171 fs
R3 −116.0 / −120.9 / −148.3; 162 fs −116.0 / −120.9 / −148.3; 162 fs
Divider −136.0 / −144.6 / −182.8; 11.9 fs −136.0 / −144.6 / −182.8; 11.9 fs
VCO (Chapter 11, simulated) −109.4 / −120.9 / −143.1; 206 fs −109.4 / −120.9 / −143.1; 206 fs
Total: 100 kHz / 1 MHz / 3 MHz / 10 MHz −104.5 / −113.0 / −127.2 / −141.5 −104.5 / −113.0 / −127.1 / −141.5
Total: jitter, rms phase; margin at 1 MHz 451 fs, 0.396°; 3.0 dB 451 fs, 0.396°; 3.0 dB
VCO and TCXO alone: 1 MHz; jitter −116.7 dBc/Hz; 313 fs  

Both parts reproduce their chapters. Part A’s seven transients give the same frequencies, amplitudes, currents and tuning gains as the 96 transients of Section 11.5 at those points; the shares of the tank losses differ by up to 0.4 points because this lab evaluates the admittances exactly at \(f_0\), while Chapter 11 interpolated them from a 50 MHz grid. In Part B, the filter components carry the three digits of Worked example 12.1, which moves the crossover to 399 kHz and a few contributions by up to 0.05 dB; nothing else changes beyond the last digit. Part B does not use the mean \(K_{VCO}\) that Part A measures at code 8 (96.9 MHz/V): it uses what the loop sees once the band calibration of Section 11.8 has chosen the code, 103–167 MHz/V, and designs for the centre, 131 MHz/V.

Questions

  • The four passive elements of step 2 add up to 441 fF, but the spiral resonates with 537 fF at \(f_0\). Where are the other 96 fF, and why does the hand calculation’s 4.88 GHz still come out within 0.3 % of the simulation?
  • The small-signal \(K_{VCO}\) peaks at 180 MHz/V, the transients give a mean of 96.9 MHz/V at code 8. Why are they so different (the pitfall of Section 11.5), and why does the loop designer use neither, but the 103–167 MHz/V of Section 11.8?
  • The phase margin is 60° and yet the step response overshoots by 18.7 %, about twice what a second-order system with 60° of margin would give. What in the type-II loop’s closed-loop transfer function causes the extra overshoot?
  • Free-running, the VCO divided by two would give −122.7 dBc/Hz at 1 MHz; inside the loop it contributes −120.9 dBc/Hz. Which transfer function makes the VCO worse at 1 MHz, and by how much should that be, from the peaking in Table L6.2?
  • The total misses the specification only if the in-band sources rise by about 3 dB. Rank the reference, the charge pump and the resistors by what it would cost to improve each by 3 dB.
  • A BLE channel hop leaves 150 µs between packets. With 6.5 µs to settle within 0.1 %, which other effect of a real synthesizer will dominate the lock time?

Extension

Part A. Run the slow corner of Section 11.5 for the bottom of the range: in out/vco_tune.cir, change mos_tt to mos_ss in both MOS .lib lines and cap_typ to cap_wcs, add .options temp=85, rerun ngspice with the printed command and analyse with python3 vco_lab.py tune --nosim. Compare code 15 at 0 V with Chapter 11’s 4.516 GHz and with the bottom of the course band.

Part B. Redesign the loop for \(I_{CP}\) = 200 µA, the next row of Table 12.1. Get the components from the chapter’s design routine (import ch12_pll_noise as C12; F = C12.design(icp=200e-6), then F.R1, F.C1, F.C2, F.R3, F.C3), put them and the new ICP into pll_lab.py, and double the charge pump’s noise current power in cp_noise(), since the cell is scaled at constant current density. Check loop first (still 400 kHz and 60°?), then noise: Table 12.1 gives −114.8 dBc/Hz at 1 MHz and 379 fs, for twice the capacitor area.


Back to top

SkillSurf · RFIC Design with Open-Source Tools, draft v0.1 (November 2026). Every source is listed on the References page.

This course was written with the help of AI tools and may contain mistakes. If you find one, please tell us through SkillSurf or email skillsurfedu@gmail.com, and we will correct it.

This site uses Just the Docs, a documentation theme for Jekyll.