Control Theory & Feedback

James Phoenix
James Phoenix

Systems thinking in mathematical form.


Engineering Applications

  • Rate Limiting: Feedback loops for traffic shaping
  • Autoscaling: PID controllers for resource management
  • Observability: Measuring system state for control
  • Circuit Breakers: State machines with feedback
  • Queue Management: Backpressure and flow control

Core Concepts

Feedback Loop

Output → Sensor → Controller → Actuator → System → Output

Every stable system has feedback. Without measurement, no control.

Open Loop vs Closed Loop

Type Description Example
Open Loop No feedback, fire-and-forget Scheduled job
Closed Loop Continuous feedback and adjustment Autoscaler

Closed loops are more robust but more complex.

PID Control

u(t)=Kpe(t)+Ki∫e(t) dt+Kdde(t)dtu(t) = K_p e(t) + K_i \int e(t)\,dt + K_d \frac{de(t)}{dt}
Term Purpose
P (Proportional) React to current error
I (Integral) Eliminate steady-state error
D (Derivative) Dampen oscillations

Stability

A system is stable if it returns to equilibrium after disturbance.

Leanpub Book

Read The Meta-Engineer

A practical book on building autonomous AI systems with Claude Code, context engineering, verification loops, and production harnesses.

Continuously updated
Claude Code + agentic systems
View Book

Signs of instability:

  • Oscillation
  • Runaway growth
  • Cascading failures

System Design Connections

Rate Limiting as Control

  • Measurement: Request count per window
  • Setpoint: Requests per second limit
  • Actuator: Accept/reject requests
  • Feedback: Adjust based on current rate

Autoscaling as PID

  • P: Scale based on current CPU/memory
  • I: Account for sustained load
  • D: Anticipate load changes (predictive scaling)

Circuit Breaker States

Closed → [failures > threshold] → Open
Open → [timeout] → Half-Open
Half-Open → [success] → Closed
Half-Open → [failure] → Open

This is a state machine with feedback.


Key Insight

Tests = Behaviour (what should happen) OTEL = Physics (what did happen)

You need both to have control. Tests define the setpoint. Observability provides the measurement.


Related

Explore it visually

Topics
Control TheoryPerformanceReliability

Newsletter

Become a better AI engineer

Weekly deep dives on production AI systems, context engineering, and the patterns that compound. No fluff, no tutorials. Just what works.

Join 306K+ developers. No spam. Unsubscribe anytime.


More Insights

Cover Image for Why Unrealistic /goal Targets Keep Coding Agents Working Longer

Why Unrealistic /goal Targets Keep Coding Agents Working Longer

I used an unrealistic tutor-discovery target to keep Codex working beyond a finished-sounding handover. Here is the run, the results and the reusable prompt.

James Phoenix
James Phoenix
Cover Image for Why I Threw Away My Video Harness When Opus 5.5 Arrived

Why I Threw Away My Video Harness When Opus 5.5 Arrived

I spent £700 on video analysis. A week later, Opus 5.5 outperformed my custom harness and changed how I think about constraints, consistency and model progress.

James Phoenix
James Phoenix