Nonlinearities: Saturation, Dead Zone, Backlash and the Describing Function
Every design so far assumed that doubling the error doubles the actuator's response. Real hardware disagrees at both ends. A heater cannot deliver more than or less than zero; a motor does not turn until the voltage beats its static friction; a gearbox has play, so the output shaft stays put for a moment when the motor reverses; an on/off thermostat has only two outputs. These static nonlinearities cause the behaviour that linear analysis cannot predict: slow, overshooting recoveries, steady errors, and sustained oscillations (limit cycles) in loops that are perfectly stable on paper. This lesson names the common ones, shows what they do, and gives one tool that predicts limit cycles: the describing function.
The usual suspects
| Nonlinearity | Input–output law | Typical source | Typical effect in a loop |
|---|---|---|---|
| saturation | : linear up to | supply rails, PWM at 0 and 100 %, valve fully open | slower response, integrator windup, large overshoot (Anti-Windup) |
| dead zone | for , then linear | static friction, valve stiction, driver dead time | steady-state error; with integral action a stick-slip cycle (hunting) |
| backlash (play) | output follows only after the input has crossed the gap | gears, belts, lead screws | phase lag; limit cycles in position loops with integral action |
| relay (on/off), with hysteresis | by the sign of , switching at | thermostats, solenoid valves, contactors | a sustained oscillation by design |
| quantisation | in steps of | ADCs, encoders, PWM resolution | small limit cycles near the setpoint |
None of these is a property of the controller you designed, so it never appears in the transfer function. The first step is always to simulate with them: a few lines of NumPy around the linear model.
Intuition: an op-amp that clips
An op-amp stage with gain 4 on rails (output headroom ) is a saturation: linear for input peaks up to , clipped at beyond. With a input peak the ideal output would be ; the lab shows the simulated peak stuck at and the state "clipping at the rails".
The clipped wave still contains a sine at the input frequency, smaller than but (surprisingly) larger than the peak: the flattened top carries extra fundamental. The ratio of that fundamental to the input sine is the describing function.
The describing function
Feed a sine into a static nonlinearity. The output is periodic; keep only its fundamental, . The describing function is the complex "gain" of that fundamental,
It depends on the amplitude but not on the frequency (for static nonlinearities). Standard results, for unit slope where there is one:
Backlash and hysteresis add a phase lag (), which is why they are worse for stability than saturation.
Predicting a limit cycle. If the loop is the nonlinearity in series with a linear , a sustained oscillation needs the loop gain of the fundamental to be :
Plot (the Nyquist plot) and for all on the same plane; where they cross, the crossing gives the frequency from and the amplitude from . For a relay, runs along the negative real axis, so the crossing is the phase crossover of , where . The method is approximate: it assumes filters out the harmonics, which holds when is low-pass.
Worked example: a relay loop
Given: an on/off controller with output around a plant (time in seconds), setpoint 0.
Find: the predicted limit cycle (period and amplitude of ), then compare with a simulation.
Solve:
- Phase of : gives , a period of .
- There .
- Crossing: , so .
Check: python-control computes describing functions numerically and finds the crossing; a time simulation shows the real cycle.
import numpy as np
import control as ct
# 1. Describing functions: numerical vs formula
sat = ct.saturation_nonlinearity(1.0)
for A in (1.5, 3.0):
r = 1 / A
formula = 2 / np.pi * (np.arcsin(r) + r * np.sqrt(1 - r * r))
print(f"saturation a = 1, A = {A}: N = {ct.describing_function(sat, A).real:.4f} (formula {formula:.4f})")
relay = lambda v: 1.0 if v > 0 else -1.0
Nr = np.ravel(ct.describing_function(relay, 0.5))[0]
print(f"relay M = 1, A = 0.5: N = {Nr.real:.4f} (formula {4 / (np.pi * 0.5):.4f})")
# 2. Predicted limit cycle of relay + G
G = ct.tf([2], [1, 3, 3, 1])
w = np.sqrt(3.0)
Gjw = G(1j * w)
print(f"phase crossover {w:.3f} rad/s: |G| = {abs(Gjw):.4f}, predicted A = {4 * abs(Gjw) / np.pi:.4f}, "
f"period {2 * np.pi / w:.3f} s")
# 3. Time simulation (RK4 on the state model, relay sampled every step)
sys = ct.tf2ss(G)
A_, B_, C_ = sys.A, sys.B[:, 0], sys.C[0]
h, x = 1e-3, np.zeros(3)
x[0] = 0.1
ys = []
for n in range(40000):
u = -1.0 if C_ @ x > 0 else 1.0 # e = 0 - y
f = lambda z: A_ @ z + B_ * u
k1 = f(x); k2 = f(x + h / 2 * k1); k3 = f(x + h / 2 * k2); k4 = f(x + h * k3)
x = x + h / 6 * (k1 + 2 * k2 + 2 * k3 + k4)
ys.append(C_ @ x)
ys = np.array(ys[20000:]) # last 20 s
up = np.where((ys[:-1] < 0) & (ys[1:] >= 0))[0]
print(f"simulated: amplitude {ys.max():.4f}, period {np.mean(np.diff(up)) * h:.3f} s")saturation a = 1, A = 1.5: N = 0.7809 (formula 0.7809)
saturation a = 1, A = 3.0: N = 0.4164 (formula 0.4164)
relay M = 1, A = 0.5: N = 2.5456 (formula 2.5465)
phase crossover 1.732 rad/s: |G| = 0.2500, predicted A = 0.3183, period 3.628 s
simulated: amplitude 0.3262, period 3.680 s
The describing function predicts the period within 2 % ( against ) and the amplitude within 3 % ( against ): good enough to decide whether a cycle matters and how to shrink it (lower relay amplitude , add hysteresis, or replace on/off by proportional action). The same experiment, done on purpose, is the relay auto-tuner: the cycle reveals the ultimate gain and period of the plant, which Ziegler–Nichols tuning needs without pushing the loop to the edge of instability.
Stick-slip and backlash in a position loop
A position loop with a PI controller around a motor with static friction does not settle. The motor needs to break away but only to keep moving, so it behaves like a dead zone that shrinks once it moves. Near the target the voltage falls below and the shaft sticks; the integrator charges until the voltage breaks it free, the shaft jumps past the target, and the integrator charges the other way: hunting. The program compares three remedies: none, freezing the integrator inside a small error band (), and dropping integral action altogether.
import numpy as np
def run(Ki, band, T=10.0, h=1e-4):
tau, K, Kp = 0.05, 50.0, 2.0 # speed time constant (s), rad/s per V, V/rad
brk, kin = 0.3, 0.1 # breakaway and running friction, in volts
th = w = integ = 0.0
log = []
for n in range(int(T / h)):
e = 0.5 - th # 0.5 rad step
if abs(e) >= band:
integ += Ki * e * h
v = Kp * e + integ
if abs(w) < 1e-3 and abs(v) < brk: # stuck
w = 0.0
else: # moving: friction opposes the motion
s = np.sign(w) if abs(w) >= 1e-3 else np.sign(v)
w += h * (K * (v - kin * s) - w) / tau
th += h * w
log.append(th)
tail = np.array(log[int(5.0 / h):]) # last 5 s
crossings = np.count_nonzero(np.diff(np.sign(tail - 0.5)))
return tail.min(), tail.max(), crossings
for name, Ki, band in (("PI, Ki = 4", 4.0, 0.0), ("PI, integrator frozen in +/-0.02 rad", 4.0, 0.02), ("P only", 0.0, 0.0)):
lo, hi, n = run(Ki, band)
print(f"{name:36s}: angle in last 5 s {lo:.4f} to {hi:.4f} rad, {n} target crossings")PI, Ki = 4 : angle in last 5 s 0.4634 to 0.6324 rad, 4 target crossings
PI, integrator frozen in +/-0.02 rad: angle in last 5 s 0.4873 to 0.4873 rad, 0 target crossings
P only : angle in last 5 s 0.4922 to 0.4922 rad, 0 target crossings
Plain PI hunts between and , crossing the target again and again. Freezing the integrator in a small band stops the cycle and leaves an error smaller than the band (). P only also stops, here even closer (), but only because nothing loads the shaft: with a load torque a P loop keeps a larger error, which is why the integrator band is the usual fix. Backlash in a gearbox does the same to a loop that measures the motor angle but cares about the load angle, and the cures are similar: an integrator band, a measurement on the load side, or a gear with preload.
Guided lab: an on/off heater
Hand calculation. The heater block with a sensor lag: (K/W) has phase only at infinite frequency, so an ideal relay would chatter infinitely fast. A thermostat therefore needs hysteresis: with switching at around the setpoint and a heater toggling between and , expect a cycle of roughly plus the overshoot caused by the sensor lag, with a period of a few minutes.
Simulation. Adapt the relay program: plant above, relay output or , hysteresis around a rise.
What you would measure. The heater block on through a MOSFET switched by a microcontroller with a simple thermostat rule, a digital temperature sensor logged every second. Expect a sawtooth of about peak to peak and a period of 2–10 minutes; reproducibility within (room draughts change the cooling rate).
Hazards and safe setup. The block reaches : mount on stand-offs, add a thermal fuse or software cut-off (e.g. ), never leave it running unattended; current-limited supply.
Pitfalls
- Tuning on a small-signal step and then commanding large steps: the actuator saturates and the loop behaves differently.
- Adding integral action to fix a friction or dead-zone error: it creates hunting instead.
- Applying the describing function to a plant that is not low-pass: harmonics then matter and the prediction fails.
- Ignoring quantisation: a fine-tuned high-gain loop can limit-cycle by one ADC or encoder count.
Practice
- A relay of around : predict the frequency and amplitude of the limit cycle.
- What is of a saturation (unit slope, limit ) for ?
Answer
- at ; ; .
- : the sine passes unchanged.
Test yourself
The describing function of an ideal relay with output driven by a sine of amplitude is
- 1
A relay loop oscillates at the frequency where
- has a pole
- the relay switches fastest
Why does PI control of a motor with static friction hunt around the setpoint?
- the proportional gain is too high
- the stuck shaft lets the integrator build up until it breaks free and jumps past the target
- friction adds a pole
- the sensor is quantised
Which nonlinearity adds phase lag to the describing function and is therefore worst for stability?
- ideal saturation
- ideal dead zone
- backlash
- an ideal relay without hysteresis