1. Home
  2. Explore
  3. Computer Science
  4. Real-Time Decision Making

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Real-Time Decision Making

Control Theory: Foundations and Modern Design Patterns

Introduction and Overview

Control theory provides a collection of tools and techniques for analyzing, designing, and implementing complex systems in the presence of uncertainty. The field has evolved from traditional applications like aircraft and building controllers to modern systems such as autonomous vehicles, biological systems, the Internet, and large-scale enterprise systems like battle space management.

The core challenge of control is managing dynamics, uncertainty, feedforward, and feedback — remembered by the acronym DUFF. Control is the product of these four elements working together.


What is Control?

Traditional View

The traditional view of control involves three essential components:

  • Sensing – measuring the system's output (e.g., vehicle speed)

  • Actuation – applying inputs to the system (e.g., pressing gas or brake)

  • Computation – processing sensor data and deciding actuation in a feedback loop

The goal is to achieve desired closed-loop behavior characterized by:

  • Stability – small perturbations remain small or converge back to equilibrium

  • Performance – smooth and quick response to commands

  • Robustness – consistent operation despite uncertainty (e.g., fuel level, car age, number of passengers)

Robust stability and robust performance are the most challenging and interesting aspects. They require the system to maintain stability and performance across a range of uncertain conditions.

Modern View

The modern view extends the traditional view to include interconnections, communications, computing, and software. Control systems now operate at multiple levels of abstraction, as seen in autonomous cars where many subsystems must be coordinated. The field now encompasses dynamics, uncertainty, feedforward, and feedback as fundamental building blocks.


Key Principles of Feedback

Feedback is a tool for managing uncertainty. If there were no uncertainty in a system, feedback would be unnecessary.

Feedback provides two primary benefits:

  1. Managing uncertainty – in both the system itself (age, weight, power) and the environment (road conditions, traffic)

  2. Designing dynamics – feedback can alter the natural dynamics of a system, e.g., making an unstable aircraft stable

These two capabilities together enable modularity and interoperability. A system designed with feedback can be interconnected with different components and still operate consistently because it is robust to the uncertainties introduced by those interconnections.

Advantages and Disadvantages of Feedback

Advantages:

  • Provides robustness to uncertainty by measuring actual behavior rather than predicted behavior

  • Enables modularity through designed dynamics

Disadvantages:

  • Complexity – requires extra sensors, actuators, and computation

  • Potential for instability – e.g., microphone squeal when gain is too high

  • Noise amplification – noisy sensors can cause the controller to react to spurious signals

Principle: If feedback is avoidable, it should be avoided. But every large-scale engineering system (and biological system) involves feedback because uncertainty is inescapable.


Advances in Control Theory

Online Optimization

Massive increases in computational power have enabled online optimization – controllers that recompute optimal trajectories in real time. Example: receding horizon control calculates a trajectory every 0.1 seconds for the next 1–2 seconds, then recomputes. This allows handling highly nonlinear systems with tight constraints. The computing power required 15 years ago ($30,000 worth) is now exceeded by a modern cell phone.

Layering and Abstraction

Complex systems like autonomous vehicles are broken into layers of abstraction, much like in computer science. For example, a self-driving car must simultaneously:

  • Stay on the road and maintain speed (low-level continuous control)

  • Navigate intersections and interact with other vehicles (higher-level discrete decision making)

Formal Methods

Ideas from computer science, particularly temporal logic and verification, are being applied to control systems. Example: a team of robots can use a protocol to switch assignments (who blocks whom) by communicating with neighbors. The protocol is designed so that assignments always resolve correctly, and the system is robust to the dynamics of incoming agents.

Scaling Up

Control theory is now applied to enterprise-level systems such as Internet congestion control, supply chains, and battle space management.


The Standard Model of Control Systems

The standard model provides a general framework applicable to any system with inputs, outputs, and dynamics.

Components of the Control Loop

  1. Process – the system being controlled (e.g., car, computer farm, building). It has inputs and outputs, and its behavior evolves over time (dynamics).

  2. Observer – processes the measured outputs to infer the internal state of the system. Measurements are often noisy and may not directly measure the quantities of interest.

  3. Controller – takes a task description (e.g., "drive at 25 mph") and decides what inputs to apply to the process to achieve that task. The simplest controller would use a perfect model of the process to compute inputs directly – this is open-loop control.

Open-Loop Control

In open-loop control, the controller applies inputs based on a model without measuring the actual output. Example: a traffic light that cycles every two minutes regardless of traffic. Open-loop control works when the model is perfect and there are no disturbances, but it fails when uncertainties exist.

Disturbances and Noise

Disturbances are external influences that affect the process (e.g., wind, temperature changes, traffic). Noise corrupts measurements. These uncertainties make open-loop control inadequate.

Closed-Loop (Feedback) Control

In closed-loop control, the output is measured and fed back to the controller, creating a cycle:

Controller → Process → Observer → Controller

The controller adjusts its actions based on the observed deviation from the desired behavior. Example: cruise control measures speed, compares to desired speed, and adjusts the gas pedal. This compensates for disturbances like hills.

Uncertainty and Unmodeled Dynamics

Control theory is model-based – it requires a model of the process and the uncertainties. However, models are always approximations. The standard model includes an additional block for unmodeled dynamics (e.g., wing flexibility, fuel sloshing). This block represents dynamics that are known to exist but not included in the design model. The designer bounds these uncertainties (e.g., "wings won't bend more than X amount") and designs the controller to be robust to them.

Key insight: The uncertainty block (often labeled "environment") represents bounded but not explicitly specified dynamics. The controller must work despite these unmodeled effects.

Noise

Noise corrupts the measurements. The observer must filter noise to produce accurate state estimates.


Types of Dynamical Systems

Control theory applies to three broad classes of systems, with many intersections:

Continuous State Systems

States vary continuously (temperature, speed, altitude). Dynamics are modeled by:

  • Ordinary differential equations (ODEs)

  • Partial differential equations (PDEs)

  • Difference equations (discrete-time)

Specifications often involve integrated cost over time or space. Linear time-invariant (LTI) systems are particularly well-studied, with many mathematical tools available.

Discrete State Systems

States take discrete values (on/off, left/right, number of parts). Dynamics are described by:

  • Finite state automata

  • Timed automata

  • Petri nets

Specifications are often written in temporal logic (e.g., safety: "nothing bad ever happens"; liveness: "something good eventually happens"). Verification tools are mature, but synthesis (designing controllers that satisfy specifications) is less developed.

Probabilistic/Stochastic Systems

Uncertainty is modeled probabilistically. Representations include:

  • Stochastic ODEs

  • Kolmogorov equations

  • Markov decision processes (MDPs)

Specifications involve probabilities and expected values. Tools are available for LTI systems and MDPs.

All three types fit into the same standard model: process, observer, controller, disturbances, noise, and unmodeled dynamics.


Control Specifications and Performance Metrics

Different layers of control use different types of specifications.

Regulation Problems (Low-Level Loops)

Goal: maintain a desired constant value (e.g., speed, position). Metrics include:

  • Transient response – how the system reacts to a change (e.g., step input from 25 to 35 mph)

    • Rise time – how quickly the system reaches the target

    • Overshoot – how much it exceeds the target before settling

    • Settling time – how long to stay within ±1% of the target

  • Steady-state response – behavior after transients die out, often evaluated using frequency response

    • Gain – amplification or attenuation of sinusoidal inputs at different frequencies

    • Phase lag – delay in response

    • Specifications: "No frequency should be amplified more than X" or "All frequencies above 100 Hz must be attenuated by at least a factor of 10"

Trajectory Optimization (Planning Layer)

Given a model, constraints, and a cost function, compute an optimal trajectory over a finite horizon (time 0 to T). The cost function may include integral costs and terminal costs. This is a core problem in autonomous systems (e.g., cars, quadrotors). Problems may be convex (solvable to global optimum) or non-convex (local optima accepted as "good enough").

Temporal Logic Specifications (Discrete Decision Layer)

For discrete state systems, specifications are expressed in temporal logic:

  • Safety – "nothing bad ever happens" (e.g., always stay at least 1 meter from other cars, never hit the curb)

  • Liveness/Progress – "something good eventually happens" or happens recurrently (e.g., always recharge, always return to lane)

These different specification languages come from different communities (control theory, optimization, computer science). A key challenge is integrating them in a single system.


Design Patterns in Control

Two primary design patterns govern the internal structure of the controller box.

Reactive Compensation (Feedback-Only Pattern)

This is the simplest and most widely used pattern.

Structure:

  • A reference input (desired output) is compared to the measured output to compute an error

  • The error is processed by a compensator (the feedback controller) to determine the control input

  • A reference shaping block pre-filters the reference to avoid large, sudden changes that would cause undesirable behavior (e.g., flooring the gas pedal when a high speed is requested)

Characteristics:

  • Controller reacts only to errors; it waits for a deviation before acting

  • Works well for regulation and tracking when the reference changes smoothly

  • Relies on the compensator dynamics to shape the closed-loop response

  • Uncertainty in disturbances and noise is managed implicitly through feedback

  • Unmodeled dynamics are always considered implicitly

Performance goals:

  • Stability – return to equilibrium after disturbances

  • Performance – good tracking of reference changes

  • Robustness – works despite model inaccuracies

This pattern was dominant when computation was limited because it only requires simple operations (e.g., multiply error by a gain).

Predictive Compensation (Feedforward + Feedback Pattern)

A more modern and powerful pattern that exploits cheap computation.

Structure:

  • A trajectory generation module receives the task description and computes a nominal state trajectory and nominal control input using a model of the process (and possibly the environment)

  • An observer estimates the actual state of the process

  • The state error (difference between estimated state and nominal state) is computed

  • A feedback compensator on the state error produces a correction

  • The correction is added to the nominal input to produce the actual control input

Key features:

  • Feedforward – the nominal input is computed from the model, so the controller can anticipate what's needed (e.g., press gas harder when climbing a hill)

  • Feedback – corrects for model imperfections, disturbances, and noise

  • The trajectory generation is continuously recomputed (replanning) – this dashed-line loop makes the trajectory generation itself part of a feedback loop

Example: Autonomous cars plan a trajectory (where to steer, how fast to go) for the next few seconds based on a model of the car and environment. If the road is wet, they replan. This recomputation happens many times per second.

When to use:

  • Use purely reactive control if it suffices (simpler, cheaper)

  • Use predictive compensation when the task requires looking ahead (e.g., lane changing, satellite antenna tracking on a moving vehicle)

  • The availability of cheap computation has made the predictive pattern increasingly common

Trade-off: Better performance requires better models. Data-driven models (e.g., from billions of miles of driving) can replace physics-based models for trajectory generation.


Conclusion

Control theory provides a systematic framework for designing systems that must operate reliably in the face of uncertainty. The core ideas are:

  • Feedback as a tool for managing uncertainty and designing dynamics

  • Model-based design with explicit consideration of unmodeled dynamics

  • Layered architectures combining continuous and discrete decision making

  • Two design patterns – reactive compensation (simple, feedback-only) and predictive compensation (feedforward + feedback, enables planning)

Modern control systems exploit abundant computation to perform online optimization, receding horizon control, and continuous replanning, making them far more capable than their predecessors. The same principles apply across a vast range of applications, from autonomous vehicles to supply chains to biological systems.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent