Lesson 17


1 Learning Objectives

By the end of this lesson students will be able to:

2 Proportional + Integral + Derivative (PID) Controller

Now we add an integral controller to the system:

Now the controller has the transfer function

C(s)=KP+KDs+KIsC(s) = K_P + K_D s + \frac{K_I}{s}

Plugging this value into our original equation for the ventilator gives

PL(s)=KI+KPs+KDs2H(s)KI(1ωn)2(1H(s)KI)s3+(2ζ+H(s)KDωnωnH(s)KI)s2+(1+H(s)KPH(s)KI)s+1Vin(s)+sH(s)KI(1ωn)2(1H(s)KI)s3+(2ζ+H(s)KDωnωnH(s)KI)s2+(1+H(s)KPH(s)KI)s+1PD(s)\begin{split} P_L(s)={}&\frac{\frac{K_I+K_Ps+K_Ds^2}{H(s)K_I}}{\left(\frac{1}{\omega_n}\right)^2\left(\frac{1}{H(s)K_I}\right)s^3+\left(\frac{2\zeta+H(s)K_D\omega_n}{\omega_nH(s)K_I}\right)s^2+\left(\frac{1+H(s)K_P}{H(s)K_I}\right)s+1}V_{in}(s)\\ &+\frac{\frac{s}{H(s)K_I}}{\left(\frac{1}{\omega_n}\right)^2\left(\frac{1}{H(s)K_I}\right)s^3+\left(\frac{2\zeta+H(s)K_D\omega_n}{\omega_nH(s)K_I}\right)s^2+\left(\frac{1+H(s)K_P}{H(s)K_I}\right)s+1}P_D(s) \end{split}

This is a third-order system and there is not a simple analytical formula to calculate the damping ratio or natural frequency. We can make two observations about the system:

  1. The natural frequency now depends on KIK_I instead of KPK_P.
  2. There is no steady state error because of the integral. Cancel all terms containing ss and you get PL=VinP_L = V_{in}.

3 Quick Review of Controllers

To sum up, as briefly as possible, the last lesson-and-a-half:

As engineers, we are given a system:

  1. We cannot change the plant, G(s)G(s), but we want the output to have certain values or characteristics.
  2. We can build a controller, C(s)C(s), that changes the overall transfer function of the system, T(s)T(s), and therefore its behavior.

We covered three types of controllers:

  1. Proportional
  2. Proportional + Derivative
  3. Proportional + Integral + Derivative (best)

Each has its pros and cons, but 99% of the controllers you encounter will be PID.

4 Steady-State Errors

With the lung model, we guessed what the steady-state values would be for different systems. The shortcut was to set all s=0s = 0 and then find the answer from the transfer function. This trick only works for step inputs. Now we practice using a method that always gives the steady-state error, regardless of the type of input.

The whole point of a control system is that the output should be equal to what the user chooses as input. The steady-state error of a system is the difference between the system input and output after a very long time, or in math lingo, as tt \rightarrow \infty.

The method shown below will work for any input, but we limit ourselves to three different types of inputs:

  1. Step
  2. Ramp
  3. Parabola

Steady-state error always means the difference between system input and output, but the graph of steady-state error depends on the type of input, as illustrated below.

Figure 1: There are two types of errors in response to a step input: none and finite.
Figure 2: There are three types of errors in response to a ramp input: none, finite, and infinite.

4.1 Before You Can Calculate Steady-State Error

If the system does not have a disturbance, it must be closed-loop with unity feedback. If it is not, you must convert it to unity feedback before proceeding.

4.2 Steady-State Error for Systems Without a Disturbance

If your unity-feedback system has already been simplified into a single block then use this formula

e()=lims0sE(s)=lims0[sR(s)(1T(s))]e(\infty) = \lim_{s \rightarrow 0} sE(s) = \lim_{s \rightarrow 0} \left[ sR(s)\left( 1 - T(s) \right) \right]

Otherwise, use this formula

e()=lims0sE(s)=lims0[sR(s)(11+G(s))]e(\infty) = \lim_{s \rightarrow 0} sE(s) = \lim_{s \rightarrow 0} \left[ sR(s)\left( \frac{1}{1 + G(s)} \right) \right]

4.2.1 Example 1

Given a unity feedback system with G(s)=120(s+2)(s+3)(s+4)G(s) = \frac{120(s + 2)}{(s + 3)(s + 4)}, find the SSE for inputs of 5u(t)5u(t), 5tu(t)5tu(t), and 5t2u(t)5t^{2}u(t).

4.2.2 Student Exercise 1

Given a unity feedback system with G(s)=100(s+2)(s+6)s(s+3)(s+4)G(s) = \frac{100(s + 2)(s + 6)}{s(s + 3)(s + 4)}, find the SSE for inputs of 5u(t)5u(t), 5tu(t)5tu(t), and 5t2u(t)5t^{2}u(t).

4.3 System Type and Static Error Constants

The free ss in the denominator of G(s)G(s) determines system type:

Notice that in the previous example the error values fell into three categories:

  1. 0
  2. some number
  3. \infty

Static error constants depend on the system type and the type of input:

Step:

estep()=11+KposandKpos=lims0G(s)e_{step}(\infty) = \frac{1}{1 + K_{pos}} \quad \text{and} \quad K_{pos} = \lim_{s \rightarrow 0} G(s)

Ramp:

eramp()=1KvelandKvel=lims0sG(s)e_{ramp}(\infty) = \frac{1}{K_{vel}} \quad \text{and} \quad K_{vel} = \lim_{s \rightarrow 0} sG(s)

Parabola:

eparabola()=1KaccandKacc=lims0s2G(s)e_{parabola}(\infty) = \frac{1}{K_{acc}} \quad \text{and} \quad K_{acc} = \lim_{s \rightarrow 0} s^{2}G(s)

In these equations we assume unit inputs (i.e., they have an amplitude of 1). If the inputs are not unit, the amplitude of the input goes in the numerator of each (see Example 1 and Student Exercise 1).

If you know the system type, then you can predict what the steady-state errors will be:

System Type, N Unit step input Unit ramp input Unit parabola input
0 11+Kpos\frac{1}{1 + K_{pos}} \infty \infty
1 0 1Kvel\frac{1}{K_{vel}} \infty
2 0 0 1Kacc\frac{1}{K_{acc}}

4.3.1 Student Exercise 2

Consider a closed-loop system with no disturbance and unity feedback. Assume a proportional controller with gain KP=0.04K_{P} = 0.04. The plant transfer function is shown below. What are the steady-state errors of the system to a step, ramp, and parabola input with magnitudes of 0.01?

G(s)=2s2+0.3sG(s) = \frac{2}{s^{2} + 0.3s}

4.3.2 Student Exercise 3

Consider a closed-loop system with no disturbance and unity feedback. Assume a proportional + integral controller with gain KP=0.04K_{P} = 0.04 and KI=0.002K_{I} = 0.002. The plant transfer function is shown below. What are the steady-state errors of the system to a step, ramp, and parabola input with magnitudes of 0.01?

G(s)=2s2+0.3sG(s) = \frac{2}{s^{2} + 0.3s}

4.4 Steady-State Error for Systems With a Disturbance

If you have a unity feedback system with a disturbance that looks like this:

Then you calculate the SSE using the equation

e()=lims0sE(s)=lims0[(11+C(s)G(s))sR(s)]lims0[(G(s)1+C(s)G(s))sD(s)]e(\infty) = \lim_{s \rightarrow 0} sE(s) = \lim_{s \rightarrow 0} \left [ \left ( \frac{1}{1 + C(s)G(s)} \right ) s R(s) \right ] - \lim_{s \rightarrow 0} \left [ \left ( \frac{G(s)}{1 + C(s)G(s)} \right) s D(s) \right ]

If you have a non-unity feedback system with a disturbance that looks like this:

Then find the SSE with this equation

e()=lims0sE(s)=lims0[(1C(s)G(s)1+C(s)G(s)H(s))sR(s)]lims0[(G(s)1+C(s)G(s)H(s))sD(s)]e(\infty) = \lim_{s \rightarrow 0} sE(s) = \lim_{s \rightarrow 0} \left[ \left(1 - \frac{C(s)G(s)}{1 + C(s)G(s)H(s)}\right) sR(s) \right] - \lim_{s \rightarrow 0} \left[ \left( \frac{G(s)}{1 + C(s)G(s)H(s)} \right) sD(s) \right]

4.4.1 Example 2

Imagine a feedback control system with a disturbance. Find the total steady-state error due to a unit step input and a unit step disturbance. Assume

C(s)=1s+5andG(s)=100s+2andH(s)=1C(s) = \frac{1}{s + 5} \quad \text{and} \quad G(s) = \frac{100}{s + 2} \quad \text{and} \quad H(s) = 1

4.4.2 Student Exercise 4

Imagine a feedback control system with a disturbance. Find the total steady-state error if

r(t)=3u(t)andd(t)=u(t)r(t) = 3u(t) \quad \text{and} \quad d(t) = -u(t)

C(s)=5andG(s)=7s+2andH(s)=1C(s) = 5 \quad \text{and} \quad G(s) = \frac{7}{s + 2} \quad \text{and} \quad H(s) = 1