A Hybrid Tank Model with a Discrete Controller


Now let us consider a hybrid Tank containing a Proportional-Integral (PI) controller.


Figure 1: A tank system with a tank, a source for liquid, and a controller.


1 Tank Model Componets

1.1 Connectors







1.2 Functions



1.3 Components

1.3.1 PI Controllers



BaseControllerClocked





PIdiscreteControllerClocked



1.3.2 PID Controlers




PIDdiscreteControllerClocked Version



1.3.3 Tank



2 TankHybridPI Model UnClocked

Finally we put together the hybrid tank system by simply replacing the continuous PI controller by the discrete one, called piDiscrete, as depicted in Figure 2.


Figure 2: A Hybrid Tank system consisting of a continuous tank model connected to a source for liquid and a discrete PI controller.



The
TankHybridPI model connects a discrete PI controller to a liquid source and a tank, both defined by the models above.




The hybrid tank system with a discrete PI controller is simulated, see Figure ??, obtaining essentially the same result as when using the continuous PI controller (compare to Figure ?? on page ??). The response shown in the curve is the reaction of the controller to an instantaneous increase in the input flow from the source at time t=150. The only difference compared to the continuous controller case is a few small squiggles in the curve probably caused by the discrete approximation.


2.1 Simulation of TankHybridPIUnclocked




3 TankHybridPI Model Clocked


This model contains clocked synchronous constructs that are not yet fully supported by OpenModelica as of October 2015, but may start working within the near future.Hence the Simulation of this models does not work






4 TankHybridPID Model Unclocked


4.1 Simulation of TankHybridPI




4.2 TankHybridPID Model Clocked


This model contains clocked synchronous constructs that are not yet supported by OpenModelica as of October 2015, but may start working within the near future.Hence the Simulation of this models does not work