Feedback, Delay & Oscillation · Guide · glidepathscience.org
GuideFeedback, Delay & Oscillation
Contents
This Guide explains the ideas and equations behind every Walkthrough step, Concept Challenge question and Predict round. Part 1 prepares the Intro track and Part 2 the Advanced track; each takes about twelve minutes. Each section ends with a worked example that is not one of the sim’s own problems.
Part 1 · The essentials
Math you’ll need: algebra, exponentials and a square root; one optional box uses calculus.
Measure, compare, correct
A thermostat, a car’s cruise control and your hand balancing a broom all run the same loop. A sensor measures the output (the room’s temperature, the car’s speed, the broom’s tilt). The controller compares it with the set point, the value you want, and acts on the difference, the error: it turns on the heater, opens the throttle, moves the hand. The action changes the output, the sensor measures it again, and the loop goes round.
In this sim the main example is a shower. You want water at 38 °C. You feel the water, and you turn the mixing valve hotter or colder according to how far off it feels. The catch is the pipe: the water reaching your head left the valve a second or two ago. Everything in this Guide follows from that one fact: the loop acts on old information.
Negative and positive feedback
A loop that pushes against the error is called negative feedback: too cold, so heat; too fast, so ease off. “Negative” describes the direction of the action relative to the error, not which side of the set point the output is on. Negative feedback is the steadying kind: each correction makes the error smaller.
A loop that pushes with the error is positive feedback. Turn the shower hotter whenever it feels too hot and the error feeds itself, growing faster the bigger it gets, until something limits it: the tap is fully open. A microphone’s squeal near its own speaker is the same runaway.
The simplest controller is on/off. A house thermostat switches the heater fully on below a temperature and fully off above a slightly higher one; the gap between them is the band. Because the heater can only be on or off, the room never holds still, even with a perfect sensor: it warms to the top of the band, the heater stops, it cools to the bottom, the heater starts. The swing is the band itself. If the sensor reports late, each switch comes late and the room overshoots both edges.
Proportional control and its time constant
A smoother controller pushes in proportion to the error. In the shower, your hand turns the mix at a rate $k$ times the error:
correction rate $= k e$
Here $e$ is the error in °C and $k$, the gain, is in s⁻¹: a gain of 0.5 s⁻¹ turns the mix half a degree per second for each degree the water is off. A bigger gain closes the gap faster.
With no pipe, the water you feel is the water leaving the valve, and the error shrinks by the same fraction every second. That is an exponential decay, the same curve a capacitor makes as it charges through a resistor. Its time constant, the time to close 63 % of the gap (leaving $e^{−1}$ = 37 %), is
no delay: time constant $1/k$
Without a delay, proportional control never overshoots: the push shrinks with the error and vanishes just as the set point is reached.
A delay, an overshoot and a swing
Now put the pipe back: the water takes a time $τ$ to travel from the valve to your head. When the water you feel finally reaches 38 °C, the pipe is already full of hotter water, and you are still turning hotter because what you feel has only just arrived. The water overshoots. Then it feels too hot, you turn colder, and the same lag makes you overcorrect the other way.
What happens next depends on a single number, the product of the gain and the delay, $kτ$. It has no units. Halve the delay and you may double the gain and see exactly the same shape, twice as fast.
- no overshoot while $kτ < 1/e$ (about 0.37): the water creeps up;
- for $kτ$ between 0.37 and about 1.57 it overshoots and rings down;
- at $kτ = π/2$ the swing neither grows nor dies: the onset of oscillation;
- beyond it each swing is bigger than the last, until something limits it.
At the onset each correction arrives exactly a quarter of a swing late, so the swing’s period is four delays: period at onset $= 4τ$.
Cruise control
A car’s cruise control is a proportional loop: it adds throttle in proportion to how far the speed is below the set speed. The engine’s response lags the command, a delay of a fraction of a second. On a hill a gentle controller lets the speed sag a little and holds it there: a proportional controller needs some error to supply the extra push the hill demands. Adding the integral of the error (PI control) removes that sag. An eager controller with the same lag has a large $kτ$: past π/2 it surges, faster and slower, and engineers keep $kτ$ well below that.
Your reaction time, and a stick on your hand
You are a feedback loop too: your eyes are the sensor, your brain the controller, your muscles the actuator, and your reaction time is the loop’s delay. A ruler drop measures it. A friend lets go of a ruler between your fingers; it falls freely from rest, $d = \frac12 g t^2$, so the distance it falls before you catch it gives
ruler drop: $t = \sqrt{2d/g}$
Typical visual reaction times are about 0.2 s. The Reaction Lab measures yours with a click test.
A stick standing on your hand falls away from upright unless you move your hand under it, and a short stick falls faster than a long one. Your delay sets the shortest stick you can follow. The model of Part 2 gives
shortest stick: $ℓ_{min} = \frac34 gτ^2$
The delay is squared: half the delay allows a stick a quarter as long. That is why anyone can balance a broom and nobody can balance a pencil.
Part 2 · Going further
Math you’ll need: differential equations, complex numbers and $e^{iθ}$; one section uses a special function, the Lambert W.
A delay differential equation
Write $x$ for the error. Proportional control with a delay is
$x′(t) = −k\,x(t − τ)$
a delay differential equation. Its slope at $t$ depends on the value at $t − τ$, so to start it you need not one number but the whole history of $x$ on $[−τ, 0]$. Its state is a function: the system is infinite-dimensional.
The method of steps solves it one interval at a time. With $x = 1$ for all $t ≤ 0$, on $0 ≤ t ≤ τ$ the delayed value is 1, so $x′ = −k$ and $x = 1 − kt$. On the next interval the delayed value is that straight line, and integrating once more gives
$x(2τ) = 1 − 2kτ + (kτ)^2/2$
Each interval adds one power of $kτ$. The sim’s engine works the same way numerically: Runge–Kutta steps with a history buffer.
Roots, Lambert W and the onset
Try $x = e^{st}$: then $x(t − τ) = e^{st}e^{−sτ}$, and the allowed rates satisfy the characteristic equation $s + k e^{−sτ} = 0$. It is transcendental and has infinitely many roots. Setting $w = sτ$ turns it into $we^w = −kτ$, the defining equation of the Lambert W function, so
$s = W_0(−kτ)/τ$
where the principal branch $W_0$ gives the rightmost root, the one that wins in the long run. For $kτ < 1/e$ it is real: no overshoot. Beyond, $W_0$ is complex, $s = σ + iω$, a swing of angular frequency $ω$ that decays at the rate $−σ$.
At the boundary a pair of roots sits on the imaginary axis, $s = ±iω$. Putting $s = iω$ into the equation and separating parts gives $k\cos ωτ = 0$ and $ω = k\sin ωτ$, so $ωτ = π/2$: onset: $ω = π/(2τ)$, $k = ω$. As $kτ$ passes π/2 the pair crosses into the right half plane, a Hopf bifurcation. In the linear model the swing then grows forever; a real actuator has a limit, which caps the growth and leaves a steady swing of fixed size, a limit cycle.
Margins and the Nyquist picture
Open the loop and look at its frequency response, $L(iω) = ke^{−iωτ}/(iω)$. Its magnitude is $k/ω$, so it crosses 1 at $ω_c = k$; its phase is −90° (the integrator) minus $ωτ$ (the delay, which attenuates nothing and only lags, more at higher frequency). The phase margin is how far the phase at the crossover is from −180°:
$φ_m = 90° − (180°/π)kτ$
Dividing the margin, in radians, by $ω_c$ gives the extra delay the loop can take, and comparing $k$ with the onset gain gives the factor it can grow by:
delay margin $= (π/2 − kτ)/k$ gain margin $= π/(2kτ)$
On a Nyquist plot, $L(iω)$ is a spiral that comes in from far down the negative imaginary axis and winds into the origin. It first crosses the negative real axis at $ωτ = π/2$, where $|L| = 2kτ/π$. The closed loop is unstable when that crossing lies beyond −1, enclosing it: again $kτ > π/2$.
Delayed damping
A mass on a spring with a damper obeys $x″ = −ω_0^2x − c\,x′$. If the damper reads the velocity late, $x″ = −ω_0^2x − c\,x′(t − τ)$, its force is out of step with the motion. For weak damping the swing’s growth rate is, to first order,
delayed damping: growth rate $≈ −\frac12 c\cos ω_0τ$
A quarter to three quarters of a period late, $\cos ω_0τ < 0$: the “damper” pushes along the motion and feeds energy in, like pushing a swing in time. This is Simple Harmonic Motion’s resonance with the loop doing the driving.
Balancing a stick: delayed PD control
A uniform stick of length $ℓ$ pivoted at your hand obeys, for small tilts, $θ″ = λ^2θ$ with $λ = \sqrt{g/ℓ_{eff}}$, $ℓ_{eff} = 2ℓ/3$: a tilt grows as $\cosh λt$, by a factor $e$ in a time $1/λ$. A hand that accelerates by $ℓ_{eff}(Pθ + Dθ′)$, read $τ$ late, gives
$θ″ = λ^2θ − Pθ(t − τ) − Dθ′(t − τ)$
The gains that hold the stick up form a region in the $(P, D)$ plane, bounded by the line $P = λ^2$ (a root at $s = 0$) and a curve where a pair crosses at $±iω$. As the delay grows the region shrinks, and it vanishes when $λτ = \sqrt2$. That gives the critical length
$ℓ_c = \frac34 gτ^2$
At $ℓ_c$ only one pair of gains works, and only exactly; real hands are noisy and imprecise, so people need a stick well above $ℓ_c$.
Reference
Common mistakes
Part 1
- Calling a loop negative because the output is below the set point: “negative” means the action opposes the error.
- Expecting an on/off thermostat to settle at the set point: it always cycles across its band.
- Thinking a delay only slows the response: a late correction overshoots.
- Judging a loop by its gain or its delay alone: only $kτ$ matters.
- Taking the period at onset as $2τ$ (half a swing) or $τ$: it is $4τ$.
- Forgetting the 2 in $t = \sqrt{2d/g}$, or the square in $ℓ_{min} = \frac34 gτ^2$.
Part 2
- Giving a delay equation one initial value: it needs a history.
- Mixing radians and degrees in the phase margin.
- Using $ℓ$ for $ℓ_{eff}$: a uniform stick’s is $2ℓ/3$.
The equation sheet
| Part 1 | |
|---|---|
| proportional control | correction rate $= k e$ |
| no delay | time constant $1/k$ |
| no overshoot | $kτ < 1/e$ |
| onset | $kτ = π/2$; period $= 4τ$ |
| ruler drop | $t = \sqrt{2d/g}$ |
| shortest stick | $ℓ_{min} = \frac34 gτ^2$ |
| Part 2 | |
|---|---|
| the loop | $x′(t) = −k\,x(t − τ)$ |
| roots | $s + k e^{−sτ} = 0$; $s = W_0(−kτ)/τ$ |
| steps | $x(2τ) = 1 − 2kτ + (kτ)^2/2$ |
| onset | $ω = π/(2τ)$, $k = ω$ |
| margins | $φ_m = 90° − (180°/π)kτ$; $(π/2 − kτ)/k$; $π/(2kτ)$ |
| stick | $λ = \sqrt{g/ℓ_{eff}}$, $ℓ_{eff} = 2ℓ/3$; $ℓ_c = \frac34 gτ^2$ |
| delayed damping | $≈ −\frac12 c\cos ω_0τ$ |
$k$ gain (s⁻¹), $τ$ delay (s), $e$ error, $x$ error in Part 2, $s = σ + iω$ a root, $W_0$ the principal Lambert W, $φ_m$ phase margin, $ℓ$ stick length, $ℓ_{eff}$ its effective length, $λ$ its fall rate, $P$ and $D$ the PD gains, $ω_0$ a spring’s angular frequency, $c$ its damping rate, $g$ = 9.81 m/s².
Further reading
- K. J. Åström and R. M. Murray, Feedback Systems: An Introduction for Scientists and Engineers, 2nd ed., Princeton University Press (2021).
- R. M. Corless et al., “On the Lambert W function,” Advances in Computational Mathematics 5, 329–359 (1996).
- This sim’s Field Manual (H): the model and what it leaves out.
Feedback, Delay & Oscillation v1.1 · © 2026 Dr. David Meier · CC BY-NC-SA 4.0 · glidepathscience.org