Control loops
What a designer must do
- Find the plant's limit first: delay, right-half-plane zeros, unstable poles. Compute the allowed gain crossover from them [1], [2], [3].
- Pick the sample rate from the bandwidth and the design method. Never design at the Nyquist rate [4], [5], [6].
- Measure sample jitter on the real loop [7].
- Clamp the integrator [8].
- Compute control margins for every servomechanism, in addition to torque margin [9].
- 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].
| Level | Plant feature | Limit | Check | Source |
|---|---|---|---|---|
| should | Right-half-plane zero at z | w_gc < 0.6 z, for an admissible phase lag of pi/3 | calc | [1] |
| should | Long time delay tau | For bandwidth limits, approximate as a zero at z = 2 / tau, then apply the limit above | calc: z = 2 / tau_loop; w_gc < 0.6 z | [2] |
| should | Right-half-plane pole at p, for example a balancing robot | w_gc > 1.7 p, for an admissible phase lag of pi/3 | calc | [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].
| Level | Requirement | Check | Source |
|---|---|---|---|
| should | Phase margin 30 to 60 degrees, gain margin 2 to 5, stability margin 0.5 to 0.8 | measure: frequency response of each joint loop | [10] |
| should | For high robustness: 60 degrees phase margin at slope -1. This leaves 30 degrees of admissible non-minimum-phase lag | calc | [12] |
| must | Compute control margins for servos in addition to torque margin. Servo performance may need far more motor capability | calc: phase and gain margin analysis | [9] |
| should | Count controller gains, sampling rate and bandwidth as factors in available torque. Source is a spaceflight standard, not written for ground robots | sim: 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].
| Level | Design method | Rate | Check | Source |
|---|---|---|---|---|
| must | Any sampled system | Margin above twice the signal bandwidth; never right at Nyquist | calc | [4] |
| guide | Purely digital design | About ten times the target closed-loop bandwidth. Course rule of thumb | calc: f_s >= 10 * BW | [5] |
| guide | Emulating an analog system, for comparable performance | About 30 times its bandwidth | calc: 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].
| Level | Requirement | Check | Source |
|---|---|---|---|
| guide | For a purely digital design, keep the anti-aliasing filter low order, so its phase lag stays small | calc: filter phase at crossover is in the margin | [14] |
| guide | For a purely digital design, look at the plant output between samples too, not only at the sample instants | sim: continuous plant response between samples | [15] |
Jitter
| Level | Limit | Scope | Check | Source |
|---|---|---|---|---|
| should | Rate varies at most plus or minus 20 percent over any ten samples | Simple PI loops. Derivative action is more sensitive | measure: loop timing histogram | [7] |
| guide | Each sample within 1 to 5 percent of the correct time. The source omits the percent sign on the 5 | Simple PI loops | measure: 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
| Level | Requirement | Check | Source |
|---|---|---|---|
| should | Limit integrator range to avoid windup, with actuator saturation considered | review: controller has an integrator clamp | [8] |
| should | 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 | calc: 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].
| Level | Requirement | Check | Source |
|---|---|---|---|
| should | Measure torque bandwidth per joint as the minus 3 dB crossover from small-signal torque-mode sine tests under task-representative loading | measure | [11] |
| should | A joint with 5 Hz torque bandwidth cannot safely render compliant behaviour, even with enough static torque | measure: same test | [19] |
| should | Joint and link flexibility adds states and complicates robot dynamics and control | sim: loop on a flexible joint model | [20] |
Reference rates
These are published examples, not limits [21], [22]. None of them is your robot.
| Level | Loop | Rate | System | Source |
|---|---|---|---|---|
| guide | Torque command; amplifier voltage loop | About 1 kHz; ten times that or more | Typical geared industrial arm | [23] |
| guide | Field-oriented commutation | 10 kHz | Stanford Doggo quadruped | [21] |
| guide | Local current control | 20 kHz | Blue, a low-cost QDD arm | [22] |
| guide | Policy | 50 Hz | ANYmal in Rudin et al. | [24] |
| guide | Training control | 10 Hz delta joint position | SO-101 in Squint | [25] |
| guide | Deployment control | 30 Hz | SO-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.
| Fact | Value | Source |
|---|---|---|
| Interface | Half-duplex TTL serial bus | TTL serial bus |
| Bus rate | 19200 to 1000000 bps; default 1000000 | STS3215, spec from a driver library |
| Encoder | 4096 steps per turn | STS3215, spec from a driver library |
| Gear ratio | 1/345 on the follower | SO-101 table in TTL serial bus |
| Backlash | Datasheet value 0.5 deg or less. One bench test measured about 1 deg by hand | [27] |
What this means for the loop:
- Treat the host loop as an outer position loop with delay. Log the real delay, then apply the time-delay bandwidth limit to it [2].
- At the follower's 1/345 gearing, do not read servo current as joint torque. Current-to-torque mapping is not safe to assume at ratios well above 10 [28].
- Use measured backlash in the position error budget, not the datasheet value [27].
- Keep hardware speed limits on the robot controller, not only in the simulation config [29].
Where the database is thin
- No fact gives the STS3215's internal loop rate, gains or current-loop bandwidth. Measure the response instead [10].
- The signal-bus guidelines cover RS-485, CAN and EtherCAT. The TTL serial-bus guidelines cover half-duplex bus timing; see TTL serial bus.
- No control guideline gives PID gain values, trajectory generation or impedance control.
- The control guidelines rest on control textbooks, course notes, papers and a spaceflight standard. No control guideline names a serial-bus servo arm.
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.
- 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
- 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
- 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
- Do not design a system to run right at the Nyquist rate. Level: must. wescottdesign.com 2026-11-08
- This guideline is held back: its source does not allow us to publish it yet.
- 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
- 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
- Limit integrator range to avoid windup. Level: should. wescottdesign.com 2026-11-08
- 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”
- 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
- 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”
- 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
- 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)”
- This guideline is held back: its source does not allow us to publish it yet.
- This guideline is held back: its source does not allow us to publish it yet.
- Prefer each PI sample within 1 to 5 percent of the correct sample time. 1 percent Level: guide. wescottdesign.com 2026-11-08
- Measure control loop timing on hardware, because it differs from simulation. Level: should. docs.nvidia.com 2026-11-08
- 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
- 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”
- Joint and link flexibility adds states and complicates robot dynamics and control. Level: should. hades.mech.northwestern.edu 2026-11-08
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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”