Buildings.Fluid.HydronicConfigurations.Controls
Package with control blocks
Information
This package contains control blocks used in the models from Buildings.Fluid.HydronicConfigurations.
Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).
Package Content
Name | Description |
---|---|
OperatingModes | Package with operating mode definitions |
PIDWithOperatingMode | PID controller with operating mode input |
Validation | Validation models |
Buildings.Fluid.HydronicConfigurations.Controls.PIDWithOperatingMode
PID controller with operating mode input
Information
This block adds the following features to Buildings.Controls.OBC.CDL.Reals.PIDWithReset.
- Based on the constants defined within Buildings.Fluid.HydronicConfigurations.Controls.OperatingModes the block allows the controller to be either disabled or switched to a change-over mode.
-
When the controller is disabled, the controller output is forced to
y_neutral
and the tracking error is zeroed out to prevent windup. Typically this neutral value should correspond to a condition that applies the minimum control effect, i.e., valves/dampers closed, VFDs at minimum speed, etc. -
When operated under the mode
enabled
the controller behaves exactly as Buildings.Controls.OBC.CDL.Reals.PIDWithReset. Furthermore, the controller output is reset toy_reset
at enable time. -
When operated under the mode
heating
the controller behaves as Buildings.Controls.OBC.CDL.Reals.PIDWithReset except that the sign of the measured and set point variables is reversed so that the controller may for instance provide a heating function if it was originally configured for a cooling function. Furthermore, the controller output is reset toy_reset
at the time the operating mode changes.
Parameters
Type | Name | Default | Description |
---|---|---|---|
SimpleController | controllerType | Buildings.Controls.OBC.CDL.T... | Type of controller |
Real | r | 1 | Typical range of control error, used for scaling the control error |
Boolean | reverseActing | true | Set to true for reverse acting, or false for direct acting control action |
Real | y_neutral | 0 | Value to which the controller output is reset at disable time |
Control gains | |||
Real | k | 1 | Gain of controller |
Real | Ti | 0.5 | Time constant of integrator block [s] |
Real | Td | 0.1 | Time constant of derivative block [s] |
Limits | |||
Real | yMax | 1 | Upper limit of output |
Real | yMin | 0 | Lower limit of output |
Integrator reset | |||
Real | y_reset | y_neutral | Value to which the controller output is reset at enable time or change-over switch |
Advanced | |||
Integrator anti-windup | |||
Real | Ni | 0.9 | Ni*Ti is time constant of anti-windup compensation |
Derivative block | |||
Real | Nd | 10 | The higher Nd, the more ideal the derivative block |
Connectors
Type | Name | Description |
---|---|---|
input RealInput | u_s | Connector of setpoint input signal |
input RealInput | u_m | Connector of measurement input signal |
output RealOutput | y | Connector of actuator output signal |
input IntegerInput | mode | Control mode |
Modelica definition
block PIDWithOperatingMode "PID controller with operating mode input"
parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType=
Buildings.Controls.OBC.CDL.Types.SimpleController.PI
"Type of controller";
parameter Real k(
min=100*Buildings.Controls.OBC.CDL.Constants.eps)=1
"Gain of controller";
parameter Real Ti(unit="s")=0.5
"Time constant of integrator block";
parameter Real Td(unit="s")=0.1
"Time constant of derivative block";
parameter Real r(
min=100*Buildings.Controls.OBC.CDL.Constants.eps)=1
"Typical range of control error, used for scaling the control error";
parameter Real yMax=1
"Upper limit of output";
parameter Real yMin=0
"Lower limit of output";
parameter Real Ni(
min=100*Buildings.Controls.OBC.CDL.Constants.eps)=0.9
"Ni*Ti is time constant of anti-windup compensation";
parameter Real Nd(
min=100*Buildings.Controls.OBC.CDL.Constants.eps)=10
"The higher Nd, the more ideal the derivative block";
parameter Boolean reverseActing=true
"Set to true for reverse acting, or false for direct acting control action";
parameter Real y_reset=y_neutral
"Value to which the controller output is reset at enable time or change-over switch";
parameter Real y_neutral=0
"Value to which the controller output is reset at disable time";
Buildings.Controls.OBC.CDL.Interfaces.RealInput u_s
"Connector of setpoint input signal";
Buildings.Controls.OBC.CDL.Interfaces.RealInput u_m
"Connector of measurement input signal";
Buildings.Controls.OBC.CDL.Interfaces.RealOutput y
"Connector of actuator output signal";
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput mode "Control mode";
Buildings.Controls.OBC.CDL.Reals.PIDWithReset conPID(
final controllerType=controllerType,
final k=k,
final Ti=Ti,
final Td=Td,
final r=r,
final yMax=yMax,
final yMin=yMin,
final Ni=Ni,
final Nd=Nd,
final xi_start=y_neutral,
final yd_start=y_neutral,
final reverseActing=reverseActing,
final y_reset=y_reset)
"Controller";
Buildings.Controls.OBC.CDL.Integers.Change cha
"Monitor change of signal value";
Buildings.Controls.OBC.CDL.Reals.Multiply mulSet
"Multiply input with mapping coefficient";
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig(final nin=3)
"Select mapping coefficient based on operating mode";
Buildings.Controls.OBC.CDL.Reals.Sources.Constant map_ms[3](k={0,1,-1})
"Map set point and measured values depending on actual operating mode";
Buildings.Controls.OBC.CDL.Reals.Multiply mulMea
"Multiply input with mapping coefficient";
Buildings.Controls.OBC.CDL.Reals.Switch swi;
Buildings.Controls.OBC.CDL.Integers.LessEqualThreshold isDis(t=Controls.OperatingModes.disabled)
"Returns true if disabled";
Buildings.Controls.OBC.CDL.Reals.Sources.Constant disVal(k=y_neutral)
"Value when disabled";
Buildings.Controls.OBC.CDL.Integers.AddParameter addPar(final p=1)
"Convert mode index to array index";
equation
connect(cha.y, conPID.trigger);
connect(u_s, mulSet.u2);
connect(extIndSig.y, mulSet.u1);
connect(u_m, mulMea.u2);
connect(extIndSig.y, mulMea.u1);
connect(mulMea.y, conPID.u_m);
connect(mulSet.y, conPID.u_s);
connect(mode, cha.u);
connect(swi.y, y);
connect(conPID.y, swi.u3);
connect(isDis.y, swi.u2);
connect(mode, isDis.u);
connect(disVal.y, swi.u1);
connect(addPar.y, extIndSig.index);
connect(mode, addPar.u);
connect(map_ms.y, extIndSig.u);
end PIDWithOperatingMode;