blockLimPID
Extends from Modelica.Icons.ObsoleteModel (Icon for classes that are obsolete and will be removed in later versions).
Information
PID controller in the standard form
y = k ( e(t) + 1 ⁄ Ti ∫ e(s) ds + Td de(t)⁄dt ),
where y is the control signal, e(t) = us - um is the control error, with us being the set point and um being the measured quantity, k is the gain, Ti is the time constant of the integral term and Td is the time constant of the derivative term.
Note that the units of k are the inverse of the units of the control error, while the units of Ti and Td are seconds.
For detailed treatment of integrator anti-windup, set-point weights and output limitation, see Modelica.Blocks.Continuous.LimPID.
Options
This controller can be configured as follows.P, PI, PD, or PID action
Through the parameter controllerType, the controller can be configured
as P, PI, PD or PID controller. The default configuration is PI.
Direct or reverse acting
Through the parameter reverseActing, the controller can be configured to
be reverse or direct acting.
The above standard form is reverse acting, which is the default configuration.
For a reverse acting controller, for a constant set point,
an increase in measurement signal u_m decreases the control output signal y
(Montgomery and McDowall, 2008).
Thus,
-
for a heating coil with a two-way valve, leave
reverseActing = true, but -
for a cooling coil with a two-way valve, set
reverseActing = false.
Reset of the controller output
The controller can be configured to enable an input port that allows resetting the controller output. The controller output can be reset as follows:
-
If
reset = Buildings.Types.Reset.Disabled, which is the default, then the controller output is never reset. -
If
reset = Buildings.Types.Reset.Parameter, then a boolean input signaltriggeris enabled. Whenever the value of this input changes fromfalsetotrue, the controller output is reset by settingyto the value of the parametery_reset. -
If
reset = Buildings.Types.Reset.Input, then a boolean input signaltriggerand a real input signaly_reset_inare enabled. Whenever the value oftriggerchanges fromfalsetotrue, the controller output is reset by setting the value ofytoy_reset_in.
Note that this controller implements an integrator anti-windup. Therefore,
for most applications, keeping the default setting of
reset = Buildings.Types.Reset.Disabled is sufficient.
However, if the controller is used in conjuction with equipment that is being
switched on, better control performance may be achieved by resetting the controller
output when the equipment is switched on.
This is in particular the case in situations
where the equipment control input should continuously increase as the equipment is
switched on, such as a light dimmer that may slowly increase the luminance, or
a variable speed drive of a motor that should continuously increase the speed.
References
R. Montgomery and R. McDowall (2008). "Fundamentals of HVAC Control Systems." American Society of Heating Refrigerating and Air-Conditioning Engineers Inc. Atlanta, GA.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Buildings.Controls.OBC.CDL.Types.SimpleController | controllerType | Buildings.Controls.OBC.CDL.Types.SimpleController.PI | Type of controller |
| Real | k | 1 | Gain of controller |
| Modelica.Units.SI.Time | Ti | 0.5 | Time constant of integrator block |
| Modelica.Units.SI.Time | Td | 0.1 | Time constant of derivative block |
| Real | yMax | 1 | Upper limit of output |
| Real | yMin | 0 | Lower limit of output |
| Real | wp | 1 | Set-point weight for Proportional block (0..1) |
| Real | wd | 0 | Set-point weight for Derivative block (0..1) |
| Real | Ni | 0.9 | Ni*Ti is time constant of anti-windup compensation |
| Real | Nd | 10 | The higher Nd, the more ideal the derivative block |
| Boolean | reverseActing | true | Set to true for reverse acting, or false for direct acting control action |
| Initialization | |||
| Real | xi_start | 0 | Initial value of integrator state |
| Real | yd_start | 0 | Initial value of derivative output |
| Integrator reset | |||
| Buildings.Obsolete.Controls.OBC.CDL.Types.Reset | reset | Buildings.Obsolete.Controls.OBC.CDL.Types.Reset.Disabled | Type of controller output reset |
| Real | y_reset | xi_start | Value to which the controller output is reset if the boolean trigger has a rising edge, used if reset == CDL.Types.Reset.Parameter |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| 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.RealInput | y_reset_in | Input signal for state to which integrator is reset, enabled if reset = CDL.Types.Reset.Input | |
| Buildings.Controls.OBC.CDL.Interfaces.BooleanInput | trigger | Resets the controller output when trigger becomes true |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Buildings.Obsolete.Controls.OBC.CDL.Continuous.Feedback | controlError | Control error (set point - measurement) | |
| Buildings.Controls.OBC.CDL.Reals.IntegratorWithReset | I | Integral term | |
| Buildings.Obsolete.Controls.OBC.CDL.Continuous.Derivative | D | Derivative term | |
| Buildings.Obsolete.Controls.OBC.CDL.Continuous.Feedback | errP | P error | |
| Buildings.Obsolete.Controls.OBC.CDL.Continuous.Feedback | errD | D error | |
| Buildings.Obsolete.Controls.OBC.CDL.Continuous.Feedback | errI1 | I error (before anti-windup compensation) | |
| Buildings.Obsolete.Controls.OBC.CDL.Continuous.Feedback | errI2 | I error (after anti-windup compensation) | |
| Buildings.Controls.OBC.CDL.Reals.Limiter | lim | Limiter |
Revisions
-
August 4, 2020, by Jianjun Hu:
Moved the block to Buildings.Obsolete.Controls.OBC.CDL.Continous.
This is for issue 2056. -
June 1, 2020, by Michael Wetter:
Corrected wrong convention of reverse and direct action.
This is for issue 1365. -
April 23, 2020, by Michael Wetter:
Changed default parameters for limitsyMaxfrom unspecified to1andyMinfrom-yMaxto0.
This is for issue 1888. -
April 7, 2020, by Michael Wetter:
Reimplemented block using only CDL constructs. This refactoring removes the no longer use parametersxd_startthat was used to initialize the state of the derivative term. This state is now initialized based on the requested initial outputyd_startwhich is a new parameter with a default of0. Also, removed the parametersy_startandinitTypebecause the initial output of the controller can be set by usingxi_startandyd_start. This is a non-backward compatible change, made to simplify the controller through the removal of options that can be realized differently and are hardly ever used. This refactoring also removes the parameterstrictthat was used in the output limiter. The new implementation enforces a strict check by default.
This is for issue 1878. -
March 9, 2020, by Michael Wetter:
Corrected unit declaration for gaink.
See issue 1821. -
March 2, 2020, by Michael Wetter:
Changed icon to display dynamically the output value. -
February 25, 2020, by Michael Wetter:
Changed icon to display the output value. -
October 19, 2019, by Michael Wetter:
Disabled homotopy to ensure bounded outputs by copying the implementation from MSL 3.2.3 and by hardcoding the implementation forhomotopyType=NoHomotopy.
See issue 1221. -
November 13, 2017, by Michael Wetter:
Changed default controller type from PID to PI. -
November 6, 2017, by Michael Wetter:
Explicitly declared types and used integrator with reset from CDL. -
October 22, 2017, by Michael Wetter:
Added to CDL to have a PI controller with integrator reset. -
September 29, 2016, by Michael Wetter:
Refactored model. -
August 25, 2016, by Michael Wetter:
Removed parameterlimitsAtInitbecause it was only propagated to the instancelimiter, but this block no longer makes use of this parameter. This is a non-backward compatible change.
Revised implemenentation, added comments, made some parameter in the instances final. - July 18, 2016, by Philipp Mehrfeld:
Added integrator reset. This is for issue 494. -
March 15, 2016, by Michael Wetter:
Changed the default value tostrict=truein order to avoid events when the controller saturates. This is for issue 433. -
February 24, 2010, by Michael Wetter:
First implementation.