Underdamped
The controller reacts lazily.
Module 2 ยท Foundation
An autoscaler is a feedback controller.
The single idea
Every feedback controller works the same way.
The controller reacts lazily.
Fastest approach without overshooting.
Overshoot and oscillation.
Stale measurements cause wrong decisions.
Interactive
Tune gain and delay.
Watch convergence
At low ฯ the signal returns in-phase โ stable. As ฯ grows, phase lag accumulates. At the critical frequency where phase = 180ยฐ and gain โฅ 1, the feedback loop generates its own oscillation โ this is the โ1 point you see on the Nyquist diagram.
Frequency domain
How the criterion works, very simply: take the open-loop system โ sensor disconnected, no corrections. Study how "steering wheel" affects "wheels" without your input. Draw a curve showing, at every frequency: how much the signal changes (magnitude) and how much it lags (phase). Then look at the red point (โ1, 0) โ the "danger button." It means: "the signal came back exactly opposite in phase and just as strong as it was." If the curve goes left of that point โ stable. If it wraps around it โ unstable. If it passes through โ on the edge.
The mic and speaker are far apart. Signal decays with each loop. The curve stays to the left of โ1.
Beyond classic PID
Classic PID requires manual tuning. Modern systems use artificial intelligence to auto-tune gains or even replace the PID equation entirely. Below are the key approaches that are changing how we build controllers.
An RL agent discovers optimal gains through trial and error in a simulator. Reward signal: minimize error, overshoot, and settle time.
Real example: Google DeepMind used RL to tune cooling in data centers โ 40% energy reduction.
A neural network directly maps sensor readings to control actions โ no PID formula needed. Trained on historical data or in simulation.
Real example: Tesla Autopilot โ NN processes camera data and outputs steering angle, bypassing any fixed PID structure.
Searches the gain space (Kp, Ki, Kd) intelligently. Builds a probability model of performance vs gains, tests only the most promising candidates.
Real example: Tuning a chemical reactor controller โ each experiment costs thousands. Bayesian Opt finds optimal gains in 10โ30 trials instead of hundreds.
Uses a learned model of the system to look ahead and optimize control actions over a future horizon. ML learns the model from data.
Real example: Energy grid balancing โ predicts demand spikes 30 min ahead, pre-emptively dispatches generation capacity.
Mimics natural selection: a population of gain sets evolves over generations. Weak controllers die, strong ones mutate and recombine.
Real example: Tuning flight controllers for delivery drones in turbulent wind โ finds robust gains that survive real-world noise.
End-to-end automated pipeline: from raw sensor logs, through feature engineering, to a trained controller model. Discovers control structures a human might never invent.
Real example: Autonomous racing โ a learned throttle+steering policy discovered by AutoML beats hand-tuned PID by 0.4s per lap.
The most practical path today is not to replace PID, but to let AI tune it continuously. A reinforcement learning agent watches the system and adjusts Kp, Ki, Kd in real time as conditions change. The controller stays interpretable and safe (PID), while the tuning becomes adaptive and optimal (AI). This is called adaptive PID or neural-PID โ it's already running in industrial plants, drone autopilots, and cloud autoscalers.
What you should see
Click each preset above.
Low gain.
Balanced gain.
High gain.
Stale metrics.
Ki eliminates error.
Cross-domain transfer
After the lab, map the model to your stack.
Gain and delay in the lab.
Power stage with sensor delay.
PWM + encoder sampling delay.
Phase-locked loop is feedback.
Self-check