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

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

The dynamic behavior of a tank of height (in meters) is governed by the following ODE:

h

A=-

dh

dt

F

0

F

1

A=1

2

m

F

0

F

1

3

m

The discharge flow is given by =maxKe+edt,0≥0, where is the valve constant expressed in /s, is the error, is the proportional gain, and is the integral time constants. The setpoint for the tank height is chosen to be 3 meters.

F

1

h

-K

p

1

τ

i

K=0.5

3

m

1/2

m

e=(3-h)

K

p

τ

i

The inlet flow rate is =1.4/s.

F

0

3

m

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 /s) corresponding to a fully open flow control valve. Computationally, this is achieved by setting =minmaxKe+edt,01.5. When reaches the maximal value of 1.5 /s, the rate of change of the tank's height is constant and negative (equal to ) and the height decreases linearly versus time, as can be seen in snapshot 2.

3

m

F

1

h

-K

p

1

τ

i

F

1

3

m

-0.1/s

3

m