Name | Description |
---|---|
ControlledTanks1 | |
ControlledTanks2 | |
Internal | Utility components for the examples |
With this example the controller of a tank filling/emptying system is demonstrated. This example is from Dressler (2004), see Literature which in turn is based on an example model from Karl Erk Arzen of JGraphCharts.
The basic operation is to fill and empty the two tanks:
The above "normal" operation can be influenced by three buttons:
The tank controller has some safeguards to prevent the tanks to overflow even if there are errors in the control system:
The default simulation time is 900 s. The result can be animated. For this, set in Dymola in the command window: "animationSpeed(speed = 50)".
Extends from Internal.PartialControlledTank.
model ControlledTanks1 extends Internal.PartialControlledTank;Internal.TankController1 tankController( limit1=0.9*tank1.height, limit2=0.9*tank2.height, waitTime=50, minLevel=0.01); Modelica_StateGraph2.Blocks.Interactive.RadioButtonSource start( reset={stop.on,shut.on}, buttonTimeTable={20,280}); Modelica_StateGraph2.Blocks.Interactive.RadioButtonSource stop( reset={start.on,shut.on}, buttonTimeTable={220,650}); Modelica_StateGraph2.Blocks.Interactive.RadioButtonSource shut( reset={start.on,stop.on}, buttonTimeTable={700}); Modelica.Blocks.Sources.RealExpression level1(y=tank1.level); Modelica.Blocks.Sources.RealExpression level2(y=tank2.level); equationconnect(level1.y, tankController.level1); connect(level2.y, tankController.level2); connect(tankController.valve1, valve1.open); connect(tankController.valve2, valve2.open); connect(tankController.valve3, valve3.open); connect(start.on, tankController.start); connect(stop.on, tankController.stop); connect(shut.on, tankController.shut); end ControlledTanks1;
This is the same model as "ControlledTanks1". The only difference is how the tank controller is implemented:
Extends from Internal.PartialControlledTank.
model ControlledTanks2 extends Internal.PartialControlledTank;Modelica_StateGraph2.Blocks.Interactive.RadioButtonSource start( reset={stop.on,shut.on}, buttonTimeTable={20,280}); Modelica_StateGraph2.Blocks.Interactive.RadioButtonSource stop( reset={start.on,shut.on}, buttonTimeTable={220,650}); Modelica_StateGraph2.Blocks.Interactive.RadioButtonSource shut( reset={start.on,stop.on}, buttonTimeTable={700}); protected Internal.SignalBus bus; public Internal.TankController2 tankController( limit1=0.9*tank1.height, limit2=0.9*tank2.height, minLevel=0.01, waitTime=50); Modelica.Blocks.Sources.RealExpression level1(y=tank1.level); Modelica.Blocks.Sources.RealExpression level2(y=tank2.level); equationconnect(level1.y, bus.level1); connect(level2.y, bus.level2); connect(shut.on, bus.shut); connect(stop.on, bus.stop); connect(start.on, bus.start); connect(valve1.open, bus.valve1); connect(valve2.open, bus.valve2); connect(valve3.open, bus.valve3); connect(tankController.bus, bus); end ControlledTanks2;