# Control Systems/System Delays

## Delays

A system can be built with an inherent delay. Delays are units that cause a time-shift in the input signal, but that don't affect the signal characteristics. An ideal delay is a delay system that doesn't affect the signal characteristics at all, and that delays the signal for an exact amount of time. Some delays, like processing delays or transmission delays, are unintentional. Other delays however, such as synchronization delays, are an integral part of a system. This chapter will talk about how delays are utilized and represented in the Laplace Domain. Once we represent a delay in the Laplace domain, it is an easy matter, through change of variables, to express delays in other domains.

### Ideal Delays

An ideal delay causes the input function to be shifted forward in time by a certain specified amount of time. Systems with an ideal delay cause the system output to be delayed by a finite, predetermined amount of time.

## Time Shifts

Let's say that we have a function in time that is time-shifted by a certain constant time period T. For convenience, we will denote this function as x(t - T). Now, we can show that the Laplace transform of x(t - T) is the following:

$\mathcal{L}\{x(t - T)\} \Leftrightarrow e^{-sT}X(s)$

What this demonstrates is that time-shifts in the time-domain become exponentials in the complex Laplace domain.

### Shifts in the Z-Domain

Since we know the following general relationship between the Z Transform and the Star Transform:

$z \Leftrightarrow e^{sT}$

We can show what a time shift in a discrete time domain becomes in the Z domain:

$x((n-n_s)\cdot T)\equiv x[n - n_s] \Leftrightarrow z^{-n_s}X(z)$

## Delays and Stability

A time-shift in the time domain becomes an exponential increase in the Laplace domain. This would seem to show that a time shift can have an effect on the stability of a system, and occasionally can cause a system to become unstable. We define a new parameter called the time margin as the amount of time that we can shift an input function before the system becomes unstable. If the system can survive any arbitrary time shift without going unstable, we say that the time margin of the system is infinite.

## Delay Margin

When speaking of sinusoidal signals, it doesn't make sense to talk about "time shifts", so instead we talk about "phase shifts". Therefore, it is also common to refer to the time margin as the phase margin of the system. The phase margin denotes the amount of phase shift that we can apply to the system input before the system goes unstable.

We denote the phase margin for a system with a lowercase Greek letter φ (phi). Phase margin is defined as such for a second-order system:

[Delay Margin]

$\phi_m = \tan^{-1} \left[ \frac{2 \zeta}{(\sqrt{4 \zeta^4 + 1} - 2\zeta^2)^{1/2}}\right]$

Oftentimes, the phase margin is approximated by the following relationship:

[Delay Margin (approx)]

$\phi_m \approx 100\zeta$

The Greek letter zeta (ζ) is a quantity called the damping ratio, and we discuss this quantity in more detail in the next chapter.

## Transform-Domain Delays

The ordinary Z-Transform does not account for a system which experiences an arbitrary time delay, or a processing delay. The Z-Transform can, however, be modified to account for an arbitrary delay. This new version of the Z-transform is frequently called the Modified Z-Transform, although in some literature (notably in Wikipedia), it is known as the Advanced Z-Transform.

### Delayed Star Transform

To demonstrate the concept of an ideal delay, we will show how the star transform responds to a time-shifted input with a specified delay of time T. The function :$X^*(s, \Delta)$ is the delayed star transform with a delay parameter Δ. The delayed star transform is defined in terms of the star transform as such:

[Delayed Star Transform]

$X^*(s, \Delta) = \mathcal{L}^* \left\{ x(t - \Delta) \right\} = X(s)e^{-\Delta T s}$

As we can see, in the star transform, a time-delayed signal is multiplied by a decaying exponential value in the transform domain.

### Delayed Z-Transform

Since we know that the Star Transform is related to the Z Transform through the following change of variables:

$z = e^{-sT}$

We can interpret the above result to show how the Z Transform responds to a delay:

$\mathcal{Z}(x[t - T]) = X(z)z^{-T}$

This result is expected.

Now that we know how the Z transform responds to time shifts, it is often useful to generalize this behavior into a form known as the Delayed Z-Transform. The Delayed Z-Transform is a function of two variables, z and Δ, and is defined as such:

$X(z, \Delta) = \mathcal{Z} \left\{ x(t - \Delta) \right\} = \mathcal{Z} \left\{ X(s)e^{-\Delta T s} \right\}$

And finally:

[Delayed Z Transform]

$\mathcal{Z}(x[n], \Delta) = X(z, \Delta) = \sum_{n=-\infty}^\infty x[n - \Delta]z^{-n}$

## Modified Z-Transform

The Delayed Z-Transform has some uses, but mathematicians and engineers have decided that a more useful version of the transform was needed. The new version of the Z-Transform, which is similar to the Delayed Z-transform with a change of variables, is known as the Modified Z-Transform. The Modified Z-Transform is defined in terms of the delayed Z transform as follows:

$X(z, m) = X(z, \Delta)\big|_{\Delta \to 1 - m} = \mathcal{Z} \left\{ X(s)e^{-\Delta T s} \right\}\big|_{\Delta \to 1 - m}$

And it is defined explicitly:

[Modified Z Transform]

$X(z, m) = \mathcal{Z}(x[n], m) = \sum_{n = -\infty}^{\infty} x[n + m - 1]z^{-n}$