Jitter: Sources and Mitigation
Jitter is the variation in timing between cycles; even when average latency is fine, jitter degrades control quality and complicates timing proofs.
What Jitter Is
Jitter is the cycle-to-cycle variation in a timing quantity, most often the variation in latency or in the interval between periodic events. A loop that should run every 1000 microseconds but actually fires at intervals ranging from 950 to 1080 has 130 microseconds of period jitter. Jitter is characterized by its distribution: mean, standard deviation, and especially the worst-case excursion.
Where Jitter Comes From
- Interrupt coalescing and variable interrupt latency
- Scheduler decisions and preemption by higher-priority tasks
- Cache and memory contention between cores
- Clock-source drift and resolution limits
- Bus arbitration and DMA bursts
- Software conditional paths of differing length
Why Jitter Matters
Sampling jitter corrupts data. If an ADC is supposed to sample uniformly but the instants wander, the reconstructed signal contains errors that look like added noise, worst for high-frequency content. Output jitter is equally damaging: if a control update or a PWM edge arrives at an uncertain time, the actuator sees an effectively noisy command. In control terms, jitter injects an uncertainty that behaves like disturbance and delay combined.
Mitigation
The first principle is to decouple timing from software wherever precision matters. Use a hardware timer to trigger sampling and output directly, so the sample instant does not depend on when the interrupt handler happens to run. Give the critical task the highest priority and a dedicated core. Pre-fault memory and lock caches. For the tightest requirements, move the timed operation into FPGA logic clocked by a stable oscillator, where jitter is measured in nanoseconds set by the clock, not by software.
Measuring Jitter
You cannot control what you do not measure. Instrument the actual event times with a high-resolution counter, record the interval histogram over long runs, and report the maximum, not just the standard deviation. A rare large excursion, not the typical spread, is what breaks a hard deadline.