S930 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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, −ωT, against ωT, with two rational approximations: the first-order Padé 1−sT/21+sT/2 and the second-order Padé 1−sT/2+s2T2/121+sT/2+s2T2/12.
  • 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, L=Ke−sθ/s, needs 60° of phase margin. What's the largest Kθ allowed?

Name it

The cost of a delay

e−jωθ has magnitude 1 and phase −ωθ. At the crossover that's ωcθ radians of margin used up, which is why a delay limits ωc to roughly 1/θ (lesson 28).

Digital controllers

A controller sampling every Ts with a zero-order hold adds about Ts/2 of effective delay from the hold, plus up to Ts more if the output is applied one sample after the input is read. That's 1.5 Ts in total, costing 1.5ωcTs 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:

e−sθ≈1−sθ/21+sθ/2≈1−sθ/2+s2θ2/121+sθ/2+s2θ2/12

Both have zeros in the right half-plane (the first-order one at +2/θ), 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, P0, 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 P0, and the closed loop is

yr=CP01+CP0e−sθ

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 P=e−5s/(2s+1) is dominated by its delay. Compare SIMC PI with a Smith predictor.

Show the solution
  1. SIMC PI. With τc=θ: Kp=21×10=0.2Ti=2s
  2. Its response. Simulated with the exact delay, it overshoots 4% and settles within 2% at 30.3 s.
  3. Smith predictor. It lets the PI be tuned for the delay-free plant: Ti = 2 s and Kp = 1 make the inner loop 12s+1
  4. Its response. The output is that response delayed 5 s, with no overshoot, settling at ts=5+2×3.91=12.8s
  5. 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
  1. At ωθ = 1. The first-order Padé phase is −2tan−1⁡0.5=−53.1° against the delay's −57.3°: 4.2° short.
  2. At ωθ = 2. It gives −90° against −114.6°.
  3. Second order. The second-order version gives −57.2° and −112.6° at those points.
  4. 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
  1. True delay. It lags by 2rad=114.6°
  2. First-order Padé. The approximation (1−sθ/2)/(1+sθ/2) lags by 2tan−1⁡(1)=90° short by 24.6°.
  3. Second-order Padé. It lags by 2tan−1⁡ωθ/21−(ωθ)2/12=2tan−1⁡1.5=112.6° short by only 2.0°.
  4. 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 Ke−sθ/s 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 (Ti = τ) is tuned for Ke−sθ/(τs+1) with K = 0.5, τ = 2 s, θ = 5 s. What Kp gives a delay-free closed-loop time constant of 4 s?

Check

With a perfect model, a Smith-predictor loop responds like e−sθ/(τcs+1) with τc = 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°.

Explain why

Why is a Smith predictor sensitive to errors in the modeled delay?

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.