Control Loop Latency Budget
Decomposing the real-time path into sense, transport, infer, decide, actuate - and the fallback taken when any stage overruns.
The five stages
Every hard-real-time decision on either machine traverses the same five stages. Budgeting means assigning each stage a worst-case execution time and proving the sum plus jitter clears the deadline. The stages are: sense (diagnostic acquisition and digitization), transport (deterministic fabric to the control node), infer (state estimate or surrogate model evaluation), decide (controller law), and actuate (power electronics response).
- Sense: magnetic probes, interferometry, thermocouples sampled at fixed rate
- Transport: time-triggered fabric with bounded latency, not best-effort Ethernet
- Infer: reduced-order model or distilled network with fixed operation count
- Decide: MPC or PID law with a hard iteration cap
- Actuate: coil power supply / gyrotron / gas valve slew
Determinism over average speed
Resiliency demands bounded worst case, not fast average. A model that is quick 99% of the time but occasionally stalls is unusable in a 1 ms loop. We therefore forbid dynamic memory allocation, unbounded loops, and non-deterministic branches in the fast path, and we pin the inference model to a fixed-operation form.
# Overrun guard: if inference exceeds its slice, fall back to the last-good
# controller law rather than block the actuation deadline.
def fast_step(state, budget_us):
t0 = now_us()
try:
u = surrogate_infer(state, deadline_us=t0 + budget_us)
except DeadlineExceeded:
u = last_good_law(state) # deterministic PID fallback
flag('infer_overrun')
actuate(u)
return u
Jitter and margin
Jitter (variation in loop period) is as dangerous as latency. We size a 2x margin between worst-case path and deadline so that a single slow cycle does not cascade. Persistent overruns are logged for postmortem and can trigger a controlled derate. The full timing hierarchy is in the timing model.
On the breeder the tightest budget is vertical-position control of the elongated delta -0.30 plasma; on the burner it is plug-field regulation near the 26.49 T operating point where the coil is already stressed 3-3.9x at the design bore, so the actuation authority is deliberately conservative.