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τ)}=0u(tτ)estdt=esτ0u(tτ)es(tτ)dt=esτ0u(t)estdt(u(t)=0 for t<0)=esτ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 esτ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ω)=ejωτ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:

τωcgPM\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+1e0.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 K8.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τs1τ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τs11+τ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 k5k\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/21τ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 k5k\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τs1τs21+τs2k=2:eτs1τs2+(τs)2121+τs2+(τs)212k=3:eτs1τs2+(τs)210(τs)31201+τs2+(τs)210+(τs)3120k=4:eτs1τ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 k0k\geq 0. In case you are curious, the general formula of order kk is given by:

eτsi=0k(2ki)!k!(2k)!i!(ki)!(τs)ii=0k(2ki)!k!(2k)!i!(ki)!(τ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

Solution to Exercise 1 #

Our annotated Bode plot is:

Annotated version of the Bode plot in .

Figure 10:Annotated version of the Bode plot in Figure 9.

  1. We have PM100°\PM \approx 100\degree and ωcg0.5\omega_{cg} \approx 0.5 rad/s, so the delay margin is:

DM=PMωcg=1000.5 rad/s=100π180 rad0.5 rad/s3.49 s\DM = \frac{\PM}{\omega_{cg}} = \frac{100^\circ}{0.5 \text{ rad/s}} = \frac{100 \cdot \frac{\pi}{180} \text{ rad}}{0.5 \text{ rad/s}} \approx 3.49 \text{ s}
  1. With K=10K=10, the magnitude plot moves up by 20 dB. This causes the gain crossover frequency to move to the right, to ωcg5\omega_{cg}'\approx 5 rad/s. The phase margin doesn’t change that much since the phase plot is rather flat in this frequency range. We can estimate PM85°\PM \approx 85\degree. Here is the newly annotated Bode plot:

Annotated version of the Bode plot in  showing the effect of using K=10 instead of K=1.

Figure 11:Annotated version of the Bode plot in Figure 10 showing the effect of using K=10K=10 instead of K=1K=1.

Therefore, the new delay margin is:

DM=PMωcg=855 rad/s=85π180 rad5 rad/s0.296 s\DM' = \frac{\PM}{\omega_{cg}'} = \frac{85^\circ}{5 \text{ rad/s}} = \frac{85 \cdot \frac{\pi}{180} \text{ rad}}{5 \text{ rad/s}} \approx 0.296 \text{ s}

Adding gain has a double effect on delay margin: it tends to increase ωcg\omega_{cg} and reduce PM\PM, both of which contribute to decreasing the delay margin. In this case, the reduction was substantial!

Solution to Exercise 2 #

Here is the Bode plot:

Bode plot for the system G(s) = \frac{1}{2(s+1)^3}.

Figure 12:Bode plot for the system G(s)=12(s+1)3G(s) = \frac{1}{2(s+1)^3}.

The Bode magnitude plot does not cross the 0 dB line, since the DC gain of this system is -6 dB and the magnitude just decreases from there. So there is no gain crossover and therefore an infinite phase and delay margin.

The phase plot starts at 0° at ω=0\omega=0 and eventually drops to -270° at high frequency due to the three poles, so there must be a phase crossover. We can calculate it by solving the equation:

G(jω)=180°    12(jω+1)3=180°    (jω+1)=60°    ω=tan(60°)=3 rad/s\begin{aligned} \angle G(j\omega) = -180\degree &\implies \angle \frac{1}{2\cdot (j\omega+1)^3} = -180\degree \\ &\implies \angle (j\omega+1) = 60\degree \\ &\implies \omega = \tan(60\degree) = \sqrt{3} \text{ rad/s} \end{aligned}

Now evaluate the gain at this frequency to find the gain margin:

G(j3)=12j3+13=12(3+1)3/2=11624.1 dB\begin{aligned} |G(j\sqrt{3})| &= \frac{1}{2|j\sqrt{3}+1|^3} \\ &= \frac{1}{2(3+1)^{3/2}} \\ &= \frac{1}{16} \approx -24.1 \text{ dB} \end{aligned}

Therefore, the gain margin is about 24.1 dB, which is finite. However, since there is no gain crossover frequency, no amount of delay will cause instability.

Although delay margin is infinite, adding delay will still decrease the phase crossover frequency and reduce the gain margin. Moreover, if we add enough gain (at least 6 dB, so that we create a gain crossover), then the delay margin will become finite.

Footnotes
  1. The transfer function esτ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 limsG(s)=0\lim_{s\to\infty} |G(s)| = 0. Likewise, G(s)=s+1G(s) = s+1 has a pole at infinity: limsG(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. lims+esτ=0\lim_{s\to+\infty} e^{-s\tau} = 0 (like a zero), limsesτ=\lim_{s\to-\infty}e^{-s\tau} = \infty (like a pole), and if sjs \to j\infty (along the imaginary axis), then esτ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)