All simulations
Simulation · Control · PID

Inverted pendulum

A cart on a track, a pole balancing on top, and a controller trying to keep the pole vertical.

controller active
θ(t) — angle from vertical
last 8s

Try Kp=0, Ki=0, Kd=0to watch gravity win. Then slide Kp and Kd up. Notice PID can get stuck pinned against a wall — it only reacts to angle, so it can’t make the wrong-way move needed to recenter the cart.