Section 7.1: Open-loop vs. closed-loop control

A Careful Control Loop
Technical illustration for Section 7.1: Open-loop vs. closed-loop control.
Figure 7.1A: Open-loop vs. closed-loop control for a robot arm: the open-loop version drifts when gravity is mis-modeled; the closed-loop version corrects the joint-angle error on every tick.
Big Picture

Open-loop vs. closed-loop control is one lens on Control for AI Practitioners. We study it because an embodied agent needs decisions that survive contact with noisy sensors, delayed effects, and changing environments.

This section develops the technical contract for Open-loop vs. closed-loop control into a usable mental model. First we define the object of study, then we connect it to the agent loop, then we test it with a compact implementation.

The key question in Open-loop vs. closed-loop control is practical: what must the agent know, what can it observe, what action is available, and what evidence shows that the action worked under the stated conditions?

Action Is The Test

A representation earns its place when it changes the measurable action interface. In Open-loop vs. closed-loop control, the reader should keep asking which decision becomes easier, safer, or more reliable.

Theory

For Open-loop vs. closed-loop control, the practical design rule is to make the interface inspectable before optimization begins: inputs, outputs, units, latency, bounds, and failure labels should all be visible in the saved artifact.

An open-loop controller commits to an action sequence before it sees the consequences: $a_{0:T-1}=g(r_{0:T-1}, \hat s_0)$. This works when the plant model, initial state, and disturbances are predictable enough that the planned sequence remains valid. A closed-loop controller instead computes $a_t=\pi(\hat s_t,r_t)$ after each new estimate, so perception and state estimation can correct drift, slip, delay, and contact surprises.

Open Loop Is A Promise, Closed Loop Is A Conversation

Open-loop control is a promise that the world will behave as predicted. Closed-loop control treats every observation as a chance to renegotiate the next action. The engineering question is not which one sounds smarter, but whether sensing is timely and reliable enough to improve the next command.

Mechanism

The mechanism in Open-loop vs. closed-loop control is the contract between representation and action. Name what enters the module, what leaves it, which assumptions make that transformation valid, and which log would reveal a bad handoff.

Worked Example

The cleanest way to feel the difference between an open-loop plan and a closed-loop controller is to run both on the same plant with the same unmodeled disturbance. Code Fragment 7.1.1 simulates a 1D point mass (\(m\,\ddot x = u\)) twice. The open-loop path commits to a precomputed force profile that would reach the target under a perfect model. The closed-loop path runs a discrete PID law, \(u(t)=K_p e(t)+K_i\!\int e\,dt+K_d\,\dot e(t)\), with an anti-windup clamp so the integral term stops accumulating while the actuator is saturated. A constant 2 N disturbance enters both runs.

import numpy as np

# 1D point mass  m*xdd = u (force).  Compare an open-loop plan with a PID loop.
m, dt, T = 1.0, 0.02, 4.0
n = int(T / dt)
kp, ki, kd = 12.0, 4.0, 6.0
u_max = 8.0          # actuator force limit (saturation)
x_ref = 1.0          # step setpoint, meters

def step(x, v, u):
    a = u / m
    return x + v * dt, v + a * dt

def open_loop(dist):
    # Bang-bang plan that "should" reach x_ref if the model were exact.
    u_plan = np.where(np.arange(n) < n // 2, u_max, -u_max)
    x, v, xs = 0.0, 0.0, []
    for k in range(n):
        x, v = step(x, v, np.clip(u_plan[k] + dist, -u_max, u_max))
        xs.append(x)
    return np.array(xs)

def pid(dist):
    x, v, ei, e_prev = 0.0, 0.0, 0.0, x_ref
    xs, errs = [], []
    for k in range(n):
        e = x_ref - x
        ei_trial = ei + e * dt
        de = (e - e_prev) / dt
        u_unsat = kp * e + ki * ei_trial + kd * de
        u = np.clip(u_unsat, -u_max, u_max)
        if u == u_unsat:            # anti-windup: integrate only when not clamping
            ei = ei_trial
        x, v = step(x, v, u + dist)
        xs.append(x); errs.append(e); e_prev = e
    return np.array(xs), np.array(errs)

dist = 2.0  # unmodeled constant force disturbance (N)
xs_ol = open_loop(dist)
xs_cl, errs = pid(dist)
print(f"open-loop final pos   = {xs_ol[-1]:+.3f} m  (target {x_ref:.1f})")
print(f"closed-loop final pos = {xs_cl[-1]:+.3f} m  steady error = {errs[-1]:+.4f} m")
open-loop final pos = +35.960 m (target 1.0) closed-loop final pos = +1.102 m steady error = -0.1026 m
Code Fragment 7.1.1: the same 2 N disturbance pushes the open-loop plan tens of meters past the target, while the closed-loop PID law re-estimates the error every tick and holds the mass near 1 m. Plotting errs against np.arange(n) * dt shows the closed-loop error decaying toward a small residual that integral action keeps shrinking.
Library Shortcut

The fragment should expose reference, command, measured state, disturbance, and error. python-control can analyze simple loops, Drake and ROS 2 control connect models to actuators, and the hand check shows why feedback changes behavior.

Practical Recipe

  1. Write the observation, action, and success metric before choosing a model.
  2. Build a baseline that is simple enough to debug by inspection.
  3. Add the library implementation only after the baseline behavior is understood.
  4. Record failures as structured cases: perception error, state error, planning error, control error, or evaluation error.
  5. Run at least one perturbation test before trusting the result.
Common Failure Mode

The common mistake in Open-loop vs. closed-loop control is to celebrate the component score before checking the closed-loop handoff. The failure usually appears at the boundary: stale state, wrong frame, delayed action, saturated actuator, or metric that ignores the real task cost.

Practical Example

A robotics team using Open-loop vs. closed-loop control should log not only final success, but intermediate observations, chosen actions, controller status, and recovery events. The logs reveal whether the method is solving the task or merely passing the easiest episodes.

Memory Hook

For open-loop vs. closed-loop control, the useful test is simple: could a teammate point to the log line, plot, or trace that proves the idea changed the agent's next action?

Research Frontier

For Open-loop vs. closed-loop control, treat frontier claims as hypotheses until they expose enough detail to reproduce the result: data boundary, embodiment, controller interface, evaluation panel, and failure cases.

Self Check

Can you name the observation, state estimate, action, success metric, and most likely failure mode for Open-loop vs. closed-loop control? If not, the system boundary is still too vague.

Production Pattern

Open-loop vs. closed-loop control sits inside the Part II robotics contract: geometry defines where things are, kinematics defines what motion is possible, dynamics defines what motion costs, control defines how errors are corrected, and sensing defines what the agent can know on time.

Open-loop plans need disturbance assumptions, while closed-loop controllers need measurement and timing contracts. This makes the section useful to students, builders, and researchers at the same time: the idea has an intuitive role, a formal interface, a runnable check, and a failure mode that can be reproduced.

Mechanism To Watch

For Open-loop vs. closed-loop control, control closes the loop between estimated state and action. Keep reference, measured state, error signal, control law, actuator limits, and safety fallback separate in the evidence record.

Library Choices And Verification Checks
Tool or LibraryWhat It HandlesVerification Check
python-controlanalyzes linear systems, transfer functions, state-space models, and feedback loopsVerify units, sample time, poles, stability margin, and reference scaling.
CasADiformulates optimization-based controllers with constraints and horizonsVerify constraints, warm start, solver status, and deadline behavior.
Drakemodels dynamical systems, multibody plants, optimization, and controllersVerify scalar type, plant finalization, frame convention, and solver status.
do-mpcformulates optimization-based controllers with constraints and horizonsVerify constraints, warm start, solver status, and deadline behavior.
ROS 2 controlsupports practical work on Open-loop vs. closed-loop controlVerify the library output against the hand-built baseline on one small case.

Use this recipe when turning Open-loop vs. closed-loop control into code, a simulator experiment, or a robot diagnostic. The point is not to use every library. The point is to keep the hand-built baseline and the maintained-tool path comparable.

  1. Write the control objective, measured state, actuator command, update rate, and saturation policy.
  2. Run a step-response test before adding learning, with overshoot, settling time, and steady-state error logged.
  3. Compare the hand controller with python-control, CasADi, Drake, do-mpc, or ROS 2 control on the same plant model.
  4. Record latency, missed deadlines, saturation events, constraint violations, and recovery actions.
  5. Only compare controllers and policies when they share sensors, action limits, disturbance tests, and safety checks.
Evidence Gate

For Open-loop vs. closed-loop control, compare methods only through one saved artifact that preserves the inputs, outputs, units, timestamps, latency budget, configuration, seed, metric definition, and failure labels relevant to this section. The comparison is meaningful only when the same script evaluates the same panel.

Exercise Extension

Extend the section exercise by adding one perturbation specific to Open-loop vs. closed-loop control and one latency or uncertainty check. Save the result in the EvidenceRecord schema, then explain which library output you trust and why.

An open-loop plan can look perfect in simulation because no observation is allowed to contradict it. Test it with a pose offset, a delayed actuator command, and a small unmodeled disturbance, then compare the same trial under a closed-loop policy that re-estimates state after each action. If the two disagree, inspect sensing latency, frame conventions, actuator saturation, and the exact point where feedback re-enters the decision loop before changing the model.

Technical Core

Open-loop vs. closed-loop control needs a topic-native core: variables, equations or system contracts, an algorithmic procedure, an expected output, and a failure diagnosis. Figure 7.1.T summarizes the chain this section must preserve when moving from a teaching example to a real embodied system.

Technical core for Open-loop vs. closed-loop control A block diagram connecting assumptions, model, algorithm, evidence, and failure analysis for Open-loop vs. closed-loop control. Assumptions frames, units, limits Model feedback control Algorithm update or plan Evidence trace, metric Failure diagnosis Graduate-depth contract: define variables, run the method, interpret output, and explain when it fails. This diagram marks the minimum technical chain the section must make explicit.
Figure 7.1.T: The technical core for Open-loop vs. closed-loop control connects assumptions, model, algorithm, evidence, and failure analysis.
Formal Object

Open-loop: choose $a_{0:T-1}$ once from $\hat s_0$ and a reference $r_{0:T-1}$. Closed-loop: update $\hat s_t=h(\hat s_{t-1},a_{t-1},o_t)$ and choose $a_t=\pi(\hat s_t,r_t)$. The closed-loop form is more robust only when $o_t$ arrives fast enough and the estimator is trusted more than the original prediction.

Controller evaluation loop
  1. Define the reference, measured state, error signal, actuator command, update rate, and saturation policy.
  2. Run a step or disturbance response before adding learning.
  3. Log overshoot, settling time, steady-state error, latency, saturation, and recovery behavior.
  4. Compare PID, LQR, or MPC only under the same plant, sensors, limits, disturbance panel, and metric code.
Technical Contract For Open-loop vs. closed-loop control
Contract FieldWhat To SpecifyWhy It Matters
State and observationVariables, units, timestamps, frames, and uncertainty.Prevents a model score from being mistaken for robot capability.
Action interfaceCommand type, limits, update rate, and safety fallback.Makes the learned or planned output executable.
Evidence artifactTrace, metric, configuration, seed, and failure label.Allows baseline and library path to be compared in one pass.
Tool pathpython-control, CasADi, do-mpc, Drake, ROS 2 control, MuJoCoShows the practical library route after the mechanism is understood.

For Open-loop vs. closed-loop control, expected output is a trace where the relevant error decreases, overshoot stays within the design bound, and actuator commands remain within limits under the stated timing budget.

Failure Mode To Test

Open-loop vs. closed-loop control should be stress-tested under delay, integral windup, actuator saturation, unmodeled friction, and reference-frame mismatch before the nominal trace is trusted.

Section References

Core references for Open-loop vs. closed-loop control: Modern Robotics; Murray, Li, and Sastry; Siciliano et al.; LaValle; and official documentation for Drake, MuJoCo, Pinocchio, CasADi, python-control, GTSAM, ROS 2, and OpenCV as applicable.

Use these references to check notation, frame conventions, units, solver assumptions, and maintained-library behavior.

Key Takeaway

Open-loop vs. closed-loop control is useful when it makes the perception-action loop more reliable, not when it merely adds a more impressive model name.

Exercise 7.1.1

Design a method-matched experiment for Open-loop vs. closed-loop control. Specify the environment, observations, actions, metric, one perturbation, and the library output you would compare against the hand-built baseline.