modelSystem3

Open loop model with boiler return temperature control

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

Information

In this step, we added the controller for the boiler return water temperature.

Implementation

This model was built as follows:

  1. First, we copied the controller Buildings.Examples.Tutorial.CDL.Controls.OpenLoopBoilerReturn to create the block Buildings.Examples.Tutorial.CDL.Controls.BoilerReturn.

  2. In this new block, we used a constant output signal Buildings.Controls.OBC.CDL.Reals.Sources.Constant and a PID controller Buildings.Controls.OBC.CDL.Reals.PID, which we configured as a PI-controller.

    We set the controller logic to reverse action. That is because the tracking error is conventionally computed as the difference between the set point value and the sensed value. In our example, if the return temperature is lower than the set point, i.e., if the tracking error is positive, the valve control signal must tend toward zero, i.e., the valve bypass port must open. That means that the unbounded control signal must tend toward negative values so that the bounded output signal tends toward its minimum value. Binding a positive tracking error to a negative unbounded control signal or to the minimum value of the output signal requires a reverse action logic.

    Additionally we set the proportional gain to 0.1 as then, in absence of the integral action, a control error of 10 Kelvin changes the control output by 1. We set the time constant to 120 seconds, which is about the time it takes to open and close a valve. These values give typically good closed loop performance.

    As the control error is in Kelvin, which is typically of the order of 1 to 10, there is no need to normalize the control input. (If pressure were used, it would make sense to divide the measured signal and the set point so that the control error is usually of the order of one, which makes tuning easier.)

  3. To allow this controller to be tuned, we exposed at the top-level the parameters for the set point temperature and the control gains.

  4. While the controller Buildings.Examples.Tutorial.CDL.Controls.BoilerReturn is very simple, for demonstration purposes we also implemented a validation model for this controller. This is done in Buildings.Examples.Tutorial.CDL.Controls.Validation.BoilerReturn. Such validation models help detect implementation errors which may be difficult to diagnose once the controller is used as part of a larger system model. In our experience, implementing small scale validation tests leads to better code and overall faster development as errors are detected early on when they can be corrected quickly. For more information about how to implement a validation model, see the Modelica Buildings Library User Guide.

Exercise

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

  1. Copy Buildings.Examples.Tutorial.CDL.System2.

  2. Implement the controller for the boiler return water temperature.

    Make a small unit test to verify that the controller is implemented correctly.

  3. Use this new controller instead of the open loop controller conBoiRet.

Simulate the system to verify that the valve is controlled to maintain a return water temperature of at least 60°C as shown below.

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.BoilerReturnconBoiRetController 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.