On paper
Plant G(s) = 1/(s+1), PI controller 4·e + 8·∫e dt, goal steps to 1. With no limits it overshoots 7.2% and settles within 2% in 1.73 s. But at t = 0 it asks for u = 4.
Saturation and windup
A motor has a top speed; a valve opens only so far; a heater has a maximum power. Our actuator gives at most 1.5. Ask for 4 and it gives 1.5: the extra is simply lost. This clipping is called saturation.
At t = 0 the controller asks for 4 and gets 1.5. While stuck at the limit the loop is open: y = 1.5(1 − e^−t), slower than designed. It reaches the goal only at t = ln 3 ≈ 1.10 s.
All that time the error stays positive, so the integral keeps adding. When y first reaches 1, I holds 3.61. The plant needs only 1 to stay at 1, and the actuator gives at most 1.5. This build-up is integrator windup.
With I = 3.61 the request stays above 1.5, so the actuator keeps pushing at full power past the goal until t = 1.91 s. Only negative error drains I. y overshoots to 1.285 (28.5%) and settles in 3.27 s.
Anti-windup
Anti-windup by clamping, also called conditional integration: while the actuator is saturated and the error pushes the same way, the integral holds still. It adds again as soon as the request is back inside the limit.
Same gains, same limit. I holds at 0 until y passes 0.625, where 4·e drops to 1.5. It then peaks at only 1.02. Overshoot falls from 28.5% to 0.3%, settling from 3.27 s to 1.44 s.
In practice
No limit: 7.2% overshoot, 1.73 s. Limit with windup: 28.5%, 3.27 s. Limit with clamping: 0.3%, 1.44 s. Another common fix, back-calculation, feeds the gap u − v back into the integrator and gives 0.3% here.
Root locus, Bode plots and closed-loop poles all assume a linear loop: double the input, double the output. Saturation breaks that. Goal steps up to 0.375 never touch the limit and match the design; bigger steps wind up.
What is happening
# step 1/9 · paper
# about: Goal, Compare, P term, I term, Asked v, Plant, No limit
# PI, goal r = 1, no actuator limit
Kp, Ki, umax, dt = 4, 8, 1.5, 0.001
y = I = peak = 0.0
for n in range(6000): # 6 s
e = 1.0 - y # error
v = Kp * e + I # what the controller asks for
u = v # what the actuator gives
I += Ki * e * dt # integral always adds
y += (u - y) * dt # plant: y' = -y + u
peak = max(peak, y)
print(f"{peak:.3f}") # 1.072
The plant 1/(s+1), the gains Kp = 4, Ki = 8 and the limit ±1.5 are a textbook-style example in normalised units, not a measured machine. Every curve and number is simulated with the same Python loop shown on the steps (Euler steps of 1 ms). The no-limit run matches the closed-form step response of (4s + 8)/(s² + 5s + 8), and the windup integral matches 8·(1 − ln3/2) ≈ 3.61. Clamping as defined in the MathWorks PID Controller block documentation: integration stops while the controller output exceeds the limits and the integrator input has the same sign as the saturation block input; it resumes when either condition no longer holds. The code here tests the same thing with e·v < 0. The Python is plain Python 3 with no libraries. python-control can simulate the linear part (control.step_response on control.feedback(C * G)), but a saturation needs a nonlinear simulation such as the loop shown.