Relay

A two-level relay.

  • signal
  • Gradara equations
  • 2 ports
  • 3 parameters
BlockRelayKindrelayLibraryNonlinear

Description

A two-level switch: the output is On value when the input is at or above Switch level, and Off value below it.

Example

Nonlinearities Saturation, dead zone, relay, and rate limiter acting on the same sine.

Sine, amplitude 2Saturation ±1Dead zone ±0.5RelayRate limit 2/s
In Gradara, select a Relay block and press F1, then choose Open example. It opens as a new model in My models, ready to run.

Also in this example:SaturationSine waveDead zoneRate limiter

Ports

Inputs 1

  • u

    Input signal.

Outputs 1

  • y

    Output signal: On value or Off value.

Parameters

  • On valueonValue1

    Output when u ≥ Switch level.

  • Off valueoffValue-1

    Output when u < Switch level.

  • Switch leveloffSwitch0

    The input level where the output switches, in both directions.

Equations

Modelica
y = onValue if u ≥ offSwitch
y = offValue if u < offSwitch

Implementation

The block’s Modelica model
y = if u >= offSwitch then onValue else offValue;

Assumptions and limitations

  • No hysteresis: the block switches at one level both ways, so a noisy input near that level makes the output chatter and can slow the solver. For a band, use Boolean hysteresis or On-off controller.

See also

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