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.
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 model ↓A 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.
- Compare proportional-only and velocity-damped controllers.
- Keep gains fixed while adding measurement delay.
- Separate physical drag from active velocity damping.
- Inject a known short external force and inspect recovery.
- Read requested versus saturated applied force from a receipt.
- Capture matched runs and distinguish sampled settling from a stability proof.
Loading this browser experiment…
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.