Relay, Hysteresis & Pulse Control
Relay controllers choose among discrete actuator states. Hysteresis, deadband, dwell time and pulse timing turn an ideal threshold into a physically usable law by trading tracking precision against chatter, wear, minimum on-time and plant ripple.
A relay controller cannot command every value of . It selects from a finite set: off/on, decrease/neutral/increase, or timed pulses. That matches heaters, compressors, contactors, solenoids and motorized valves whose physical interface is discrete.
Two-position control and hysteresis #
Let error be . An ideal on/off law switches at zero:
With noise or delay, repeated crossings cause chatter. A symmetric hysteresis band of half-width gives the controller memory:
stateDiagram-v2 [*] --> Off Off --> On: e > h and minimum-off time met On --> Off: e < −h and minimum-on time met
Hysteresis reduces switching but intentionally permits output ripple. Increasing reduces wear and noise sensitivity while worsening regulation. Minimum on/off times protect compressors and contactors but add another dynamic constraint.
Three-position and deadband control #
A motorized valve may need open, hold and close commands:
The neutral region is a deadband when no corrective action occurs inside it. Separate hysteresis around each transition prevents rapid reversal. Do not conflate deadband with hysteresis: deadband defines a zero-output region; hysteresis makes the switching threshold depend on current state.
Position feedback matters. Timed open/close pulses assume actuator speed and load are predictable; backlash, stiction or a stalled motor can make commanded motion differ from actual position.
Pulse and PWM outputs #
When the plant is slow relative to switching, average effort can be controlled by duty cycle over period :
This approximation fails when the period is not small relative to plant dynamics or when the actuator has nonlinear startup loss, minimum pulse width, thermal limits or asymmetric transitions. A solid-state heater can switch much faster than a mechanical contactor; the same PWM period is not portable.
Pulse-frequency control changes event rate rather than width. Time-proportioning converts a continuous controller output into a duty command. In every case, distinguish the requested average from instantaneous physical state.
Limit cycles are expected #
A relay plus a lagged plant typically oscillates around the setpoint. The questions are amplitude, period, actuator wear and whether the oscillation stays inside product and safety limits. Delay increases amplitude because the plant continues moving after a switch.
Relay-induced oscillation can be used deliberately for PID auto-tuning. Åström and Hägglund replace a high-gain proportional test with a bounded relay, estimate ultimate frequency and gain from the limit cycle, then choose controller parameters for specified margins. That experiment is identification; it still needs amplitude limits, watchdogs and operator authority.
Implementation safeguards #
- define fail-safe output for loss of sensor, power or computation;
- enforce hardware and process interlocks outside the tuning law;
- filter only enough to suppress irrelevant noise—filter delay also affects switching;
- timestamp samples and account for scan jitter;
- log state transitions, thresholds and inhibit reasons;
- detect implausible switching rate, stuck output and missing response;
- test mode transfer so manual and automatic states do not issue conflicting commands.
Relay control is not a crude PID. It is a hybrid system whose discrete state, timing and actuator physics are part of the control law.
Sources
- docsTypes of Controllers: Controller Tuning Methodologypdfnotes
- paperÅström and Hägglund — Automatic Tuning of Simple Regulators with Specifications on Phase and Amplitude Margins