Practical use case: Hysteresis
- Ivaylo Fiziev
- 7 hours ago
- 1 min read

Hysteresis is a control technique where two different thresholds are used - one for switching ON and one another for switching OFF. This prevents rapid toggling (chatter) when the input signal fluctuates around a single setpoint.
Common use cases are:
Temperature control (heaters, ovens)
Pressure systems (compressors)
Motor control with feedback signals
Tank level control (pump start/stop)
Why it’s needed?
Analog signals often fluctuate slightly. Without hysteresis:
A value near a threshold (e.g., 50.0°C) may bounce between 49.9 and 50.1
This causes outputs (like heaters, pumps, relays) to switch rapidly
That leads to wear, instability, and poor control
A typical implementation looks like this:
FUNCTION_BLOCK "MAIN"
VERSION:1.0
VAR_INPUT
input : LREAL; // signal value
low_limit : LREAL; // lower threshold
high_limit : LREAL; // upper threshold
END_VAR
VAR_OUTPUT
output : BOOL; // ON/OFF
END_VAR
BEGIN
IF #input < #low_limit THEN
#output := true;
ELSIF #input > #high_limit THEN
#output := false;
END_IF;
END_FUNCTION_BLOCKThink of a home thermostat:
Heater turns on when it’s too cold
Turns off when it’s warm enough
Doesn’t constantly toggle at one exact temperature
Design tips:
Choose hysteresis band wide enough to handle noise
A band too wide will affect system performance



Comments