The bang-bang controller is the simplest closed-loop regulator: its output switches between two discrete levels depending on whether the controlled variable is above or below a threshold. Without hysteresis, a plain threshold comparator chatters — switching at high frequency whenever noise nudges the signal across the boundary.
Adding a dead-band (Schmitt trigger) eliminates chatter by giving the relay memory: once the output goes High it stays High until the measurement falls all the way to a lower threshold, and vice versa. This makes the relay a practical actuator-safe control primitive for thermostats, fridge compressors, tank level switches, and power-stage on/off regulation.
The relay holds a binary state
where
The output levels
The band width
A wider band reduces
| Case | Time | Space | Notes |
|---|---|---|---|
| All | Two comparisons, one state bit, one select |
No arithmetic on the signal path — only comparisons — so the relay introduces no numerical error and is exactly representable in any floating-point format.
Setup: band
| Step | Condition | |||
|---|---|---|---|---|
| 1 | 0.0 | Low, |
Low | 0 |
| 2 | 0.3 | Low, |
High | 1 |
| 3 | 0.1 | High, |
High | 1 |
| 4 | −0.3 | High, |
Low | 0 |
| 5 | 0.0 | Low, |
Low | 0 |
-
Inverted band.
$\theta_H \leq \theta_L$ latches the output in an undefined state; reject this at construction time via a precondition assertion. -
Exactly on threshold. Transitions are inclusive:
$x = \theta_H$ triggers Low→High and$x = \theta_L$ triggers High→Low. This avoids a dead-zone at the switching points. -
Zero-width band.
$\theta_H = \theta_L$ collapses the relay to a pure comparator (no hysteresis). The logic is still correct but offers no chatter suppression. - Noise sizing. The band width must exceed the peak-to-peak noise amplitude; otherwise noise alone drives state transitions at the sampling rate.
-
Actuator minimum on-time. Size
$\Delta$ so that the minimum on-time (derived from$\Delta / |\dot{x}|_\text{max}$ ) is above the actuator's rated minimum switching period.
| Variant | Key Difference |
|---|---|
| Plain comparator |
|
| Asymmetric band |
|
| Three-state relay | Adds a dead-band output level |
| Adaptive hysteresis | Band width tracks signal variance online to maintain a target switching rate |
| Relay feedback test (Åström–Hägglund) | Deliberate oscillation under relay feedback to identify the ultimate gain/period for automatic PID tuning |
- Thermostats and HVAC — heating/cooling switched on/off around a temperature set-point.
- Tank and vessel level control — pump on/off between high- and low-level floats.
- Power-stage converters — hysteretic current-mode control in DC-DC converters and class-D amplifiers.
- Motor drive enable/disable — protecting power stages with a current-band relay.
- Åström–Hägglund auto-tuning — the relay feedback experiment that drives limit-cycle oscillation for PID parameter identification.
| Algorithm | Relationship |
|---|---|
| PID Controller | The relay's limit cycle can be used to identify PID tuning parameters via the Åström–Hägglund relay-feedback test |
| Saturation / Rate Limiter | Continuous-output counterpart for actuator constraint; often combined with a relay in cascaded loops |
- K. J. Åström, R. M. Murray, Feedback Systems: An Introduction for Scientists and Engineers, Princeton University Press, 2008 — relay feedback, Chapter 10.
- Ya. Z. Tsypkin, Relay Control Systems, Cambridge University Press, 1984.
- K. J. Åström, T. Hägglund, "Automatic Tuning of Simple Regulators with Specifications on Phase and Amplitude Margins," Automatica, 20(5), 1984.