Can the robot deliver with a noisy sensor and bounded control?
Choose a laboratoryCheck my intuition
01 · Predict
Before changing the settings.
With Kp = 3, position error 1 m, Kd = 2, estimated velocity 0.5 m/s and Ki = 0, what command is computed before saturation?
A hint
u = Kp × error − Kd × estimated_velocity
02 · Experiment and compare
Put the model to the test.
The same robot receives measurements, estimates position and velocity, then commands acceleration towards A* waypoints. Compare Kalman feedback with raw measurements and an ideal reference. Step through time, then open the three challenges below the diagram.
Grey dashes: A* plan. Brown line: actual disk motion. Blue dashes: estimate; dots: received measurements; empty circle: current target. Origin is top left, x goes right and y goes down. The ellipse appears only for Kalman.
Kalman · Delivery succeeded. Current target (7.5 ; 7.5) m.
A button replaces current settings with a prepared scenario. Saved records remain in your notebook. Goals are checked over the complete simulation even when playback shows an earlier time.
1 · Deliver with a noisy sensor
Keep σ ≥ 0.25 m. Using Kalman, deliver without collision and reduce estimation RMSE relative to raw measurements. Adjust confidence and control; keep actual noise unchanged.
A hint to get started
Vary √q before changing several gains. Estimated arrival does not guarantee an actual stop inside the goal.
2 · Compensate a disturbance
Keep disturbance acceleration at least 0.4 m/s². Add integral action, then tune the filter and damping to deliver using Kalman without collision.
A hint to get started
Start around Ki = 0.3 and √q = 1.5, then compare effects separately. Integral state resets at each waypoint.
3 · Diagnose bias
Keep |bias| ≥ 0.3 m. Estimate the offset from a known position, enter its correction and then deliver using Kalman. The filter does not know actual bias.
A hint to get started
At known position x = 0.5 m, compare x measurements with the reference. The entered correction is subtracted from each x measurement.
Choose one of the three challenges to load a guided experiment.
Compare the three feedback signals.
All three robots use the same plan, gains and time-indexed noise. Feedback changes their trajectories and evaluated duration. The ideal reference supplies true state to the controller and is unavailable without a perfect sensor. Statistics cover each complete trial and are not population success rates.
PID feedback
Actual delivery
Collision
t (s)
Final error (m)
Estimation RMSE (m)
Distance (m)
Effort ∫‖u‖²dt
Raw measurements + finite differences
No
No
90.00
2.96
0.24
28.40
448.78
Kalman
Yes
No
31.90
0.08
0.09
13.79
18.62
True state · ideal reference
Yes
No
29.00
0.03
0.00
13.42
16.29
Understand the calculations
03 · Connect the diagram to calculations
The numbers behind motion.
The robot is a holonomic unit mass: both accelerations are independently controlled. A* plans once between centres of one-metre cells. PID advances using only its estimate, within 0.12 m and below 0.25 m/s, with ten consecutive stable steps at the final point.
Two position–velocity filters use known commands, drag 0.6 s⁻¹ and Joseph covariance updates. Measurements arrive every 0.2 s with independent Gaussian errors. The x bias and y force after 8 s are unknown to the filter. You supply bias correction. Without filtering, velocity comes from measurement differences and the model predicts between measurements.
PID is limited to ±2 m/s² per axis, with anti-windup and integral bounded to ±2 m·s, reset at waypoint changes. A geometric detector stops a trial before the radius-0.12 m disk penetrates an obstacle. The evaluator uses true state to accept delivery within 0.22 m and below 0.3 m/s. The ellipse covers 95% of the 2D Gaussian model, without guarantees under bias. Budget is 90 s. The map is known; perception, arms, differential wheels and generative networks are not integrated.
Δt = 0.05 s ; d = 0.6 s⁻¹
f = 1 − d Δt
F = [[1, Δt f], [0, f]] ; B = [Δt², Δt]ᵀ
x̂⁻ = F x̂ + B u ; P⁻ = F P Fᵀ + q B Bᵀ
z = true_position + bias − correction + noise
K = P⁻ Hᵀ / (H P⁻ Hᵀ + R), H = [1,0]
u = clip(Kp(target − x̂) + Ki I − Kd v̂, −2, 2)
v ← f v + Δt(u + unknown_disturbance)
x ← x + Δt v
A few lines to reconstruct
plan = astar(known_map)
for time in simulation:
estimate = kalman_correct_if_measurement(prediction)
target = next_waypoint_using(estimate)
command = bounded_pid(target, estimate)
truth = physical_step(command, unknown_disturbance)
prediction = kalman_predict(estimate, command)
The notebook provides one function per laboratory, hand-calculated examples and tests. Exercises isolate components; these pages run the complete simulations.
Compare two settings. Record the effect, your explanation and a case where the model might fail. Saving keeps the current settings and seed, not a certification of competence.