Fix one case before changing gains
Comparing PID settings requires the same plant, setpoint, sampling time and output limits. If everything changes at once, a different response does not tell you which decision caused it.
For practice, use K = 1, τ = 1 s, setpoint 1, maximum sampling interval 0.02 s and control output between 0 and 2. The plant starts at zero. These are normalized units and an ideal first-order plant, not values to copy into a real motor controller.
Observe P-only error first
Set Ki = Kd = 0. At equilibrium, y = K·u and u = Kp·(r − y). Without saturation, y/r = K·Kp/(1 + K·Kp). This explains why proportional control can settle below the reference without the simulation being wrong.
| Kp | Output | Error |
|---|---|---|
| 1 | 0.5 | 0.5 |
| 2 | 0.6667 | 0.3333 |
| 4 | 0.8 | 0.2 |
Now compare Kp = 2, Ki = 1 and Kd = 0 over 20 s. The integral term accumulates error and model output approaches 1. Record u as well: an apparently good output can require a control effort the actuator cannot deliver.
Identify the problem you are observing
- Slow response: observe how long it takes to approach the target and whether control output remains limited.
- Oscillation: look for repeated setpoint crossings. Compare amplitude and persistence; one crossing does not describe the whole response.
- Saturation: control output stays at its maximum or minimum. Raising Ki does not expand those limits.
- Persistent error: check for missing integral action, a short observation window or a physically unreachable setpoint.
Try setpoint 5 with maximum control output 1 and K = 1: steady output cannot exceed 1. Disabling anti-windup shows I continuing to grow without overcoming that limit. Anti-windup blocks integration when it would push harder against a limit.
OhmPlay’s D term acts on the measurement and uses a Tf filter. Change Kd while holding Tf fixed; do not assume more D always helps. Noise, delay and disturbances are absent, so this test does not prove a physical controller is robust.
One record per comparison
- Record the plant, sampling interval, setpoint and limits.
- Change just one gain and observe output, error, control effort and saturation.
- Repeat with a smaller sampling interval. Similar-looking results help assess simulation resolution; they do not replace a stability analysis.
- Explain the improvement you want and the trade-off you accept before tuning.
With K = 2, Kp = 1 and r = 1, without saturation, what is P equilibrium?
y = 2/(1 + 2) = 0.6667. Equilibrium depends on plant gain as well as Kp.
If y cannot reach 5 because K = 1 and maximum u = 1, will increasing Ki help?
No. The highest available steady-state output is y = K·u = 1. Review the setpoint or system capability rather than hiding saturation.
Further reading: MathWorks: saturation and anti-windup ↗. Accessed October 24, 2026. The numerical cases in this guide are original teaching examples, not component measurements.