TExcelTAD
Home › Control Systems & Automation › Nonlinearities: Saturation, Dead Zone, Backlash and the Describing Function

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 14.4 W14.4\ \text{W} 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 u=sat⁡(v)u = \operatorname{sat}(v): linear up to ±umax\pm u_\text{max} supply rails, PWM at 0 and 100 %, valve fully open slower response, integrator windup, large overshoot (Anti-Windup)
dead zone u=0u = 0 for ∣v∣<δ\lvert v \rvert < \delta, 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 2b2b gears, belts, lead screws phase lag; limit cycles in position loops with integral action
relay (on/off), with hysteresis u=±Mu = \pm M by the sign of vv, switching at ±h\pm h thermostats, solenoid valves, contactors a sustained oscillation by design
quantisation uu in steps of qq 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 ±5 V\pm 5\ \text{V} rails (output headroom 1 V1\ \text{V}) is a saturation: linear for input peaks up to 1 V1\ \text{V}, clipped at ±4 V\pm 4\ \text{V} beyond. With a 1.5 V1.5\ \text{V} input peak the ideal output would be 6 V6\ \text{V}; the lab shows the simulated peak stuck at 4.000 V4.000\ \text{V} and the state "clipping at the rails".

-+voutRfRinvinclipping at the railsideal gain4.00 V/VfCL (-3 dB)250 kHz|A(f)| linear4.000 V/Vout pk wanted6.00 Vrail limit+/-4.00 V2 pi f Vpk needs0.004 V/usSR available0.50 V/ussupply+/-5.0 V-5050T/2T3T/22TVf = 100 Hz+VS-VSvinvoutideal gain x vin

The clipped wave still contains a sine at the input frequency, smaller than 6 V6\ \text{V} but (surprisingly) larger than the 4 V4\ \text{V} 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 v=Asin⁡ωtv = A\sin\omega t into a static nonlinearity. The output is periodic; keep only its fundamental, b1sin⁡ωt+a1cos⁡ωtb_1 \sin\omega t + a_1\cos\omega t. The describing function is the complex "gain" of that fundamental,

N(A)=b1+ja1AN(A) = \frac{b_1 + j a_1}{A}

It depends on the amplitude AA but not on the frequency (for static nonlinearities). Standard results, for unit slope where there is one:

relay ±M:N(A)=4MπAsaturation at ±a:N(A)=2π[arcsin⁡aA+aA1−a2A2 ],A>adead zone ±δ:N(A)=1−Nsat(A)∣a=δ\begin{aligned} \text{relay } \pm M: \quad & N(A) = \frac{4M}{\pi A} \\ \text{saturation at } \pm a: \quad & N(A) = \frac{2}{\pi}\left[\arcsin\frac{a}{A} + \frac{a}{A}\sqrt{1 - \frac{a^2}{A^2}}\,\right], \quad A > a \\ \text{dead zone } \pm\delta: \quad & N(A) = 1 - N_\text{sat}(A)\big|_{a = \delta} \end{aligned}

Backlash and hysteresis add a phase lag (a1≠0a_1 \ne 0), which is why they are worse for stability than saturation.

Predicting a limit cycle. If the loop is the nonlinearity NN in series with a linear G(s)G(s), a sustained oscillation needs the loop gain of the fundamental to be −1-1:

G(jω) N(A)=−1⟺G(jω)=−1N(A)G(j\omega)\,N(A) = -1 \quad \Longleftrightarrow \quad G(j\omega) = -\frac{1}{N(A)}

Plot G(jω)G(j\omega) (the Nyquist plot) and −1/N(A)-1/N(A) for all AA on the same plane; where they cross, the crossing gives the frequency ω\omega from GG and the amplitude AA from NN. For a relay, −1/N=−πA4M-1/N = -\frac{\pi A}{4M} runs along the negative real axis, so the crossing is the phase crossover of GG, where ∠G=−180∘\angle G = -180^\circ. The method is approximate: it assumes GG filters out the harmonics, which holds when GG is low-pass.

Worked example: a relay loop

Given: an on/off controller with output ±1\pm 1 around a plant G(s)=2(s+1)3G(s) = \frac{2}{(s + 1)^3} (time in seconds), setpoint 0.

Find: the predicted limit cycle (period and amplitude of yy), then compare with a simulation.

Solve:

  • Phase of GG: −3arctan⁡ω=−180∘-3\arctan\omega = -180^\circ gives ω=tan⁡60∘=3=1.732 rad/s\omega = \tan 60^\circ = \sqrt{3} = 1.732\ \text{rad/s}, a period of 2π/1.732=3.63 s2\pi/1.732 = 3.63\ \text{s}.
  • There ∣G∣=2(1+3)3/2=28=0.25\lvert G \rvert = \frac{2}{(1 + 3)^{3/2}} = \frac{2}{8} = 0.25.
  • Crossing: πA4M=0.25\frac{\pi A}{4M} = 0.25, so A=4×1×0.25π=0.318A = \frac{4 \times 1 \times 0.25}{\pi} = 0.318.

Check: python-control computes describing functions numerically and finds the crossing; a time simulation shows the real cycle.

python · try it yourself
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 % (3.633.63 against 3.68 s3.68\ \text{s}) and the amplitude within 3 % (0.3180.318 against 0.3260.326): good enough to decide whether a cycle matters and how to shrink it (lower relay amplitude MM, 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 Ku=4M/(πA)K_u = 4M/(\pi A) and period TuT_u 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 0.3 V0.3\ \text{V} to break away but only 0.1 V0.1\ \text{V} to keep moving, so it behaves like a dead zone that shrinks once it moves. Near the target the voltage falls below 0.3 V0.3\ \text{V} 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 (±0.02 rad\pm 0.02\ \text{rad}), and dropping integral action altogether.

python · try it yourself
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 0.460.46 and 0.63 rad0.63\ \text{rad}, crossing the target again and again. Freezing the integrator in a small band stops the cycle and leaves an error smaller than the band (0.013 rad0.013\ \text{rad}). P only also stops, here even closer (0.008 rad0.008\ \text{rad}), 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: G(s)=4(300s+1)(20s+1)G(s) = \frac{4}{(300 s + 1)(20 s + 1)} (K/W) has phase −180∘-180^\circ only at infinite frequency, so an ideal relay would chatter infinitely fast. A thermostat therefore needs hysteresis: with switching at ±0.5 K\pm 0.5\ \text{K} around the setpoint and a heater toggling between 00 and 14.4 W14.4\ \text{W}, expect a cycle of roughly ±0.5 K\pm 0.5\ \text{K} plus the overshoot caused by the sensor lag, with a period of a few minutes.

Simulation. Adapt the relay program: plant above, relay output 00 or 14.4 W14.4\ \text{W}, hysteresis ±0.5 K\pm 0.5\ \text{K} around a 25 K25\ \text{K} rise.

What you would measure. The heater block on 12 V12\ \text{V} through a MOSFET switched by a microcontroller with a simple thermostat rule, a digital temperature sensor logged every second. Expect a sawtooth of about 1–2 K1\text{–}2\ \text{K} peak to peak and a period of 2–10 minutes; reproducibility within ±20 %\pm 20\,\% (room draughts change the cooling rate).

Hazards and safe setup. The block reaches 50–60 ∘C50\text{–}60\,^\circ\text{C}: mount on stand-offs, add a thermal fuse or software cut-off (e.g. 80 ∘C80\,^\circ\text{C}), never leave it running unattended; current-limited 12 V12\ \text{V} 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

  1. A relay of ±2 V\pm 2\ \text{V} around G(s)=10s(s+1)(s+2)G(s) = \frac{10}{s(s + 1)(s + 2)}: predict the frequency and amplitude of the limit cycle.
  2. What is N(A)N(A) of a saturation (unit slope, limit aa) for A≤aA \le a?
Answer
  1. ∠G=−90∘−arctan⁡ω−arctan⁡(ω/2)=−180∘\angle G = -90^\circ - \arctan\omega - \arctan(\omega/2) = -180^\circ at ω=2=1.414 rad/s\omega = \sqrt{2} = 1.414\ \text{rad/s}; ∣G∣=101.414×1.732×2.449=1.667\lvert G \rvert = \frac{10}{1.414 \times 1.732 \times 2.449} = 1.667; A=4×2×1.667/π=4.24 VA = 4 \times 2 \times 1.667/\pi = 4.24\ \text{V}.
  2. N=1N = 1: the sine passes unchanged.

Test yourself

The describing function of an ideal relay with output ±M\pm M driven by a sine of amplitude AA is

  1. M/AM/A
  2. 4MπA\frac{4M}{\pi A}
  3. πA4M\frac{\pi A}{4M}
  4. 1

A relay loop oscillates at the frequency where

  1. ∣G∣=1\lvert G \rvert = 1
  2. ∠G(jω)=−180∘\angle G(j\omega) = -180^\circ
  3. GG has a pole
  4. the relay switches fastest

Why does PI control of a motor with static friction hunt around the setpoint?

  1. the proportional gain is too high
  2. the stuck shaft lets the integrator build up until it breaks free and jumps past the target
  3. friction adds a pole
  4. the sensor is quantised

Which nonlinearity adds phase lag to the describing function and is therefore worst for stability?

  1. ideal saturation
  2. ideal dead zone
  3. backlash
  4. an ideal relay without hysteresis