Phase-Frequency Detector (PFD) Simulator
Visualize PFD timing in a charge-pump PLL — REF vs FB, UP/DN pulses, and average charge-pump current — then design the Type-2 loop filter (R, C, optional 3rd-order pole) for a given bandwidth and phase margin, with the resulting open-loop Bode plot.
Inputs
Result
Loop specifications
Component values
PFDs, Charge Pumps & PLL Loop Filters
A phase-frequency detector (PFD) is the front end of nearly every modern phase-locked loop. Compared to a simple XOR or mixer-style phase detector, the PFD has two huge advantages: a linear range of one full cycle (±2π rad), and an output that's sensitive to frequency difference as well as phase difference. The second property is what lets a PLL acquire lock from any starting frequency offset.
How the PFD works
The classic three-state PFD is two D flip-flops with their D inputs tied high. REF clocks one, FB (the divided VCO) clocks the other. The Q outputs are UP and DN. An AND gate resets both flip-flops whenever both go high simultaneously. The behaviour:
- REF leads FB by Δt: UP goes high on REF's rising edge, stays high until FB's rising edge resets both. UP pulse width = Δt; DN pulse ≈ 0 (just the reset-path delay).
- FB leads REF by Δt: DN goes high on FB's rising edge, resets when REF arrives. DN pulse width = Δt; UP ≈ 0.
- Perfect lock: UP and DN go high together briefly each cycle (matched edges → reset). The "deadband" is just the reset-path propagation delay (~1 ns) — vanishingly small ripple.
- Frequency error: faster input keeps triggering its flip-flop while the slower one hasn't caught up. The PFD spends almost all of its time pulling the loop in the right direction. This is what gives charge-pump PLLs their "infinite" capture range.
The charge pump
UP and DN drive a charge pump — typically a pair of matched current sources/sinks. When UP is high, +Icp flows into the loop filter; when DN is high, −Icp flows out. The average current per reference cycle is Iavg = Icp · φ / (2π) where φ is the phase error in radians. The combined PFD+CP block is therefore a perfectly linear phase-to-current converter with gain Kpd = Icp / (2π) A/rad. This PFD-plus-charge-pump combination is the defining feature of a CPPLL (charge-pump PLL), which is the dominant architecture in modern frequency synthesis and clock-recovery circuits.
Type-2 loop filter — the standard choice
The charge pump's output is a current; you need a filter that converts that to a control voltage for the VCO. The simplest stable design is a Type-2 lead-lag: a capacitor C in series with a resistor R, with the VCO control voltage taken across the C. The filter impedance is Z(s) = R + 1/(sC) — an integrator (the 1/sC term) plus a stabilising zero (the R term) at ωz = 1/(RC). The integrator gives infinite DC gain (so static phase error → 0); the zero provides phase margin for stability.
Designing for a chosen bandwidth and phase margin
Once you pick a target loop bandwidth ωc (the unity-gain crossover) and a phase margin PM, the component values fall out as:
- R·C = tan(PM) / ωc — sets the zero location to give the desired phase margin
- C = Icp·Kvco / (cos(PM) · N · ωc²) — sets the open-loop magnitude to 1 at ωc
- R = sin(PM) · N · ωc / (Icp·Kvco) — solve the above two together
This gives you exactly 1 at ωc with exactly PM phase margin. Adding a 3rd-order pole (an extra cap Cp = C/10 in parallel) attenuates reference spurs at multiples of fref, but slightly reduces the actual phase margin — the tool shows you the achieved PM with Cp included.
The "bandwidth < fref/10" rule
The CP-PLL is fundamentally a sampled-data system; the PFD samples once per reference cycle. The continuous-time linear analysis above only holds when the loop bandwidth is well below the sampling rate, conventionally BW < fref/10. Push past that and the loop will exhibit instability and excess ripple not predicted by Bode analysis. The tool flags this in the stability badge.
Phase noise and VCO contribution
The loop filter does double duty: it smooths the charge-pump ripple and shapes the phase-noise spectrum. Inside the loop bandwidth, phase noise tracks the reference and PFD noise floor; outside the bandwidth, it tracks the free-running VCO's noise. A wider bandwidth suppresses more in-band VCO noise but passes more reference noise and spurs. For low-noise synthesizers in applications such as fractional-N frequency synthesis or clock recovery in SerDes links, the optimal bandwidth sits right at the crossing point of the reference and VCO phase-noise curves. To verify a built loop's spectral purity, the FFT frequency analyser can reveal reference spurs and phase-noise sidebands directly from the VCO output.
Integer-N vs fractional-N impact on the PFD
In an integer-N PLL the divider N must be a whole number, limiting the output frequency resolution to fref. A fractional-N synthesizer dithers N between two adjacent integers using a delta-sigma modulator (ΔΣ-N), achieving fine frequency steps at the cost of fractional spurs and quantisation noise. The ΔΣ modulator shapes this noise out of band, but it raises the noise floor near the carrier and demands careful loop filter design — typically a narrower bandwidth (10 kHz presets in this tool) and a higher-order filter to attenuate the shaped noise. Reference spurs and fractional spurs are distinct: reference spurs appear at offsets of ±fref regardless of N type; fractional spurs depend on the fractional word and modulator order.