Lesson 16


1 Learning Objectives

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

2 Introduction

We continue with our exercise to design a mechanical ventilator. We create a second-order model of the lung and investigate how the system response changes with this more accurate model. Then we start to investigate the effect of different controllers on system response.

3 Second-Order Model

To make the lung model more accurate, we need to also model the inertia of moving air. An inductor models the inertia of mass.

First, derive G(s)=PL(s)Pin(s)G(s) = \frac{P_{L}(s)}{P_{in}(s)}

Now that we have the controlled system transfer function, we can simulate the open-loop and closed-loop system response to various inputs.

3.1 Open-Loop Second-Order System

Using the open-loop system diagram from Lesson 15 as a guide, we write an equation for the output of the system. When done, we replace G(s)G(s) with the second-order system.

3.2 Closed-Loop Second-Order System

Next, using the closed-loop system diagram from exercise 1 as a guide, we write an equation for the output of the system. When done, we replace G(s)G(s) with the second-order system.

3.3 Student Exercise 1

Compare the responses of the open- and closed-loop systems in Simulink. Assume a step input of magnitude 1, R=1R = 1 cmH20 sec/L, C=0.1C = 0.1 L/cmH20, L=0.01L = 0.01 cmH20 sec2^2/L, KC=1K_C = 1, KF=1K_F = 1, and d=0d = 0. Write the steady-state value for the open-loop and closed-loop systems below. Run the simulation again with KC=100K_C = 100.

Results

3.4 Student Exercise 2

In the model you used in the previous exercise, add a disturbance that is a step input of magnitude -0.5 and delay the disturbance by 0.75 seconds. Set KC=1K_C = 1 and run both models. Record the steady-state value. Set KC=100K_C = 100 and run again.

Results

3.5 Summary of Second-Order Systems

  1. Feedback introduces a steady-state error
  2. An increase in gain increases the output of an open-loop system but reduces steady-state error in a closed-loop system; we cannot eliminate steady-state error completely
  3. Feedback and high gain reduce the impact of disturbances, but may alter type of system response

Be sure to save your models. We will continue using them.

4 Controllers

We have seen the effect of feedback on system response.

For the rest of this lesson, we focus only on second-order systems with feedback. We will look at ways to reduce the negative impacts of feedback on ζ\zeta and steady-state error (i.e., controllers).

4.1 System Layout

When we talk about controllers, all systems will have this layout:

Since we will only use second-order systems:

G(s)=1(1ωn)2s2+(2ζωn)s+1G(s)=\frac{1}{\left(\frac{1}{\omega_n}\right)^2 s^2+\left(\frac{2\zeta}{\omega_n}\right)s+1}

The closed-loop feedback equation for the system above becomes

PL(s)=C(s)1+C(s)H(s)(1ωn)2(11+C(s)H(s))s2+(2ζωn)(11+C(s)H(s))s+1Vin(s)+11+C(s)H(s)(1ωn)2(11+C(s)H(s))s2+(2ζωn)(11+C(s)H(s))s+1PD(s)\begin{split} P_L(s)={}&\frac{\frac{C(s)}{1+C(s)H(s)}}{\left(\frac{1}{\omega_n}\right)^2\left(\frac{1}{1+C(s)H(s)}\right) s^2+\left(\frac{2\zeta}{\omega_n}\right)\left(\frac{1}{1+C(s)H(s)}\right)s+1}V_{in}(s)\\ &+\frac{\frac{1}{1+C(s)H(s)}}{\left(\frac{1}{\omega_n}\right)^2\left(\frac{1}{1+C(s)H(s)}\right) s^2+\left(\frac{2\zeta}{\omega_n}\right)\left(\frac{1}{1+C(s)H(s)}\right)s+1}P_D(s) \end{split}

The difference between this system and the equations for a first-order system is that the controller block is labeled with C(s)C(s) instead of a constant and the feedback block is labeled with H(s)H(s) instead of a constant.

We will look at three types of controllers that can be plugged into the C(s)C(s) block:

  1. Proportional
  2. Proportional + derivative (PD)
  3. Proportional + integral + derivative (PID)

5 Proportional Controller

In a proportional controller, C(s)=KPC(s) = K_P.

The equation for PL(s)P_L(s) becomes

PL(s)=KP1+KPH(s)(1ωn)2(11+KPH(s))s2+(2ζωn)(11+KPH(s))s+1Vin(s)+11+KPH(s)(1ωn)2(11+KPH(s))s2+(2ζωn)(11+KPH(s))s+1PD(s)\begin{split} P_L(s)={}&\frac{\frac{K_P}{1+K_PH(s)}}{\left(\frac{1}{\omega_n}\right)^2\left(\frac{1}{1+K_PH(s)}\right) s^2+\left(\frac{2\zeta}{\omega_n}\right)\left(\frac{1}{1+K_PH(s)}\right)s+1}V_{in}(s)\\ &+\frac{\frac{1}{1+K_PH(s)}}{\left(\frac{1}{\omega_n}\right)^2\left(\frac{1}{1+K_PH(s)}\right) s^2+\left(\frac{2\zeta}{\omega_n}\right)\left(\frac{1}{1+K_PH(s)}\right)s+1}P_D(s) \end{split}

This equation is the same one from earlier in this lesson (if H(s)H(s) is set equal to KFK_F). This type of controller is called a proportional controller because it multiplies the error signal by a constant, KPK_P.

Important features of this equation:

  1. At steady-state there is an error between the output and input.

  2. The natural frequency, ωn\omega_n, is modified by the presence of KPK_P. The new effective natural frequency of the system becomes

ωpf=ωn1+KP\omega_{pf} = \omega_n \sqrt{1 + K_P}

  1. The damping ratio, ζ\zeta, is modified by the presence of KPK_P. The new effective damping ratio can be written

ζpf=ζ1+KP\zeta_{pf} = \frac{\zeta}{\sqrt{1 + K_P}}

Important point. We want KPK_P to be as large as possible to minimize the steady-state error. But large KPK_P increases the natural frequency and decreases the damping ratio. An increase in natural frequency is desirable, a decrease in damping ratio is not, so the feedback improves the system in one area while degrading it in another.

6 Proportional + Derivative Controller

We are not limited to a single controller. We can add more, like this:

Now the controller contains a proportional controller and a derivative controller. In other words, C(s)=KP+KDsC(s) = K_P + K_D s.

The KDsK_D s takes the derivative of the error signal and adds it to the result of the proportional controller.

Plug the new value for C(s)C(s) into the original PL(s)P_L(s) equation and the equation becomes

PL(s)=KP+KDs1+KPH(s)(1ωn)2(11+KPH(s))s2+(2ζ+H(s)KDωnωn(1+H(s)KP))s+1Vin(s)+11+KPH(s)(1ωn)2(11+KPH(s))s2+(2ζ+H(s)KDωnωn(1+H(s)KP))s+1PD(s)\begin{split} P_L(s)={}&\frac{\frac{K_P+K_Ds}{1+K_PH(s)}}{\left(\frac{1}{\omega_n}\right)^2\left(\frac{1}{1+K_PH(s)}\right) s^2+\left(\frac{2\zeta+H(s)K_D\omega_n}{\omega_n\left(1+H(s)K_P\right)}\right)s+1}V_{in}(s)\\ &+\frac{\frac{1}{1+K_PH(s)}}{\left(\frac{1}{\omega_n}\right)^2\left(\frac{1}{1+K_PH(s)}\right) s^2+\left(\frac{2\zeta+H(s)K_D\omega_n}{\omega_n\left(1+H(s)K_P\right)}\right)s+1}P_D(s) \end{split}

Important points about this equation:

  1. The natural frequency is only controlled by KPK_P. We can increase KPK_P to minimize steady-state error without affecting the damping ratio ζ\zeta.

  2. The damping ratio is now controlled by KPK_P, KDK_D, and ωn\omega_n. We can adjust KDK_D without altering the other parameters (and changing ωn\omega_n) to increase ζ\zeta. Rearranging the term for ζ\zeta gives

ζdf=2ζ+KDωn21+KP\zeta_{df} = \frac{2\zeta + K_D \omega_n}{2\sqrt{1 + K_P}}

6.1 Student Exercise 3

Load the closed-loop model of your ventilator (without disturbance) from last time. Add a derivative controller to the proportional controller. Run the lung mechanics model with the following parameters. Assume a step input, R=1R = 1 cmH2O sec/L, C=0.01C = 0.01 L/cmH2O, L=0.01L = 0.01 cmH2O sec2^2/L, KP=1K_P = 1, KD=1K_D = 1, H=1H = 1, and PD=0P_D = 0. How does the response compare to just a proportional controller (i.e., KD=0K_D = 0)? What happens to the response if KP=100K_P = 100 and KD=1K_D = 1?

Results

6.2 Student Exercise 4

Using the model you developed at the end of the last class, add a disturbance that is a step input of magnitude -0.5 and delay the disturbance by 0.75 seconds. Run the lung mechanics model with the following parameters. Assume a step input, R=1R = 1 cmH2O sec/L, C=0.01C = 0.01 L/cmH2O, L=0.01L = 0.01 cmH2O sec2^2/L, KP=1K_P = 1, KD=1K_D = 1, H=1H = 1. What effect does the disturbance have? Set all controller gains = 100. How does this change the response to the disturbance?

Results

Main point. The derivative controller lets us control the steady-state error without negatively affecting damping ratio. The drawback to this type of controller is that we need an infinite value of KPK_P to get zero steady-state error. To tackle this problem, we need another type of controller.