Lesson 5 of 21 in this unit
Correct errors using feedback.
Tune an ideal cart controller and inspect overshoot, velocity damping and delayed measurements.
By the end: Explain setpoint error, proportional force, damping and delayed feedback, and compare finite-horizon responses without claiming stability from one run.
Prerequisites and path options
Why learn this? Understand how repeated correction can reject disturbances or cause oscillation when delayed or too aggressive.
Start with something concrete.
Imagine pushing a cart to a marked line. Pushing toward the line is not enough: the cart may still be moving fast when it arrives.
Try the interactive modelA cart reaches its target position while moving quickly. Is its position error alone enough to conclude it has settled?
Change one thing. Watch what follows.
Loading this browser experiment…
Understand what changed.
A shorter explanation, with the original worked examples available below. Both explain the same experiment and its limits.
The idea in everyday terms
Feedback repeatedly compares the desired state with an observation and applies a correction. Stronger correction can respond quickly but can also overshoot, especially when readings are delayed. Damping responds to motion to reduce oscillation.
What to watch in the experiment
Compare the same disturbance under different gains and observation delays. Inspect the requested force, force actually applied and resulting position separately. Physical drag and controller damping are different contributions even if both reduce motion.
What this does not establish
A short trace within the settling bands is not a proof of permanent stability. The cart model omits many real actuator and sensor effects, so it does not certify a physical controller.
Open the full worked examples, calculations and limitations
This is the same reference used in Technical mode. Expand it whenever you need the exact numbers, assumptions or further explanation.
Reaching the mark is not the same as stopping
A cart can cross a target while moving too fast to remain there. Feedback control repeatedly measures the cart, compares its position with a setpoint (the desired position), and requests a correction. The lab starts a one-kilogram cart at rest at zero and sets its target to one metre.
The error is setpoint minus measured position. Positive error asks for a push in the positive direction. A proportional controller multiplies error by a gain Kp to request force. The gain has units newtons per metre: a 0.5 m error with Kp = 4 N/m requests 2 N.
Force changes velocity, and velocity changes position
A push does not set position directly. Net force divided by mass gives acceleration, which changes velocity. Velocity then changes position. A cart still moving at the target can overshoot even if proportional force is momentarily zero.
Velocity damping subtracts Kd times measured velocity from the requested force. With positive velocity, this term brakes motion; with negative velocity it pushes the other way. Kd has units newton-seconds per metre. This is a PD-style controller using an observed velocity, not a full PID controller: no accumulated-error integral term is implemented.
The position and velocity terms add before the actuator limit. The lab records both requested force and the applied force clipped to ±20 N. Raising a gain can simply produce more saturation instead of the response expected from an unlimited-force formula.
Physical drag and active damping are different
Physical drag opposes the cart’s true current velocity. Active damping is a command computed from measured velocity. With ideal current observations they may have similar effects in this simple equation, but delayed measurements separate them: the controller can brake according to an old motion direction.
The plant equation is mass × acceleration = applied force + disturbance − physical drag coefficient × true velocity. The mass is fixed at 1 kg. A selectable disturbance acts from 2.0 to 2.2 seconds; it is an external force, not a forged sensor value or an extra controller term.
Why the simulation is sampled even with an exact plant update
The controller samples every 0.02 seconds, then holds the applied force constant for that interval. Between samples, linear drag and constant forcing have an analytic solution; the simulator uses that solution rather than an Euler approximation. This removes one source of numerical integration error, but it does not make the controller continuous-time. Sampling, delayed information and saturation remain part of the modeled system.
The zero-drag case is familiar constant acceleration: next velocity is current velocity plus acceleration times duration, and next position adds velocity times duration plus half the acceleration times duration squared.
A delayed observation is old information
The inspector shows two timestamps: when the controller acts and when its observation was taken. Both measured position and measured velocity come from that older sample. The simulator knows true current state to evolve the physical model and report diagnostics, but the controller does not secretly use it.
Before time zero, the cart is assumed to have remained at rest at zero. Negative observation timestamps therefore have a defined initial history. This matters: changing initialization can change a delayed controller’s early response.
Try the damped controller with delay, then increase gain. A correction can arrive after the cart has already moved across the target. The resulting force may increase oscillation. There is no universal rule that higher gain, more damping or more effort improves every delayed system.
Judge a response over time
Overshoot measures how far position exceeds the target. The lab reports the largest observed sample overshoot; a sampled maximum need not equal the continuous-time maximum between samples. Settling asks whether the cart remains near the target with low speed, rather than merely passing through it.
Here observed settling requires every remaining recorded sample to stay within 0.02 m of the target and 0.02 m/s of rest, with at least half a second of observations remaining. The eight-second horizon is part of that claim. Failure to settle within it does not alone prove divergence, and a passing trace does not prove stability forever.
Stability concerns how a system’s behavior responds over time and under perturbations. One finite trace cannot establish all initial conditions, delays, disturbances or unmodeled effects. The plot keeps its axes fixed so large oscillations are not made visually small by rescaling. Clipped sample counts and exact receipts remain visible.
Write a claim you can test
Capture proportional-only and damped runs under the same initial conditions. Change one factor, such as delay, and compare error, speed, overshoot and saturation. Inspect the delayed receipt at a target crossing. For implementation practice, independently integrate a held-force interval and check the observation timestamps; matching an attractive plot is insufficient.
For a decision brief, state the conditions tested and the finite-horizon acceptance rule. Identify additional actuator, sensor, disturbance and model-mismatch evidence that would be needed before deployment. This ideal local cart controls no hardware. Temporary exported comparisons are practice, not independent implementation review or completed learner pilots.
With delayed sensing, which velocity should the programmed controller use?
Take this idea with you.
Feedback reacts to measured error. Damping, delay, sampling and actuator limits all affect the response; inspect motion over time rather than a single target crossing.
Explore related topics and the topic map
How this topic connects
Explore this topic on the interactive mapUse these connections to review a foundation or choose where to go next. You can open any topic without completing the others.
What it builds on
- Turn a target into motion
Translate a desired position into joint choices while recognizing unreachable targets and multiple solutions.
- Vectors and matrices refresher
Treat a list of numbers as one representation and trace weighted sums. These operations connect the lesson’s inputs to its outputs.
Tune an ideal cart controller and inspect overshoot, velocity damping and delayed measurements.
What it enables
- Learn continuous dynamics
Learn what a prediction model gains from collected motion and when a simpler baseline already earns its place before adding planning cost.
- Plan briefly then observe again
Compare the benefit of observing and replanning with the work and errors added by a longer search horizon.
- Choose continuous actions
Explore how action limits and smooth control affect a physical system’s response.
Show 3 more connections
- Stop when the controller leaves its limits
Identify when a controller’s assumptions no longer hold and a fallback is needed.
- Turn observations into estimates
Separate noisy measurements from estimated motion before using them to control a system.
- Reason about forces and contact
Understand why a geometrically possible movement can fail once forces and contact matter.