Hysteresis

True above uHigh, false below uLow, unchanged in between.

  • signal
  • Boolean
  • Modelica Standard Library
  • 2 ports
  • 2 parameters
BlockHysteresisKindboolHysteresisLibraryLogic

Description

A Schmitt trigger: the output turns true when the input rises above uHigh and turns false only when it falls below uLow. Between the two thresholds it keeps its previous value.

The output starts false.

Example

Comparators A sine compared with thresholds, with a ramp, and through a hysteresis band.

sin(πt)t / 4Above 0.5Below −0.5Hysteresis ±0.5Sine > rampSine < ramp
In Gradara, select a Hysteresis block and press F1, then choose Open example. It opens as a new model in My models, ready to run.

Also in this example:RampSine waveGreater than thresholdLess than thresholdGreater thanLess than

Ports

Inputs 1

  • u

    Real input.

Outputs 1

  • y

    Boolean output.

Parameters

  • Lower thresholduLow0

    Lower threshold. When y is true and u < uLow, y becomes false. Must be less than uHigh.

  • Upper thresholduHigh1

    Upper threshold. When y is false and u > uHigh, y becomes true. Must be greater than uLow.

Equations

Modelica
y = (¬y⁻ ∧ u > uHigh) ∨ (y⁻ ∧ u ≥ uLow)
y⁻ is the value just before the current event; y⁻ = false at t = 0.

Implementation

Modelica Standard Library 4.1.0Modelica.Blocks.Logical.Hysteresis
MSL documentation

Assumptions and limitations

  • The simulation stops with an error unless uHigh > uLow.

Tips

  • For a thermostat-style loop around a moving setpoint, On-off controller expresses the band relative to a reference signal.

See also

Select a block in Gradara and press F1 to open its page offline.