S9 · Lesson 30 · Time delay in control loops
Where delays come from, why they limit bandwidth, Padé approximations and their right-half-plane zeros, the delay a digital controller adds, and the Smith predictor with its sensitivity to model errors
Fluid takes time to flow down a pipe to a sensor, a network packet takes time to arrive, a digital controller takes a sample to compute and a zero-order hold half a sample to deliver. A delay doesn't change the loop gain's magnitude at all, but it subtracts phase in proportion to frequency, so it caps how fast any loop can be. This lesson measures that cost, shows how to model a delay with rational transfer functions, and presents Otto Smith's 1957 trick for controlling a plant as if its delay weren't there.
- The phase of a pure delay, , against ωT, with two rational approximations: the first-order Padé and the second-order Padé .
- All three agree at low frequency. The first-order one falls behind by ωT = 1 (−53° against −57°) and saturates at −180°; the second-order one tracks to about ωT = 2 and saturates at −360°.
- Both approximations have the same magnitude as the delay, 1 at every frequency, because they're all-pass.
Predict
An integrator with a delay, , needs 60° of phase margin. What's the largest Kθ allowed?
The loop crosses at = K, where the phase is (radians converted). A 60° margin leaves 30° = π/6 for the delay, so Kθ ≤ 0.524. The loop's speed is tied to the delay: halve the delay and you can double the gain.
Name it
The cost of a delay
has magnitude 1 and phase . At the crossover that's radians of margin used up, which is why a delay limits to roughly (lesson 28).
Digital controllers
A controller sampling every with a zero-order hold adds about of effective delay from the hold, plus up to more if the output is applied one sample after the input is read. That's 1.5 in total, costing radians at crossover: 27° for a 1 kHz crossover sampled at 20 kHz.
Padé approximations
Rational stand-ins for the delay let polynomial tools (root locus, Routh, state space) handle it:
Both have zeros in the right half-plane (the first-order one at ), the polynomial signature of a delay: the response can't start until the delay passes.
The Smith predictor
Run a model of the plant without its delay, , and a model of the delay alongside the controller. Feed back the measured output plus the difference between the undelayed and delayed model outputs. If the model is exact, the controller effectively sees , and the closed loop is
the delay-free response, simply delayed. The controller can be tuned as if there were no delay. The catch is model error: if the real delay differs from the model's, the predictor feeds back a wrong correction, and robustness falls quickly.
Worked example
A process is dominated by its delay. Compare SIMC PI with a Smith predictor.
Show the solution
- SIMC PI. With :
- Its response. Simulated with the exact delay, it overshoots 4% and settles within 2% at 30.3 s.
- Smith predictor. It lets the PI be tuned for the delay-free plant: = 2 s and = 1 make the inner loop
- Its response. The output is that response delayed 5 s, with no overshoot, settling at
- If the model is wrong. If the real delay is 6 s instead of the modeled 5, the same predictor overshoots 16% and takes 27.5 s.
Answer SIMC PI settles in 30.3 s with 4% overshoot; the Smith predictor settles in 12.8 s with none, but overshoots 16% and takes 27.5 s if the delay is really 6 s.
Worked example
How good is the first-order Padé approximation?
Show the solution
- At ωθ = 1. The first-order Padé phase is against the delay's −57.3°: 4.2° short.
- At ωθ = 2. It gives −90° against −114.6°.
- Second order. The second-order version gives −57.2° and −112.6° at those points.
- When first order is enough. Since a loop with a delay must cross over below about ωθ = 1, the first-order approximation is usually adequate for analysis near crossover.
Answer good enough near crossover: 4.2° short at ωθ = 1, though by ωθ = 2 it gives only −90° against −114.6°.
Worked example
At ωθ = 2, compare the true delay's phase with the first- and second-order Padé approximations.
Show the solution
- True delay. It lags by
- First-order Padé. The approximation lags by short by 24.6°.
- Second-order Padé. It lags by short by only 2.0°.
- What it means for design. A design that crosses over near ωθ = 2 needs at least the second-order form to predict its margin.
Answer the delay lags 114.6°, the first-order Padé 90° (24.6° short) and the second-order Padé 112.6° (2.0° short).
Check
At ωθ = 1, how far does the first-order Padé approximation's phase lag fall short of the true delay's?
Check
A plant has K = 1 and θ = 0.1 s. What proportional gain gives a 60° phase margin?
Check
A digital loop sampled at 10 kHz crosses over at 2 kHz. How much phase do the hold and one sample of computation delay cost there?
Check
Where's the right-half-plane zero of the first-order Padé approximation of a 1 s delay?
Write units the way you normally would: 1.5 rad/s and 1500 mrad/s are the same answer.
Check
With a Smith predictor, a PI controller ( = τ) is tuned for with K = 0.5, τ = 2 s, θ = 5 s. What gives a delay-free closed-loop time constant of 4 s?
Check
With a perfect model, a Smith-predictor loop responds like with = 1 s and θ = 2 s. When does it settle within 2%?
Write units the way you normally would: 1.5 s and 1500 ms are the same answer.
Check
A delay is approximated at ωθ = 1.
(a)
By how much does the first-order Padé approximation understate the phase lag?
(b)
And the second-order one?
Check
A delay of h seconds, at a frequency w (rad/s) with wh below 1.5.
Step 1
What is its phase, in degrees?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What phase does the first-order Padé approximation give?
Step 3
Where is that approximation's right-half-plane zero?
Explain why
Why is a Smith predictor sensitive to errors in the modeled delay?
The predictor works by subtracting its model's delayed output from the measured output, which cancels the real delayed response and leaves the controller looking at the undelayed model. If the model's delay is wrong, the two signals are misaligned in time, and their difference is no longer zero during transients: it's a time-shifted copy of the response that the controller treats as real error. That spurious error arrives at the wrong moment and drives the controller harder, causing overshoot or oscillation. Because the controller was tuned aggressively on the assumption that the delay was gone, it has little margin to absorb the mistake.
Practice
Keep practicing
10 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.