control//digital control//sampling rate selection

Sampling rate selection is the choice of how often a digital controller reads its sensors and updates its command, and the working rule is to run the loop 10 to 30 times faster than the closed-loop bandwidth it has to reach. The rule exists because every sample period is delay: the command is held for a whole period (zero-order hold), which on average makes it half a period late, and computation adds to that.


Sampling rate selection is the choice of how often a digital controller reads its sensors and updates its command, and the working rule is to run the loop 10 to 30 times faster than the closed-loop bandwidth it has to reach. The rule exists because every sample period is delay: the command is held for a whole period (zero-order hold), which on average makes it half a period late, and computation adds to that.

The rule follows from one line of arithmetic. A delay τ\tauτ removes a phase of 360∘fcτ360^\circ f_c\tau360∘fc​τ at the crossover frequency fcf_cfc​ of the loop. With a sampling period T=1/(Nfc)T=1/(Nf_c)T=1/(Nfc​), the hold alone costs

Δφ=360∘ fc T2=180∘N,\Delta\varphi=360^\circ\,f_c\,\frac{T}{2}=\frac{180^\circ}{N},Δφ=360∘fc​2T​=N180∘​,

so a loop sampled at ten times its crossover gives up 18 degrees of phase margin to the hold, at twenty times 9 degrees, at thirty times 6. Against a margin of 45 to 60 degrees, the first is already a large bite.

That is why drones run their inner loops far faster than their dynamics. Attitude moves at tens of hertz, yet a quadcopter autopilot runs its rate and attitude loops at around 500 Hz to 1 kHz, and some racing firmware closes the rate loop at several kilohertz; the extra speed buys back phase and lets the filters on the gyroscope work with little delay. The slower layers drop in rate with their dynamics: the estimator at 100 to 250 Hz, the position loop around 50 Hz, the planner at 1 to 10 Hz (autopilot).

A process plant reads the same rule at another scale. A temperature loop whose plant has a time constant of minutes is well served by a PLC that runs its PID every few hundred milliseconds; running it faster costs scan time and buys nothing.

Faster has its own price. Processor time grows with the rate, and a derivative computed from a quantized sensor gets noisier as the period shrinks (one step of a 12-bit encoder read at 1 kHz looks like 88 degrees per second); filter coefficients drift towards 1, where a float32 loses resolution.

Running faster than the sensor adds nothing. A GNSS receiver delivering 5 to 10 fixes a second does not improve with a 1 kHz loop; the fast loop predicts between fixes and corrects when one arrives (multi-rate fusion).

The rate also decides which frequencies exist. Noise above half the sampling rate folds down and looks like slow motion (aliasing), so either the rate is high enough or an anti-aliasing filter sits before the converter, and that filter adds its own delay.