RobotGuide
Labs/The Jitter Bill of a 1kHz Control Loop

Lab 2 / 15 · A/B experiment

The Jitter Bill of a 1kHz Control Loop

The same control loop on stock Linux vs PREEMPT_RT — how many microseconds apart, made visible.

Math: High school math is enoughNo coding neededNo hardware needed≈ 6 min

Runtime environment

Readouts

Max jitter—
99.9th percentile—
Deadline misses—
Cycles sampled—

Data is modeled on field experience (non-real-time 100–800µs, PREEMPT_RT 10–50µs, isolated cores + governor off 5–20µs) with random variation per run. Measure it yourself on real hardware with cyclictest.

What problem this lab solves

«Robots need real-time» gets said in every interview, but few can state concrete numbers: what period, what jitter, what eats the jitter. This experiment plots period error as a histogram — switch the configuration and see the difference.

How to read the figure

Left: the distribution of period error (ideal 1000µs). Right: how the error drifts over time. Three metrics: max jitter, the 99.9th percentile, and timeout count (times beyond 1.5× the period). Jitter is not an average problem, it is a tail problem — averages look lovely, but one 800µs spike is enough to make an arm shudder.

Hands-on

Start on «unoptimized» and note the jitter tail; switch to «PREEMPT_RT», then to «+isolated cores». Then ask: if jitter drops from 300µs to 40µs, how many times higher can you push your position-loop Kp? That is the real impact of real-time on performance.

Related topics

Next labs (in play-learn order)