Design Book › Control loops

Control loops

What a designer must do

  1. Find the plant's limit first: delay, right-half-plane zeros, unstable poles. Compute the allowed gain crossover from them [1], [2], [3].
  2. Pick the sample rate from the bandwidth and the design method. Never design at the Nyquist rate [4], [5], [6].
  3. Measure sample jitter on the real loop [7].
  4. Clamp the integrator [8].
  5. Compute control margins for every servomechanism, in addition to torque margin [9].
  6. Measure the frequency response of each joint, under task-representative loading. A calculation is not the sign-off [10], [11].

Scope: the control guidelines, the loops under a policy. Bandwidth limits, margins, sampling, jitter and integrators.

Bandwidth limits

These three guidelines bound the gain crossover w_gc. All three use linear loop analysis from Astrom and Murray. Their level is should [1].

Bandwidth limits
LevelPlant featureLimitCheckSource
shouldRight-half-plane zero at zw_gc < 0.6 z, for an admissible phase lag of pi/3calc[1]
shouldLong time delay tauFor bandwidth limits, approximate as a zero at z = 2 / tau, then apply the limit abovecalc: z = 2 / tau_loop; w_gc < 0.6 z[2]
shouldRight-half-plane pole at p, for example a balancing robotw_gc > 1.7 p, for an admissible phase lag of pi/3calc[3]

With an admissible phase lag of pi/3, a loop with both a long delay and an unstable pole has a window: 1.7 p < w_gc < 0.6 z. If the window is empty, no gain fixes it under these guidelines. Cut the delay or change the plant [2], [3].

Stability margins

Margins are measured, not assumed. Record them per joint [10].

Stability margins
LevelRequirementCheckSource
shouldPhase margin 30 to 60 degrees, gain margin 2 to 5, stability margin 0.5 to 0.8measure: frequency response of each joint loop[10]
shouldFor high robustness: 60 degrees phase margin at slope -1. This leaves 30 degrees of admissible non-minimum-phase lagcalc[12]
mustCompute control margins for servos in addition to torque margin. Servo performance may need far more motor capabilitycalc: phase and gain margin analysis[9]
shouldCount controller gains, sampling rate and bandwidth as factors in available torque. Source is a spaceflight standard, not written for ground robotssim: T_avail with the real controller limits[13]

Sample rate

Two rate guidelines look like a conflict and are not. They apply to different design methods [5], [6].

Sample rate
LevelDesign methodRateCheckSource
mustAny sampled systemMargin above twice the signal bandwidth; never right at Nyquistcalc[4]
guidePurely digital designAbout ten times the target closed-loop bandwidth. Course rule of thumbcalc: f_s >= 10 * BW[5]
guideEmulating an analog system, for comparable performanceAbout 30 times its bandwidthcalc: f_s >= 30 * BW[6]

For a purely digital design, keep the anti-aliasing filter low order, so it adds little phase lag. The check counts filter phase in the margin [14].

Sample rate
LevelRequirementCheckSource
guideFor a purely digital design, keep the anti-aliasing filter low order, so its phase lag stays smallcalc: filter phase at crossover is in the margin[14]
guideFor a purely digital design, look at the plant output between samples too, not only at the sample instantssim: continuous plant response between samples[15]

Jitter

Jitter
LevelLimitScopeCheckSource
shouldRate varies at most plus or minus 20 percent over any ten samplesSimple PI loops. Derivative action is more sensitivemeasure: loop timing histogram[7]
guideEach sample within 1 to 5 percent of the correct time. The source omits the percent sign on the 5Simple PI loopsmeasure: sample time error histogram[16]

A general-purpose computer over a serial bus is not a timed loop until you measure it. Simulation timing does not tell you [17].

Integrator and current command

Integrator and current command
LevelRequirementCheckSource
shouldLimit integrator range to avoid windup, with actuator saturation consideredreview: controller has an integrator clamp[8]
shouldConvert gear torque to motor torque using the gear ratio and rotor inertia, then command current as motor torque divided by efficiency and torque constantcalc: I_cmd = tau_motor / (eta * k_t)[18]

Torque bandwidth and flexibility

Static torque is not control authority. High gearing can raise one and cut the other [19].

Torque bandwidth and flexibility
LevelRequirementCheckSource
shouldMeasure torque bandwidth per joint as the minus 3 dB crossover from small-signal torque-mode sine tests under task-representative loadingmeasure[11]
shouldA joint with 5 Hz torque bandwidth cannot safely render compliant behaviour, even with enough static torquemeasure: same test[19]
shouldJoint and link flexibility adds states and complicates robot dynamics and controlsim: loop on a flexible joint model[20]

Reference rates

These are published examples, not limits [21], [22]. None of them is your robot.

Reference rates
LevelLoopRateSystemSource
guideTorque command; amplifier voltage loopAbout 1 kHz; ten times that or moreTypical geared industrial arm[23]
guideField-oriented commutation10 kHzStanford Doggo quadruped[21]
guideLocal current control20 kHzBlue, a low-cost QDD arm[22]
guidePolicy50 HzANYmal in Rudin et al.[24]
guideTraining control10 Hz delta joint positionSO-101 in Squint[25]
guideDeployment control30 HzSO-101 in Squint[26]

On the SO-101 with 12 V STS3215

The STS3215 is a serial-bus servo: gearmotor, position sensor and a small controller in one case (Servos). You do not close the inner loop. You send targets over the bus.

On the SO-101 with 12 V STS3215
FactValueSource
InterfaceHalf-duplex TTL serial busTTL serial bus
Bus rate19200 to 1000000 bps; default 1000000STS3215, spec from a driver library
Encoder4096 steps per turnSTS3215, spec from a driver library
Gear ratio1/345 on the followerSO-101 table in TTL serial bus
BacklashDatasheet value 0.5 deg or less. One bench test measured about 1 deg by hand[27]

What this means for the loop:

Where the database is thin

Sources

Each guideline in this chapter with its source, the date it was read and the exact words of the source. Level: must means breaking it causes failure or harm, should is good practice, guide is a rule of thumb.

  1. With admissible phase lag pi/3, keep gain crossover below 0.6 z for a right-half-plane zero at z. 0.6 Level: should. cds.caltech.edu 2026-11-08
  2. For bandwidth limits, approximate a long time delay tau as a right-half-plane zero at z = 2/tau. 2 Level: should. cds.caltech.edu 2026-11-08
  3. With admissible phase lag pi/3, keep gain crossover above 1.7 p for a right-half-plane pole at p. 1.7 Level: should. cds.caltech.edu 2026-11-08
  4. Do not design a system to run right at the Nyquist rate. Level: must. wescottdesign.com 2026-11-08
  5. This guideline is held back: its source does not allow us to publish it yet.
  6. For comparable performance when emulating an analog system, sample at about 30 times its bandwidth. 30 times Level: guide. mocha-java.uccs.edu 2026-11-08
  7. Keep sampling rate variation to at most plus or minus 20 percent over any ten samples for a PI loop. 20 percent Level: should. wescottdesign.com 2026-11-08
  8. Limit integrator range to avoid windup. Level: should. wescottdesign.com 2026-11-08
  9. Compute control system margins for servomechanisms in addition to torque margin, since servo performance may need far more motor capability. Level: must. standards.nasa.gov 2026-11-08“[DDMR 17] For servomechanism applications, control system performance margins shall be”
  10. Reasonable margins are phase margin 30 to 60 degrees, gain margin 2 to 5, and stability margin 0.5 to 0.8. 60 degrees Level: should. cds.caltech.edu 2026-11-08
  11. Measure each joint's torque bandwidth as the minus 3 dB crossover from small-signal torque-mode sine tests under task-representative loading. 3 dB Level: should. arxiv.org 2026-11-08“Computation: Measure the −3 dB crossover frequency fc,j via small-signal torque-mode sine”
  12. For high robustness choose a 60 degree phase margin at slope -1, leaving 30 degrees of admissible non-minimum-phase lag. 60 degrees Level: should. cds.caltech.edu 2026-11-08
  13. Include controller gains, sampling rate and bandwidth as factors in available torque. Level: should. standards.nasa.gov 2026-11-08“Motor controller parameters (gains, sampling rate, bandwidth)”
  14. This guideline is held back: its source does not allow us to publish it yet.
  15. This guideline is held back: its source does not allow us to publish it yet.
  16. Prefer each PI sample within 1 to 5 percent of the correct sample time. 1 percent Level: guide. wescottdesign.com 2026-11-08
  17. Measure control loop timing on hardware, because it differs from simulation. Level: should. docs.nvidia.com 2026-11-08
  18. Convert gear torque to motor torque using the gear ratio and rotor inertia, then command current as motor torque divided by efficiency and torque constant. Level: should. hades.mech.northwestern.edu 2026-11-08
  19. High static torque through high gearing can cut torque bandwidth; a joint with 5 Hz torque bandwidth cannot safely render compliant behaviour even with enough static torque. 5 Hz Level: should. arxiv.org 2026-11-08“interaction sloppy or unstable. A joint with 5 Hz torque bandwidth cannot safely render compliant”
  20. Joint and link flexibility adds states and complicates robot dynamics and control. Level: should. hades.mech.northwestern.edu 2026-11-08
  21. Doggo runs field-oriented commutation at 10 kHz; treat this as an example, not a limit. 10 kHz Level: guide. arxiv.org 2026-11-08
  22. Blue runs local current control at 20 kHz on each servo motor; treat this as an example, not a limit. 20 kHz Level: guide. arxiv.org 2026-11-08
  23. Expect torque commands at about 1 kHz and the amplifier voltage loop at ten times that or more. 1 kHz Level: guide. hades.mech.northwestern.edu 2026-11-08
  24. Use 50 Hz as one published legged reference, not a universal rate; Rudin et al. ran policies at this rate. 50 Hz Level: guide. arxiv.org 2026-11-08
  25. Treat 10 Hz delta joint position control as Squint's SO-101 training setting, chosen for faster training. 10 Hz Level: guide. arxiv.org 2026-11-08
  26. On a first SO-101 transfer, consider scaling actions down and raising control rate at deployment; Squint used 0.15 and 30 Hz and reports smoother paths. 0.15 action scale Level: guide. arxiv.org 2026-11-08
  27. A bench test of the STS3215 measured about 1° of encoder backlash against a ≤0.5° datasheet value. Level: guide. github.com 2026-11-08
  28. Do not assume current maps to torque at gear ratios well above 10; backlash, vibration and friction can no longer be ignored. Level: guide. manipulation.csail.mit.edu 2026-11-08
  29. Do not treat Isaac Lab joint_velocity_limit as a safety clamp, because its enforcement depends on the backend. Level: must. isaac-sim.github.io 2026-11-08“is not a backend-independent safety clamp”