Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay
Package with blocks for a relay controller
Information
This package contains blocks related to a relay controller.
Package Content
| Name | Description |
|---|---|
| Output relay signals for tuning PID controllers | |
| Calculate the lengths of the on and off period, the half period ratio, and the times when the tuning starts and ends | |
| Collection of models that validate the blocks of a relay controller | |
| Package with base classes |
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.Controller
Output relay signals for tuning PID controllers
Information
This block generates a relay output yDif = (u_m - u_s)/r, where
u_m is the measurement,
u_s is the setpoint and
r is the typical range of control error.
This block also generates the control output y,
and a boolean relay switch output yOn using the following
procedure.
Step 1: Calculate control error,
-
If the parameter
reverseActing = true, set the control errorerr = (u_s - u_m)/r, else seterr = (u_m - u_s)/r.
Step 2: Calculate y and yOn,
-
If
err > deaBanandtrigger = true, theny = yHigandyOn = true, -
else if
err < -deaBanandtrigger = true, theny = yLowandyOn = false, -
else,
yandyOnare kept as the initial values.
where deaBan is a dead band, yHig and yLow
are the higher value and the lower value of the output y, respectively.
References
J. Berner (2017). "Automatic Controller Tuning using Relay-based Model Identification." Department of Automatic Control, Lund University.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real | r | 1 | Typical range of control error, used for scaling the control error |
| Real | yHig | Higher value for the relay output | |
| Real | yLow | Lower value for the relay output | |
| Real | deaBan | Deadband for holding the relay output | |
| Boolean | reverseActing | true | Set to true for reverse acting, or false for direct acting control action |
Connectors
| Type | Name | Description |
|---|---|---|
| input RealInput | u_s | Setpoint input signal |
| input RealInput | u_m | Measurement input signal |
| input BooleanInput | trigger | Connector for enabling the relay controller |
| output RealOutput | y | Control output |
| output BooleanOutput | yOn | Relay switch output, true when control output switches to the higher value |
| output RealOutput | yDif | Input difference, measurement - setpoint |
Modelica definition
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.ResponseProcess
Calculate the lengths of the on and off period, the half period ratio, and the times when the tuning starts and ends
Information
This block processes a relay switch output signal and calculates
- the length of the on period,
- the length of the off period,
- the normalized time delay of the responses, and
- the flags which indicate if the tuning starts and completes.
For more details, please refer to:
- Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.HalfPeriodRatio,
- Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.NormalizedTimeDelay,
- Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.OnOffPeriod.
- Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.TuningMonitor.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real | yHig | Higher value for the output | |
| Real | yLow | Lower value for the output |
Connectors
| Type | Name | Description |
|---|---|---|
| input BooleanInput | on | Relay switch. True: tuning on perid, False: tuning off period |
| input RealInput | tim | Simulation time [s] |
| input BooleanInput | trigger | Reset the output when trigger becomes true |
| input BooleanInput | inTun | Check if a tuning is ongoing |
| output RealOutput | tOn | Length of the on period [s] |
| output RealOutput | tOff | Length of the off period [s] |
| output BooleanOutput | triSta | True: the tuning starts |
| output BooleanOutput | triEnd | True: the tuning ends |
| output RealOutput | tau | Normalized time delay |