Relay
A two-level relay.
- signal
- Gradara equations
- 2 ports
- 3 parameters
relayLibraryNonlinearDescription
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
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 value
onValue1Output when u ≥ Switch level.
-
Off value
offValue-1Output when u < Switch level.
-
Switch level
offSwitch0The 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.