WOLFRAM|DEMONSTRATIONS PROJECT

Proportional-Integral-Derivative (PID) Control of a Tank Level with Anti-Windup

​
proportional gain
1
integral time constant
1
tank height
discharge flow rate
The dynamic behavior of a tank of height
h
(in meters) is governed by the following ODE:
A
dh
dt
=
F
0
-
F
1
, where
A=1
is the tank area in
2
m
, and
F
0
and
F
1
are the inlet and outlet flow rates (expressed in
3
m
/s
). Initially the tank height is 2 meters.
The discharge flow is given by
F
1
=maxK
h
-
K
p
e+
1
τ
i
edt,0≥0
, where
K=0.5
is the valve constant expressed in
3
m
/s
1/2
m
,
e=(3-h)
is the error,
K
p
is the proportional gain, and
τ
i
is the integral time constants. The setpoint for the tank height is chosen to be 3 meters.
The inlet flow rate is
F
0
=1.4
3
m
/s
.
The red and blue curves correspond to a controller with and without anti-windup. Anti-windup is important because it is possible that the discharge flow rate has a maximum value (taken here to be 1.5
3
m
/s
) corresponding to a fully open flow control valve. Computationally, this is achieved by setting
F
1
=minmaxK
h
-
K
p
e+
1
τ
i
edt,01.5
. When
F
1
reaches the maximal value of 1.5
3
m
/s
, the rate of change of the tank's height is constant and negative (equal to
-0.1
3
m
/s
) and the height decreases linearly versus time, as can be seen in snapshot 2.