You are on page 1of 60

PI Controller Tuning for Automated Vasopressor

Drug Infusion in Critical Patient Resuscitation

A Thesis

Presented to

The Faculty of the Department of Mechanical Engineering

University of Houston

In Partial Fulfillment

Of the Requirements for the Degree

Honor in Major

Bachelor of Science

In Mechanical Engineering

By

Luc To

May 2017
PI Controller Tuning for Automated Vasopressor
Drug Infusion in Critical Patient Resuscitation

______________
Luc To

Approved: ___________________________
Chair of the Committee
Karolos M. Grigoriadis, Professor
Mechanical Engineering

Committee Members: ___________________________


Christiana Chang,
Instructional Assistant Professor
Mechanical Engineering

___________________________
Leonard P. Trombetta
Associate Professor
Electrical and Computer Engineering

_____________________________ ___________________________
Suresh K. Khator, Associate Dean, Pradeep Sharma
Cullen College of Engineering M.D. Anderson Chair Professor
Chair of Mechanical Engineering
Acknowledgements

I would like to thank my thesis advisor Dr. Karolos Grigoriadis for accepting my

request to participate in this project and for his consistent advice and support during the

year. I would also like to show my appreciation to Dr. Christina Chang, Dr. Leonard P.

Trombetta, Dr. Behrouz Ebrahimi, and Dr. Karen Weber, who took time from their busy

schedules to assist me through the semesters.

I would like to make a special note of thanks to my advisor and committee

members for their understanding of my circumstances and cooperating to help me finish

my thesis as well as my senior year on schedule. Additionally, I would like to thank the

University of Texas Medical Branch (UTMB) in Galveston, Texas for providing data and

the National Science Foundation project CMMI1437532 for supporting this research.

Finally, I would like to thank my family for their constant encouragement and

support throughout my struggling time. Without their love and support, I wouldnt have

been able to complete my undergraduate study.

iv
PI Controller Tuning for Automated Vasopressor
Drug Infusion in Critical Patient Resuscitation

An Abstract

of a

Thesis

Presented to

The Faculty of the Department of Mechanical Engineering

University of Houston

In Partial Fulfillment

Of the Requirements for the Degree

Honor in Major

Bachelor of Science

In Mechanical Engineering

By

Luc To

May 2017

v
Abstract

This thesis introduces a strategy to tune PI controllers for phenylephrine (PHP)

infusion to automate the stabilization of the mean arterial blood pressure (MAP) response

of hypotensive patient requiring resuscitation. This thesis will define the model of the

MAP response to PHP along with the challenge of controlling this response subject to

patient variability and the time-delay of the drug to act. This thesis introduces a strategy,

which is a combination of Skogestads tuning method and a manual approach for tuning

the PI controller gains based on the MATLAB/SIMULINK simulation of the system

response. The results validate the success of the tuning process in terms of finding

appropriate gains for the PI controller in several cases corresponding to varying dynamic

models of physiological response and varying time delays. The relations among the PI

controller gains, the model parameter variability and the process disturbance were

explored.

vi
Table of Contents

Acknowledgements ............................................................................................................ iv
Abstract .............................................................................................................................. vi
Table of Contents .............................................................................................................. vii
List of Figures .................................................................................................................... ix
1 Chapter 1: Introduction ................................................................................................ 1
1.1 Research Objective ............................................................................................... 3
1.2 Organization of thesis........................................................................................... 4
2 Chapter 2: MAP Response to PHP Infusion Rate Model ............................................ 5
2.1 MAP: .................................................................................................................... 5
2.2 Phenylephrine: ...................................................................................................... 6
2.3 System Modeling.................................................................................................. 6
3 Chapter 3: Time Delay Problem ................................................................................ 10
3.1 Time delay transfer function .............................................................................. 10
3.2 The effect of time delay on the control system .................................................. 11
4 Chapter 4: Control Design ......................................................................................... 13
4.1 PID control ......................................................................................................... 13
4.2 Skogestads tuning method ................................................................................ 15
4.3 4-Step controller tuning strategy ........................................................................ 18
4.3.1 Matlab and the Control System Designer ................................................... 18
4.3.2 The tuning strategy ..................................................................................... 18
4.3.3 Finding Kp and Ki for the nominal parameters set: .................................... 20
5 Chapter 5: Simulation and validation ........................................................................ 25
5.1 Simulation environment ..................................................................................... 25
5.1.1 Target MAP set point and disturbance........................................................ 25
5.1.2 Initial MAP ................................................................................................. 26
5.1.3 Model of MAP response to PHP................................................................. 26
5.1.4 PI controller ................................................................................................ 26
5.1.5 Simulation set up......................................................................................... 27
5.2 Simulations results with the obtained gains ....................................................... 29

vii
5.3 Adjust the gains of the PI controller for each case:............................................ 36
6 Chapter 6: Discussions .............................................................................................. 42
6.1 Overshoot and settling time relation .................................................................. 42
6.2 Relation between PI controllers gains and the gap of current MAP and the set
point 42
6.3 Relation between models parameters and PI controller gains .......................... 43
6.3.1 Gains and the time delay ............................................................................. 43
6.3.2 Gains and the first order lag ........................................................................ 45
6.3.3 Gains and the sensitivity ............................................................................. 46
7 Chapter 7: Conclusion ............................................................................................... 48
Bibliography ..................................................................................................................... 49

viii
List of Figures

Figure 2-1: Typical swine MAP response to PHP infusion[6]. ....................................................... 7


Figure 3-1: Unit step response of a first order transfer function without time delay ..................... 11
Figure 3-2: Unit step response of a first order transfer function with time delay .......................... 11
Figure 3-3: Compensated system without time delay .................................................................... 12
Figure 3-4: Compensated system with time delay ......................................................................... 12
Figure 4-1: PI controller block diagram in parallel form (top) and in series form (bottom).......... 15
Figure 4-2: Skogestad's control system block diagram .................................................................. 15
Figure 4-3: The Control System Designer graphic interface. ........................................................ 21
Figure 4-4: Tuning compensator by changing dynamics components and gains .......................... 22
Figure 4-5: Step response of Skogestad's tuning method (left) and the 4-step strategy (right) ..... 23
Figure 5-1: The block diagram of the MAP response to PHP infusion model .............................. 26
Figure 5-2: Block diagram of the overall simulation environment for the testing the PI controller
for MAP response to PHP .............................................................................................................. 27
Figure 5-3: Case 1 (K=0.5, =200, T=30) with PI controller having Kp=6.18, Ki=0.0309 .......... 29
Figure 5-4: Typical PHP infusion in ml/h profile (solid line) to stabilize MAP (dashed line). ..... 30
Figure 5-5: Simulation of category 1 (Case 2, 3, and 4) which share the same sensitivity, K, ..... 31
Figure 5-6: Simulation of category 2 (Case 5, 6, and 7) which share the same sensitivity, K, ..... 33
Figure 5-7: Simulation of category 3 (Case 8, 9, and 10) which share the same first order .......... 34
Figure 5-8: Case 1 before (top) and after (bottom) adjustments ................................................. 36
Figure 5-9: Case 2 - before (top) and after (bottom) adjustments.................................................. 37
Figure 5-10: Case 6 - before (top) and after (bottom) adjustments................................................ 38
Figure 5-11: Case 10 - before (top) and after (bottom) adjustments.............................................. 39
Figure 6-1: Proportional gain and time delay relation ................................................................... 44
Figure 6-2: Integral gain and time delay relation ........................................................................... 44
Figure 6-3: Proportional gain and first order lag relation .............................................................. 45
Figure 6-4: Integral gain and first order lag relation ...................................................................... 46
Figure 6-5: Proportional gain and sensitivity relation ................................................................... 47
Figure 6-6: Integral gain and sensitivity relation ........................................................................... 47

ix
1 Chapter 1: Introduction

Stabilization and regulation of hemodynamic variables is important to the

resuscitation of critical patients that suffer trauma, brain injury, septic shock, or other

critical conditions resulting in significant drop of blood pressure, or hypotension. To

achieve this objective, appropriately infusing fast acting drugs is essential. Vasopressors

that increase blood pressure, such as phenylephrine (PHP), can help maintain adequate

perfusion of the brain and other vital organs, especially when fluid alone cannot achieve

hemodynamic stability. A fully autonomous, closed-loop system with computerized

decision support can assist without delay by delivering lifesaving fluids and drug to

maintain hemodynamic stability in these critical situations. Using computational models

and feedback control algorithms can greatly enhance the infusion process and produce

better outcome and survivability rates.

Computer-aided administration and automated close-loop control of medication

has been researched since the 1980s. Research has focused on increasing accuracy and

reliability of many difference cases of treatments. Because of disturbances that perturb

pressure, the changing condition of the patient and the wide range of response

characteristics among patients, automated close-loop drug delivery could improve patient

care by maintaining blood pressure near a desired target.

Clinical experiences indicate that automatic control can be faster, safer and more

reliable than manual methods and offer a reduction in clinician workload [1]. Early

methods were designed without an explicit dynamical model of the process. Then, model-

based approaches were introduced [2]. Single model based methods with fixed

1
parameters have been shown to be inadequate to describe drug infusion based on

physiological responses of different patients or the different conditions of a patient. The

proposed single-input, single-output (SISO) adaptive approaches for blood pressure

regulation can be categorized into three main groups: self-tuning controllers, model-

reference controllers and multiple-model controllers [3].

Self-tuning regulators consist of two major steps: determining the parameters of

the model based on measurements of a recursive identification algorithm and calculating

the control input. Model-reference based methods gradually control the process to

diminish the error between the actual response and a reference model which describes the

desired dynamical behavior of the system. Multi-model based adaptive controllers use a

bank of possible dynamical and generate inputs by probabilistic methods. Previously,

regulating blood pressure for maintaining hemodynamic stability and preventing adverse

effects of hypotension on patients has been performed manually using a syringe or

infusion pump manually. This manual method is labor intensive and is often results in

poor performance.

A large variety of control designs have been developed, including proportional

integral derivative (PID) control, optimal control, robust control, adaptive control, and

neural network control. Validation methods vary from computer simulations to laboratory

animal and/or clinical testing. However, these techniques have not been applied to the

administration of vasopressors for maintaining blood pressure in hypotensive patients. A

simple computer controlled on/off algorithm was proposed by Tam et al. to maintain

maternal blood pressure during spinal anesthesia for caesarian section by infusing

phenylephrine [4]. The results were similar to those achieved during manual control, but

2
this method is much less demanding of time and attention from the anesthesiologist.

Recently, Kwan et al. have developed closed-feedback computer controlled infusion

using a proportional algorithm to maintain systolic arterial pressure during spinal

anesthesia for caesarian section [5]. The conclusion was that computer controlled PHP

infusion provided better arterial pressure control compared to the manual control.

1.1 Research Objective

The objective of this thesis is to attempt to tune a proportional-integrating

controller which controls the PHP infusion in order to stabilize the mean arterial pressure

(MAP) of the patient in varied conditions. The outcomes are used to find the relations

between the PI controller gains and the conditions. This thesis is divided into three major

sections.

First, this thesis will define the MAP response to PHP infusion rate model which

is obtained from posted literature. The method of obtaining the model will be further

explained in this thesis. The definition of MAP will be explored in the context of this

thesis. The limits of the parameters which define the MAP response to PHP transfer

function will be presented. This thesis also introduces the problem in controlling MAP

caused by the effect of the time delay in the process. The transfer function of the time

delay will be demonstrated.

Next, this thesis introduces a method to attempt to design and tune the controller

in order to overcome the time delay problem. PID controls definition and transfer

function will be reviewed. The Skogestads tuning method will also be introduced. A

3
strategy for tuning the PID controller will be developed. A demonstration of the process

for one special case will be presented. The simulation environment for validating the PI

controllers will be described in detail. The simulation results will be presented for further

discussions.

Lastly, this thesis validates the success of the tuning process in terms of finding

the most appropriate gains for the PI controller in each case. The results will be discussed

and all the obtained gains and the parameters of the models will be used to visualize the

relations among them.

1.2 Organization of thesis

This thesis consists of six chapters. The first chapter introduces the topic of this

thesis. The second chapter presents the MAP response to PHP infusion model. The third

chapter defines the problems introduced by response time delay. The fourth chapter

introduces the strategy for tuning a controller for a specific case. The fifth chapter

introduces the simulation environment, simulation results, and the results after adjusting

the controller. The sixth chapter validates the success of the method and discusses the

relation between the gains and the parameters of the model. Finally, the seventh chapter

summarizes the findings in this thesis.

4
2 Chapter 2: MAP Response to PHP Infusion Rate Model

In this chapter, a simple first-order model of MAP response to PHP infusion is

introduced and explained. The transfer function of this model will be use to tune the PI

controller and to create the simulation environment. Basic understanding of mean arterial

blood pressure (MAP) and phenylephrine (PHP) is also delivered in this chapter.

2.1 MAP:

MAP, or mean arterial blood pressure, is defined as the average pressure in a

patients arteries during one cardiac cycle. It is consider a better indicator of perfusion to

vital organs than systolic blood pressure (the amount of pressure in bodys arteries during

contraction of heart muscle). MAP can be calculated using a formula of the systolic blood

pressure (SBP) and the diastolic blood pressure (the pressure when the heart is at rest

between beats, DBP) [6]:

+ 2
= . (1)
3

For example: if a patients blood pressure is 120/80mmHg then the MAP is:

120 + 2(80)
= = 93.
3

5
2.2 Phenylephrine:

Phenylephrine (PHP) is a rapid-acting vasopressor. Phenylephrine is a

decongestant that is typically used to shrink blood vessels in the nasal passages. PHP is

used to increase the blood pressure in unstable patients with hypotension, especially

resulting from septic shock [7].

2.3 System Modeling

In order to design an appropriate controller, the characteristic of MAP response to

a step Phenylephrine (PHP) infusion were examined. Animal experiments were

conducted on swine to collect data for system modeling [7]. Each swine was prepared for

an open-loop experiment in which the PHP infusion rate was controlled. Arterial blood

pressure and mean arterial blood pressure were recorded. Experimental data presented in

this paper was obtained from the Resuscitation Research Laboratory, Department of

Anesthesiology, University of Texas Medical Branch at Galveston, Texas [8]. The

experiments were designed to represent varied health conditions of the animals. PHP was

infused in animals with different pre-existing physiological conditions, such as healthy

animals, animals with different level of hypotension, animals resuscitated with different

fluids, and animals at different level of baseline MAP [7]. The PHP input profiles were

designed to capture the complete range of dynamics of the MAP response to PHP.

Illustrated in Figure 2-1 is a typical response of swine blood pressure to staircase profile

PHP infusion.
6
Figure 2-1: Typical swine MAP response to PHP infusion [7].

A simplified first-order transfer function is used to describe the local swine MAP

response for an individual step PHP [7].

P(s) K
= eTs , (2)
I(s) (s + 1)

where (mmHg) is the change of the MAP value from its baseline, (ml/h) is the PHP

infusion rate, and K (mmHg/ml/h) is the swines sensitivity to PHP. The first order lag,

(sec), is the result from the uptake, distribution, and biotransformation of the

7
vasopressor. The pure time delay, T (sec), is transport delay time for PHP to reach the

circulatory system from the infusion pump.

The sensitivity K, first order lag , and time delay T are the major model

parameters which define the response of the blood pressure to PHP infusion rate. These

parameters vary from patient to patient (inter-animal variability) and from time to time

(intra-animal variability) [7].

The inter-animal sensitivities vary with the weight and current health conditions

of the swine. The intra-animal varies with the PHP infusion rate [7]. From the data

collected, Table 2-1 below gives the limits for these parameters [7].

Table 2-1: Range of the Model Parameters

Parameter Nominal Minimum Maximum


K 0.5 0.1 1.2
200 180 340
T 30 20 50

Ranges of these parameters were used to generate several swine in different

conditions for tuning purposes and later simulation. In the scope of this thesis, only

sixteen swine were generated. These sixteen swine were grouped in three categories:

constant sensitivity K and first order lag , constant sensitivity K and the time delay T,

and finally, constant first order lag , and the time delay T. Table 2-2 show the all the

swine generated.

8
Table 2-2: Categorized swine simulation models; shading indicates nominal case

K(sensitivity) (first order lag) T(time delay)


0.5 200 20
Constant 0.5 200 25
K, 0.5 200 30
0.5 200 35
0.5 200 40
0.5 200 50
0.5 180 30
Constant K, 0.5 200 30
T 0.5 230 30
0.5 260 30
0.5 300 30
0.5 340 30
0.1 200 30
Constant 0.3 200 30
T, 0.5 200 30
0.8 200 30
1 200 30
1.2 200 30

9
3 Chapter 3: Time Delay Problem

This chapter defines one of the most prominent challenges in controlling the MAP

response to PHP infusion, the time delay of the system.

3.1 Time delay transfer function

Time delay, also called transport delay or dead time, is a feature of non-

minimum-phase behavior and has an excessive phase lag with no attenuation at high

frequencies [9]. Time delay exists in many application systems, such as thermal,

hydraulic, and pneumatic systems [9]. Consider a transport lag system has x(t) and y(t) as

input and output respectively then: y(t) = x(t - T) where T is the time delay. The transfer

function of the time delay is

L[x(t T)1(t T)]


transfer function of time delay = |
L[x(t)1(t)] zero initial condition

X(s)eTs
= = eTs . (3)
X(s)

Figure 3-1 and Figure 3-2 show the difference between the response of a simple

first-order plant to a step function with and without time delay.

10
Figure 3-1: Unit step response of a first order transfer function without time delay

Figure 3-2: Unit step response of a first order transfer function with time delay

With time delay, from 0 to 1 second, the output response does not change due to

the input signal. The longer the time delay is, the longer it takes for the output to change

due to the change in the input signal.

3.2 The effect of time delay on the control system

Few applications actually gain advantages from the presence of a time delay [10].

Time delay causes difficulties to the control of a simple plant. One of these difficulties is

that time delay destabilizes the system. With a compensator gain of one added to the

above first-order system without time delay, the output response quickly settles around 3

seconds without an overshoot as shown in Figure 3-3. However with a time delay of one

11
second, the unit-step response of the system has an overshoot, more oscillation, and

longer settling time. Figure 3-4 shows the output of a system with time delay.

Figure 3-3: Compensated system without time delay

Figure 3-4: Compensated system with time delay

Therefore, in controlling the PHP infusion to stabilize MAP of the patient, time

delay is one big challenge. As a result, a carefully designed controller is required. The

next chapter introduces the control design and an attempting strategy to tune PI

controller.

12
4 Chapter 4: Control Design

In the scope of this thesis, PI control is used. PI controllers need to be tuned in

order to have good performance and deal well with disturbance. This chapter introduces a

step by step process of applying Skogestads tuning method to find gains for PI

controller. The gains were then validated by simulations.

4.1 PID control

PID control is a name given to a three-term control: the P, I, and D refer to the

first letter of the names of the individual terms that make up the standard of such

controller - P for the proportional term, I for the integral term, and D for the derivative

term in the controller. PID controller is one of the most widely used industrial controllers

[11]. In the scope of this paper, the derivative term will not be used, the reason for which

is explained further in this thesis.

Proportional control is denoted by the P-term in the PID controller. It is used

when the controller action is to be proportional to the size of the process error

signal,() = () (), with () is the desired input and () is the output

response [11]. The time domain and the Laplace domain representations for the

proportional control are

Time domain, () = . (),

Laplace domain, () = . (),

with is the proportional gain.

13
Integral control, the I-term in PID controller, is used when it is required that the

controller correct for any steady offset from a constant reference signal value. The

integral control can eliminate offset without the use of excessively large controller gain.

The time and Laplace domain representations for integral control are given as:

t
Time domain () = 0 e(T)dT,


Laplace Domain () = [ ] E(s),

with is the integral controller gain.

PI controller is the combination of the P and I term. The general Laplace domain for PI

control is

K
Uc (s) = [K p + i ] E(s) (4)
s

or can be written as

1
Uc (s) = K p [1 + ] E(s) , (5)
Ti s


where equal to . Figure 4-1 shows the architectures for a generic PI controller: one

is in parallel form, one is in serial form.

14
Figure 4-1: PI controller block diagram in parallel form (top) and in series form (bottom)

4.2 Skogestads tuning method

Skogestads PID tuning method is a model-based tuning method where the

controller parameters are expressed as functions of the process model parameters [12].

Assume that the control system has a transfer function block diagram as show in Figure

4-2:

Figure 4-2: Skogestad's control system block diagram

15
The control system tracking function Tr(s) is the transfer function from the set

point to the process measurement. The tracking function Tr(s) is specified as a first order

transfer function with time delay:

ymf (s) 1
Tr(s) = = eTs , (6)
ymsp (s) s + 1

where is the time-constant of the control system which is needed to be specify,

and T is the process time delay of the process model.

From the block diagram show in Figure 4-2, the system tracking function consists

of the controller, the process, and the negative feedback loop. The tracking transfer

function can be expressed as

HC (s)HP (s)
Tr(s) = . (7)
1 + HC (s)HP (s)

Set equation (6) equal to (7) gives

HC (s)HP (s) 1
= eTs . (8)
1 + HC (s)HP (s) s + 1

Here, the only unknown is Hc(s). By making a first order Taylor series expansion

approximations to the time delay term, the controller become a PID or a PI controller for

the process transfer function assumed. Table 4-1 below includes Skogestads tuning

formulas for several processes.

16
Table 4-1: Skogestad's tuning method table

Process type HP(s) KP Ti Td


Integrator + 1
4( + ) 0
delay ( + )
Time-constant 1
min[, 4( + )] 0
+ delay + 1 ( + )
Integrator +
1
time-constant + 4( + )
( + 1) ( + )
delay
Two time-
1
constant + min[1 , 4( + )] 2
(1 + 1)(2 + 1) ( + )
delay
Double
1
integrator + 4( + ) 4( + )
2 4( + )2
delay

According to Skogestads tuning fomulas, the compensator will have the

derivative gains of 0, because the natural first-order transfer function with time delay of

the MAP response to PHP infusion. Therefore, this thesis will only focus on the PI

controller.

17
4.3 4-Step controller tuning strategy

This section proposes a method to tune PI controller based on Skogestads tuning

method and Matlabs Control System Designer.

4.3.1 Matlab and the Control System Designer

The computation tools used in this section is Malab and its Control System

Toolbox developed by MathWorks. The Control System Toolbox is designed to assist in

designing single-input single-output (SISO) controllers using graphic interface methods.

User can uses Bode Editor and Root Locus Editor to add and remove controller poles and

zeros to change loop gain and view changes in close-loop step responses as the user tunes

controller parameters. The tool box can be used to observe system characteristics, such as

rise time, overshoot, and gain and phase margins. The Control System Designer can

create and store multiple controller designs for comparing and choosing the best option.

4.3.2 The tuning strategy

From equation (5), the compensators general transfer function can also be

expressed as

1 Kp 1+ TI s 1+ TI s
Uc (s) = K p [1 + ] E(s) = [ ] = C[ ], (9)
TI s TI s s


the compensators gain C is equal to .

18
Equation (9) shows that the dynamics of the compensator always include an

1
integrator and a zero equal to .. A controller is designed for each set of model

parameters (sensitivity K, first order lag , and the time delay T) though 4 steps:

Step 1: Calculate the zero location by applying Skogestads tuning method.

Step 2: Run Matlab Control System Designer with Bode plot and step response

plot.

Step 3: Add the appropriate zero and integrator to the compensators dynamics.

Step 4: Edit the compensator gain C to match the desired step response. Start with


the recommended gain obtained from Skogestads tuning method.

Sixteen sets of model parameters were generated and were described previously

in chapter 2. These sets are grouped in three categories: constant sensitivity K and first

order lag , constant sensitivity K and the time delay T, and finally, constant first order

lag , and the time delay T. The nominal set of the parameters with K = 0.5, = 200, T =

30 is included in all three categories.

An acceptable gain of the compensator is to have the step response settle within 4

minutes (240 seconds) with less than 20% over shoot. The optimal result is having no

over shoot (over shoot 2%) in the least amount of settling time

19
4.3.3 Finding Kp and Ki for the nominal parameters set:

This section is a demonstration of the process of tuning a PI controller for the nominal set

of model parameters: K = 0.5, = 200, T = 30.

Step 1:

From the second case of the Skogestads formulas table (Table 4-1) with:

K
() = eTs (K =0.5, = 200, T=30 sec).
s+1

The derivative part is Td = 0, meaning there is no derivative component in the PID

controller. Then the proportional gain is


= = 6.6667.
K(+T)

and the integral component is

Ti = min[, 4( + T)] = 200.

The integral gain is = 0.0333.

1 1
The designed zero of the compensator will be located at T = 200 = 0.005.
I

Step 2:

In Matlab command window, run the following code lines to activate the Control System

Designer tool box.

>> G= tf(0.5,[200,1],'InputDelay',30);

>> controlSystemDesigner(G);

20
The first line of the code told Matlab to create a block variable, G, for the transfer

function and sets the numerator, denominator, and input time delay of the function equal

to 0.5, 200s +1, and 30 second respectively. The next line of the code activate the Control

System Designer tool box and then put the function block, G, as the fixed block for the

system. Figure 4-3 illustrates the graphic interface of Control System Designer after the

code was executed.

Figure 4-3: The Control System Designer graphic interface.

Step 3:

After the Control System Designer opens, an integrator and a zero at -0.005 is added to

the compensators dynamics by double-click to the letter C under the Controller and

Fixed Blocks tab. Figure 4-4 depicts the process of tuning by configuring the dynamics

and changing gain C of the compensator.

21
Figure 4-4: Tuning compensator by changing dynamics components and gains

Step 4:

Kp
Start with compensator gain Co = = 0.0333 (obtain from Skogestads method). Then
Ti

gain C is modified until the desired response is met. The best C obtained is 0.0309 with

settling time of 121 sec and overshoot of 1.02 (2%). Figure 4-5 is the comparison

between the step respond of C = 0.0333 (Kp =6.6667) and C = 0.0309 (Kp=6.18). The

final transfer function of the compensator is:

1 + 200s
C(s) = 0.0309 [ ]
s

or:

s + 0.005
C(s) = 6.18 [ ].
s

22
a) b)

Figure 4-5: Step response of Skogestad's tuning method (left) and the 4-step strategy (right)

The gains (Kp = 6.18 and Ki = 0.0309) of the compensator will be then validated by
simulations which will be addressed in the next chapter.

The manually adjusted gains for each set of parameters are presented in Table 4-2.

23
Table 4-2: Gains found by Skogestads and modified by Matlab's tool

Skogestad's k1=4 modified by Matlab step response


Settling Settling
Peak Peak
K T Kp C/Ki zero Ti Time Kp C/Ki zero Time
(%) (%)
(sec) (sec)
0.5 200 30 6.6666667 0.03333333 -0.005 200 1.04 182 6.18 0.0309 -0.005 121 1.02

0.5 200 20 10 0.0625 -0.00625 160 1.08 202 10.4 0.065 -0.00625 182 1.09
0.5 200 25 8 0.04 -0.005 200 1.04 151 7.4 0.037 -0.005 101 1.02
0.5 200 30 6.6666667 0.03333333 -0.005 200 1.04 182 6.18 0.0309 -0.005 121 1.02
0.5 200 35 5.7142857 0.02857143 -0.005 200 1.04 212 5.2 0.026 -0.005 146 1.02
0.5 200 40 5 0.025 -0.005 200 1.04 242 4.62 0.0231 -0.005 162 1.02
0.5 200 50 4 0.02 -0.005 200 1.04 303 3.71 0.01855 -0.005 201 1.02

0.5 180 30 6 0.03333333 -0.0055556 180 1.04 182 5.5576 0.030876 -0.00556 121 1.02
0.5 200 30 6.6666667 0.03333333 -0.005 200 1.04 182 6.18 0.0309 -0.005 121 1.02
0.5 230 30 7.6666667 0.03333333 -0.0043478 230 1.04 182 7.1034 0.030884 -0.00435 121 1.02
0.5 260 30 8.6666667 0.03611111 -0.0041667 240 1.06 207 7.3199 0.0305 -0.00417 136 1.02
0.5 300 30 10 0.04166667 -0.0041667 240 1.05 368 10.295 0.042896 -0.00417 240 1.09
0.5 340 30 11.333333 0.04722222 -0.0041667 240 1.1 348 11.711 0.048796 -0.00417 283 1.11

0.1 200 30 33.333333 0.16666667 -0.005 200 1.04 182 30.9 0.1545 -0.005 121 1.02
0.3 200 30 11.111111 0.05555556 -0.005 200 1.04 182 10.3 0.0515 -0.005 121 1.02
0.5 200 30 6.6666667 0.03333333 -0.005 200 1.04 182 6.18 0.0309 -0.005 121 1.02
0.8 200 30 4.1666667 0.02083333 -0.005 200 1.04 182 3.86 0.0193 -0.005 121 1.02
1.0 200 30 3.3333333 0.01666667 -0.005 200 1.04 182 3.09 0.01545 -0.005 121 1.02

24
5 Chapter 5: Simulation and validation

The main objective of this thesis is to tune, simulate and validate different PI

controllers for different sets of parameters which represent different swine MAP

responses to PHP infusion. The PI controller was expected to quickly stabilize the MAP

of a hypotension patient to a certain MAP set point. The PI controller was also expected

to overcome a disturbance. Keeping the MAP of the patient from not overshooting the

designed set point was an important requirement. This chapter introduces the simulation

environment created in Matlab Simulink. After that, recorded plots are presented for

several cases. All the plots will be analyzed and discussed further in this chapter.

5.1 Simulation environment

Matlab Simulink is a block diagram environment for simulation and model-based

design. It supports simulation, automatic code generation, and continuous test and

verification of embedded systems. Matlab Simulink is used to create an environment to

test every PI control designs in this thesis.

5.1.1 Target MAP set point and disturbance

The MAP set point and the disturbance are created by using step function blocks

signal. These step function blocks can be modified to have specific step times, initial

values, and final values. The step time of the set point block represents the activation

time of the PHP infusion system. The disturbance block is added to the value of the MAP

25
output. The initial value of this block is zero when there is no disturbance. The final value

is a negative value which represents the drop in blood pressure.

5.1.2 Initial MAP

The constant signal block is used to produce the initial MAP of the body of the animal.

This block is also added to the MAP output

5.1.3 Model of MAP response to PHP

Modelling of MAP response to PHP in Simulnk is a combination of two blocks:

the first-order continuous transfer function block and a transport-delay function block.

The parameters of the first-order block are modified based on the value of sensitivity K

and the first-order lag , as presented earlier. The transport-delay is the value of time-

delay T. The two blocks are connected as shown in Figure 5-1.

Figure 5-1: The block diagram of the MAP response to PHP infusion model

5.1.4 PI controller

MatLab Simulink provides a built-in PID control block. The proportional and

integral gains of the PID controller are tuned based on the values provided in Table 4-2

26
for every case. The PID controller is also set to the lower output saturation limit of zero

because negative PHP infusion rate is impossible.

5.1.5 Simulation set up

All the components are connected as show in Figure 5-2.

Figure 5-2: Block diagram of the overall simulation environment for the testing the PI
controller for MAP response to PHP

For every simulation, the initial MAP was set to 60 mmHg to represent a

hypotensive animal. The MAP set point had been set for 80mmHg after 15 minutes

(900sec) by setting the step time to 900, the initial value to 60, and final value to 80. The

simulated disturbance challenge was applied after 40 minutes by setting the step time to

2400, initial value to 0, and final value to - 40 (the negative value represents the drop in

blood pressure). The simulations were run for 1 hours and 15 seconds (4500 seconds).

27
10 cases were applied to simulations. In each case, the parameters of the plant and

the PI controller were set based on values obtained from previous designs. Table 5-1

shows the chosen cases. Case 1 is the nominal case. Cases 2 to 4 share the same

sensitivity, K, and first order lag, . Cases 5 to 7 share the same sensitivity, K, and time

delay, T. Cases 8 to 10 share the same first order lag, , and time delay, T.

Table 5-1: Chosen cases with their parameters and gains for simulations

(first order T(time


Case K(sensitivity) Kp Ki
lag) delay)
1
0.5 200 30 6.18 0.0309
2
0.5 200 20 10.4 0.065
3
0.5 200 35 5.2 0.026
4
0.5 200 50 3.71 0.01855
5
0.5 180 30 5.5576 0.03087556
6
0.5 230 30 7.1034 0.03088435
7
0.5 300 30 10.295 0.04289583
8
0.1 200 30 30.9 0.1545
9
0.8 200 30 3.86 0.0193
10
1.2 200 30 2.576 0.01288

28
5.2 Simulations results with the obtained gains

The MAP responses to PHP s of the ten chosen cases are presented below in

Figure 5-3 through Figure 5-7. The simulations are grouped in 3 categories as introduced

in the previous chapter. In each graph, x-axis is time in second; y-axis is MAP in

(mmHg). The solid lines are the MAP responses. The dashed lines are the MAP set point

input.

The nominal case showed in Figure 5-3 has the settling time less than 4 minutes

(237 seconds) after the MAP set point was set at 80 mmHg and after the disturbance. The

settling time is about 8 times of the models time delay. The overshoot of the MAP

response is only about 2%.

Figure 5-3: Case 1 (K=0.5, =200, T=30) with PI controller having Kp=6.18, Ki=0.0309

29
Figure 5-4 shows a PHP rate in ml/h along with the MAP response of Case 1.

Figure 5-4: Typical PHP infusion in ml/h profile (solid line) to stabilize MAP (dashed line).

Figure 5-5 captures the simulations of the cases in the first categories. The

sensitivity parameters, K, and the first order lag parameters, , are held constant at 0.5

and 200 respectively. The time delay, T, increases from 20 seconds to 50 seconds through

the cases.

30
Case 2

Case 3

Case 4

Figure 5-5: Simulation of category 1 (Case 2, 3, and 4) which share the same sensitivity, K,
and first order lag,

31
Based on the observation from Figure 5-5, case 2 has the highest overshoot

compared to the others in this category. Case 3 and 4 have the overshoot about 2%. Case

2 has the lowest time delay of 20 seconds. Case 2 is the only case that has the time delay

lower than the nominal value of 30 seconds. The settling time of the three cases, of

course, increases respectively with their models time delays. However, the settling times

are always around 8 times of the values of their time delay.

Figure 5-6 captures the simulations results of the cases in the second category.

The second category holds the time delay and sensitivity constant at 30 and 0.5

respectively. The first order lag, , increases from 180 to 300 through the cases. Case 5

has the lowest overshoot and performed the best controlling compared to other cases in

this category. Case 5 settled around 8 times of its time delay. Case 6 and 7 have a higher

overshoot and longer settling time. Both of these cases have the first order lag values

higher than the nominal value of 200.

32
Case 5

Case 6

Case 7

Figure 5-6: Simulation of category 2 (Case 5, 6, and 7) which share the same sensitivity, K,
and time delay, T

33
Figure 5-7 below are the simulation results of the third category. Third category

shares the same first order lag , and the time delay T of 200 and 30 respectively. The

sensitivity parameters, K, increase from 0.1 to 1.2.

Case 8

Case 9

Case 10

Figure 5-7: Simulation of category 3 (Case 8, 9, and 10) which share the same first order
lag, , and time delay, T

34
All three tuned controllers in this category performed well. They all have the

settling time less than 4 minutes and 7 to 8 times of the values of their time delay.

In summary, most of the cases had good MAP response profiles. The controller

quickly settled the MAP at the set point of 85mmHg after the input was set (at 900 sec)

and after the disturbance occurred (2400 sec). Some cases with higher overshoots have

either low time delay compared to the nominal time delay or high first order lag

compared to nominal first order lag. Table 5-2 shows the settling time in second and

overshoot in percentage of each case.

Table 5-2: Simulation result data before adjustments


K T Settling Settling
(first peak 1 peak 2
(sensiti (time Kp Ki time 1 time 2
order (%) (%)
vity) delay) (sec) (sec)
lag)
6.18 0.0309
0.5 200 30 242 252 2.1 3.28
10.4 0.065
0.5 200 20 252 297 9.6 15.2
5.2 0.026
0.5 200 35 192 242 1.72 1.75
0.0185
3.71
0.5 200 50 5 327 352 2.12 2.225
0.0308
5.5576
0.5 180 30 76 212 222 2.04 2.07
0.0308
7.1034
0.5 230 30 84 187 197 1.56 1.5
0.0428
10.295
0.5 300 30 96 402 502 9.04 9.275
30.9 0.1545
0.1 200 30 192 207 2.16 2.075
3.86 0.0193
0.8 200 30 192 212 1.92 2.05
0.0128
2.576
1.2 200 30 8 187 207 2.12 2.08

35
5.3 Adjust the gains of the PI controller for each case:

Because some controllers did not perform as expected, several adjustments were

made for every case. The adjustments are made by changing the proportional and integral

gains of the PI controller so that the MAP response has a shorter settling time and lower

overshoot. It was experienced that there exist a limit value for gains which give out the

acceptable MAP response. The ultimate gains were taken within these limits. The new

gains were then recorded and compared with the old gains. Figure 5-8, Figure 5-9, Figure

5-10, Figure 5-11 are the simulations after adjustments of case 1, case 2, case 6, and case

10 respectively (one of each categories and the nominal case). The graphic of others

cases are not included in this thesis. The essential collected data of the remaining cases

are included.

Figure 5-8: Case 1 before (top) and after (bottom) adjustments

36
The gains obtained by 4-step tuning for case 1 are Kp = 6.18, Ki = 0.0309.

The new gains after adjustment for case 1 are Kp = 5.3, Ki = 0.0265.

The settling time after adjustment is shorter and there is no overshoot after adjustment.

Figure 5-9: Case 2 - before (top) and after (bottom) adjustments

The gains obtained by 4-step tuning for case 2 are Kp = 10.4, Ki = 0.065.

The new gains after adjustment for case 2 are Kp = 9 , Ki = 0.046.

The settling time after adjustment is shorter. The overshoot is much lower compared to

the previous simulation.

37
Figure 5-10: Case 6 - before (top) and after (bottom) adjustments

The gains obtained by 4-step tuning for case 6 are Kp = 7.1, Ki = 0.0308.

The new gains after adjustment for case 6 are Kp = 6.2, Ki = 0.02696.

The settling time after adjustment is shorter. The overshoot is much lower compared to

the previous simulation.

38
Figure 5-11: Case 10 - before (top) and after (bottom) adjustments

The gains obtained by 4-step tuning for case 10 are Kp = 2.57, Ki = 0.013.

The new gains after adjustment for case 10 are Kp = 2.2, Ki = 0.011.

The settling time is shorter and there is no overshoot after adjustment.

39
Table 5-3 records the settling times and the overshoots of each case after

adjustment were made.

Table 5-3: Simulation result data after adjustments

Kp Ki
K T Settling Settling peak peak
(first after after
(sensiti (time time 1 time 2 1 2
order adjust adjust
vity) delay) (sec) (sec) (%) (%)
lag) ments ments

0.5 200 30 5.3 0.0265 237 237 0 0

0.5 200 20 9 0.046 142 172 1.8 1.4

0.5 200 35 4.8 0.024 177 182 0 0.5

0.5 200 50 3.3 0.0165 267 267 0.24 0.27


0.0272
0.5 180 30 4.9 2 167 167 0.2 0.22
0.0269
0.5 230 30 6.2 5 162 172 0.12 0.175

0.5 300 30 9 0.031 217 237 2.08 2

0.1 200 30 28.5 0.147 142 232 1.36 1.375

0.8 200 30 3.6 0.018 142 152 0.76 0.8

1.2 200 30 2.2 0.011 187 192 0 0

40
Table 5-4 below presents the gains for all simulations including the gains before and after

adjustments are made.

Table 5-4: Gains from the 4-step strategy and adjusted gains

C K T
Kp Ki Kp Ki
as sensitivit first order time
(before) (before) (after) (after)
e y lag delay
1 0.5 200 30 6.18 0.0309 5.3 0.0265

2 0.5 200 20 10.4 0.065 9 0.046

3 0.5 200 35 5.2 0.026 4.8 0.024

4 0.5 200 50 3.71 0.01855 3.3 0.0165


0.02722
5 0.5 180 30 5.5576 0.030876 4.9
2
0.02695
6 0.5 230 30 7.1034 0.030884 6.2
7
7 0.5 300 30 10.295 0.042896 9 0.031

8 0.1 200 30 30.9 0.1545 31 0.149

9 0.8 200 30 3.86 0.0193 3.6 0.018

10 1.2 200 30 2.576 0.01288 2.2 0.011

41
6 Chapter 6: Discussions

In order to have a better understanding of the performance of the controller, it is

important to pay attention to the relations among the factors which contribute to the

stability of the MAP response to PHP infusion. In this chapter, relations among model

parameters, PI controller gains, MAP response, and disturbance will be discussed.

6.1 Overshoot and settling time relation

Tuned PI controller was expected to quickly and smoothly compensate the MAP

of the patient to a certain set point without creating a big over shoot. It is impossible to

give a negative PHP infusion. Therefore, the MAP response will take more time to settle

at the set point if a high overshoot is created by the PI controller. The simulation

environment was created with the lower limit of 0 for the PI controller to present this

characteristic of the real life situation. As observed in case 2, 6, and 7 before adjustments,

the high overshoot leads to long recovery time.

6.2 Relation between PI controllers gains and the gap of current MAP and

the set point

The 4-Step tuning strategy took the zero of the compensator from Skogestads

tuning method as a base for further adjustments. The 4-Step tuning strategy gives better

gains compared to Skogestads gains because of the computer aid. The 4-Step tuning

strategy relied on the unit step response of the function to find the better gains. However,

42
these gains did not perform as expected in the simulation environment. In the simulation

environment, the difference between the current MAP and the set point are 25mmHg

after 900 seconds and 40mmHg after 2400 seconds.

The relation between gains and disturbance can be drawn from the difference

between the gains for the unit step response and the gains for the simulation environment.

In Table 5-4, all the new proportional gains have values less than the old gains. The new

integral gains are also less than the old gains. Therefore, a bigger step disturbance

requires smaller gains of the PI controller to compensate for better MAP response.

6.3 Relation between models parameters and PI controller gains

The purpose of separating all the generated swine model parameters into 3

categories is to examine the relation of each parameter and the gains of the PI controller.

In each category, two of the models parameters are held fixed at a certain value in order

to examine how the gains change with the change of the last parameter. For example, if

the sensitivity and the first order lag are held fixed, the relation between the time delay

and the PI controllers gains can be observed. In the scope of this thesis, the fixed values

of the parameters are the nominal values.

6.3.1 Gains and the time delay

Figure 6-1 and Figure 6-2 are the graphs showing the relation between the time

delay and the proportional and integral gains respectively. The diamond data points are

the gains obtained from the 4-step tuning strategy which is best for the unit step response.

43
The square data points are the gains obtained after adjustment to find the best gains for

the simulation environment.

Proportional gain and time delay relation


11

10

8
Proprtional gain

4-Step tuning
7
After adjustments
6

2
10 20 30 40 50
Time delay (sec)

Figure 6-1: Proportional gain and time delay relation

Integral gain and time delay relation


0.07

0.06

0.05
Integral gain

0.04 4-step tuning


After adjustments
0.03

0.02

0.01
10 20 30 40 50
Time delay (sec)

Figure 6-2: Integral gain and time delay relation

44
Based on the collected data, the proportional and integral gains increase when the

time delay of the model decreases. The gain increases quickly as the time delay was less

than 20 second. The gain gradually decreases when the time delay is more than 40 sec.

This relation is applicable for both high and low step disturbance.

6.3.2 Gains and the first order lag

Figure 6-3 and Figure 6-4 show the relation between the first order lag parameter

of the model and the fitted gains of the PI controller. The proportional gain, Kp, has a

linear relation to the first order lag, . The proportional gain increase when the first order

lag increases.

Proportional gain and First order lag relation


11

10

9
Proprotional gain

8 4-Step tuning

After adjustments
7

4
100 150 200 250 300 350
First order lag

Figure 6-3: Proportional gain and first order lag relation

45
Integral gain and First order lag relation
0.045

0.04
4-Step tuning
Integral gain

After adjustments
0.035

0.03

0.025
150 200 250 300
First order lag

Figure 6-4: Integral gain and first order lag relation

Based on Figure 6-4, the integral gain also increases when the first order lag

increases. However, unlike the linear relation between the proportional gain and the first

order lag, the integral gain has only an accountable change when the first order lag is

more than 230.

The above relation between the PI controller gains and the first order lag is

applied for both low and high disturbance.

6.3.3 Gains and the sensitivity

Figure 6-5 and Figure 6-6 show the relation between the PI controllers gains and

the sensitivity parameter K of the model. Both the proportional and integral gains of the

PI controller increase when the sensitivity value of the model decreases. The value of the

gain dramatically increases when the sensitivity is below 0.5. This relation is applied to

both low and high disturbance.

46
Proportional gain and Sensitivity relation
31

26

21
Proportional gain

4-Step tuning
After adjustments
16

11

1
0 0.5 1 1.5
Sensitivity parameter

Figure 6-5: Proportional gain and sensitivity relation

Integral gain and Sensitivity relation


0.16

0.14

0.12
4-Step tuning
0.1
Integral gain

After adjustments
0.08

0.06

0.04

0.02

0
0 0.2 0.4 0.6 0.8 1 1.2 1.4
Sensitivity parameter

Figure 6-6: Integral gain and sensitivity relation

47
7 Chapter 7: Conclusion

The objective of this thesis is to propose a strategy for tuning PI controllers in

order to stabilize arterial blood pressure for critical care hypotensive patients using

phenylephrine (PHP). The subjects of this research are the swine. However, based on the

similarity between swine cardiovascular response and human physiology it is expected

that the developed methods would be applicable to human patients [13]. This thesis

introduces a 4-step strategy which is a combination of Skogestads tuning method and

Matlab Control System Designer for tuning the PI controller. The gains obtained from the

4-step strategy were validated in a simulation environment created by using

Matlab/Simulink. During the validation, it was observed that the 4-step tuning strategy

successfully compensates for most cases quickly and without a high overshoot. However,

the 4-step tuning strategy doesnt give out the best gain for each case. This thesis also

discusses the simulation results and draws relations among the PI controllers gains,

model parameter, and the disturbance. The proportional and integral gains should be low

when there is a big gap between the MAP set point and the patients MAP. Higher

overshoot leads to a longer settling time because it is impossible to give a negative PHP

infusion. Gains should be tuned higher when either time delay decreases or the sensitivity

decreases. Gains should be tuned higher if the first order lag increases.

48
Bibliography

[1] The ESCAPE Trial Group, "Strict Blood-Pressure Control and Progression of Renal

Failure in Children," The New England Journal of Medicine, no. 361, pp. 1639-50,

2009.

[2] J. B. Slate, L.C. Sheppard, "Automatic Control of Blood Pressure by Drug Infusion,"

IEE PROC, vol. 126, pp. 639 - 645, 1982.

[3] S. Isaka, A. V. Sebald, "Control Strategies for Arterial Blood Pressure Regulation,"

IEEE Trans, Biomed. Eng, vol. 40, pp. 353-363, 1993.

[4] K. Ngan, Y. Tam, K. Khaw, F. Ng, L.Critchley, and M. Karmakar, "Closed-Loop

Feedback Computer Controlled Infusion of Phenylephrine for Maintaining Blood

Pressure During Spinal Anaesthesia for a Cesarean Section: A Preliminary

Descriptive Study," Anaesthesia, vol. 62, p. 1251 - 1256, 2007.

[5] K. Khaw, K. Ngan, F. Ng, Y. Tam, "Randomized Comparision of Closed-Loop

Feedback Computer-Controlled with Manual-Controlled Infusion of Phenylephrine

for Maintaining Arterial Pressure During Spinal Anaesthesia for Caesarean

Delivery," Br. J. Anaesth, vol. 110, p. 59 65, 2013.

[6] S. C. Smeltzer, B. G. Bare, K. H. Cheever, J. L. Hinkle, Brunner and Suddarth's

Textbook of Medical-Surgical Bursing. Philadelphia: LWW, 2008.

[7] T. Wassar, T. Luspay, K. R. Upendar, M. Moisi, R. B. Voigt, N. R. Marques, M. N.

Khan, K. M. Grigoriadis, M. A. Franchek, G. C. Kramer, "Automatic Control of

Arterial Pressure for Hypotensive Patients Using Phenylephrine," International

49
Journal of Modelling and Simulation, vol. 34, 2014.

[8] T. Luspay, K. Grigoriadis, "Robust Linear Parameter-Varying Control of Blood

Pressure Using Vasoactive Drugs," International Journal of Control, no. 88:10, pp.

2013-2029, 2015.

[9] K. Ogata, System Dynamics, 4th ed. Pearson, 2004.

[10] G. Baker, "PID Tuning of Plants With Time Delay Using Root Locus," Department

of General Engineering, San Jose State University, Master's Thesis 4036, 2011.

[11] M. H. Moradi M. A.John, Ed., PID Control: New Identificaion and Design Methods.

London, UK, Springer, 2005.

[12] F. Haugen, PID Controll. Tapir Academic Press, 2004.

[13] M. M. Swindle, A. Makin, A.J. Herron, F.J. Clubb, K.S. Frazier, "Swine as Models

in Biomedical Research and Toxicology Testing," Vet Pathol, vol. 49, pp. 344-356,

2012.

50

You might also like