blockLessThreshold

Output y is true, if input u is less than threshold with hysteresis

Information

Block that outputs true if the Real input u is less than a threshold t, optionally within a hysteresis h.

The parameter h ≥ 0 is used to specify a hysteresis. For any h ≥ 0, the output switches to true if u < t, where t is the threshold, and it switches to false if u ≥ t + h. Note that in the special case of h = 0, this produces the output y=u < t.

Usage

Enabling hysteresis can avoid frequent switching. Adding hysteresis is recommended in real controllers to guard against sensor noise, and in simulation to guard against numerical noise. Numerical noise can be present if an input depends on a state variable or a quantity that requires an iterative solution, such as a temperature or a mass flow rate of an HVAC system. To disable hysteresis, set h=0.

Parameters

TypeNameDefaultDescription
Realt0Threshold for comparison
Realh0Hysteresis
Advanced
Booleanpre_y_startfalseValue of pre(y) at initial time

Connectors

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Interfaces.RealInputuInput to be compared against the threshold
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutputyOutputs true if u is less than the threshold with hysteresis

Contents

NameDescription
LessNoHysteresisprotectedLess block without hysteresis
LessWithHysteresisprotectedLess block without hysteresis

Revisions

  • April 29, 2022, by Jianjun Hu:
    Corrected the condition of swiching true back to false.
    This is for Buildings, issue 2981.
  • February 3, 2021, by Antoine Gautier:
    Corrected documentation.
    This is for Buildings, issue 2246.
  • August 5, 2020, by Michael Wetter:
    Added hysteresis.
    This is for Buildings, issue 2076.
  • January 3, 2017, by Michael Wetter:
    First implementation, based on the implementation of the Modelica Standard Library.