blockController

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 error err = (u_s - u_m)/r, else set err = (u_m - u_s)/r.

Step 2: Calculate y and yOn,

  • If err > deaBan and trigger = true, then y = yHig and yOn = true,
  • else if err < -deaBan and trigger = true, then y = yLow and yOn = false,
  • else, y and yOn are 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

TypeNameDefaultDescription
Realr1Typical range of control error, used for scaling the control error
RealyHigHigher value for the relay output
RealyLowLower value for the relay output
RealdeaBanDeadband for holding the relay output
BooleanreverseActingtrueSet to true for reverse acting, or false for direct acting control action

Connectors

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Interfaces.RealInputu_sSetpoint input signal
Buildings.Controls.OBC.CDL.Interfaces.RealInputu_mMeasurement input signal
Buildings.Controls.OBC.CDL.Interfaces.BooleanInputtriggerConnector for enabling the relay controller
Buildings.Controls.OBC.CDL.Interfaces.RealOutputyControl output
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutputyOnRelay switch output, true when control output switches to the higher value
Buildings.Controls.OBC.CDL.Interfaces.RealOutputyDifInput difference, measurement - setpoint

Revisions

  • March 8, 2024, by Michael Wetter:
    Changed deadband to be consistent within the package.
  • March 8, 2024, by Michael Wetter:
    Propagated range of control error r to relay controller.
  • December 1, 2023, by Sen Huang:
    Add a parameter reverseActing
  • June 1, 2022, by Sen Huang:
    First implementation.