PID Controller
How do you hold a spring at a target when a steady load pulls it away?
Position 0.00 m Time 0.0 s Same steady load on both runs
Spring and damper model G(s) = 1 / (s² + 0.4s + 1)
What you are looking at
- With controller
- The position of the mass as the controller pushes against the load.
- No controller
- The position of the same mass under the same load with no corrective push.
- P: push in proportion to the error
- Push toward the target in proportion to how far away it is.
- I: push harder the longer the error lasts
- Build up a push while the mass stays on one side of the target.
- D: brake when closing fast
- Push against the measured motion to damp the swings.
Try this
- Try P only. Where does the mass stop?
- Pick PI. Watch the push build, then look for overshoot.
- Compare PID with Too much gain. Watch PID brake the mass and Too much gain make the swings grow.
Key idea
The three pushes use the gap now, the gap accumulated over time, and how fast the mass moves. Together they can hold the target against a steady load.