>
section 9 of 125 min read

9. Putting It All Together: Real-World Control Systems

Let us trace several real systems through everything we just learned.

9.1 Quadcopter flight controller

A quadcopter is a wonderfully complete control problem.

rendering diagram...
  1. The IMU (inertial measurement unit) gives noisy gyroscope and accelerometer readings.
  2. An Extended Kalman Filter (an observer!) fuses these into a clean attitude estimate.
  3. The pilot's stick gives a reference attitude (or rate, in acro mode).
  4. Error = reference minus estimate.
  5. Three independent PID loops (one per axis: roll, pitch, yaw) compute corrective rates.
  6. A "mixer" translates body-frame corrections to per-motor RPM commands.
  7. ESCs (electronic speed controllers) translate to PWM signals; brushless motor commutation runs another inner control loop.
  8. The motors spin propellers, generating thrust and moments that move the airframe.
  9. The motion is sensed by the IMU. Loop closed.

Inner loops run at 1-4 kHz on a $10 microcontroller (typically STM32 F4 or ARM Cortex M7). State-space LQR controllers replace PID in some advanced platforms. Modern flight controllers (PX4, Ardupilot, Betaflight) implement all of this in under 100 KB of firmware.

9.2 Aircraft autopilot

A conventional aircraft has many cross-coupled control loops.

  • Inner-loop stability augmentation: damps short-period and Dutch-roll modes. Usually a state-feedback law on the aircraft's natural rigid-body modes.
  • Attitude hold: keeps a commanded pitch and roll. PI control.
  • Heading hold / track: bank to a commanded heading.
  • Altitude hold: pitches to a commanded altitude.
  • Airspeed hold: throttles to a commanded airspeed.
  • Flight director / autoland: outer-loop guidance for path-following.

Modern fly-by-wire aircraft (Airbus A320 onward, F-16, F-22, F-35) replace the mechanical control linkages with digital controllers that interpret pilot inputs and translate to control surface commands using full-state feedback. Triple or quadruple redundancy ensures fault tolerance. All of this is rooted in state-space methods.

9.3 Phase-locked loop (PLL): control theory in your CPU

A PLL is the chip in your laptop that turns a 25 MHz crystal into a 3 GHz CPU clock.

rendering diagram...
  1. Phase detector compares the reference clock (25 MHz) and the divided VCO output.
  2. Loop filter (a compensator!) integrates the phase error.
  3. VCO produces an output frequency proportional to its tuning voltage, ranging up to GHz.
  4. Divider feeds back a frequency-divided VCO output.

The output is locked at 25 MHz × 120 = 3 GHz, and locked in phase. The loop filter is a compensator with one zero (a lead) and two poles (a lag plus integrator). The bandwidth of the PLL determines how quickly it locks and how much VCO noise it suppresses. Phase noise on the output clock is limited by the loop filter design.

Every PLL is a control system. RF synthesizers, clock generators, frequency multipliers, FM demodulators, all use feedback control with phase as the feedback variable.

9.4 Voltage regulators

Every chip's VDD pin is fed by a voltage regulator. A switching regulator (buck or boost converter) is a feedback control system:

  • Reference: the desired output voltage (e.g., 1.2 V).
  • Output: the actual VDD.
  • Sensor: a voltage divider sampling VDD.
  • Controller: an error amplifier (typically Type II or Type III compensator) followed by a PWM modulator.
  • Plant: the inductor + capacitor + MOSFETs that form the buck topology.

The compensator is designed to cross over at one-tenth the switching frequency, with adequate phase and gain margin. A typical buck converter switches at 500 kHz to 5 MHz; the loop bandwidth is 50 kHz to 500 kHz; the load can swing transiently from microamps to amps in microseconds. The compensator must keep VDD within ±2% under all load conditions.

Hardware-security tie-in. Voltage regulators are direct attack surfaces. Inducing a brief voltage glitch (drop VDD for a hundred nanoseconds) can cause a chip to skip an instruction or misread a memory value, which is the basis of voltage-glitching attacks. A well-designed regulator with high loop gain rejects glitches; a poorly designed one passes them through. Attackers and defenders both think hard about the regulator's transfer function.

9.5 3D printer hotend

The simplest closed-loop control system in your house. A thermistor measures temperature; a microcontroller runs PID; a MOSFET drives a 12 V cartridge heater. The plant is roughly first-order with a time constant of 10-30 seconds. PID tuning is done automatically by the firmware; many printers have a "M303" command that does Ziegler-Nichols.

Setpoint: 215 °C. Noise: drafty room, fan air, ambient humidity. PID rejects all of it, holding ±0.5 °C at the print site. Without good control, prints fail.