---
title: Steady-state error and system type
heading: The final value theorem applied to the error, system type as the number of integrators in the loop, position, velocity and acceleration error constants, and why integral action removes steady error and rejects constant disturbances
eyebrow: S9 · Lesson 10 · Steady-state error and system type
xp: 50
---

::: hook
An antenna pointing at a satellite has to follow it as it crosses the sky, a steadily rising angle. A position servo with a motor in it can follow a fixed target exactly, but trails a moving one by a fixed lag. Whether a loop's error goes to zero, settles at a constant or grows without bound depends on one thing: how many integrators the loop contains. This lesson counts them and computes the leftover error.
:::

::: play
- A type-1 loop, $L = K/(s(s + a))$, following a ramp reference r = t (the dashed line).
- After the transient the output runs parallel to the ramp, trailing it by $a/K = 1/K_v$.
- Raise K and the lag shrinks, but the loop gets less damped: ζ = $a/2\sqrt{K}$. The lag never reaches zero; that would take a second integrator.
:::

```sim plot
view: graph
x: t = 0..4 s
y: y = 0..4
slider: K = 10..200 = 50 log
slider: a = 2..6 = 5
plot: t - (a/K + exp(-a/2*t)*(-a*cos(sqrt(K - a^2/4)*t) + (K - a^2/2)/sqrt(K - a^2/4)*sin(sqrt(K - a^2/4)*t))/K) | samples: 600 | label: output
plot: t | dashed | color: ch3 | label: ramp reference
readout: steady lag 1/Kv = a/K | digits: 3
readout: damping ratio = a/(2*sqrt(K)) | digits: 3
```

::: predict
## A position servo has $L = 50/(s(s + 5))$ and is told to follow an angle rising at 1 rad/s. What's its steady lag?

- [ ] Zero: the integrator removes all error
- [x] 0.1 rad
- [ ] 0.5 rad
- [ ] It grows without bound

::: reveal
One integrator removes the error to a step but not to a ramp. The velocity error constant is $K_v = \lim_{s\to 0} sL(s)$ = 50/5 = 10 s⁻¹, so a 1 rad/s ramp is followed with a lag of 1/10 = 0.1 rad.
:::
:::

::: nameit
## The error

With unity feedback, $E(s) = S(s)R(s) = \frac{R(s)}{1 + L(s)}$, and if the closed loop is stable the final value theorem gives $e_{ss} = \lim_{s\to 0} sE(s)$.

## System type

Write $L(s) = \frac{K(\dots)}{s^N(\dots)}$. N, the number of integrators (poles at the origin), is the **type**.

| Reference | Error constant | Type 0 | Type 1 | Type 2 |
|---|---|---|---|---|
| Step, $r = R$ | $K_p = \lim L(s)$ | $R/(1 + K_p)$ | 0 | 0 |
| Ramp, $r = Rt$ | $K_v = \lim sL(s)$ | ∞ | $R/K_v$ | 0 |
| Parabola, $r = Rt^2/2$ | $K_a = \lim s^2L(s)$ | ∞ | ∞ | $R/K_a$ |

## Integral action

Adding $1/s$ in the controller raises the type by one. PI control, $C = K_p\left(1 + \frac{1}{T_is}\right)$, around a type-0 plant makes the loop type 1: zero steady error to a step, and $K_v = K_pP(0)/T_i$.

## Disturbances

The type that counts for a disturbance is the number of integrators *between the error and the point where the disturbance enters*. An integrator in the plant after a load-torque input doesn't reject the torque; one in the controller does. That's why speed and position loops put the integrator in the controller even when the plant already has one.

## Nonunity loops

The table assumes unity feedback. Otherwise compute $e = r - y$ directly: if $T(s) = b_0/(s^2 + a_1s + a_0)$, the step error is $1 - b_0/a_0$.
:::

::: example
## A type-0 loop has $L = 20/((s + 2)(s + 5))$. What fraction of a step does it leave as error, and what would fix it?

::: solution
1. **Position constant.**
   $$\begin{aligned} K_p &= L(0) \\ &= 20/10 \\ &= 2 \end{aligned}$$
2. **Step error.**
   $$\begin{aligned} e_{ss} &= \frac{1}{1 + 2} \\ &= 33\% \end{aligned}$$
3. **More gain.** Quadrupling the gain only brings it to 11%, and makes the loop less damped.
4. **The fix.** PI control makes the loop type 1 and the step error zero; the integrator's zero is placed near the slow plant pole so the transient stays clean.

**Answer:** it leaves 33% of a step as error, and PI control removes it.
:::
:::

::: example
## The servo $L = 50/(s(s + 5))$ must follow ramps with a lag below 0.02 rad per rad/s. What gain does that take, and what does it do to the damping?

::: solution
1. **Gain for the lag.** The ramp lag is $a/K$, so
   $$\begin{aligned} K &\ge 5/0.02 \\ &= 250 \end{aligned}$$
2. **Damping at that gain.**
   $$\begin{aligned} \zeta &= \frac{5}{2\sqrt{250}} \\ &= 0.158 \end{aligned}$$
   about 60% overshoot.
3. **What it takes.** Gain alone can't meet both requirements; lesson 14 adds a lag compensator that raises $K_v$ at low frequency without disturbing the transient.

**Answer:** it takes K ≥ 250, which drops ζ to 0.158, about 60% overshoot.
:::
:::

::: example
## PI control with $K_p$ = 2 and $T_i$ = 0.5 s drives a plant $5/(s + 1)$. What errors remain for a step and for a ramp of 1 unit/s?

::: solution
1. **Loop type.**
   $$L = 2\left(1 + \frac{1}{0.5s}\right)\frac{5}{s + 1}$$
   has one integrator: type 1, so the step error is zero.
2. **Velocity constant.**
   $$\begin{aligned} K_v &= \lim_{s\to0}sL \\ &= 2 \times 2 \times 5 \\ &= 20\ \text{s}^{-1} \end{aligned}$$
3. **Ramp lag.**
   $$\begin{aligned} e_{ss} &= 1/20 \\ &= 0.05\ \text{units} \end{aligned}$$
4. **The trade-off.** Halving $T_i$ would halve the lag, at the cost of a less damped response.

**Answer:** no error for a step, and a lag of 0.05 units behind the 1 unit/s ramp.
:::
:::

::: check
given: K = 20 | 80 | 300; a = 2 | 8; R = 0.5 | 2
answer: R*a/K
unit: rad
tolerance: 0.5%

## A servo with $L = \given{K}/(s(s + \given{a}))$ follows a reference rising at {R} rad/s. What's its steady lag?

::: right
Right. $K_v = K/a$, so the lag is $R/K_v$ = {answer} rad.
:::

::: misses
- [R/K] $K_v = \lim sL(s) = K/a$.
- [0] One integrator removes step error, not ramp error.
- [any] Not yet. $e_{ss} = R/K_v$.
:::
:::

::: check
given: K = 5 | 30 | 100; a = 1 | 4; b = 5 | 10
answer: 100/(1 + K/(a*b))
unit: %
tolerance: 0.5%

## A type-0 loop $L = \given{K}/((s + \given{a})(s + \given{b}))$. What percentage of a step reference is left as error?

::: right
Right. $K_p = K/ab$, error $1/(1 + K_p)$ = {answer}%.
:::

::: misses
- [100*a*b/K] Add one: $1/(1 + K_p)$.
- [any] Not yet. $K_p = L(0)$.
:::
:::

::: check
given: K = 10 | 50; z = 1 | 3; p = 10 | 20; R = 1 | 4
answer: R*p/(K*z)
tolerance: 0.5%

## A type-2 loop $L = \given{K}(s + \given{z})/(s^2(s + \given{p}))$ follows $r = \given{R}t^2/2$. What's its steady error?

::: right
Right. $K_a = Kz/p$, error $R/K_a$ = {answer}.
:::

::: misses
- [R/K] $K_a = \lim s^2L(s) = Kz/p$.
- [any] Not yet. $e_{ss} = R/K_a$.
:::
:::

::: check
given: a = 2 | 5 | 10; e = 0.01 | 0.05
answer: a/e
tolerance: 0.5%

## A loop $L = K/(s(s + \given{a}))$ must follow a unit ramp with error at most {e}. What's the least K?

::: right
Right. $a/K \le e$, so K ≥ {answer}.
:::

::: misses
- [1/e] $K_v$ is K/a, so K must be a times $1/e$.
- [any] Not yet. Set $a/K$ = e.
:::
:::

::: check
given: K = 0.5 | 2; P = 4 | 10; T = 0.1 | 0.5; R = 1 | 3
answer: R*T/(K*P)
tolerance: 0.5%

## PI control $K_p(1 + 1/(T_is))$ with $K_p$ = {K} and $T_i$ = {T} s drives a plant with DC gain {P}. What's the steady error to a ramp of slope {R}?

::: right
Right. $K_v = K_pP(0)/T_i$, so the error is $R/K_v$ = {answer}.
:::

::: misses
- [R/(K*P)] Include the integral time: $K_v = K_pP(0)/T_i$.
- [any] Not yet. $K_v = \lim sL(s)$.
:::
:::

::: check
given: b = 8 | 12 | 15; c = 3 | 6; d = 10 | 20
answer: 100*(1 - b/d)
unit: %
tolerance: 0.5%

## A closed loop has $T(s) = \given{b}/(s^2 + \given{c}s + \given{d})$. What percentage of a step is left as error?

::: right
Right. $1 - T(0)$ = {answer}%. A negative error means the output settles above the reference.
:::

::: misses
- [100*b/d] That's where the output settles; the error is the rest.
- [any] Not yet. $e_{ss} = 1 - T(0)$.
:::
:::

::: check
kind: parts
given: K = 10 | 40 | 100; a = 2 | 5; R = 0.5 | 2; d = 0.1 | 1

## A servo loop $L = K/(s(s + a))$ with K = {K} and a = {a}: the gain K sits in the controller, and the plant is $1/(s(s + a))$.

::: part
answer: R*a/K
tolerance: 0.5%

### What lag remains when the reference ramps at {R} units/s?

::: misses
- [R/K] $K_v = K/a$.
- [any] $R/K_v$ with $K_v = K/a$.
:::
:::

::: part
answer: d/K
tolerance: 0.5%

### What steady error does a constant disturbance of {d} at the plant's input leave?

::: misses
- [0] The plant's integrator sits after the disturbance, so it can't reject it.
- [any] The controller must cancel it: error = d/K.
:::
:::
:::

::: check
kind: derivation
vars: K = 1..1000, a = 0.5..10, b = 0.5..10, R = 0.1..10

## A type-0 loop $L = K/((s + a)(s + b))$ gets a step of size R.

::: step
answer: K/(a*b)

### What is $K_p$?
:::

::: step
answer: R/(1 + K/(a*b))

### What steady error remains?
:::

::: right
Right. Only an integrator in the loop removes it entirely.
:::
:::

::: explain
## Why does an integrator in the controller drive the steady error to a step all the way to zero?

::: model
In steady state every signal in a stable loop settles to a constant. An integrator's output can only be constant if its input is zero, since any nonzero input would keep it ramping. The integrator sits on the error, so the only possible steady state has zero error. Its output then holds whatever drive the plant needs to stay at the reference, and that value was found automatically while the error was nonzero. A proportional controller has no such memory: to keep producing drive it needs a standing error.
:::
:::

::: practice

::: check
given: K = 40 | 150; a = 3 | 12; R = 1 | 5
answer: R*a/K
unit: rad
tolerance: 0.5%

## Ramp lag of $L = \given{K}/(s(s + \given{a}))$ at {R} rad/s?

::: misses
- [any] $Ra/K$.
:::
:::

::: check
given: K = 8 | 60; a = 2 | 3; b = 4 | 12
answer: 100/(1 + K/(a*b))
unit: %
tolerance: 0.5%

## Step error of $L = \given{K}/((s + \given{a})(s + \given{b}))$?

::: misses
- [any] $1/(1 + K_p)$.
:::
:::

::: check
given: a = 4 | 8; e = 0.002 | 0.02
answer: a/e
tolerance: 0.5%

## Least K for unit-ramp error {e} with $L = K/(s(s + \given{a}))$?

::: misses
- [any] $K \ge a/e$.
:::
:::
:::
