PID control and integral windup
Introduced
6:36
System Dynamics and Control
The cooling loop needs one more part - a valve that sets the flow, moved by a small motor and a controller. This course builds the models, reads their…
English narration · English and 中文 subtitles you can switch
In this lesson
| English | Meaning |
|---|---|
| PID controller/ˌpiː aɪ ˈdiː kənˈtrəʊlə/ | A controller whose output is the sum of proportional, integral and derivative actions on the error. |
| error/ˈerə/ | The difference between the setpoint and the measured output, which a controller acts on. |
| control/kənˈtrəʊl/ | Making a system's output follow a desired value, usually by measuring it and correcting the input. |
| phase margin/feɪz ˈmɑːdʒɪn/ | How much extra phase lag at the gain crossover frequency would make a feedback loop unstable. |
| rate limit/reɪt ˈlɪmɪt/ | The largest rate of change an actuator or signal is allowed to have. |
| integrator windup/ˈɪntɪɡreɪtə ˈwɪndʌp/ | The build-up of the integral term while an actuator is saturated, which causes large overshoot. |
| overshoot/ˌəʊvəˈʃuːt/ | How far a step response goes past its final value, usually given as a percentage of the step. |
| Anti-windup/ˈænti ˈwɪndʌp/ | A method that stops the integral term growing while the actuator is saturated. |
| windup protection |
Exact, even when the water pushes
- The valve must stop exactly where it is told, even when the water pushes on it. Feedback makes a cheap motor accurate, if the design respects the motor's limits.
- A PID controller PID控制器 acts on the error 误差: $u = K_pe + K_i\int e\,dt + K_d\dot e$. The proportional term gives speed, the integral removes the steady error, and the derivative adds damping.

Why the integral is needed
- The 5 N·m load acts like 3.0 V taken away at the motor. With P control 控制 alone, that voltage must come from $K_pe$, so an error of $e = 3.0/133.5$ rad $= 1.29°$ (with $K_p$ unrounded) remains. That fails the 0.5° specification.
- An integral keeps growing until the error is zero, so it can supply the 3.0 V by itself.
Which term fixes it?
Match each behaviour to the PID term or protection that handles it.
Steady error with P only, d = 3.0 V, K_p = 134 V/rad (two decimals, degrees)?
Difficulty 2/5 · 140 coins + a small bonus on first completion today
3.0/134 rad in degrees.
Proportional control alone removes the steady error under a constant load.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
It needs an error to make the holding voltage.
Tuning against the specification
- Put the integral zero a decade below $\omega_n$: $K_i = K_p\omega_n/10 = 993$ V/(rad·s).
- The steady error is now zero, and the phase margin 相位裕度 falls by about 9°, to 56°.
- No derivative: $K_p$ and the motor lag already give the damping, and a derivative would make the encoder noise larger.
K_i = K_p omega_n / 10 with K_p = 133.4 and omega_n = 74.4 (whole number)?
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Place the zero a decade down.
Saturation and windup
- A 90° step asks $134 \times 1.571 = 210$ V of a 12 V driver. The valve then moves at its rate limit 速率限制, 3.58 rad/s under load.
- Meanwhile the integrator keeps adding up error that the motor cannot act on. This is integrator windup 积分饱和, and the valve overshoots 超调量 to 159°. Anti-windup 抗积分饱和 by clamping the integrator removes the overshoot completely.
Voltage asked by a 90 degree step at K_p = 134 (V, whole number)?
Difficulty 2/5 · 140 coins + a small bonus on first completion today
134 times 1.571.
Rate limit under load: 0.398 x (12 - 3.0) (two decimals, rad/s)?
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Only 9 V is left for speed.
Integrator windup happens because:
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Error accumulates that the actuator cannot act on.
What the integral costs
- A PI controller is $K_p(1 + \omega_i/s)$, with its zero at $\omega_i = K_i/K_p = 993/134 = 7.41$ rad/s. At crossover it adds a lag of $\tan^{-1}(\omega_i/\omega_c)$.
- $\tan^{-1}(7.41/48.2) = 8.7°$, so the margin falls from 65.2° to 56.5°. A zero closer to crossover removes load errors 误差 faster but costs more margin, so a decade below is the usual compromise.
PI zero at $K_i/K_p = 993/134$, crossover 48.2 rad/s: phase lag it adds (one decimal, degrees)?
Difficulty 2/5 · 140 coins + a small bonus on first completion today
$\omega_i = 7.41$ rad/s; $\tan^{-1}(7.41/48.2) = 8.7°$.
Moving the PI zero up to crossover removes load errors faster at no cost in phase margin.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
At $\omega_i = \omega_c$ the zero costs 45° of margin; a decade below costs about 6° to 9°.
Worked example: how big a step stays linear?
- The driver saturates when $K_pe$ reaches 12 V, so the largest step the linear model describes is $12/134 = 0.0896$ rad, which is 5.1°.
- The 90° move is 17.5 times larger. For almost the whole move the valve runs at its rate limit 速率限制, and the overshoot and settling formulas apply only to the last 5°. That is why the specification must be checked with a nonlinear simulation.
$K_p = 134$ V/rad and a 12 V driver: largest step that stays linear (one decimal, degrees)?
Difficulty 2/5 · 140 coins + a small bonus on first completion today
$12/134 = 0.0896$ rad $= 5.13°$.
Three common mistakes
- Judging a P-only design on small steps. Large steps saturate.
- Using a derivative on a noisy measurement. It makes the noise larger.
- Using an integral without windup protection 积分饱和保护. Clamp it.
Recap
| P only | PI | |
|---|---|---|
| Error under load | 1.29°: fails | 0 |
| Phase margin 相位裕度 | 65.2° | 56.5° |
- $K_i = 993$; phase margin 56.5°.
- Windup carries a 90° move to 159°; clamping fixes it.
What went wrong? Only the site team sees this.