Open-Loop vs. Closed-Loop Feedback
Up to now, we've treated robot motion like drawing on graph paper — ask for an angle, and the arm magically snaps there. The first time you power up real motors on a workbench, you learn fast that physics pushes back. Gravity pulls links downward, joints stick with friction, and a blind motor command almost never lands where you hoped.
Core ideas covered in this module
- Open-loop drift & steady-state sag
- Error signals & negative feedback
- Disturbance rejection
Why blind commands sag and drift
Imagine holding your foot completely steady on a car's gas pedal at 30% throttle. On flat pavement, you might cruise happily at 45 mph. Hit a steep hill, catch a headwind, or load three friends into the back seat, and your speed drops even though your foot didn't move an inch. That's open-loop control: you send a command based on a guess, and you never look at what actually happened.
A robot arm running open-loop has the exact same problem. Suppose you calculate how much motor current it takes to hold a 1 kg arm horizontal, and you send that fixed current. If someone clips a 200 g camera onto the wrist, or the gearbox warms up and loses a bit of friction, the arm quietly sags below the target. Worse, if a breeze or a light bump knocks the arm aside, an open-loop controller has no idea anything went wrong.
Closing the loop with an error signal
Closed-loop feedback fixes this by constantly asking one simple question: where do I want to be, minus where am I right now? That difference — target minus measured position — is the error signal e(t).
Once a joint encoder tells the controller the real angle hundreds or thousands of times a second, the motor can react automatically:
- If the arm sags below the target, error becomes positive and the motor pushes harder upward.
- If the arm overshoots above the target, error flips negative and the motor pulls back.
- If someone pokes the arm mid-task (an external disturbance), the encoder spots the deviation immediately and the controller fights to reject it.
Interactive lab
Gravity-Loaded Single-Joint Arm PID Tuner
marimo· LiveThe stubborn catch: proportional droop
Even with feedback turned on, notice something sneaky in the plot when Gravity Compensation is off and Ki is 0: the arm climbs up toward the target, stops oscillating, and then settles noticeably below the dashed target line.
Why doesn't a simple proportional controller finish the job? Because proportional torque equals Kp times error. If the arm ever reached zero error, the motor torque would drop to zero too — and gravity would immediately yank the arm right back down. So the arm finds a compromise angle where its sag creates just enough error to hold up its own weight.
The feedback error signal
e(t) = θ_target − θ_measured(t) → τ_fb = f(e, ė, ∫e dt)
Open-loop control ignores θ_measured entirely. Closed-loop control measures the gap at every tick and turns that gap into corrective motor torque.
You command an open-loop motor torque calibrated for an empty gripper, then pick up a heavy wrench without changing the command. What happens?
Even when a learned policy runs slowly at 20–50 Hz, real robots rely on a tight inner feedback loop running at 500–2,000 Hz right at the motor drivers to track targets cleanly and reject unexpected bumps.
Hands-On Python Notebook
01 · Open-Loop vs. Closed-Loop Feedback Lab
Simulate a single-joint arm under gravity and compare blind open-loop torque commands against closed-loop feedback under payload shifts.
Try this on your own inside the notebook
- Double the link mass and measure how far open-loop sags vs. closed-loop
- Inject a step disturbance torque at t = 1.5 s and watch recovery
In Google Colab, use File → Save a copy in Drive to keep your own edits and notes. Or download the files directly:
uvx marimo edit --sandbox notebooks/course-4/01_open_loop_vs_closed_loop.pyWrap up this module
Saved automatically in your browser profile so you can pick up right where you left off.