Relay Block
Hysteresis switch: toggles between on/off values based on input thresholds
Open Relay in BlockWerk →# Relay Block
Description
A hysteresis switch that toggles between two output values. Turns on when input rises above the switch-on point, and turns off when input falls below the switch-off point. The gap between the two thresholds creates hysteresis, preventing chattering around a single threshold.
Mathematical Model
\begin{cases} y_{\text{on}}, & u(t) \ge \text{switchOn} \\ y_{\text{off}}, & u(t) \le \text{switchOff} \\ y(t-\Delta t), & \text{otherwise} \end{cases}
Parameters
switchOnPoint / switchOffPoint
Threshold values for switching. switchOnPoint should be >= switchOffPoint for proper hysteresis.
onValue / offValue
Output values for the on and off states.
switchOffPoint
Type: number (Default: -0.5)
Switch Off Point parameter description placeholder.
offValue
Type: number (Default: 0)
Off Value parameter description placeholder.
Remarks
- Hysteresis gap: The gap between switchOnPoint and switchOffPoint prevents chattering around a single threshold; a wider gap means more noise immunity
- State memory: The relay remembers its current state (on/off) and only transitions when the thresholds are crossed
- Initial state: When the input starts between the thresholds, the relay stays in its initial off state
- Comparator vs Relay: Use Comparator for noise-free digital signals; use Relay when you need hysteresis to suppress noise on a real sensor signal
- Inverted logic: Swap onValue and offValue to create an inverting relay (normally-on behaviour)
Examples
- Zie de ingebouwde voorbeelden in de handleiding voor een demonstratie van dit blok.
See Also
- Comparator: Single-threshold comparison (no hysteresis)
- DeadZone: Continuous nonlinearity
- Switch: Signal routing based on selector