Phase-Locked Loop (2D)

Oscilloscope traces, a phasor diagram and a live block diagram of a second-order PLL: choose wn and zeta, offset the input frequency and watch the loop lock or slip cycles.

Switch to 3D

Presets

Playback

Loop

Input signal

Layers

Model check

The science

What a phase-locked loop does. A phase detector (PD) compares the phase of an input carrier with the phase of a voltage-controlled oscillator (VCO). The PD output passes through a loop filter and steers the VCO frequency until the VCO follows the input in phase (it is locked).

Model used here (phase domain). Phase error e = θin − θvco. Sinusoidal PD: u = sin(e) (Kd = 1 V/rad near lock). VCO: dθvco/dt = Kvvc relative to the carrier. With loop gain K = KdKv and the active PI filter F(s) = (1 + sτ2)/(sτ1):

e′ = Δω − K(a sin e + x),   x′ = sin(e)/τ1,   a = τ2/τ1.

For small e this is a second-order system: ωn = √(K/τ1), ζ = ωnτ2/2, closed loop H(s) = (2ζωns + ωn2)/(s2 + 2ζωns + ωn2). The error after a phase step is e(t) = Δθ e−ζωnt(cos ωdt − (ζωn/ωd) sin ωdt), ωd = ωn√(1−ζ2). The 3 dB bandwidth is ωn√(1 + 2ζ2 + √((1 + 2ζ2)2 + 1)); the noise bandwidth is BL = (ωn/2)(ζ + 1/(4ζ)).

Lock ranges. First-order loop (no filter): e′ = Δω − K sin e has a stable solution exactly when |Δω| < K (the hold-in range), then sin e = Δω/K. The PI loop has no static error, so its hold-in range is set by the VCO tuning range. The lock-in range (a frequency step handled without a cycle slip) is often quoted as 2ζωn; the graph compares that rule of thumb with the largest step this simulation can take before |e| reaches π. The two are defined differently, so they differ by a factor that depends on ζ: the rule of thumb is conservative.

Simplifications (honest list). No ripple at 2ω0 from the multiplier PD (a phase-domain model has none); no digital or charge-pump PD; the loop filter is an ideal PI with anti-windup at the VCO limits; the VCO is linear; the input amplitude is constant; noise is white phase noise at the PD input applied as a zero-order hold each 50 µs. The 500 Hz carrier on the scope is a display choice; loop dynamics do not depend on it. Time runs in slow motion so you can watch it.

Independent numerical checks run in the page. (1) Simulated phase step vs the closed form. (2) Closed-loop |H(jω)| measured by driving the nonlinear simulation with a small phase sine and demodulating the VCO phase, vs the formula. (3) First-order loop: 970 rad/s locks with sin e = 0.97 and 1030 rad/s slips for K = 1000 rad/s. (4) Monte-Carlo VCO phase variance for white input noise vs S·BL.

Phase-step error against the closed form
Closed-loop response |H| (Bode magnitude)
Phase portrait of frequency steps
Lock-in estimate against damping