PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

More from Math Visualization

Other simulators in this category — or see all 52.

View category →
NewUniversity / research

ΔΣ (1-bit) Modulator

First- and second-order discrete-time ΔΣ with ±1 quantizer: shaped quantization noise, sine test tone, boxcar reconstruction, and Hann-windowed error spectrum (last 1024 samples).

Launch Simulator
NewUniversity / research

Polyphase L/M Resampling

Zero-stuff by L, Hamming-windowed sinc FIR at the high rate with min(π/L,π/M) cutoff, then decimate by M; spectra in/out and Noble-identity polyphase intuition.

Launch Simulator
NewUniversity / research

Mandelbrot Deep Zoom

Drag/wheel deep zoom into the Mandelbrot set with smooth continuous coloring and named landmarks.

Launch Simulator
NewUniversity / research

Julia Set Explorer

Pick c by clicking the embedded mini-Mandelbrot or animate c along a circle; Fatou dust vs connected sets.

Launch Simulator
NewUniversity / research

Newton Fractal

Basins of attraction for Newton iteration on zⁿ−1 with adjustable relaxation ω.

Launch Simulator
NewUniversity / research

Rössler Attractor

RK4 integration of ẋ=−y−z, ẏ=x+ay, ż=b+z(x−c); period-doubling cascade as c grows.

Launch Simulator
PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Math Visualization/PLL (Phase-Locked Loop)

PLL (Phase-Locked Loop)

A phase-locked loop (PLL) synchronizes a controlled oscillator to a reference by closing a feedback loop through a phase detector and a loop filter. This page uses a compact discrete-time caricature of an analog second-order PLL: the reference integrates a piecewise-constant angular frequency ω_ref(t) to produce φ_ref; the voltage-controlled oscillator (VCO) integrates ω_VCO = ω_fr + K_v u where ω_fr is the free-running offset and u is the loop-filter output. A multiplier-style phase detector yields e = K_d sin(φ_ref − φ_VCO), and a proportional–integral (PI) loop filter implements u = K_p e + ∫ K_i e dt with simple Euler accumulation. When gains are chosen in a stable range, the loop can lock so that ω_VCO tracks ω_ref and the wrapped phase error φ_e = wrap(φ_ref − φ_VCO) stays small; stepping ω_ref illustrates transient pull-in/capture behavior versus loss of lock or prolonged ringing. Setting K_i = 0 recovers a type-I loop where a frequency offset typically forces a nonzero steady-state phase error. The model omits delay, higher-order filtering, cycle slips as discrete events, and digital-specific blocks (N-dividers, PFD/CP), but it is enough to build intuition for lock, loop bandwidth, and the trade-off between damping and integral action.

Who it's for: Undergraduate signals-and-systems or communications students learning FM demodulation, clock recovery, and control-style frequency tracking; anyone who wants a hands-on feel for PD gain, loop filter poles, and VCO tuning sensitivity.

Key terms

  • Phase-locked loop
  • VCO
  • Phase detector
  • Loop filter
  • Lock range
  • Capture range
  • Type-I vs type-II loop
  • PI control

Live graphs

PLL parameters

100rad/s
138rad/s
1s
92rad/s
1
2.2
28
12

Measured values

RMS φ_e (last 25%)0.0173rad
Mean |u| (last 25%)3.8333
ω_VCO − ω_ref @ end0.000rad/s

How it works

Analog PLL model: reference sin φ_ref with piecewise-constant ω_ref, VCO integrates ω = ω_fr + K_v u, multiplier phase detector gives e = K_d sin(φ_ref − φ_VCO), and a PI loop filter u = K_p e + ∫ K_i e drives the VCO toward lock (ω tracks ω_ref, φ_e small). Step the reference to see capture and steady-state error; turning K_i to zero mimics a type-I loop with residual phase offset under frequency detuning.

Key equations

φ̇_ref = ω_ref(t), φ̇_VCO = ω_fr + K_v u
e = K_d sin(φ_ref − φ_VCO), u = K_p e + ∫ K_i e dt

Frequently asked questions

Why is the phase detector modeled as K_d sin(φ_ref − φ_VCO)?
A four-quadrant analog multiplier fed with two sinusoids produces a double-frequency term plus a baseband term proportional to sin of the phase difference. After ignoring the high-frequency component (implicit low-pass), the sinusoidal PD characteristic is the standard small-angle teaching model; near lock it behaves approximately linearly.
What is the difference between lock range and capture range here?
Informally, lock range is the frequency offset magnitude for which a loop already in lock can continue tracking as parameters change, while capture range is the offset from which an unlocked loop can still pull in without slipping cycles. This simulator does not compute those intervals analytically; instead you sweep ω_fr, ω_ref steps, and gains to see when φ_e remains bounded and the sine traces stay aligned.
Why does K_i = 0 often leave a frequency error at the end of the run?
With only proportional action, the loop must generate a nonzero average control u to sustain a different ω_VCO from ω_fr when ω_ref demands a new locked frequency. That typically requires a persistent phase offset at the PD output in this simplified model—classic type-I behavior—whereas integral action can drive the average phase error toward zero for a type-II loop under many conditions.
Is this suitable for designing a real RF PLL?
No. Real PLLs include divider ratios, charge-pump and loop-filter dynamics, reference and VCO noise, spurs, and nonlinear acquisition phenomena. Treat this page as a qualitative sandbox for the core feedback structure and the roles of K_p, K_i, and K_v.