WOLFRAM NOTEBOOK

WOLFRAM|DEMONSTRATIONS PROJECT

PID Control of a Tank Level

proportional gain
1
integral time constant
1
differential time constant
0.1
The dynamic behavior of the tank 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
,
F
0
and
F
1
are the inlet and outlet flow rates (expressed in
3
m
/s
), respectively. Initially the tank height is equal to 0.1 meter.
The flow equation is given by:
F
1
=K
h
where
K=0.5
is the valve constant expressed in
3
m
/(s
0.5
m
).
The setpoint for the tank height is chosen to equal 2 meters.
The inlet flow rate is varied in order to achieve the desired setpoint value using a P, PI, or PID (proportionalintegralderivative) control:
F
0
=1+
K
p
e+
1
τ
i
edt+
τ
d
de
dt
, where
e=(2-h)
is the error,
K
p
is the proportional gain, and
τ
i
and
τ
d
are the integral and differential time constants, respectively.
For large
τ
i
and
τ
d
=0
, the control simplifies to the usual proportional control, which is usually characterized by a small offset value (i.e., the final steady-state height is not exactly equal to the setpoint value).
PI control is achieved when
τ
d
is taken to be zero. PI control can show an overshoot and dumped oscillations around the setpoint. No offset is observed and the final steady-state tank height is exactly equal to the setpoint value.
In the most general case, when
τ
d
0
and
τ
i
is not too large, one gets PID control of the tank height.
Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.