The simplest feedback rule: push harder the farther you are from the goal.
Key idea
A proportional controller sends $u = K_p\, e$. The gain $K_p$ sets how hard it pushes per unit of error. Real motors have limits, so the command is clipped to what the motor can give (this is called saturation).
Why it works
Far from the goal the command is big; near it, small. So the robot slows as it arrives. But with friction or a load, a small error makes too small a push to move, so P control alone often stops a little short. That leftover is called steady-state error.
Worked example: Command
$K_p = 3$, setpoint 40, measurement 25.
- $e = 15$.
- $u = 3 \times 15 = 45$.
Answer: 45.
Worked example: Saturated
$K_p = 8$, $e = 40$, motor limit Β±255.
- $u = 320$, past the limit.
- Clipped to 255.
Answer: 255.
Common mistake
Forgetting the motor's limit. Big gains with big errors ask for commands the motor cannot give.