# System Performance

{% hint style="info" %}

#### Definition 14

The step response of a system is how a system $$H(s)$$ responds to a step input.

$$y(t) = \mathcal{L}^{-1}\left{ \frac{H(s)}{s} \right}$$
{% endhint %}

## First Order Systems

{% hint style="info" %}

#### Definition 15

A first order system is one with the transfer function of the form

$$H(s) = \frac{s+\alpha}{s+\beta}.$$
{% endhint %}

After applying partial fraction decomposition to them, their step response is of the form

$$Au(t) + Be^{-\beta t}u(t).$$

Thus, the larger $$\beta$$ is (i.e the deeper in the left half plane it is), the faster the system will “settle”.

## Second Order Systems

{% hint style="info" %}

#### Definition 16

Second order systems are those with the transfer function in the form

$$H(s) = \frac{\omega\_n^2}{s^2+2\zeta\omega\_ns+\omega\_n^2}.$$

$$\omega\_n$$ is known as the natural frequency, and $$\zeta$$is known as the damping factor.
{% endhint %}

Notice that the poles of the second order system are

$$s = \frac{-2\zeta\omega\_n \pm \sqrt{4\zeta^2\omega^2\_n-4\omega^2\_n}}{2} = -\zeta\omega\_n \pm \omega\_n\sqrt{\zeta^2 - 1}.$$

There are four cases of interest based on $$\zeta$$.

1. **Undamped**

   When $$\zeta=0$$, the poles are $$s = \pm \omega\_n j$$. Because they are purely imaginary, the step response will be purely oscillatory.

   $$Y(s) = \frac{1}{s}\frac{\omega\_n^2}{s^2+\omega\_n^2} \leftrightarrow y(t) = u(t) - \cos(\omega\_n t)u(t)$$
2. **Underdamped**

   When $$\zeta\in(0, 1)$$, the poles are $$s = -\zeta\omega\_n\pm j\omega\_n\sqrt{1-\zeta^2}$$. They are complex and in the left-half plane, so the step response will be a exponentially decaying sinusoid. We define the damped frequency $$\omega\_d = \omega\_n\sqrt{1-\zeta^2}$$ so that the poles become $$s=-\zeta\omega\_n \pm \omega\_dj$$. Notice that $$\omega\_d < \omega\_n$$. If we compute the time-response of the system,

   $$y(t) = \left\[ 1 - \frac{e^{-\zeta\omega\_nt}}{\sqrt{1-\zeta^2}}\cos\left(\omega\_d t - \arctan\left( \frac{\zeta}{\sqrt{1-\zeta^2}} \right)\right)\right]u(t)$$
3. **Critically Damped**

   When $$\zeta=1$$, both poles are at $$s=-\omega\_n$$. The poles are both real, so the time-response will respond without any overshoot.
4. **Overdamped**

   When $$\zeta>1$$, the poles are $$-\zeta\omega\_n\pm \omega\_n\sqrt{\zeta^2-1}$$. Both of these will be real, so the time-response will look similar to a first-order system where it is slow and primarily governed by the slowest pole.

### The Underdamped Case

If we analyze the underdamped case further, we can first look at its derivative.

$$\begin{aligned} sY(s) &= \frac{\omega\_n^2}{s^2+2\zeta\omega\_ns+\omega\_n^2} = \frac{\omega\_n^2}{\omega\_d} \frac{\omega\_d}{(s+\zeta\omega\_n)^2+\omega\_d^2}\ \therefore \frac{d^{}y}{dt^{}} &= \frac{\omega\_n^2}{\omega\_d}e^{-\zeta\omega\_nt}\sin(\omega\_d t)u(t) \qquad (8)\end{aligned}$$

{% hint style="info" %}

#### Definition 17

The Time to Peak ($$T\_p$$) of a system is how long it takes to reach is largest value in the step response.
{% endhint %}

Using Equation 8, we see that the derivative is first equal to 0 when $$t = \frac{\pi}{\omega\_d}$$.

$$\therefore T\_p = \frac{\pi}{\omega\_d}$$

{% hint style="info" %}

#### Definition 18

The Percent Overshoot ($$% O.S$$) of a system is by how much it will overshoot the step response.
{% endhint %}

The percent overshoot occurs at $$t = \frac{\pi}{\omega\_d}$$, so

$$% O.S = e^{-\zeta\omega\_n \frac{\pi}{\omega\_d}} = e^{\frac{-\zeta\pi}{\sqrt{1-\zeta^2}}}.$$

{% hint style="info" %}

#### Definition 19

The Settling Time ($$T\_s$$) of a system is how long it takes for the system to start oscillating within 2\\% of its final value.
{% endhint %}

$$\begin{aligned} |y(T\_s) - 1| < 0.02 \implies \frac{e^{-\zeta\omega\_nT\_s}}{\sqrt{1-\zeta^2}} = 0.02\ \therefore T\_s = -\frac{1}{\zeta\omega\_n} \ln(0.02 \sqrt{1-\zeta^2})\end{aligned}$$

Since our poles are complex, we can represent them in their polar form.

$$\begin{aligned} r = \omega\_d^2 + \zeta^2 + \omega\_n^2 = \omega\_n^2(1-\zeta^2)+\zeta^2\omega\_n^2 = \omega\_n^2\ \cos(\pi-\theta) = \frac{-\zeta\omega\_n}{\omega\_n} = -\zeta\\\end{aligned}$$

What this tells us is that if we search along the vector at angle $$\pi-\theta$$, we get a constant $$\zeta$$.

### Additional Poles and Zeros of a Second Order System

Suppose we added an additional pole to the second order system so its transfer function was instead

$$H(s) = \frac{bc}{(s+c)(s^2+2as+b)}.$$

Then its step response will be

$$\begin{aligned} Y(s) &= \frac{1}{s}+\frac{D}{s+c}+\frac{Bs+C}{s^2+as+b}\ B &= \frac{c(a-c)}{c^2+b-ca}\quad C = \frac{c(a^2-ac-b)}{c^2+b-ca} \quad D = \frac{-b}{c^2-ac+b}.\end{aligned}$$

Notice that

$$\lim\_{c\to\infty} D = 0 \quad \lim\_{c\to\infty} B = -1 \lim\_{c\to\infty} C = -a.$$

In other words, as the additional pole moves to infinity, the system acts more and more like a second-order. As a rule of thumb, if $$Re{c}\geq5Re{a}$$, then the system will approximate a second order system. Because of this property, we can often decompose complex systems into a series of first and second order systems.

If we instead add an additional zero to the second order system so its transfer function looks like

$$H(s) = \frac{s+a}{s^2+2\zeta\omega\_n+\omega\_n^2}$$

and its step response will look like

$$sY(s) + aY(s).$$

Thus if $$a$$ is small, then the effect of the zero is similar to introducing a derivative into the system, whereas if $$a$$ is large, then the impact of the zero is primarily to scale the step response. One useful property about zeros is that if a zero occurs close enough to a pole, then they will “cancel” each other out and that pole will have a much smaller effect on the step response.

## Stability

Recall Equation 7 which told us the time-domain solution to state-space equations was

$$\mathbf{x}(t) = e^{At}\mathbf{x}(0) + \int\_{0}^{t}e^{A(t-\tau)}B\mathbf{u}(\tau)d\tau.$$

{% hint style="info" %}

#### Definition 20

A system is bounded-input, bounded output(BIBO) stable if $$\exists K\_u, K\_x < \infty$$ such that $$|\mathbf{u}(t)| < K\_{u} \implies |\mathbf{x}(t)| < K\_x$$.
{% endhint %}

Following from Definition 20, Equation 7, this means that

$$\lim\_{t\to\infty}\mathbf{x}(t) = \boldsymbol{0}.$$

If instead $$\lim\_{t\to\infty}\mathbf{x}(t) = \infty$$, then the system is unstable.

{% hint style="info" %}

#### Theorem 3

If all poles are in the left half plane and the number of zeros is less than or equal to the number of poles, then the system is BIBO stable.
{% endhint %}

{% hint style="info" %}

#### Definition 21

A system is called marginally stable if the zero-input response does not converge to $$\boldsymbol{0}$$.
{% endhint %}

{% hint style="info" %}

#### Theorem 4

A system is marginally stable if there is exactly one pole at $$s=0$$ or a pair of poles at $$s=\pm j\omega\_0$$.
{% endhint %}

In all other cases, the system will be unstable.

## Steady State Error

Consider the unity feedback loop depicted in Figure 4 where we put a system $$G(s)$$ in unity feedback to control it.

![Figure 4: Unity Feedback Loop](https://3896527066-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQYqMkpf2WPiP6MKWRe%2Fuploads%2Fgit-blob-abae93dc69ebb1e82015401a56a532acfe3e5f13%2Fa86379e5b5f70b90f28ee748670e88f225367c40.png?alt=media)

We want to understand what its steady state error will be in response to different inputs.

{% hint style="info" %}

#### Theorem 5

The final value theorem says that for a function whose unilateral laplace transform has all poles in the left half plane,

$$\lim\_{t\to\infty}x(t) = \lim\_{s\to0} sX(s).$$
{% endhint %}

Using this fact, we see that for the unity feedback system,

$$E(s) = \frac{R(s)}{1+G(s)}.$$

Using these, we can define the static error constants.

{% hint style="info" %}

#### Definition 22

The position constant determines how well a system can track a unit step.

$$K\_p = \lim\_{s\to0}G(s) \qquad (9)$$

$$\lim\_{t\to\infty} e(t) = \lim\_{s\to0} s \frac{1}{s} \frac{1}{1+G(s)} = \frac{1}{1+K\_p}$$
{% endhint %}

{% hint style="info" %}

#### Definition 23

The velocity constant determines how well a system can track a ramp.

$$K\_v = \lim\_{s\to0}sG(s) \qquad (10)$$

$$\lim\_{t\to\infty} e(t) = \lim\_{s\to0} s \frac{1}{s^2} \frac{1}{1+G(s)} = \frac{1}{K\_v}$$
{% endhint %}

{% hint style="info" %}

#### Definition 24

The acceleration constant determines how well a system can track a parabola.

$$K\_a = \lim\_{s\to0}s^2G(s) \qquad (11)$$

$$\lim\_{t\to\infty} e(t) = \lim\_{s\to0} s \frac{1}{s^3} \frac{1}{1+G(s)} = \frac{1}{K\_a}$$
{% endhint %}

Notice that large static error constants mean a smaller error. Another observation we can make is that if a system has $$n$$ poles at $$s=0$$, it can perfectly track an input whose laplace transform is $$\frac{1}{s^{n-k}}$$ for $$k\in\[0, n-1]$$. We give $$n$$ a formal name.

{% hint style="info" %}

#### Definition 25

The system type is the number of poles at 0.
{% endhint %}

This also brings another observation.

{% hint style="info" %}

#### Definition 26

The internal model principle is that if the system in the feedback loop has a model of the input we want to track, then it can track it exactly.
{% endhint %}

If instead we have a state-space system, then assuming the system is stable,

$$\lim\_{t\to\infty}\frac{d^{}\mathbf{x}}{dt^{}} = \boldsymbol{0} \implies \lim\_{t\to\infty}\mathbf{x} = \mathbf{x}\_{ss}.$$

Applying this to the state space equations for a step input,

$$\frac{d^{}\mathbf{x}}{dt^{}} = \boldsymbol{0} = A\mathbf{x}*{ss} + B\cdot I \implies \mathbf{x}*{ss} = -A^{-1}B \qquad (12)$$

Looking at the error between the reference and the output in the 1D input case,

$$\mathbf{e}(t) = \mathbf{r}(t) - \mathbf{y}(t) = 1 - C\mathbf{x}\_{ss} = 1 + CA^{-1}B.$$

## Margins

![Figure 5: Frequency Response](https://3896527066-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQYqMkpf2WPiP6MKWRe%2Fuploads%2Fgit-blob-47d7e5411863215c591677e9dcd94459dc96fac8%2F26be685aa86914d15af1c8cc7569c6acf97a401a.png?alt=media)

If we take a complex exponential and pass it into a causal LTI system with impulse response $$g(t)$$, then

$$y(t) = e^{j\omega t} \* g(t) = \int\_{-\infty}^{\infty}g(\tau)e^{j\omega(t-\tau)}d\tau = e^{j\omega t} \int\_{0}^{\infty}g(\tau)e^{-j\omega \tau}d\tau.$$

This shows us that $$e^{j\omega t}$$ is an eigenfunction of the system.

{% hint style="info" %}

#### Definition 27

The frequency response of the system determines how it scales pure frequencies. It is equivalent to the Laplace transform evaluated on the imaginary axis.

$$G(j\omega) = \int\_0^{\infty}g(\tau)e^{-j\omega\tau}d\tau \qquad (13)$$
{% endhint %}

Suppose we put a linear system $$G(s)$$ in negative feedback. We know that if $$\angle G(j\omega) = (2k+1)\pi$$ for some $$k\in\mathbb{Z}$$, then the output of the plant will be $$-|G(j\omega)|e^{j\omega t}$$. If $$|G(j\omega)| \geq 1$$, then this will feed back into the error term where it will be multiplied by $$|G(j\omega)|$$ repeatedly, and this will cause the system to be unstable because $$|G(j\omega)|\geq1$$ and thus will not decay.

{% hint style="info" %}

#### Definition 28

The gain margin $$G\_m$$is the change in the open loop gain required to make the closed loop system unstable.
{% endhint %}

{% hint style="info" %}

#### Definition 29

The phase margin $$\phi\_m$$is the change in the open loop phase required to make the closed loop system unstable.
{% endhint %}

We can imagine the gain and phase margin like placing a “virtual box” before the plant as shown in Figure 6.

![Figure 6: The Gain and Phase Margin virtual system](https://3896527066-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQYqMkpf2WPiP6MKWRe%2Fuploads%2Fgit-blob-78f76cf0bc5855c3b4b54bba911fca734822b132%2F8832ffa2bd68ff136387cb6f3537f0c6815bbdfd.png?alt=media)

The characteristic polynomial of the closed loop transfer function is

$$1 + G\_me^{-j\phi\_m}G(s) = 0.$$

At the gain margin frequency $$\omega\_{gm}$$,

$$|G\_m||G(j\omega\_{gm})| = 1 \implies |G\_m| = \frac{1}{|G(j\omega\_{gm})|}.$$

where the gain margin frequency is $$\angle G(j\omega\_m) = (2k+1)\pi$$ for $$k\in\mathbb{Z}$$. Likewise, at the phase margin frequency $$\omega\_{pm}$$,

$$1 + G\_me^{-j\omega\_m}G(j\omega\_{pm}) = 0 \implies -\phi\_m + \angle G(j\omega\_{pm}) = (2k+1)\pi.$$

where the phase margin frequency is $$|G(j\omega\_{pm})| = 1$$.

Notice that if there is a time delay of $$T$$ in the system, the phase margin will remain unchanged since the magnitude response will be the same, but the gain margin will change because the new phase will be

$$\angle G(j\omega) - \omega T.$$
