224
6 Hierarchical Component Models
Fig. 6.26 Building the BaseController icon
Let us build an icon. We draw the image as a rectangle Rectangle, according to
the pattern “solid”. The selection of the appropriate shape and sample is shown in
Fig. 6.26.
We proceed to the construction of the content of the regulators. First, we use
the PI controller, which we will later replace with other types of regulators. We
already know that the behavior of the PI controller (proportional-integral controller)
is determined by the following equations:
dx(t)
dt
=
1
T
e(t)
u h (t) = K · (e(t) + x(t))
We put these two equations in the PIController controller class.
model PIController ”Elementary PI controller”
extends BaseController;
parameter Real K(unit = ”m2/s”) = 0.1 ”Gain”;
parameter Real T(unit = ”s”) = 10 ”Integrator time
constant”;
Real x(unit = ”m”) ”Integrator state”;
equation
der(x) = e / T;
u = K * (e + x);
Précédent

- 235/274

Suivant