6.1 Draining of a Tank
211
Fig. 6.4 Graphical representation of a tank system
Add to the circuit shown in Fig. 6.2 management system. We will control the
liquid level h in the tank using a PI controller, i.e., a controller with proportional and
integral regulation, as shown in Fig. 6.4.
The controller calculates the error signal, defined as the difference between the
set value and the actual value of the controlled variable. The output value of the
controller is calculated as the sum of two variables: one directly proportional to the
error signal and the other proportional to the integral of the error signal.
Let e(t) be the control of the error signal, i.e., the difference between the set and
the actual liquid level determined by the sensor, h ref is the set liquid level, h(t) is the
current liquid level in the tank, and u h (t) is the output signal that controls the valve
position.
Then, the PI controller is described by the following equations:
e(t) = h ref − h(t)
u h (t) = K p · e(t) +
1
T I
·
t
0
e(t) · dt
where K p is the gain of the proportional component (proportional to the PI controller
parameter), and T I is the integration constant (integral parameter of the PI controller),
a value that represents the time interval during which the integral component of the
output value reaches the input value. To create code in Modelica, we have to get rid
of the integral component. To do this, we introduce the notation for the error signal
integral
I (t) =
t
0
e(t) · dt
Then, the equations will take the following differential form:
e(t) = h ref − h(t)
211
Fig. 6.4 Graphical representation of a tank system
Add to the circuit shown in Fig. 6.2 management system. We will control the
liquid level h in the tank using a PI controller, i.e., a controller with proportional and
integral regulation, as shown in Fig. 6.4.
The controller calculates the error signal, defined as the difference between the
set value and the actual value of the controlled variable. The output value of the
controller is calculated as the sum of two variables: one directly proportional to the
error signal and the other proportional to the integral of the error signal.
Let e(t) be the control of the error signal, i.e., the difference between the set and
the actual liquid level determined by the sensor, h ref is the set liquid level, h(t) is the
current liquid level in the tank, and u h (t) is the output signal that controls the valve
position.
Then, the PI controller is described by the following equations:
e(t) = h ref − h(t)
u h (t) = K p · e(t) +
1
T I
·
t
0
e(t) · dt
where K p is the gain of the proportional component (proportional to the PI controller
parameter), and T I is the integration constant (integral parameter of the PI controller),
a value that represents the time interval during which the integral component of the
output value reaches the input value. To create code in Modelica, we have to get rid
of the integral component. To do this, we introduce the notation for the error signal
integral
I (t) =
t
0
e(t) · dt
Then, the equations will take the following differential form:
e(t) = h ref − h(t)
