A point robot of mass m moves under a control force computed by a genuine discrete PID law from the position error e = target − position:
e(t) = target − pos
I += e·dt (anti-windup clamped)
u = Kp·e + Ki·I + Kd·(−velocity)
a = u/m − c·velocity/m
v += a·dt ; pos += v·dt
Raise Kp and the robot accelerates toward the target faster but overshoots more; raise Kd to damp that overshoot; raise Ki to kill any steady-state offset left by friction or a disturbance force, at the cost of slower settling and possible oscillation if it's too high. Toggling the disturbance adds a random wandering force to the plant, the way real sensor noise or wind/friction variation would — watch the integral term fight it to hold position.
- Overshoot — how far the robot travels past the target on its first approach, as a percentage of the initial distance.
- Settling time — elapsed time from the moment a target is set until the error stays inside a small tolerance band continuously.