modelSystem2

Open loop model with control architecture implemented

Extends from Buildings.Examples.Tutorial.CDL.BaseClasses.PartialOpenLoop (Partial model with open loop system).

Information

In this step, we added the control architecture. How the control is partitioned into various subcontrollers depends usually on the need to avoid communication over the network and on how control is distributed to different field controllers. Here, we used the four controllers indicated by the shaded background in the figure of Buildings.Examples.Tutorial.CDL. One controller switches the overall system on and off, one switches the boiler on and off, one tracks the supply water temperature to the room and one tracks the return water temperature that is fed to the boiler.

Implementation

This model was built as follows:

  1. First, we determined what functionality should be implemented in which controller, and what the inputs and outputs of the controllers are. In this example, we used these controllers:

    • Boiler return water controller, with input being the return water temperature TRet and output being the valve control signal yVal.

    • Radiator loop temperature controller, with input being the measured supply water temperature TSup, the measured room air temperature TRoo and output being the valve control signal yVal.

    • System on/off controller, with inputs being the outdoor temperature TOut and the room air temperature TRoo, and output being the system on/off signal onSys. Note that how inputs and outputs are named can simplify usability. For example, we called the output onSys so that a value of true is clearly understood as the system being on. If we had called it y, then it would not have been clear what a value of true means.

    • Equipment controller, with inputs being the system on/off command and the boiler temperature, and outputs being the pump on/off signal onPum and the boiler on/off signal onBoi.

  2. To organize our code, we created package that we called Controls.

  3. Next, we added the open loop controller for the boiler return water temperature. This controller is implemented in Buildings.Examples.Tutorial.CDL.Controls.OpenLoopBoilerReturn. To implement it, we created a Modelica block, and added an input, using a Buildings.Controls.OBC.CDL.Interfaces.RealInput, called it TRet for the measured return water temperature, and a Buildings.Controls.OBC.CDL.Interfaces.RealOutput for the valve control signal, which we called yVal.

    To output the valve control signal, which we set for now to a constant value of 1, we used an instance of Buildings.Controls.OBC.CDL.Reals.Sources.Constant, set its parameter to 1, and connected it to the output.

    At this stage, because the control is open loop, we leave the input of the controller unconnected.

    Looking at the Modelica file shows that we also added documentation in an info section, a defaultComponentName, as well as graphical elements so that it is easily distinguishable in a schematic diagram. We also added the unit and displayUnit attributes.

    In the next step of this tutorial, we will provide an actual implementation of the controller. To better distinguish the open loop controller from the closed loop controller, we color the icon of open loop controllers grey, and will change this color to white when we implement the actual control logic.

  4. We did a similar process to add the other three open loop controllers. As before, we added all inputs and outputs, and set the outputs to a constant.

  5. Lastly, we instantiated these four controllers in the system model. Because the pumps and the boiler take as a control input a real-valued signal, we used Buildings.Controls.OBC.CDL.Conversions.BooleanToReal to convert between the boolean-valued signal and the real-valued inputs of these components. Whether this conversion is part of the controller or done outside the controller is an individual design decision.

Exercise

Create a model, such as this model. To do so,

  1. Copy Buildings.Examples.Tutorial.CDL.System1.

  2. Implement all four open loop controllers.

  3. Delete the constant control inputs, instantiate the open loop controllers, convert the signal as needed from Boolean to Real, and connect the control inputs and outputs.

Simulate the system to verify that you get the response shown below. As we have not changed any of the control logic, simulating the system should give the same response as for Buildings.Examples.Tutorial.CDL.System1.

Open loop temperatures.

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.HeatFlowRateQ_flow_nominal (from PartialOpenLoop)20000Nominal heat flow rate of radiator
Modelica.Units.SI.TemperatureTRadSup_nominal (from PartialOpenLoop)273.15 + 50Radiator nominal supply water temperature
Modelica.Units.SI.TemperatureTRadRet_nominal (from PartialOpenLoop)273.15 + 40Radiator nominal return water temperature
Modelica.Units.SI.MassFlowRatemRad_flow_nominal (from PartialOpenLoop)Q_flow_nominal/4200/(TRadSup_nominal - TRadRet_nominal)Radiator nominal mass flow rate
Modelica.Units.SI.TemperatureTBoiSup_nominal (from PartialOpenLoop)273.15 + 70Boiler nominal supply water temperature
Modelica.Units.SI.TemperatureTBoiRet_min (from PartialOpenLoop)273.15 + 60Boiler minimum return water temperature
Modelica.Units.SI.MassFlowRatemBoi_flow_nominal (from PartialOpenLoop)Q_flow_nominal/4200/(TBoiSup_nominal - TBoiRet_min)Boiler nominal mass flow rate
Modelica.Units.SI.MassFlowRatemRadVal_flow_nominal (from PartialOpenLoop)Q_flow_nominal/4200/(TBoiSup_nominal - TRadRet_nominal)Radiator nominal mass flow rate
Modelica.Units.SI.VolumeV (from PartialOpenLoop)6*10*3Room volume
Modelica.Units.SI.MassFlowRatemA_flow_nominal (from PartialOpenLoop)V*1.2*6/3600Nominal mass flow rate
Modelica.Units.SI.HeatFlowRateQRooInt_flow (from PartialOpenLoop)4000Internal heat gains of the room

Connectors

TypeNameDefaultDescription
BoundaryConditions.WeatherData.BusweaBus (from PartialOpenLoop)Weather data bus

Components

TypeNameDefaultDescription
Buildings.Fluid.MixingVolumes.MixingVolumevol (from PartialOpenLoop)Room air volume
Modelica.Thermal.HeatTransfer.Components.ThermalConductortheCon (from PartialOpenLoop)Thermal conductance with the ambient
Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlowpreHea (from PartialOpenLoop)Prescribed heat flow
Modelica.Thermal.HeatTransfer.Components.HeatCapacitorheaCap (from PartialOpenLoop)Heat capacity for furniture and walls
Buildings.Controls.OBC.CDL.Reals.Sources.TimeTabletimTab (from PartialOpenLoop)Time table for internal heat gain
Buildings.Fluid.HeatExchangers.Radiators.RadiatorEN442_2rad (from PartialOpenLoop)Radiator
Buildings.Fluid.Sensors.TemperatureTwoPorttemSup (from PartialOpenLoop)Supply water temperature
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensortemRoo (from PartialOpenLoop)Room temperature
Buildings.Fluid.Movers.FlowControlled_m_flowpumRad (from PartialOpenLoop)Pump for radiator
Buildings.Fluid.FixedResistances.Junctionmix (from PartialOpenLoop)Mixer between valve and radiators
Buildings.Fluid.FixedResistances.Junctionspl (from PartialOpenLoop)Splitter of boiler loop bypass
Buildings.Fluid.FixedResistances.Junctionspl2 (from PartialOpenLoop)Flow splitter in return from radiator
Buildings.Fluid.FixedResistances.Junctionmix2 (from PartialOpenLoop)Mixer
Buildings.Fluid.FixedResistances.Junctionspl4 (from PartialOpenLoop)Splitter for radiator loop valve bypass
Buildings.Fluid.Movers.FlowControlled_m_flowpumBoi (from PartialOpenLoop)Pump for boiler
Buildings.Fluid.Boilers.BoilerPolynomialboi (from PartialOpenLoop)Boiler
Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinearvalRad (from PartialOpenLoop)Three-way valve for radiator loop
Buildings.Fluid.Sources.Boundary_pTpreSou (from PartialOpenLoop)Source for pressure and to account for thermal expansion of water
Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinearvalBoi (from PartialOpenLoop)Three-way valve for boiler
Buildings.Fluid.Sensors.TemperatureTwoPorttemRet (from PartialOpenLoop)Return water temperature
Buildings.Fluid.FixedResistances.Junctionspl1 (from PartialOpenLoop)Splitter
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensorsenTOut (from PartialOpenLoop)Outdoor temperature sensor
BoundaryConditions.WeatherData.ReaderTMY3weaDat (from PartialOpenLoop)Weather data reader
Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperatureTOut (from PartialOpenLoop)Outside temperature
Controls.OpenLoopBoilerReturnconBoiRetController for boiler return water temperature
Controls.OpenLoopSystemOnOffconSysStaController that switches the system on and off
Controls.OpenLoopRadiatorSupplyconRadSupController for the mixing valve for the radiator supply water
Controls.OpenLoopEquipmentOnOffconEquStaController that switches the equipment on and off
Buildings.Controls.OBC.CDL.Conversions.BooleanToRealradPumConType conversion for radiator pump signal
Buildings.Controls.OBC.CDL.Conversions.BooleanToRealboiPumConType conversion for boiler pump signal
Buildings.Controls.OBC.CDL.Conversions.BooleanToRealboiSigConType conversion for boiler signal

Revisions

  • February 18, 2020, by Michael Wetter:
    First implementation.