Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Delay and delay margin

All physical systems have delays. Although we have ignored them in our analyses so far, they can have a significant impact on the stability and performance of a control system.

Delay

All physical systems have delays. Examples include:

Delay as an LTI system

A time delay of τ>0\tau>0 seconds is an LTI system because it satisfies the properties we learned about: time-invariance, homogeneity, additivity, and causality. In fact, a delay of τ\tau seconds has a very simple step response:

Step response of a delay of \tau seconds.

Figure 1:Step response of a delay of τ\tau seconds.

There is no ODE that describes a delay, only the equation y(t)=u(t−τ)y(t) = u(t-\tau). Nevertheless, we can derive the transfer function of a delay by taking the Laplace transform of the input-output relationship:

Y(s)=L{u(t−τ)}=∫0∞u(t−τ)e−st dt=e−sτ∫0∞u(t−τ)e−s(t−τ) dt=e−sτ∫0∞u(t)e−st dt(u(t)=0 for t<0)=e−sτU(s)\begin{aligned} Y(s) &= \Lap\{u(t-\tau)\} \\ &= \int_0^\infty u(t-\tau) e^{-st} \, \dd t \\ &= e^{-s\tau} \int_0^\infty u(t-\tau) e^{-s(t-\tau)} \, \dd t \\ &= e^{-s\tau} \int_{0}^\infty u(t) e^{-st} \, \dd t \qquad\textsf{($u(t)=0$ for $t<0$)}\\ &= e^{-s\tau} U(s) \end{aligned}

Therefore the transfer function of a delay of τ\tau seconds is e−sτe^{-s\tau}.

Bode plot of delay

The frequency response of a delay of τ\tau seconds is given by evaluating the transfer function at s=jωs = j\omega:

G(jω)=e−jωτG(j\omega) = e^{-j\omega\tau}

This is a complex number in polar form, with magnitude 1 and phase −ωτ-\omega\tau (radians). To make a Bode plot, we convert the magnitude to decibels and the phase to degrees:

M(ω)=0 dB,ϕ(ω)=−ωτ⋅180π degM(\omega) = 0\text{ dB}, \qquad \phi(\omega) = -\omega\tau \cdot \frac{180}{\pi} \text{ deg}

We saw that LTI systems have -90° of phase per pole and +90° per zero at high frequencies, but delays are different. The phase lag for a delay increases without bound as ω→∞\omega\to\infty. Moreover, the phase lag increases linearly. So on a logarithmic frequency axis, the phase lag will grow exponentially! Here are the Bode plots for different delays.

Bode plots for delays of different lengths. The magnitude is always 0 dB, but the phase lag increases linearly with frequency, which shows up as an exponential increase on the logarithmic frequency axis.

Figure 2:Bode plots for delays of different lengths. The magnitude is always 0 dB, but the phase lag increases linearly with frequency, which shows up as an exponential increase on the logarithmic frequency axis.

Margin illustration

Let’s return to our example from the previous section, but this time, instead of adding gain to reduce the gain margin, let’s add delay to reduce the phase margin:

Standard feedback interconnection of a system G(s) with a delay \tau.

Figure 3:Standard feedback interconnection of a system G(s)G(s) with a delay τ\tau.

Here is the resulting Bode plot for a delay of τ=0.2\tau = 0.2 seconds:

As we increase the delay \tau, the phase plot shifts down, the phase crossover frequency \omega_{cg} moves to the left, and the gain margin \GM and phase margin \PM are reduced.

Figure 4:As we increase the delay τ\tau, the phase plot shifts down, the phase crossover frequency ωcg\omega_{cg} moves to the left, and the gain margin GM\GM and phase margin PM\PM are reduced.

We observe the following:

Delay margin

Delays can occur in many places in a feedback control loop, but if all the components are LTI, then we can aggregate all the delays into a single delay in the feedback path. We can then ask the question: how much delay can we add to the feedback path before the system becomes unstable? The answer to this question is known as the delay margin of the system.

Since adding delay adds phase lag, we will destabilize the closed-loop system if we add more phase lag than the phase margin. We only care about the phase lag at the gain crossover frequency ωcg\omega_{cg}, because that’s where phase margin is measured. If the delay is τ\tau seconds, this leads us to the equation:

τωcg≤PM\tau \omega_{cg} \leq \PM

The maximum delay τ\tau that we can add before instability is called the delay margin DM\DM, so we have the formula:

DM=PMωcg\boxed{ \DM = \frac{\PM}{\omega_{cg}} }

If there is no gain crossover frequency (i.e., PM=+∞\PM = +\infty), then the delay margin is also infinite, meaning no amount of delay added to the feedback path will cause closed-loop instability.

Example of delay margin

Let’s consider a simple first-order system with a 0.2 second delay in the feedback path:

G(s)=1s+1e−0.2sG(s) = \frac{1}{s+1} e^{-0.2s}

We know that proportional control can move the pole left as far as we like when there is no delay, but what happens when there is a delay? Here is the Bode plot for the undelayed and delayed systems:

Bode plots for a first-order system with and without a delay of 0.2 seconds. The delay causes the phase to shift down, which gives us a finite gain margin.

Figure 5:Bode plots for a first-order system with and without a delay of 0.2 seconds. The delay causes the phase to shift down, which gives us a finite gain margin.

The system now has a gain margin of about 18.5 dB (magnitude of 8.4), which means we can only use a proportional gain of about K≈8.4K\approx 8.4 before the system becomes unstable. This is a huge difference from the undelayed case, where we had infinite gain margin!

Due to the phase lag explosion caused by delay, and the fact that all feedback loops have some amount of delay, we come to an important conclusion:

Approximating delays (bonus)

Delays are difficult to work with because they are not rational transfer functions, and they cause closed-loop systems to have infinitely many poles. Therefore, it is common to use approximations.

Taylor approximations

A tempting approximation is the Taylor (Maclaurin) series ex=1+x+x22!+⋯e^x = 1 + x + \frac{x^2}{2!} + \cdots Applying this to the delay transfer function:

e−τs≈1−τs+(τs)22!+⋯+(−1)k(τs)kk!e^{-\tau s} \approx 1 - \tau s + \frac{(\tau s)^2}{2!} +\cdots+ (-1)^k\frac{(\tau s)^k}{k!}

This will not work for us, because we can’t have more zeros than poles, and this approximation has no poles. We could approximate the inverse instead:

e−τs=1eτs≈11+τs+(τs)22!+⋯+(τs)kk!e^{-\tau s} = \frac{1}{e^{\tau s}} \approx \frac{1}{1 + \tau s + \frac{(\tau s)^2}{2!} + \cdots + \frac{(\tau s)^k}{k!}}

This is better, and it has the correct DC gain (both sides are 1 at s=0s=0). The simplest Taylor approximation is 1τs+1\frac{1}{\tau s + 1}, which is a familiar first-order system. Unfortunately, the gain is only correct at zero frequency. To see why, take a look at the Bode plots for the first few Taylor approximations for a 1-second delay:

Taylor approximations of a 1-second delay. The approximation is only good at low frequencies.

Figure 6:Taylor approximations of a 1-second delay. The approximation is only good at low frequencies.

Interestingly, k=4k=4 is as far as we can go because for k≥5k\geq 5, the Taylor approximation has roots in the RHP, meaning that our approximation in Eq. (11) becomes unstable! Another possibility is to take the ratio of two Taylor approximations, which gives us a rational function with the same number of poles and zeros. For example:

e−τs=e−τs/2eτs/2≈1−τs2+(τs)28+⋯+(−1)k(τs)k2kk!1+τs2+(τs)28+⋯+(τs)k2kk!e^{-\tau s} = \frac{e^{-\tau s/2}}{e^{\tau s/2}} \approx \frac{1 - \frac{\tau s}{2} + \frac{(\tau s)^2}{8} + \cdots + (-1)^k\frac{(\tau s)^k}{2^k k!}}{1 + \frac{\tau s}{2} + \frac{(\tau s)^2}{8} + \cdots + \frac{(\tau s)^k}{2^k k!}}

This is much better than the previous approximation because it has the correct magnitude at all frequencies. Here are the updated Bode plots:

Taylor approximations of a 1-second delay using the ratio of two Taylor approximations. This is better than the previous approximation, but can only go up to k=4 before it becomes unstable.

Figure 7:Taylor approximations of a 1-second delay using the ratio of two Taylor approximations. This is better than the previous approximation, but can only go up to k=4k=4 before it becomes unstable.

Unfortunately, this approximation suffers from the same instability issues as the previous one; namely the poles of Eq. (12) become unstable for k≥5k\geq 5.

Padé approximation

An even better approximation for the delay is the Padé approximation. The Padé approximation (pronounced “pah-DAY”) named after the French mathematician Henri Padé, is a method for approximating a delay by a rational function. The idea is similar to that of the Taylor series: match as many derivatives as possible at s=0s=0, but do it for the entire function (not the numerator and denominator separately). The first few Padé approximations are:

k=1:e−τs≈1−τs21+τs2k=2:e−τs≈1−τs2+(τs)2121+τs2+(τs)212k=3:e−τs≈1−τs2+(τs)210−(τs)31201+τs2+(τs)210+(τs)3120k=4:e−τs≈1−τs2+3(τs)228−(τs)384+(τs)416801+τs2+3(τs)228+(τs)384+(τs)41680\begin{aligned} k=1: \qquad e^{-\tau s} &\approx \frac{1 - \frac{\tau s}{2}}{1 + \frac{\tau s}{2}} \\ k=2: \qquad e^{-\tau s} &\approx \frac{1 - \frac{\tau s}{2} + \frac{(\tau s)^2}{12}}{1 + \frac{\tau s}{2} + \frac{(\tau s)^2}{12}}\\ k=3: \qquad e^{-\tau s} &\approx \frac{1 - \frac{\tau s}{2} + \frac{(\tau s)^2}{10} - \frac{(\tau s)^3}{120}}{1 + \frac{\tau s}{2} + \frac{(\tau s)^2}{10} + \frac{(\tau s)^3}{120}} \\ k=4: \qquad e^{-\tau s} &\approx \frac{1 - \frac{\tau s}{2} + \frac{3(\tau s)^2}{28} - \frac{(\tau s)^3}{84} + \frac{(\tau s)^4}{1680}}{1 + \frac{\tau s}{2} + \frac{3(\tau s)^2}{28} + \frac{(\tau s)^3}{84} + \frac{(\tau s)^4}{1680}} \end{aligned}

Note that the coefficients change as we increase kk, unlike the Taylor series where the coefficients are fixed. This turns out to be a much better approximation than the Taylor series. Critically, it has a Bode magnitude of 0 dB at all frequencies, which is a key property of the delay. It also doesn’t suffer from the instability issues of the Taylor approximation. Here are the Bode plots for the first few Padé approximations for 1-second delay:

Padé approximations of a 1-second delay. The Padé approximation is much better than the Taylor approximation, and it has the correct magnitude of 0 dB at all frequencies.

Figure 8:Padé approximations of a 1-second delay. The Padé approximation is much better than the Taylor approximation, and it has the correct magnitude of 0 dB at all frequencies.

Comparing Figure 7 and Figure 8, we can see that the Padé approximation does a better job at approximating the phase plot than the Taylor approximation.

The Padé approximation also makes the best use of poles and zeros to maximize phase lag in order to approximate the exponential function. It has kk stable poles (-90° each) and kk RHP zeros (another -90° each)[2], so we get −180°k-180\degree k of phase lag for an order kk Padé approximation.

The Padé approximation continues to work for any k≥0k\geq 0. In case you are curious, the general formula of order kk is given by:

e−τs≈∑i=0k(2k−i)! k!(2k)! i! (k−i)!(−τs)i∑i=0k(2k−i)! k!(2k)! i! (k−i)!(τs)ie^{-\tau s} \approx \frac{\sum_{i=0}^k \frac{(2k-i)!\,k!}{(2k)!\,i!\,(k-i)!} (-\tau s)^i} {\sum_{i=0}^k \frac{(2k-i)!\,k!}{(2k)!\,i!\,(k-i)!} (\tau s)^i}

Test your knowledge

Footnotes
  1. The transfer function e−sτe^{-s\tau} has what is known as an essential singularity at s=∞s=\infty, which means it does not behave like a normal pole or zero. For example, G(s)=1s+1G(s) = \frac{1}{s+1} has a zero at infinity: we have lim⁡s→∞∣G(s)∣=0\lim_{s\to\infty} |G(s)| = 0. Likewise, G(s)=s+1G(s) = s+1 has a pole at infinity: lim⁡s→∞∣G(s)∣=∞\lim_{s\to\infty} |G(s)| = \infty. It doesn’t matter what direction we approach s=∞s=\infty from, the limit is the same. With an essential singularity, that’s not true. lim⁡s→+∞e−sτ=0\lim_{s\to+\infty} e^{-s\tau} = 0 (like a zero), lim⁡s→−∞e−sτ=∞\lim_{s\to-\infty}e^{-s\tau} = \infty (like a pole), and if s→j∞s \to j\infty (along the imaginary axis), then e−sτe^{-s\tau} rotates around the unit circle and does not converge to anything!

  2. LHP vs RHP causes a flip in phase (see Figure 1)