0% found this document useful (0 votes)
8 views

Automatic Tuning of PID Controller

This master's thesis by Olalekan Olusoji Ige focuses on the automatic tuning of PID controllers, which are essential in industrial automation. The study evaluates various tuning algorithms, particularly the Åstrom and Schei relay feedback methods, through simulations and real experiments on air heater and quadruple tank processes. The aim is to enhance PID tuning efficiency and adaptability in response to changing process dynamics, thereby reducing downtime and improving product quality.

Uploaded by

gajmer72
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Automatic Tuning of PID Controller

This master's thesis by Olalekan Olusoji Ige focuses on the automatic tuning of PID controllers, which are essential in industrial automation. The study evaluates various tuning algorithms, particularly the Åstrom and Schei relay feedback methods, through simulations and real experiments on air heater and quadruple tank processes. The aim is to enhance PID tuning efficiency and adaptability in response to changing process dynamics, thereby reducing downtime and improving product quality.

Uploaded by

gajmer72
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 88

www.usn.

no

FMH606 Master's Thesis 2018


M.Sc. Industrial IT and Automation

Automatic Tuning of PID Controllers

Olalekan Olusoji Ige

Faculty of Technology, Natural sciences and Maritime Sciences


Campus Porsgrunn
www.usn.no

Course: FMH606 Master's Thesis, 2018


Title: Automatic Tuning of PID Controllers
Number of pages: 88
Keywords: Air-heater process, Auto-tuning, Limit cycle, PID controllers, Parameter
estimation, Quadruple tank , Relay feedback, Robustness, Stability, System Identification.

Student: Olalekan Olusoji Ige

Supervisor: David Di Ruscio

External partner: None

Availability: Open

Summary:
Proportional Integral and Derivative (PID) controllers are the most frequently used
controllers in the process industry over the years. The performance is a factor of adequate
tuning. The knowledge of the process is critical to the tuning process as well selecting the
right PID form and the tuning algorithm. Since there can be as many as possible PID loop
in an industry, manually performing this task will take a lot of time and cause down time
that can results to poor product quality as well as loss of income. Thus, there is a need for
tuning to be done automatically, and this form the basis of this thesis, automatic tuning of
PID controller.
It’s therefore pertinent to adjudge the right tuning rule as well as selecting the right model
for the process and thereafter if there are any changes in this model, to readjust the
parameters used for the PID algorithms to get the right PID tuning parameter on real time
basis. The standard form of the PID is used in the simulation and the relay feedback
experiment by Åstrom is considered for the parameters adjustment, and the variant of this
method developed by Schei is also investigated and the two methods compared.
Implementation and evaluation of these methods were done with the quadruple tank and
air heater processes. The relay experimentation is an easy process that ensured recursive
parameter calculation based on identified point on the Nyquist plot and this method can
be seamless automated with just a push point from the Operator.

The University College of Southeast Norway takes no responsibility for the results and
conclusions in this student report.
Preface

Preface
This thesis title ‘Automatic Tuning of PID Controller’ is carried out in partial fulfillment of the
requirement for the award of Master of Science degree in Industrial Information Technology
and Automation at the University of Southeast Norway, Porsgrunn Campus.
The task description in appendix A form the basis of the work carried out for the fulfilment of
the thesis objectives. The simulation is performed using MATLAB and Simulink software and
the codes and supporting documentation are described in the appendices.
I will like to express my gratitude to God Almighty for His sufficient grace and favor for the
period of the study. Also, I sincerely appreciate the effort of my supervisor, David Di Ruscio
(Ph.D.) for sharing his knowledge and time in ensuring that the thesis work is successfully
executed. Moreover, the support of my colleagues and lecturers at the department are highly
appreciated.
Finally, I appreciate my wife, children and siblings for their encouragement, contribution and
motivation for the entire period of the study,

Porsgrunn, 15th May 2018.

Olalekan Olusoji Ige

3
Contents

Contents
Preface ..................................................................................................................... 3
Contents ................................................................................................................... 4
1 Introduction ......................................................................................................... 8
1.1 Earlier work ................................................................................................................................ 9
1.2 Aim and Objectives ................................................................................................................... 10
Task Description ........................................................................................................... 10
2 System Identification and Parameter Estimation ................................................... 11
2.1 System Identification ............................................................................................................ 11
Model structure ............................................................................................................. 11
Static and Dynamic Models.......................................................................................... 13
Transient and Frequency Response ........................................................................... 13
Step Response .............................................................................................................. 13
2.2 Parameter Estimation ........................................................................................................... 13
Ordinary Least Squares Estimates, OLS .................................................................... 14
Weighted Least Squares Estimation ........................................................................... 14
Recursive least square estimate (RLS) ....................................................................... 15
Kalman Filter.................................................................................................................. 15
Relay Methods ............................................................................................................... 16
3 PID Controllers Tuning Algorithms........................................................................ 18
3.1 PID Controllers Basic ................................................................................................................. 18
PID Algorithms .............................................................................................................. 19
3.2 PID Controllers Tuning Rule ....................................................................................................... 22
Ziegler-Nichols Open loop method ............................................................................. 22
Ziegler-Nichols’ Ultimate Gain and Period ................................................................. 23
Good Gain method ........................................................................................................ 24
Cohen-Coon Method ..................................................................................................... 25
Relaxed Ziegler and Nichols (R-ZN) ............................................................................ 26
Simple Internal Model Controller (SIMC) .................................................................... 26
Tyreus-Luyben Method ................................................................................................. 27
Relative Time Delay Error Method (RTDE) ................................................................. 27
A Semi-Heuristic Process-Reaction Curve PID Controller Tuning Method ............ 28
Åstrom Relay method ................................................................................................... 28
3.3 Stability Analysis ....................................................................................................................... 29
3.4 Performance Criteria ................................................................................................................. 29
Transient and Frequency Response Analysis ........................................................... 30
The sensitivity indexes ................................................................................................. 32
Stability margins and cross-over frequencies ........................................................... 33
Bode Plot and Bode Stability Criterion ....................................................................... 33
Nyquist Plot and Nyquist Stability Criterion .............................................................. 35
Integrated Absolute Error Index .................................................................................. 35
Total Variance Index ..................................................................................................... 36
4 PID Auto-Tuning Methods ................................................................................... 37
4.1 Ultimate Period and Gain from Relay Experimentation .................................................... 38
Limit cycle Oscillation .................................................................................................. 38
Describing function analysis (DF) ............................................................................... 39

4
Contents
4.2 Åstrom Relay Method ........................................................................................................... 40
4.3 Schei Relay Method .............................................................................................................. 41
4.4 Modification of the relay for noisy process and improved performance........................ 43
Symmetrical and Asymmetrical relay ......................................................................... 45
Relay with Hysteresis ................................................................................................... 45
Relay with Integrator ..................................................................................................... 46
Relay with Filters ........................................................................................................... 46
Saturation relay ............................................................................................................. 47
Relay with preload ........................................................................................................ 48
5 Simulation and experimentation study ................................................................. 49
5.1 The Air Heater Process ........................................................................................................ 49
Ultimate Period and Gain analytically. ........................................................................ 50
Åstrom Relay Experiment on simulated Air heater ................................................... 51
Results from Åstrom relay experimentation on simulated process ........................ 53
Schei Relay Experiment on simulated Air heater ...................................................... 55
Comparing the performance of Åstrom and Schei Relay Experiment on simulated
Air heater ................................................................................................................................. 57
Schei Relay Experiment on Real Air heater ............................................................... 60
5.2 The Quadruple tank Process ............................................................................................... 63
Åstrom relay experiment on simulated quadruple tank ............................................ 65
Schei relay experiment on simulated quadruple tank ............................................... 67
Comparing the performance of Åstrom and Schei Relay Experiment on simulated
quadruple tank ........................................................................................................................ 69
6 Discussion and Result .......................................................................................... 71
7 Conclusions ........................................................................................................ 73
7.1 Further Works ....................................................................................................................... 73
8 References....................................................................................................... 74

5
Abbreviation

Abbreviation
A-H Åstrom, Hang and Wang

As Åstrom without noisy process

Aswn Åstrom with noisy process

DF Describing Function

GM Gain Margin

IAE Integrated Absolute Error

IE Integrated Error

IMC Internal Model Controller

ISA Instrument Society of Automation

LTI Linear Time Invariant

MATLAB MATrix LABoratory

MIMO Multiple Input Multiple Output

MRAS Model Reference Adaptive Scheme

OLS Ordinary Least Squares

PD Proportional and Derivative

PE Persistence Excitation

PI Proportional and Integral

PID Proportional Integral and Derivative

PM Phase Margin

SISO Single Input Single Output

Sc Schei without noisy process

Scwn Schei with noisy process

6
Abbreviation

SIMC Simple Internal Model Controller

SSEP Sum of Prediction Error Squared

STR Self-Tuning Regulator

TITO Three input three output

TV Total Variance

WLS Weighted Least Squares

Z-N Ziegler Nichols

7
Introduction

1 Introduction
Proportional Integral and Derivative (PID) controllers are widely used in virtually all area of
industrial automation and control. The PID controllers has three terms which are the
proportional term P, integral term I and the derivative term D. The P gives a proportional
control to the input signal, I and D terms gives control that is proportional to the integral and
derivative time of the error respectively.
They provide a good response to process control but may not give optimal performance under
some circumstances. Hence there is a need for PID parameters (the proportional gain, integral
and derivative time) readjustment in case of process offset or the dynamics of the process
changing or varying. The process of adjusting the PID parameters is referredred to as tuning
and this can be done manually or automatically. A large industry may have many PID and to
tune these manually will take time and cause down time and thus the need to develop an
adaptive or a controller with an auto tune capability.
Based on the context of the thesis, PID tuning rules discussed in chapter 3 are general PID auto
tuning and will be referred to as PID tuning algorithms (most of which cannot be easily
automated ) while the PID tuning rules discussed in chapter 4 are easily automated and as such
will be referred to as PID auto tuning.
Auto tuning is the process whereby the PID controllers are tuned automatically by the operators
or users. Other terms like adaptive controllers and gain scheduling will be used to mean almost
the same things but with little variations. Adaptive controllers continuously adjust their
parameters to accommodates for changes in process parameters/dynamics or model because of
disturbances which can be external or internal. Gain scheduling is adjusting the parameters of
PID controllers based on non-linearity’s of the process such as changes in operating conditions.
[1].
In some context, adaptive tuning requires the prior knowledge of time scales for determining
suitable sampling interval whereas automatic tuning is specified on demand by the operator
without a prior information about the process dynamic. Mostly both adaptive tuning and auto
tuning means relatively the same things based on the applied algorithm and principles.
In auto tuning, the process is disturbed on demand, whereas adaptive tuning does not involve
operator intervention before changing the PID parameters as demand by the changes in process
dynamics. The parameters of adaptive controllers are uninterruptedly adjusted to cater for a
disturbance in the process. Adaptive controllers are widely used for controller parameters
adjustment on both model and non-model based auto tuning.
Most common auto tuning procedure is using a relay and gain scheduling, and MRAS and STR
are common used schemes for adaptive controllers. In recent years other techniques are been
employed in fine tuning controllers and among them is predictive controllers, expert system,
and pattern recognition.
The choice of the PID auto tuning for the thesis work is based on the relay auto tuner described
by Åstrom and Hågglung in [2]. This is a non-model based auto tuning in which an operator
initiates the auto tuning process and the relay is used to obtained sustained oscillation in other
to capture the critical point for the parameters estimation as obtained by Ziegler and Nichols
method. An extension of this method presented by Schei in [3] will also be explored.
Irrespective of the name or terms employed, the major objectives are designing a controller
that will be able to

8
Introduction

 Handle changes in process dynamic


 Handle disturbance variation
 Gives operator choice of changing the parameters [4]
 Adapt to the process dynamic
The implementation of the adaptive controllers with auto tuning function can be done by [4]
 Define the closed loop response
 Determined the control law with adjustable parameters
 Determined the mechanism for parameters adjustment- on demand, online or offline-
push button, etc.
 Implement the above steps
The choice of adaptive controller types depends on the process dynamics, and the base line is
parameters or model variability. A knowledge of parameter estimation or techniques for
determining the process dynamics is essential for controller tuning. This will be discussed in
chapter 2.

1.1 Earlier work


There has been extensive work on auto tune PID controllers that date back to the era of Ziegler
and Nichols in the 1940s. They presented two famous methods of tuning PID controllers, Z-N
closed and open loop methods. The ultimate period and gain are determined by a step response
in closed or open loop experiment and this information is used to determine the controller
parameters. Rivera et al presented the Internal Model Controller (IMC PID) in 1986 and
Skogestad [5] improved on this as Simple Internal Model Controller (SIMC). These are
characteristically a model-based computation and mostly the available models are not perfect
or there is always a deviation from the derived model and the real plant, thus there is a need
for improved methods. This method has been improved upon by a lot of researchers to include
rules based and adaptive tuning methods. Nishikawa et al used the transient response to
improve on disturbance effect on the model parameters determination.
These aim of these approaches (non-model based/heuristic) is to create a disturbance on the
system to throw the system into an oscillation that will be within the limit of the system
stability. This limit is the point on the Nyquist curve that intersects with the negative real axis
and the point is called the critical point. The critical point is the ultimate gain after the sustained
oscillation and the ultimate period for the oscillation. This is method may pose a danger to
process equipment as the sustained oscillation may be too much, also these are difficult to
perform in real time.
Åstrom [4] defined adaptive controller as a controller that have a mechanism for adjusting the
parameters and describes four types which are gain scheduling, model-reference adaptive
control, self-tuning regulators and dual control. Schei discussed the relay auto tuning by
generating a limit cycle with a relay such that control system oscillates at a frequency that is
essential to decide the critical point of the control system stability [3].
Åstrom et al, [6] employed the use of different relay types, transient, biased and parasitic relay
to refine the original Åstrom experiment. This was successful for the process with oscillatory
dynamics and extended to dead-time compensators and multivariable controllers.
Josefin [7] extended the application of the relay auto tuner to TITO system and employed three
different versions in industrial application. The study further improved the Relay Auto tuning
with Normalized Time Delay and this improved the noise susceptibility of the controller [7].

9
Introduction

Luyben in 1987 introduces the use of relay-feedback to fit a typical transfer function [8] and
Schei in his paper demonstrated auto tuning of PID based on transfer function model with the
use of relay experimentation.
In [9], Finn Haugen demonstrated that the Åstrom relay auto tuning method can also be
archived by turning the PID controller into a relay making the proportion and the integral
constant very high and the derivative part set to zero. And this method can be applied to
processes, like the air heater used for experimentation in this thesis, which does not accept
negative control signal. The results obtained from this is achieved with the anti-windup
function de-activated.
The Ziegler-Nichols approach suffers a deficit in that the system can be thrown out of the
stability limit (the oscillations are produced by gradually increasing the proportional gain in a
closed loop system) but the A-H approaches is safe as the oscillation is bounded within a
bounded limit (control amplitude).
Nyquist, Nichols and Bode plot and charts are essential background in studying system stability
and performance monitoring.

1.2 Aim and Objectives


The main objective of this thesis investigates the various algorithm used for automatic tuning
of PID controllers. The specific objectives of the study are to:
 Perform literature review on recursive parameter estimation for PID auto tuning
 Perform literature review on PID tuning algorithms
 Investigate Åstrom relay feedback experimentation
 Investigate Schei relay feedback experimentation
 Implement Åstrom and Schei relay experimentation on simulated air heater and
quadruple tank
 Execute the relay experimentation on real air heater

Task Description
 Perform a literature research on algorithms for automatic tuning of the PID controller
 Perform a literature research on recursive system identification based methods for PID
controller parameters calculation
 Perform a simulated experiment of one or a few algorithms for automatic tuning of PID
controllers.
 A laboratory experiment of the auto tuning method on quadruple tank process and/or
the air heater

10
System Identification and Parameter Estimation

2 System Identification and Parameter


Estimation
The PID controller parameters is based on the model or the dynamic system parameters.
Therefore, effective use of a PID controller depends on the accuracy of the system model and
ideal system dynamic representation. Identification of plant dynamics and the parameter of PID
controllers can be determined in several ways. The most common method is manually adjusting
the parameters of a system and studying the response. But this is time consuming and mostly
in accurate. Hence the need to perform the parameters adjustment automatically is inevitable.
Since all mathematical models derived from system identification stages differs or may vary
from the physical system, there is a need for parameters estimation and this call for adaptive
control strategies. [10]. Adaptation in this context means calculating the parameter online at
every time step in a recursive manner.
The major steps in system identification are [4]
 Selection of model structure
 Real experiment design
 Parameter Estimation and
 Validation
Many process models can be approximated with a first or second order linear system with a
time delay term as given in equations (3-20) and (3-21) and this will be the basis of the system
identification discussion. The thesis is based on an established model that has been validated
but there is still need for parameters estimation to correct modelling errors and disturbance
influence.1.1
The choice of parameters estimation is a determinant of the model types used. Also, the data
properties must be one that can be excited persistently. It can be shown that a pulse signal is
not a PE signal, a step is a PE of order one, a sinusoid is a PE of order 2, and a periodic signal
of period n is a PE of order n. [4].

2.1 System Identification


System identification is defined as using observed data (input and output) to construct a
mathematical model of a plant. [11]. Since system identification is done automatically in an
adaptive system, selection of model structure, parameterization and recursive computation is
essential keys to successful implementation of such system. Some useful definition regarding
system identification will be discussed in the following section.

Model structure
The model structure is an important part of system identification and paramount for correct
parameter estimation. Basically, the following types of model can be identified:
 Linear / nonlinear state space model which can be in the continuous or discrete form
 Input/output (polynomial) models which can be linear, nonlinear, continuous or discrete
 Transfer function model
The above listed types can be classified as shown in the following section.

11
System Identification and Parameter Estimation

2.1.1.1 White Box model


This is a model based on the first principle like Newton’s law and always results to differential
equations. The ordinary differential equation of the air heater is given by equation (5-1)

2.1.1.2 Black Box model


The model structure and its parameter is completely unknown and can be estimated with only
input and output data. This is also known as a parametric model and described the system in
terms of a differential equation and transfer functions.
The following types of black box can be identified: [12].
 Transfer function model
The differential equation can be converted to a transfer function model as shown in section 5.1
for the air heater and the transfer function given by equation (5-7).
 Polynomial models [11]
The following types of polynomial models can be identified:
o Autoregressive, AR model: this is represented by equation (2-1) where the term
A(q) represent the Auto regressive part.
( ) = (2-1)

o Autoregressive eXogenous, ARX model: this is shown in equation (2-2), where


the term B(q) represent the eXogenous (extra input) part
( ) = ( ) + (2-2)

o Autoregressive Moving Average, ARMA model: this represent the moving


average of the white noise and the term C (q) in equation (2-3)is the Moving
Average part.
( ) = ( ) (2-3)

o Autoregressive Moving-Average with eXogenous variable, ARMAX Model is


as shown in equation (2-4).
( ) = ( ) + ( ) (2-4)

o Output-Error Model: the auto regressive and the eXogenous part are the same
as shown in equation (2-5)
( ) = ( ) + ( ) (2-5)

o Box-Jenkins Model: the model structure separates the input and noise path as
shown in equation (2-6).
( ) ( ) = ( ) ( ) + ( ) ( ) (2-6)

 State Space Model: The state space model is given in general forms in (2-7)
= + + (2-7)

12
System Identification and Parameter Estimation

= + +

2.1.1.3 Grey Box model


The model structure is partially known from the first principle, the rest is reconstructed from
data.

Static and Dynamic Models


The static model is determined by the information in the process characteristic curve that gives
the steady state relation between input and output signal. This is a starting point in the model
identification and it’s mostly done with the open loop experimentation of the process. The
dynamic models, on the other hand, give the input and output relationship during transients
(closed loop experimentation) and can only be applied to linear time-invariant (LTI) systems.

Transient and Frequency Response


The response from signals like step, pulse and impulse are terms transient response while those
from signal line sinusoid are term frequency response. The Z-N open and closed loop
experiments are transient and frequency responses respectively.

Step Response
In an open loop system, a step input will be applied to the system and the response recorded.
But in a closed loop system, the controller will be in manual mode and the control variable
changed rapidly by increasing or decreasing, (this is done after the system is at rest). The
process variable is recorded and scaled by the change in control variable. In both cases, it’s
advisable to repeat the process for different step changes and at different operating conditions
to capture a wider range of the process dynamics. The a one parameter model
Another model structure is a two-parameter model for which the process gains and the average
residence time (capture the time behavior) can be the parameter of interest. For a better
approximation of the model, the number of parameters can be increased to three to give a
Three-parameter model. This is characterized by three parameters as follow:
 the gain K
 the time constant, T
 the dead time or time delay
Other methods for a more precise model are four parameter and methods of moment as
discussed in [1]. The step response is employed for the air heater model (which is a three
parameters model) validation and the details is contained in section (3-2).

2.2 Parameter Estimation


Parameters estimation is an integral part of system identification and essential to auto tuning
of PID controllers. The parameters of process change dynamically during adaptive control
(auto tuning), so there is a need for an estimation method that updates the parameters
recursively. There is need to validate this automatic estimation. The choice of input signals
plays a major role in parameter estimation and requires some knowledge of the process.

13
System Identification and Parameter Estimation

In offline estimation, already processed input/output data are used to estimate the model
parameters whereas in online parameter estimation parameters of a model are evaluated with
both past and current data that are made available as each time instant during the operation of
the process. It involves the use of recursive algorithms as discussed in section 2.2.3 and 2.2.4.
Recursive computation can be done in the in the least square sense (minimizing the sum of
square errors) for the method for system identification and parameter estimation as well. The
following section will explain the least squares method and also the recursive computation of
some methods.

Ordinary Least Squares Estimates, OLS


The principle of least square was formulated in 1809 by Karl Gauss and used to determine the
orbits of planet and asteroids. The same principle can be extended to process data in which the
unknown parameters of the process model can be determined from observing the input and the
output data. The objective is to minimize the sum of the squares of errors (the difference
between the observed and computed values), multiply by a number that measures the degree
of precision. [4]. It’s essential to choose the order of the polynomial to avoid under or over
fitting.
Let Y is a set of observed variables, X a set of regressors variables and B a vector or matrix of
unknown parameters as given in equation (2-8).The objective function, J becomes minimizing
the error, E as shown in equation (2-9). And minimizing equation (2-9) with respect to the
regressor variable will give equation (2-10).
= + ; = − (2-8)

= =( − ) ( − ) (2-9)

=− + =0 (2-10)

The ordinary least square estimate of B is given in equation (2-11) by solving equation (2-10)
=( ) (2-11)

Weighted Least Squares Estimation


In section 2.2.1, it’s assumed that all the measured parameters have an equal amount of
confidence, but in reality, this is not always the case. An example may be the feedback sensors
in a control loop, some sensors may be reliable than others and thus the need to put a varying
degree of confidence in each sensor. The degree of confidence is term weight function and
instead of minimizing the sum of squares of the errors, the weighted sum of error squared is
minimized. Therefore, the objective function is as shown in equation (2-12) and minimizing
this will gives equation (2-13). The weighted least square estimate of B is given in equation
(2-14) by solving equation (2-13).

= =( − ) ( − ) (2-12)

=− + =0 (2-13)

14
System Identification and Parameter Estimation

=( ) (2-14)

This requires that the measurement noise, R be a nonsingular matrix and invertible, which mean
that each of the measurement y, must be noisy. [13].

Recursive least square estimate (RLS)1


In general, for online parameters estimation, there is need to measure continuously and update
the estimate of the parameters with each measurement. However, this can be a problem for a
large data over a large computational period. Thus, instead of performing the least squared
estimate from start until the time instant, again and again, the computation can be made
recursively. In section 2.2.1 and 2.2.2, if the parameters are time varying. Given P as the
estimator error covariance as given in equation (2-15), the least square estimates of B, as a
function of time is given in equation (2-16)

( )= ( ) ( )= () ()

(2-15)
= () () + ( ) ( )

= ( − 1) + ( ) ( )

( ) = ( − 1) + ( ) ( )− ( ) ( − 1)

( ) = ( ) ( ) = ( − 1) ( ) + ( ) ( − 1) ( )
(2-16)
( ) = ( − 1) − ( − 1) ( ) + ( ) ( − 1) ( )

= − ( ) ( ) ( − 1)

Kalman Filter
The Kalman filter is a great tool for analyzing and solving estimation problems. The linear
standard Kalman filter is used for linear process model whereas Extended Kalman Filter,
Unscented Kalman Filter, etc. are used for the non-linear process model. Its work by
propagating the covariance and mean of the state through time. The Kalman filter for states
estimate is optimal several different senses. The following steps are involving in Kalman filter
algorithm:
 A mathematical model of the dynamic system is derived as shown in equation (2-17)
= + + (2-17)

1
X(t) and X(t-1) mean X at present time instant and X at previous time instant respectively. The notation Xt and
Xt-1 also mean the same things as present and previous time instant.

15
System Identification and Parameter Estimation

= + + ,

= [ ],

= [ ]

 Describe the propagation of the state mean and covariance of the system with time
 Discretization of the state mean and covariance as states above
 Update of the discrete form at every time step [13]
W and V are covariance’s matrices which are used to tune the Kalman filter. The discrete time
filter for a linear process can be implemented with the following steps [14]
 Initialize the Kalman filter for time k=0, using the initial state or known state of the
system as given in equation (2-18)
= = ( )
(2-18)
= = [( − )( − ) ]

 Compute the Kalman filter gain ( ) as shown in (2-19)

=A +
(2-19)
= ( + )

 Compute the predictor, a priori state and output estimate as given in equation (2-20)
= +
(2-20)
= +

 Compute the corrector, a posterior state estimate using the output measurement as
given in equation (2-21)
= + ( − ) (2-21)

 Update the covariance of the state as given in equation (2-22)

= − − + (2-22)

 Repeat the step all over again for the next time interval, k+1.
If the Kalman filter gain is assumed to be steady then the algorithm reduces to a single equation
as shown in equation (2-23).
= + + ( − + ) (2-23)

Relay Methods
The relay experimentation as discussed in section 4.1 can be employed to determined critical
point for parameter estimates for PID auto tuning. Different configuration and modification
will give different points on the Nyquist curve which will give the point of interest to identify

16
System Identification and Parameter Estimation

the gain and the time delay parameter in equation (3-20) and (3-21). This will only give an
estimate and only valid around the ultimate frequency for an ideal relay and at different
frequencies as given by the modification of the relay during the experimentation. The
experimentation will recursively calculate the critical parameters as discussed in in section 4.

17
PID Controllers Tuning Algorithms

3 PID Controllers Tuning Algorithms


PID controllers are widely used in the industry and still gaining acceptance irrespective of the
new method of automatic control based on Model predictive control and rule based control.
PID controllers are used in the industries as a standalone controller or part of direct digital
control package or at the lower level of a distributed control system. The PID controllers require
adequate tuning of the controller parameters (proportional gain, integral and derivative time)
for optimum performance. This has been a lot of challenges to the operators over the years and
new a lot of research that has led to successful algorithms have been done over the year.
The design method that results to the algorithm used differ based on the dynamics of the
process. A proportional and Integral (PI) controller is mostly described by two parameters and
a PID by three or four parameters. The objective of the tuning process is to derive these
parameters that will give the optimal performance of the controller.
The foremost tuning rule starts from Ziegler-Nichols process reaction curve and the ultimate
gain methods. Thereafter, they have been a lot of researches that have resulted in better tuning
rules for PID controllers. Section 3.2 will discuss few of these rules among which are, Simple
internal model, Tyres-Luyben, Cohen-Coon, Relaxed Ziegler-Nichols, Good gain and Relative
time delay error methods. Rehearses are ongoing on developing new rules on the subject matter
as shown in the recent paper [15].
The performance of the PID controllers has to be measured based on some benchmarks. The
different tuning rules offer some advantages and also disadvantages over the other. This can be
subjective to the yard stick of performance indicator. This will be discussed in section 3.3,
stability analysis and section 3.4, performance criteria.
The thesis is based on an Air heater process section 1.2 and this is a first order plus time delay
process, therefore only PI was employed and the standard / ISA algorithm discussed in section
3.1.1.1 was used.

3.1 PID Controllers Basic


In the process and all other industries, the major aim is to keep track of the output as well as
maintain the process parameters as steady state or desired value. In other to achieve this aim, a
feedback/feedforward control loop is employed as shown in Figure 3-1. Whereas feed-forward
control gives a perfect control in case of an exact model, in real life experiences there will be
an unknown disturbance, model imperfection and this call for feedback control. PID controllers
provide such a feedback which eliminate steady state error and future disturbance through the
integral and derivative action respectively. [1]. The basic principle of a feedback system as
stated in [1] is that the controller decreases the control effort when the process variable
increases and increases the control effort otherwise. This is for a negative feedback system as
the manipulated variable (the control effort) moves in the opposite direction to the process
variable. For a positive feedback system, the reverse is the case. For a perfect control of both
feedback and feed-forward control, the controllers’ parameters must be tuned adequately.
PID’s controller has three terms as defined as follows:
 The proportional term which gives proportional control
 The integral term gives a control action that is proportional to the time integral of the
error (set point minus the output) and keeps this error minimum (zero) at steady state.
 The derivative term gives a control action proportional to the time derivative of the
error and keeps track of future errors.

18
PID Controllers Tuning Algorithms

Ref Σ e Controller u Process Σ y

-1

Figure 3-1: Implementation of feedback control in a closed loop.

PID Algorithms
The major algorithms used for PID design are in three forms, which are standard, parallel and
classical. These algorithms contain several variation or modification. The major difference
between these three algorithms is the way the controller gain is specified. The parallel form has
a proportional gain that affects only the proportional part while the other two forms have a
controller gain that affects all the three terms. [16]
For better performance, the following are taking into consideration [4]
 The derivative part is mostly applied to the process output
 Proportional part act only on a fraction of the reference part
 The integral action is kept within the saturation action of the control variables (anti
windup)
 Bump less or smooth transfer from manual to automatic (or when there are parameter
changes)

3.1.1.1 Standard or Non-interactive form of PID Controller


The standard form is also called the standard or ISA algorithm. In some text, it’s called the
expanded form and it’s the form used in MATLAB [17] and in [1]. As shown in equation (3-1)
and the equivalent transfer function form in equation (3-2), the controller parameters of interest
are the proportional gain Kp, integral time Ti, and the derivative time Td. The term ‘e’ is the
control error, which is the difference between the set point and the process output variable. It’s
thus the sum of the terms vis: the proportional, the integral and the derivative terms. The
application of the respective terms is as discussed in section 3.1.1. The algorithm internal
structure is as shown in Figure 3-2. The standard PID can be represented in time and frequency
domain as given in equations (3-1) and (3-2) respectively.
1
( )= + . + (3-1)

( ) 1
ℎ ( )= = 1+ + (3-2)
( )

Where Kp is the proportional constant, Ti is the integral time and Td is the derivative time as
shown in Figure 3-2. The output of the controller is ( ) and the input e(t) in time domain
respectively. And the input and output are u(s) and e(s) in frequency domain respectively. The
Laplace transfer function of the controller is given as ℎ ( ).

19
PID Controllers Tuning Algorithms

Proportional
Set point /Reference +- Error + Process

Integral
1
+
Derivative

Figure 3-2: The ideal or ISA PID algorithm. It’s also called the non-interactive, expanded. In
this form the proportional gain affects all the three parts.

3.1.1.2 Parallel / Ideal form of PID Controller


The parallel algorithm is simple to understand, but difficult to tune by the traditional tuning
method like Z-N and Cohen-Coon. The controller has a gain factor that affect only the
proportional part as oppose to other algorithm that has a gain that affect three terms. However,
this can be converted to an equivalent standard form for which the parameter values as given
in equation (3-5)(3-7).

( )= × + . + (3-3)

ℎ ( )= + + (3-4)

Where Kpp is the proportional constant, i is the integral time and is the derivative time for
the parallel form. The superscript ‘p’ is used to indicate the parallel form of the PID.

= ; = ; = (3-5)

Proportional
Set point /Reference +- Error
+ Process
+
Integral

+
Derivative

Figure 3-3: The Parallel form of PID algorithm, the gain affects only the proportional part as
compared to the standard form where the proportional gain is affect both the integral and
derivative parts.

20
PID Controllers Tuning Algorithms

3.1.1.3 Series/Classical / Interacting form of PID Controller


This is also called the series, cascade, real or interactive PID controller, in this form the PI and
the PD element operated in series. The controller’s parameters interact with each other. The
integral time does influence the derivative terms and verse visa. The differential and the transfer
function equation of the controller is given in equation (3-6) and (3-7) respectively. Figure 3-4
shows the internal structure of the controllers. The interacting and non-interacting form are
the same for a P, PI or PD only controllers, they only differ when the three terms are used at
the same time. If the derivative time is much smaller than the integral part, the two forms are
equivalent. The choice of the forms to use depends on the manufacture and the operator needs
to understand this for better tuning as to ensure optimal performance.
1
( )= + . × 1+ (3-6)

1
ℎ ( )= 1+ × [1 + ] (3-7)

Where Kc is the proportional constant, is the integral time and is the derivative time.
The superscript ‘s’ is used to indicate the series form of the PID.
Proportional
Set point /Reference +- Error + + Process

Integral
1

Derivative

Figure 3-4: Series or interacting PID form. It’s also called the cascade real form. The PID parts
interact with each other, the integral part interacts with the derivative part and vice versa.
The series or cascade form of equation (3-7) is equivalent to the ideal form of equation (3-2)
where the relationship between the controller parameters is as given in equation (3-8).
+
= ; = + ; = (3-8)
+

Given the ideal form of the controllers’ parameters their equivalent series parameters can be
determined if only if the condition given in equation (3-9) holds. [18]
≥4 (3-9)

Then the following conversion as given in equation (3-10) is established

= 1 + √ 1− ; = 1 + √ 1− ; (3-10)

21
PID Controllers Tuning Algorithms

4
= 1 + √ 1−
2

The derivative time is often much smaller that the integral time and the two forms are then
equivalent as shown in equation (3-11) .

1+ + ≅ 1+ × [1 + ] (3-11)

3.2 PID Controllers Tuning Rule


Tuning is the process of finding the optimal gains for the P, I and D parts to get an acceptable
response from the control system. A good design should enable parameter changes to enable
improvement on the system performance. The acceptable response is a function of performance
criterial as discussed in 3.4. The tuning process can be heuristic (based on experimentation and
simulation) and non –heuristic (analytical approach). Christer Dalen proposed a semi heuristic
approach in [15]. Other methods like optimization method and pole placement do exist but
will not be discussed in this report. Most of the heuristic tuning rules stem from the ultimate
gain and period, and process reaction curve as defined by Ziegler and Nichols method (ZN) in
the 1940’s. The simplest tuning rules based on model reduction by half rule will be discussed
in section 3.2.6 under Simple Internal Model Controller (SIMC). This method is simple and is
based on approximate model of first and second order with time delay or inverse response [18].

Ziegler-Nichols Open loop method


The Z-N tuning method is also known as the process reaction curve and was developed by
Ziegler and Nichols in 1942. This method is based on the characteristic of the open loop step
response of the process as shown in Figure 3-5. This is equivalent to modelling a process by
an integrator and a dead time as given in equation (3-12). This method is aggressive and
oscillatory (poor stability) but has good disturbance response for integrating process as shown
in [9]. With a step response experiment a first order with time delay can be approximated by
equation (3-12).

ℎ ( )= (3-12)

Where 'a and L are derived from step response as shown in Figure 3-5 (a) [4]. The tangent at
the point of maximum slope of the step response is extended to both the vertical and horizontal
axes to gives a and L respectively. The relationship between the maximum slope R, dead time
L, applied step change U (which is usually unity) and a is given by equation (3-13).

22
PID Controllers Tuning Algorithms

Figure 3-5: Process reaction curve: The left figure (A) shows L, the dead time, and R, the
reaction rate, which is the max rate of change of temp with respect to time [9]. The right
figure (B) shows the step response of the air heater.

= ; = ; = − (3-13)

Table 3-1 gives the PID setting for Z-N open loop method where a is equivalent to LR/U as
given in Figure 3-5 where U is the applied step change, L is the dead time and R is the maximum
rate of change of the process output.
Table 3-1: Z-N open loop method.

Controller Type Kp Ti Td

P Controller 1/a

PI Controller 0.9/a 3L

PID Controller 1.2/a 2L L/2

Ziegler-Nichols’ Ultimate Gain and Period


This method is also called the frequency response method and it is based on step response
experiment on an established closed loop of the process. The PID controller is set to a P terms
only controller by setting the integral time large (infinity) and the derivative term to zero. The
P-term is increased until a sustained oscillation of the process is obtained without the control
signal reaching is lower and upper limit. The ultimate gain and period are given by Bode
stability criterion that gives open loop stability at the gain/phase cross over frequency. This is
the point at which the Nyquist curve of the system intersects the negative real axis.
The value of the proportional gain that cause the sustained oscillation is the ultimate gain Kcu
and time for the sustained oscillation is labeled the ultimate period Pu. The step response method
in section 3.2.1 often gives higher gain Kp than the frequency response method. [1]. The PID
parameters are calculated as presented in Table 3-2.

23
PID Controllers Tuning Algorithms

Table 3-2: Z-N Ultimate gain and Period method.

Controller Type Kp Ti Td

P Controller 0.5Ku

PI Controller 0.4Ku 0.8 Pu

PID Controller 0.6Ku 0.5 Pu 0.125 Pu

Good Gain method


Good Gain method is an alternative to Ziegler-Nichols closed loop method discussed in 3.2.2.
It was proposed by F. Haugen in 2010 [19] and presented in detail in his paper Good Gain
method for simple experimental tuning of PI controllers. [20]. As against Z-N closed method,
the good gain reduced the process upset during the tuning as it does not bring the process to
marginal stability during tuning. It’s also gives more stable and robust controllers as compare
to Z-N. [20]. It’s ensure good stability at reasonable response time. The procedure is as follows:
 Set the controller to manual mode and brings the system to near set point by controlling
the process manual.
 In automatic control, disable the Integral and the derivative part of the controller and
put it only on P-mode starting with small value of Kp between 0 and 1
 Apply small step changes to the process with (as not to bring the control signal to
saturation as this point will not give a good results),
 Increase the Kp value until there is significant overshoot and a small trace of undershoot
 The value of Kp in the step above that cause the overshoot is the good gain, Kpg of the
controller and the time interval between the overshoot and undershoot is called the Tout

Figure 3-6: The plot showing the reading of the gain that cause first significant overshoot and
Tout which is the time between the overshoot and undershoot. [20]. The controller is set in P
only mode and the proportional gain increased to achieve this.

24
PID Controllers Tuning Algorithms

The controller parameter can be found in relation to Good Gain method as given in equation
(3-14).
= 0.5 ; = 0.8 ; ; = 0.125 (3-14)

Where Tout and Kpg are the time interval between the overshoot and undershoot, and the value
of Kp that cause the overshoot as shown in Figure 3-6.
However, the method is not suitable for a process with double integrator, an integrator only
process and time constant without time delay process. [20]

Cohen-Coon Method
Like Z-N method, is based on the loop response of the process as shown in Figure 3-7 . A step
change is applied after the process has reached a steady state under manual mode, the time
constant τ and delay td are evaluated as shown in Figure 3-7 [21]. The tuning formula is
presented in table xxx. The relationship between z, k, B A, is given in equation (3-15).

= ; = (3-15)

Figure 3-7: Process reaction curve for the Cohen-Coon method showing the dead time and
time constant.
Table 3-3: Cohen-Coon method

Controller Type Kp Ti Td

P Controller 1
1+
. 3

PI Controller 1 30 + 3.
0.9 +
. 12 9 + 20.

PID Controller 1 32 + 6. 4
(1.33 + 0.25 )
. 13 + 8. 11 + 2.

25
PID Controllers Tuning Algorithms

Relaxed Ziegler and Nichols (R-ZN)


The R-ZN is an improvement on both Z-N and SIMC tuning rules and was proposed by Finn
Haugen and Bernt Lie in [22]. It’s modified Z-N closed loop tuning formula based on SIMC
tuning formula for an integrator plus time delay process. The parameter setting is as given in
equation (3-16) and with a more relaxed (enhanced relaxer) as given in equation (3-17). The
parameter Er is a relaxation parameter chosen by the user and is always greater than or equal to
unity. Equation (3-17) and (3-14) are equivalent when Er is equal to 1. The relaxation parameter
affects the gain and the integral time in inverse proportion such that an increase in the
proportional gain will result to reduce integral time giving a good tradeoff between disturbance
response and response time respectively.
= 0.320Ku; = Pu (3-16)

2 1+E
= Ku; = Pu (3-17)
(1 + E ) 2

Simple Internal Model Controller (SIMC)


The SIMC method which is also called the Skogestad method stem from the Internal Model
Control tuning rules (by Rivera et al.1986). The SIMC like the IMC is a model based tuning
method where the controller parameters are expressed as a function of the process model
parameters. The procedure involves the derivation of first- or second order plus delay model
and using this to derive controller settings. The controller setting gives a PI setting if the starting
model is a first order and a PID setting if it’s a second order model. [5]
The method applies model reduction by half rule. The rule stated that any process with nth
order can be approximated by a first or second order system with time delay. The first order
plus time delay is equivalent to an integrator plus delay process as shown in equation (3-19),
for a large time constant. The second order model with time delay, equation (3-21) is equivalent
to first order with time delay equation (3-20) if T2 is mush lesser than T1 or equal to zero.

ℎ ( )= (3-18)

ℎ ( )= , = for a large (3-19)

1−
ℎ ( )= = (3-20)
1+ 1+

1−
ℎ ( )= = (3-21)
(1 + )(1 + ) (1 + )(1 + )

Generally, if the model does not have a dominant second order dynamic, then it’s can be
approximated with a first order model as given in equation (3-20). Also, a first order time delay
system with a dominant time constant can be approximated with an integrator plus time delay
model of equation (3-18). However, a system with dominant second order dynamics can only
be approximate with second order model as given in equation (3-21). [18]. Given an nth order
system as given in equation (3-22) this can be reduced to the form of equation (3-20) or (3-21)
by setting the time constant and time delay as given in equation (3-23) and (3-24) respectively.

26
PID Controllers Tuning Algorithms

1−
ℎ ( )= (3-22)
(1 + )(1 + ) … … … (1 + )

:= + ; := + …+ (3-23)

:= ; := + ; := + …+ (3-24)

is the time delay and 1 − is the time delay approximation, T1, T2 …. Tn are time constants.
The SIMC PID controller setting for a PID2 is given by equation.

= ( )
; = [ , ( + )] ; = (3-25)

Where the respective terms in equation (3-25) are as defined in section 3.1.1.13 and TC is a user
specified time constant for set-point response. In the original IMC setting the integral time is
set to the dominant time constant, and in SIMC a smaller integral time was suggested to
improve on the disturbance response. The parameter c, determined the value of the integral
time and a value of 4 was suggested by Skogestad. A more conservative value for the parameter
c is suggested in other variant of this method for better disturbance response performance.

Tyreus-Luyben Method
The Tyreus-Luyben method was proposed by Bjorn Tyreus and William Luyben in 1992. [23].
This method provides an improvement on IMC by using classical frequency response analysis.
This method optimally selects a tradeoff between the integral time and proportional gain of a
PI controller. The tradeoff is based on the fact, that there is a minimum reset time for the
integrator time below which reasonable closed loop damping confidents cannot be achieved
and there must be an optimum controller gain for this to occur. The method is similar to Z-N
closed loop method and the experimentation steps are the same for finding the ultimate gain
and period. The setting for PI and PID controller are shown in Table 3-4.
Table 3-4: Tyreus-Luyben method.

Controller Type Kp Ti Td

PI Ku/3.2 2.2Pu

PID Ku/3.2 2.2Pu Pu/6.3

Relative Time Delay Error Method (RTDE)


An important and crucial process model is an integrator plus time delay process, this type of
process is common in industries. A first order plus time delay system can also be approximated
with an integrator plus time delay process as shown in equation (3-19) if the time constant is
much larger than the delay (a lag dominant process). An example is the temperature control
system for which the Air Heater laboratory process described in section 5.1 is a typical of this

2
A first order approximation will result in a PI controller while a second order will result in a PID controller.
3
The standard or Idea PID algorithms is used.

27
PID Controllers Tuning Algorithms

process. Therefore, it is necessary to examine a typical tuning rule for these processes. David
[24] proposed the RTDE method that gives an improvement on SIMC discussed in section
3.2.6 for time lag dominant systems.
The PI parameters are chosen in such a way as to ensure a maximum delay error, for
stability margin.
̅
= ; ̅= ; = ( + 1); =( )
;
(3-26)
̅
= ; =

The PI parameter are given in term of time delay error ratio parameter
, ℎ ̅, which is equal to 3.28 for the original ZN method [24]
and the integrator gain velocity k’ as shown in equation (3-27).
̅
= = (
; and
)
= = ( + 1) (3-27)

This method was extended in [25] to double integrating plus time delay system where a PD
and PID controller was designed for such a system based on relative time delay error. Consider
a PI controller with an integrating plus time delay system will have a loop transfer function as
given in equation (3-28) also a PD controller for a double integrating plus time delay system
will have a loop transfer function as given in equation (3-29)

ℎ = (1 + ) (3-28)

′ (3-29)
ℎ = (1 + ) ; =

Comparing equations (3-27), (3-28) and (3-29) will give a PD controller tuning formula as
given in equation (3-30).

= ; = (3-30)

A Semi-Heuristic Process-Reaction Curve PID Controller Tuning Method


A method that is based on both heuristic and analytical method is proposed by David and Dalen
in [15]. This method is based on both the Z-N open loop method and the RTDE method. The
open loop reaction curve shown in Figure 3-5 is used to derive the RTDE parameters as given
in equation (3-27).

Åstrom Relay method


Åstrom modified the transient response experimentation with a relay in a feedback loop with
the process. The major aim of this method is to be able to automate the Z-N method in other to
capture the ultimate gain and period of the process. Detail of the process are given in chapter
4.

28
PID Controllers Tuning Algorithms

3.3 Stability Analysis


To understand the basis of PID tuning and for effective use of the tuning rule, the principle of
stability in the control theory is important. Given a linear continues time system as given in
equation (3-31), the system stability is defined given the following conditions for the system
matrix A [18]
 The real of the eigenvalues are negatives which means they are in the left half of the
complex plane, then the system is said to be stable.
 The system is marginally stable if one or some of the eigenvalues lies on the imaginary
axis
 A system with an integrator(s) will have one or more of its eigenvalues located at zeros
 An unstable system will have one or more of its eigenvalues located at the right half
plane
For a linear discrete time, system, the following conditions holds
1. The system is stable if the eigenvalues of the system matrix A is located inside the unit
circle in the complex plane.
2. An integrator(s) exist in the system if one or more of the eigenvalues have magnitude
of one.
= + :
(3-31)
=

In frequency domain or transfer function representation of the system as given in equation


(3-32), the above condition also holds if the poles of the transfer function satisfy the above
listed conditions.
ℎ ( )= ( − ) (3-32)

In equation (3-32) the s is the Laplace operator A, B and C as given in equation (3-31)
The condition for stability can be study with different tools like Nyquist stability criterion,
Nichols plot, Bode Plot, finding the gain margin and phase margin.

3.4 Performance Criteria


The PID tuning are based on experimentation on either the model or the real system. There is
possibility of uncertainty in the model, external disturbance or process dynamic and thus the
PID tuning parameters does not guarantee a time invariant capability for the system. Based on
this problem, performance and robustness criterial are introduced to provide a benchmark for
the tuning process in other to get a PID with stable performance over a wide range of system
uncertainties.
The performance indication is set to ensure that the values of the controller parameters satisfies
the underline objectives of a robust and stable system. A good controller will ensure that the
system performance is within acceptable limits, to give the desired closed loop response and
provide a good robustness to model uncertainty and noise. In [9] three major measures used to
compare the performance of tuning methods are:
 Set point tracking and disturbance response

29
PID Controllers Tuning Algorithms

 Robustness against parameter changes in the model, considered as model imperfection


or model variance from the real one.
 The simplicity and fastness of the tuning procedure, which is relative as this, depend
on the individual operators’ skills and familiarity with the controller.

Transient and Frequency Response Analysis


The closed and open loop frequency response measures of a system can be used to measures
the robustness of the system under consideration.
 Step Response
Open and closed loop can be used can be used to judge the criticality of process
variation and the need of a controller. For a process as given by equation (3-33), with
‘a’ having three different values as given in Figure 3-8 and Figure 3-9 [4], the values
of the disturbance can shift the system from stable to non-stable margin. Therefore, it
is essential to design a controller to maintain the system stability at all times irrespective
of varying disturbance. Figure shows that for the system at a= 0.01, the system is
approach stability whereas for the other cases the system is unstable.(3-22)
1
( )= (3-33)
( + 1)( + )
Step response for open loop
500
a=0

450 a=0.01
a=-0.01
400

350

300

250

200

150

100

50

0
0 50 100 150 200 250 300 350 400 450 500
Time (seconds)

Figure 3-8: Open loop step response for the system in equation (3-33)

30
PID Controllers Tuning Algorithms

Step response for closed loop


2

a=0
1.8
a=0.01
a= -0.01
1.6

1.4

1.2

0.8

0.6

0.4

0.2

0
0 2 4 6 8 10 12
Time (seconds)

Figure 3-9: Closed loop step response for the system in equation (3-33)
The performance of the control system may be analyzing from the step response of the system
as shown Figure 3-10, with the following criteria as define in [1], [26].
 The time for the system to rise from 10% to 90 % of its steady state value as shown in
Figure 3-10.
 The overshoot Os is the ratio of the first peak minus the steady value, and the steady
state value.
 Steady state error is the value of the control error at steady state
 Settling time is the time for the response to reach a specified percentage of the steady
value, usually within 2% of the input step.
 Decay ratio is the ratio between two consecutive peaks for a step response
 Time to peak which is the time the step response reaches its peak value

31
PID Controllers Tuning Algorithms

Figure 3-10: Closed loop step response showing performance indexes [26].

The sensitivity indexes


Robustness to process variation and measurement noise can be capture with the sensitivity
function. The sensitivity index and complementary sensitivity index gives an indication of the
sensitivity of the closed loop system to disturbances. As discussed in section 3.4.1 the
responses of a system can be improved by providing a feedback as in a closed loop, however
this may not provide an optimal result and the performance of the loop can be measures with
sensitivity index as follows:
 Sensitivity Index – the sensitivity function can be defined as shown in equation (3-34)
and this should be small at low frequency for robust design.
1
( )= (3-34)
1+ℎ ( )

 Complementary Sensitivity Index - the complementary function is given by equation


(3-35) and this provides information about the set point tracking of the controller and
should be as closed to one as possible. ℎ ( ) is the open loop transfer function of the
system.
ℎ ( )
( )= = 1− ( ) (3-35)
1+ℎ ( )

 Maximum Sensitivity Index – the maximum sensitivity function can be defined as


shown in equation (3-34) as the maximum of the sensitivity index and determined the
robustness of the controller
( )= | ( )| (3-36)

32
PID Controllers Tuning Algorithms

Stability margins and cross-over frequencies


The following four frequency domain specification are importance tools in analyzing the
performance and robustness of the control system closed loop dynamic. [17]
 The phase crossover frequency,
This is the frequency at which there is a phase shift of - . This is given by equation (3-37).
∠ℎ ( )=− (3-37)

 The Gain Margin (GM)


The gain margin is the system gain change that will results in a marginally stable system at
phase crossover frequency. This shown in equation (3-38).
1
= (3-38)
|ℎ ( )|

 The gain crossover frequency,


This is the frequency at which the system gain is unity. This shown in equation (3-39).
|ℎ ( )| = 1 (3-39)

 The Phase Margin (PM)


This is the amount of phase shift that can be tolerated before the system will become unstable
as shown in equation (3-40).
= ∠ℎ ( ) + (3-40)

 Maximum time delay error ratio


The phase margin is an indication of the amount of delay that can be accommodated before the
system will become unstable. The maximum time delay ratio is also a measure of the
performance of the system as given in equation (3-41)

= = (3-41)

The rule of thumb is that a well tune controller should have GM between 1.7 and 4.0 and PM
range of 30o to 45o. [17]

Bode Plot and Bode Stability Criterion


The plot can be used to display the frequency response characteristic of a transfer function
model of a process. The plot is generated by plotting the magnitude and phase as a function of
the frequencies on separate plane. From the plot stability margins and cross over frequencies
as described in section 3.4.3 can be obtained.
The Bode stability criterion stem from the stability conditions as given in section 3.3 that a
system is stable if and only if all roots of the characteristic equation lie to the left of the
imaginary axis in the complex plane with an exception of a single pole at the origin and that
there is only single phase and gain cross over frequencies, then the closed loop system is stable
if the open loop gain at the cross over frequency is less than one otherwise its unstable. [17].

33
PID Controllers Tuning Algorithms

The bode plot from the air heater process is shown in Figure 3-11.
The following relation also can be obtain from the Bode plot:
 A system is stable if the phase cross over frequency is greater than the gain cross over
frequency. Also if both gain and phase margin are positive then the system is stable.
 A system is said to be marginally stable if both the gain and phase margins are zero, or
if the phase and the gain cross over frequency are equal.
 A system is unstable if phase cross over frequency is less than gain cross over frequency
or if either one/both of the margin is negative.

Table 3-5 gives a summary of the performance indication that can be capture from the
frequencies response analysis.
Table 3-5: Frequency and stability relationship

Stable Marginally Stable Unstable

Poles All negative poles One or more poles are All positive poles
zeros

Frequency margin < = >

Gain margins | ( )| < 1 | ( )| = 1 | ( )| > 1

Figure 3-11: Bode Plot of the air heater (using bode function in MATLAB)

34
PID Controllers Tuning Algorithms

Nyquist Plot and Nyquist Stability Criterion


If the system has more than one phase and gain cross over frequencies (i.e. the plot crosses the
-180 degrees more than once) or the open loop is unstable then Bode cannot used to analysis
the system stability. The Nyquist plot can handle such a situation and it’s the same as bode plot
with magnitude and the phase plotted on a single plane. The stability criterion is that if open-
loop Nyquist plot of a feedback system encircles the point (-1, 0) as the frequency varies from
negative infinity to positive infinity, then the closed loop response is unstable. Alternatively,
the number of unstable closed-loop poles is equal to the number of unstable open –loop poles
plus the number of encirclements of the point (-1, j0) of the open loop transfer function of the
feedback system. The right plot in Figure 3-12 shows the margins from the plot while the left
figure shows the Nyquist plot for the air heater open loop transfer function. The air heater as
given in equation (5-10) is stable as the contour on the Nyquist plot does not enclose the -1+0j
point.

Figure 3-12: Nyquist plot showing margins [27] and the left plot show the Nyquist plot for the
air heater transfer function.

Integrated Absolute Error Index


The Integrated Absolute Error, IAE, or set point tracking can be used as a criterion to determine
the offset between the set point and the output. The drift from desired values is cause by load
disturbance and IAE can also be used to measured disturbance response of the controller. The
IAE index is define as the summation of the absolute error over a given period and is calculated
as given in equation (3-42)(3-22).

= | | (3-42)

The IAE for set point tracking is designated as IAES and for disturbance response as IAED. The
lower the IAE index the better control performance response of the system. Other index like
Integral error (IE), Sum of prediction error squared (SSEP) and Integrated squared error are
also used and provide almost the same bench mark for comparison.

35
PID Controllers Tuning Algorithms

Total Variance Index


The total variation of the control effort is given by the total variance index and is calculated
as shown in equation (3-43)

= | − | (3-43)

36
PID Auto-Tuning Methods

4 PID Auto-Tuning Methods


PID auto tuning simplified the task of operators manually tuning each PID loop in a process
plant. PID auto tuning saves time and reduces production lost by eliminating down for manual
tuning of PIDs. Based on the context of this thesis the PID tuning rules as discussed in chapter
3 will be refer as PID tuning rules in offline mode. This chapter will present tuning rules that
can be apply online and easily automated and these rules will be referred to PID auto tuning.
PID auto tuning can be achieved in major three ways among which are gain scheduling, model
base adaptive tuning and relay feedback experiment. The Relay feedback auto tuning method
presented by Åstrom and Hågglund will be presented [2] [6]. An extension of this method
presented by Schei [3] will be presented as well.
The aim of the auto tuning is to generate a point in the Nyquist curve that can be used to identify
the varying system parameters (for changing system dynamics) as discussed in Section 2.2.5.
In simple terms the relay auto tuning is a process of bringing the process to oscillation by
interchanging the controller with a relay or in a feedback loop with the controller. The relay
can be modified in different ways to get better result for the parameter estimation, one of such
is the used of relay with hysteresis. The amplitude and frequency of this sustained oscillation
is used to tune the controller parameters. This method can easily be employed in a closed loop
system and can be designed to use just a push button to start the process.
The procedure for auto tuning consist of three major steps as reported in [1], these are
 The generation of process disturbance/oscillation intentionally by the operator
 Automatic evaluation or computation of the disturbance dynamics
 The usage of the disturbance response to re-evaluate the controller parameters
In the relay feedback experiment, the amplitude of the oscillation is controlled by the amplitude
of the relay. [28] The major aim is to generate a limit cycle at the critical point of the process.
Other point of identification is also possible with the modification of the relay. Limiting the
oscillation in this way will present the process going into uncontrolled oscillation, which can
damage process equipment. The major problems with this method is that if there is a noisy
system that can cause hysteresis, then the identified frequency is not the ultimate and further
modification and calculation need to be exploited.
There are two major methods for analyzing relay excitation of the process:
 Limit Cycle analysis
 Describing functions

Relay has been in used since the fifties as amplifier but was applied to adaptive control in the
sixties. Relay auto tuning has the following advantages: [6]
 It’s easy to automate by switching from the controller to the relay during auto tuning
operation
 The method does not introduce loop instability
 Little priory knowledge of the process is necessary
 With the correct selection of the relay parameter the process error can be minimize
during the tuning.
Åstrom Relay is designed in such a way that whenever the process value (or error) passes a
preset point, the process is actuated by the relay as shown in Figure 4-2 [29]., an oscillation
within the limit cycle of the relay amplitude is generated. Schei relay is connected as shown in

37
PID Auto-Tuning Methods

Figure 4-4, and when the relay is operational the input to the system will varied between the
set point plus relay amplitude and set point minus relay amplitude. The experiment is done in
closed loop to keep the process output within limited bounds.
Åstrom method required that the system is brought to rest before the experiment is performed
whereas Schei make used of established control loop, thus any input during the experimentation
will be sufficient to trigger the relay into action.
The system is automated as shown in the block diagram of the implementation in Appendix C,
where the operator can select through a knob either the PID or relay mode.

4.1 Ultimate Period and Gain from Relay


Experimentation
The section will give the mathematical derivation of the system gain and period during relay
experimentation. The derived frequency and period depends on the configuration of the relay
used in the experiment. An ideal relay will give the approximate ultimate period and gain
whereas other point of interest can be determined as discussed in Section 4.4.

Limit cycle Oscillation


Limit cycle is a path for which the energy will constant with no loss or gain in a system. The
non-linearity of the relay causes the process to reach limit cycle oscillation quite rapidly.
Debabrata and Bhattacharjee demonstrate in their paper [30] that linear systems under memory
effects can cause limit cycle oscillation as well. The principle of limit cycling is a key input to
the describing function analysis. The method of determining the period and amplitude of
oscillation will be explained as described in [4]. The non-linearity in a relay as shown in Figure
4-1 will generate persistence excitation that will make the output of the linear element to goes
to oscillation as follows:
Given a state space of the process as given in equation (4-1) a limit cycle is generated if the
condition in equation (4-5) is true

= + ; y= (4-1)

Assume the process is oscillating with a limit cycle of period T, and tk is the time for relay to
switches at time k, therefore the time to change from one state to another, ∆ /2 which is
half the limit cycle period as given in equation (4-2)


= + ; ∆ = − = (4-2)

Recall that the output of the relay, d is the input to the process, therefore resolving equation(4-2)
will gives equation (4-3), since the limit cycle is symmetric, the input at time k and k+1 have
the relationship given in equation (4-4)
=ɸ + ɣd
(4-3)
Where ɸ = + and ɣ =

=− (4-4)

38
PID Auto-Tuning Methods

Putting equation (4-4) into equation (4-3) and solve for the output in equation (4-1), will gives
equation (4-5) which must be true for a limit cycle to occurs.

( + ɸ) ɣ = 0 (4-5)

Figure 4-1: A nonlinear element f (.) such as a relay will drive the linear element g(s) into
oscillation.

Describing function analysis (DF)


The describing function was developed to investigate the limit cycles behavior in nonlinear
systems. It gives a reliable estimate of limit cycle behavior. Describing function can be defined
as the ratio of the fundamental component of the relay output to the sinusoid input. The sinusoid
input can be given as described by equation (4-6):
( )= sin , = (4-6)

The Fourier series expansion of the periodic output signal is given by equation (4-7):

( )= + ( cos + sin ) (4-7)

Where the fundamental component is given by equation (4-8):

= ( ) (4-8)

The harmonics components are given in equation (4-9) and (4-10):

= ( )cos( ) (4-9)

= ( )sin( ) (4-10)

Since the output of the non-linearity is assumed to be sinusoid, the term a0 and an are equal to
zero because the output is symmetrical about the origin. Equation (4-7) becomes:

( )= sin( ) (4-11)

39
PID Auto-Tuning Methods

2
= ( ) ( ) (4-12)

Solving equation (4-12), gives equation (4-13) for odd harmonics and zeros for even
harmonics:

= (4-13)

Thus equation (4-8) becomes which is the output of the relay:

( )= sin( ) (4-14)

And the describing function N(a) is given by the ratio of equation (4-14) to (4-6) at the
fundamental component:
( )
( )= = ( )
= (4-15)

The system will be show continues cycling or marginal stability if the open loop transfer
function is zero, (Zeros poles for the feedback system.). This means that the system
input/output amplitude and phase are the same for the closed loop. For this condition equation
(4-16) is established:

1 + ( ) ( ) = 0; ( ) =− (4-16)

The ultimate gain, Ku and ultimate period, and ultimate frequency are as given in equation:

= ; = Tu; = (4-17)

Where Tu is the period of the sustained oscillation at approximately cross over frequency:

4.2 Åstrom Relay Method


Åstrom uses a simple relay in a feedback loop to achieve the same aim as Nichols and Ziegler
tuning rules. The critical point of a process determined by Z-N by increasing the proportional
gain indefinitely was achieved by Åstrom with the use of relay experimentation with just a
fractional perturbation signal of the process range. The amplitude of the relay is a small amount
of the control effort usually between 2% to 10% of the control effort [29]. This method ensure
that the system oscillation is achieved without the risk of making the system goes into definite
instability. As shown in Figure 4-2, the control input into the system is the relay output. This
varies between positive and negative values of the relay amplitude, h, as given in equation
(4-18) and (4-19) and displayed in Figure 4-3. Some process like the Air heater process does
not accept a negative control value and as such the Åstrom relay tuner cannot be implemented
on such a system. The system gains and frequency is calculated as given in equation (4-17).

40
PID Auto-Tuning Methods

Figure 4-2 Åstrom Relay Auto Tuner showing the Relay and PID controllers’ connection to
the Process in a feedback loop. The operator can perform auto tuning by switching from the
controller to the relay in which case the input into the process will oscillate between the set
point +/- the relay amplitude.
The period of oscillation is determined through zero crossing of the signal during the relay
experimentation as shown in the MATLAB code in Appendix B. Amplitude is measured
through the simple measurement of the maximum and minimum values of the signal during the
relay experimentation. The code for this is presented in Appendix B.
With the ultimate gain and period derived as in equation (4-17), Z-N tuning algorithms as given
in Table 3-2 can be applied. Other tuning algorithms can as well be applied to achieve varying
results but this will not the subject of discussion for this thesis.

Figure 4-3: The plots from the relay experiments using Åstrom method with Air heater. The
upper plot (yellow color) shows the error signal between the reference and output signal, this
is used as the input to the linearizing element to get the switching action for the relay in the
middle plot (blue color). The middle plot shows the output from the relay and this is the control
signal to the process. The Last plot in red color shows the process output.

4.3 Schei Relay Method


Schei method is like Åstrom with the same principle of relay feedback experimentation during
the tuning process. The method assume that a stable controller is in operation before the

41
PID Auto-Tuning Methods

experiment and this need to be improved. The reference signal to the PID controller is varies
between positive and negative values of the relay. Therefore, the control signal to the process
is a function of the relay switching and thus a limit cycle will be established as discussed in
section 4.1.1. It’s also employed a filter in the derivative loop to help in noise situation as
discussed in section 4.4. Figure 4-4 shows the block diagram of the implementation of Schei
scheme and the result from simulation will be discussed in section 5.

Figure 4-4: Schei Relay Auto Tuner showing the Relay and PID controllers’ connection to the
Process in a feedback loop. During relay experiment the reference signal varies in step by the
relay output. The relay is made to switch by the error signal by the application of a linearizing
element as shown in equation (4-18).
The principle is based on the near critical point estimation with automatic generated relay test
signal that make the process to oscillate around the ultimate frequency with bounded amplitude.
This estimation point is a function of the linearizing element in the loop.
The relay is designed to change the control effort each time the process output passes the set
point (or the error crosses zero). This will create an oscillation that will becomes stable after
some time as shown in Figure 4-3 and Figure 4-5 for Åstrom and Schei method respectively.
The following steps are taken for both Åstrom and Schei auto tuner
 Let the process to a steady state
 Implement relay controller
o If process gain is positive,
ℎ ≥0
= (4-18)
−ℎ <0

o If process gain is negative,


−ℎ ≥0
= (4-19)
ℎ <0

 After a sustained periodic oscillation, evaluate using equation (4-17),


 Use PID tuning rules as described in 3.2

42
PID Auto-Tuning Methods

Figure 4-5: The plots from the relay experiments using Schei method with Air heater
(simulator). The upper plot (red color) shows the output from the relay which is used to varies
the reference signal thereby changing the error signal. The output from the PID controller is a
function of the error signal and with the right perturbation of the relay, this error signal will
cause a sustained oscillation in the process output which can be used to re-evaluate the process
parameter.
Schei [3] auto tuner improve on the result by optimally trading between robustness and stability
in choosing the PID parameters. This is done by specifying four different mode of the auto
tuner based on the complementary sensitivity function as shown in equation (4-20)
3.0 0.75
1 = ; = , = 1.1

3.0
2 = ; = 0, = 1.1
(4-20)
1.0
3 = ; = 0, = 0.9

3.0
4 = ; = 0, = 1.3

4.4 Modification of the relay for noisy process and


improved performance
The idea relay described in section 4.1and 4.2 perform poorly under noisy environment as
shown in Figure 4-6 and can only identified the ultimate point on the Nyquist plot. Figure 4-7
shows the relay experimentation for a process with measurement noisy, the output is filtered to
reduce the effect of the nose. As shown in Figure 4-7 the relay switching is erratic and cannot

43
PID Auto-Tuning Methods

be use for obtaining the parameters as required. The switching makes it difficult to find the
period and amplitude accurately. Modification of the ideal relay can be used to identified
different point and prevent relay chattering. Several options exist for relay modification and
only five of this option will be discussed in this section.

Figure 4-6: Air heater simulation with a random noise. The upper plot in yellow shows the
process without noise, the middle plot shows the process with measurement noise added and
the lower plot in red show the filtered process with a low pass filter.

44
PID Auto-Tuning Methods

Figure 4-7: The plots from the relay experiments with noisy process using Åstrom method with
Air heater. The upper plot shows the error signal between the reference and output signal, this
is used as the input to the linearizing element to get the switching action for the relay in the
middle plot. The middle plot show that the relay switches too fast because of the noise.

Symmetrical and Asymmetrical relay


Relay may be classified in general terms as asymmetrical (uneven) and symmetrical (even relay
with or without hysteresis as shown in Figure 4-8 . Figure 4-8 (a, b, c, d) show relay which are
symmetrical, asymmetrical symmetrical with hysteresis and asymmetrical without hysteresis
respectively. Without the hysteresis Ɛ, the relay is referred to as ideal or conventional relays.
[31].

Figure 4-8: Types of relay shown (a) Symmetrical without hysteresis. (b)Asymmetrical without
hysteresis. (c) Symmetrical with hysteresis. (d)Asymmetrical with hysteresis [31].

Relay with Hysteresis


Noise will affect the operation of an ordinary relay by making it to switch randomly and causing
chattering. However, using a relay with hysteresis the noise must be larger than the hysteresis
for the relay to switch. A relay with hysteresis of value Ɛ is given by equation (4-21) and switch
on when the input is greater than Ɛ and switch off for input less than Ɛ.

45
PID Auto-Tuning Methods

+ℎ ≥Ɛ
= (4-21)
−ℎ <Ɛ

4 1
( )=
(4-22)
1− +

The describing function for a relay with hysteresis is as given in equation (4-22) , with different
values of the hysteresis and the relay amplitude, several points of interest can be identified on
the Nyquist curve other than the critical point. [32] . The major problem is that the switching
period may differs from the ultimate period. The switching oscillation period as shown in
equation (4-23) is not the ultimate period.

arg ( ) = − + arctan (4-23)


1−

Relay with Integrator


An integrator will introduce a phase shift of 90 degree when introduced to the feedback loop
as shown in Figure 4-9, instead of identifying the phase cross over frequency at frequency ω180
at ω90.

Figure 4-9: Fig(a) and Fig(b) shows the use of an integrator in conjunction with a relay to
identify the parameters at frequency ω90, and phase shift of -90 deg.

Relay with Filters


Filters may be used in conjunction with the relay to solve the problem of relay chattering due
to noise. Lee and co proposed in [32], the use of low-pass filters in a noisy environment and
band pass filters for process with both noise and drifts. A low pass filter will attenuate the high
noise while the high pass filter will attenuate the low frequency noise part. Application of a
low pass and high pass configuration as shown in Figure 4-10 will give the parameter
estimation at the critical point as the effect of low and high pass filter will cancel out. [32].

46
PID Auto-Tuning Methods

Figure 4-10: A relay with filtering implementation to prevent chattering for a noisy process.

Saturation relay
The describing function analysis use the ratio of the input and the output of the relay to identify
the critical point. The results from this method is subjected to errors as the two functions being
compare are not of the same dynamic, the input is purely a sine wave and the out a square
wave. To remove this anomalies saturation relay is employed instead of the ideal relay to make
the output as close as possible to the input of the relay that is to be more sine wave and less
square wave. [8]. The saturation relay is characterized by the relay height h, and the slope k,
and the saturation factor, ϱ, as given in equation (4-24).

ϱ= ; (4-24)

The output of the relay is given by equation (4-25)


× | | ϱ
= (4-25)
ℎ | | >ϱ

The describing function for a saturation relay is as given in equation (4-26), if the values of the
slope are too large; the saturation relay tends to behave like an ideal relay. Figure 4-11 shows
the saturation relay where the relay height h, the slope k, and the factor ϱ are as given in
equation (4-24) [8].

2ℎ 1 ϱ −ϱ
( )= sin + (4-26)
ϱ

47
PID Auto-Tuning Methods

Figure 4-11: The saturation relay is shown in A and the input and output of a saturation relay
is shown in B. The output is more like the input (sine wave) compare to an ideal relay which
is purely square wave.

Relay with preload


The fundamental frequency in the sustained oscillation can be boosted by adding a parallel gain
to the ideal relay [33]. This will give a better estimate of the ultimate gain and period compare
to an ordinary relay.

= k+ ; = Tu; = (4-27)

Figure 4-12: A gain K, preload in parallel with an ideal relay.

48
Simulation and experimentation study

5 Simulation and experimentation study


The air heater and the quadruple tank process laboratory system were used for simulation and
experimentation as discussed in section 1.2.1. A brief description of the systems will be given
in the following section. Also, simulated and real experimentation on the process using the
Åstrom and Schei method will be discussed. A PI controllers is the most widely controller
algorithms in the industries, the D term are always de-activated [9].4 This chapter will be based
on PI controller for the simulated and real systems experimentation.

5.1 The Air Heater Process


The air heater mathematical model is given by equation (5-1). [34]. For implementation in
Simulink equation (5-1) was discretized using Euler forward method to give equation (5-2)
1
= ∗ (− +[ ∗ ( − )+ ]) (5-1)

Where:
Tout- is the air temperature at the tube outlet in degree Celsius,
Tenv- is the environmental (room) temperature in degree Celsius,
Kh [ oC/V] is the heater gain,
is the time constant,22
[ ] = 2 sec (is the delay due to air transportation and sluggishness in the heater),
[ ] – is the control signal of the heater,
1
( ) = ( ) +[ ∗ ∗ (− +[ ∗ ( − )+ ])] (5-2)

Where:
( ) is the next (future) temperature out of the air heater,
is the present air heater temperature out of the air heater,
is the sampling time.
The air heater Ordinary Differential Equation (ODE) model as given by equation (5-1) need to
be transform to the transfer function model for frequency analysis in MATLAB.
The Laplace transforms of the ODE is given by equation (5-7). Equations (5-3) to (5-6) shows
the steps for the transformation.
1
ʆ ) = ʆ( ∗ (− +[ ∗ ( − )+ ])) (5-3)

4
The D term in the PID controller do amplifies measurement noise thus causing the control signal to changes
randomly.

49
Simulation and experimentation study

1
( )= ∗ (− ( )+[ ( ) ]) (5-4)

( ) ( )
( )+ = (5-5)

( ) ( )
( )+ = (5-6)

Simplifying equation (5-6) will give the transfer function as given in equation (5-7)
( )
= (5-7)
( ) 1+

Where Tout, u, Kh and Tc have their respective definition as given for equation (5-1).

Ultimate Period and Gain analytically.


The mathematical model of the air heater is as given in equation (5-8), this is validated from
the process reaction curve as discussed in 3.2.

( )= (5-8)
1+

The open loop transfer function of the air heater process with a pure P controller is given by
equation (5-9)

( )= ( ) ( )= (5-9)
1+

Equation (5-9) is equivalent to equation (5-10) in frequency response

( )= ( ) ( )= (5-10)
1+

This can be written in polar form as equation (5-11)

( )= ( ) ( )= (5-11)
1+

The ultimate gain and frequency can be find at the cross over frequency as given in
equation (5-12)

= = 1+ ; ( + tan )= (5-12)

With the value of the air given as derived from step response discussed in section 2.1.4, Tc is
22 and 2 .

= = 1 + 22 ; (2 + tan 22 )= (5-13)

50
Simulation and experimentation study

Solving equation (5-13) gives Kc and as 17.92 and 0.8133rad/s respectively. Also, the
period of oscillation is calculated to be 7.72s. This is the basis for Z-N method and the gain is
always too much that it can damage some process equipment if used on real process, therefore
Åstrom devised the relay experimentation method that only uses a fractional part of the ultimate
gain to re-evaluate the process parameter.

Åstrom Relay Experiment on simulated Air heater5


Åstrom relay experiment was performed on the simulated air heater with and without noise.
Without noise the ideal relay switched as expected and also with noise of 0.01, the relay work
as expected. But with much bigger value of 0.1, the switching of the relay was erratic. The
following simulation was carried out to see the effect of noise and the modification of the relay
1. Process without noise and ideal relay
2. Process with noise (0.1) and ideal relay
3. Process with noise (0.1) and relay with filter
4. Process with noise (0.1) and relay with hysteresis
5. Process with noise (0.01) and relay with hysteresis
6. Process with noise (0.01) and relay with hysteresis and filter
7. Process with noise (0.1) and relay with hysteresis and filter
The result of the above simulation is presented in Table 5-1. The calculated PI parameters and
the critical gain and period with different values of filter time constant is documented. Figure
5-1 and Figure 5-2 shows the output of the relay experimentation for a process with small noise.
The relay switching is not erratic but with small amplitude, increasing the noise make the relay
switching to be erratic as shown in Figure 4-6 and Figure 4-7 in Section 4.4.
Integral Absolute Error (IAE) and Sum of Squared Error (SSE) are the two criterial used for
performance indication. This is because the simulations are done in Ordinary Differential
Equation (ODE) and to perform frequency analysis in Simulink block will be more tedious,
notwithstanding the frequency analysis was perform using the transfer function of controller
and process in using MATLAB function ‘margin’.

5
The noise is added to the measurement output as a random noise

51
Simulation and experimentation study

Figure 5-1: Åstrom relay experimentation for a noisy signal of random noise (0.01). The
upper middle and lower plot shows the error signal, relay output and process output
respectively.

Figure 5-2: Åstrom relay experimentation for a noisy signal of random noise (0.01). The
upper middle and lower plot shows the process without noise, noisy and filter output
respectively.

52
Simulation and experimentation study

Results from Åstrom relay experimentation on simulated process


From Figure 5-3, the PI parameters derived from the relay with hysteresis and filter (No7 in
Table 5-1) gives the best performance and this will be used as a bench mark for the comparison
with the Schei method. It converge faster, give less overshoot and with less steady state error
as compared to others as shown in Figure 5-3. Also from the frequency analysis in MATLAB,
as presented in Table 5-2, it gives stability performance better than the other in relation to the
bench mark giving in section 3.4.3. It should be noted that the phase and gain margin are wide
because of the filter element in series with the relay. Also the hysteresis act as a delay element
in the process.
Table 5-1: PI parameters derived from Åstrom experimentation with the amplitude of
oscillation, critical gain and period with different relay modification.

S/ Experiment Output Pu Wcu Kc Ultimate Amplitude of Ti[s] Kp


N Filter gain oscillation, a
[s] [rad/s]
Constant [degC]

1 Åstrom N/A 8 0.786 4.089 0.03129 6.667 1.831

2 Åstrom_ noise 0.5 1.4 4.489 8.194 0.01554 1.167 3.687


(0.1)

0.8 0.6 10.473 10.06 0.01265 0.5 4.528

3 Åstrom_ noise 0.5 0.2 31.42 5.466 0.0233 0.1667 2.49


(0.1)+Relay with
filtered
0.8 0.6 10.47 -9.736 -0.0131 0.5 4.378

4 Åstrom_ noise 0.5 37.2 0.169 1.0452 0.1256 31.00 0.4562


(0.1) _FC +Relay
with
0.8 26.5 0.237 1.255 0.1014 22.08 0.5649
hysteresis(0.2)

5 Åstrom_ noise 0.5 61.5 0.102 0.6072 0.2097 51.25 0.2733


(0.01) _FC
+Relay with
0.8 60.1 0.105 0.6126 0.2078 50.08 0.2757
hysteresis(0.2)

6 Åstrom_ noise 0.5 62.5 0.100 0.5908 0.2155 52.08 0.2658


(0.01) +Relay
hysteresis(0.2)+
0.8 60.1 0.105 0.6134 0.2076 50.08 0.276
Relay filtered

6
Due to the eractic switching of the relay

53
Simulation and experimentation study

7 Åstrom_ noise 0.5 37.2 0.169 1.029 0.1237 31.00 0.463


(0.1) +Relay
hysteresis(0.2)+
0.8 26.5 0.237 1.261 0.101 22.8 0.5674
Relay filtered

Figure 5-3: The comparison of the PI parameters estimated during Åstrom relay experiment
on simulated air heater
Table 5-2: Stability analysis in frequency domain7

S/N Experiment with output filter time GM PM W180 Wc


constant of 0.8 (except no 1)
[dB] [deg] [rad/s] [rad/s]

1 Åstrom 2.9040 67.2926 0.8764 0.2964

2 Åstrom_ noise (0.1) 10.9092 116.8090 0.9093 0.0680

3 Åstrom_ noise (0.1)+Relay with 10.9358 116.8381 0.9129 0.0680


filtered

4 Åstrom_ noise (0.1) _FC +Relay 9 110.4443 0.8313 0.0805


with hysteresis(0.2)

5 Åstrom_ noise (0.01) _FC +Relay 18.2285 inf 0.8212 NAN


with hysteresis(0.2)

7
The MATLAB function MARGIN was used with the transfer function equivalent of the controller and the
process

54
Simulation and experimentation study

6 Åstrom_ noise (0.01) +Relay 18.2086 inf 0.8212 NAN


hysteresis(0.2)+Relay filtered

7 Åstrom_ noise (0.1) +Relay 8.9603 110.2495 0.8313 0.0809


hysteresis(0.2)+Relay filtered

Schei Relay Experiment on simulated Air heater


The Schei relay experimentation was carried out using simulated process without noise and
with noise. The results are shown in Table 5-3 which include the critical gain and period,
amplitude of oscillation and the derived PI parameters. Different relay modification was tried
and relay with hysteresis gives the desired relay switching response. In particular, it was noted
that the relay does not switch when its output was filtered. Figure 5-4 shows the relay output
and control signal while Figure 5-5 shows the process output and error signal from the Schei
relay experiment. Figure 5-6 shows the period and frequency of oscillation during the Schei
relay experimentation. The indicate margin is calculated from MATLAB using the transfer
function of the controller and process.
Table 5-3: PI parameters derived from Schei experimentation with the amplitude of oscillation,
critical gain and period with different relay modification.
8
Schei Exp Pu Kc Amplitude Ti Kp GM PM W180 Wc
[s] of
[s] [dB] [deg] [rad/s] [rad/s]
oscillation, a

Schei 8.4 1.22 0.1044 7 0.549 9.66 112.15 0.8732 0.0775

Schei _ noise (0.1) 10.8 0.93 0.1362 9 0.4206 12.45 125.75 0.8593 0.0517
+Relay hysteresis(0.1)

8
For Schei method the relay does not switch with a filter in series with it as the output is filtered out

55
Simulation and experimentation study

Figure 5-4: The upper plot show the relay output and the lower plot shows the control signal
during Schei experimentation for noisy process. The experimentation is initiated around 110
seconds.

Figure 5-5: The upper plot show the control error and the lower plot shows the process output
during Schei experimentation for noisy process. The experimentation is initiated around 110
seconds.

56
Simulation and experimentation study

Figure 5-6: The frequency and period during Schei Relay experimentation.

Comparing the performance of Åstrom and Schei Relay Experiment on


simulated Air heater
The performance criteria as discussed in section 3.4 will be used in this section to judge the
response of the system with the PI parameters derived with the relay experimentation under the
following selected cases:
 Åstrom without noise (As)
 Åstrom with noise process using relay with hysteresis and filtered (Aswn)
 Schei without noise (Sc)
 Schei with noise process using relay with hysteresis (Scwn)
The performance of the controller is a function of the user requirement. A process that need
fast response will require a small rise time and a process with a delicate equipment will required
a small overshoot. The results of the comparison for both process with noise and with noise is
presented in Table 5-4 and Table 5-5.
Figure 5-7, Figure 5-8, Figure 5-9, Figure 5-10 and Figure 5-11 shows the results of using the
PI controllers’ parameter derived from AS, Aswn, Sc and Scwn respectively.
Based on the criterial presented in Table 5-4 and Table 5-5, an ideal relay parameter estimation
give a better PI performance for a non-noisy process and a relay with hysteresis and filtered
gives a better parameter estimation for a noisy process. A PI controller derives from Åstrom
relay experiment gives less percentage overshoot and but more steady state error than the Schei
relay experiment PI controllers. Moreover for set point tracking the Åstrom relay
experimentation is better than Schei while the later gives better performance for disturbance
rejection.
Table 5-4: Performance tracking for a process without noise using different PI parameters.

IAE SSE IAEd %overshoot Rise Time(s)

As 9.07 113.7 10.08 0% 15.6

57
Simulation and experimentation study

Aswn 11.6 109.8 22.33 0.05% 48.4

Sc 3.54 107 7.07 1.24% 12.6

Scwn 5.944 116.5 11.92 0.81% 18.3

Table 5-5: Performance tracking for a process with noise using different PI parameters.

IAE SSE %overshoot Rise Time(s) Steady state error

As -4.6049 123 0.19% 12.17 0.19

Aswn 11.1 119.5 0.09% 43.7 0.01

Sc 3.473 116.3 1.24% 12.17 0.01

Scwn 5.864 126.3 0.81% 18.3 0

Figure 5-7: The plot of the different PI parameters derived from the relay experiment (Astrom
and Schei with and without noise) to control the simulated process without noise

9
The negative sign means that the process does not converge within the time frame of comparisons

58
Simulation and experimentation study

Figure 5-8: The plot of the different PI parameters derived from the relay experiment
experiment (Astrom and Schei with and without noise) to control the simulated process without
noise with a step change around 100s.

Figure 5-9: The plot of the different PI parameters derived from the relay experiment (Astrom
and Schei with and without noise) to control the simulated noisy process

59
Simulation and experimentation study

Figure 5-10: The plot of the different PI parameters derived from the relay experiment (Astrom
and Schei with and without noise) to control the simulated noisy process with reduced scale
to have a better view of the effect of noise.

Figure 5-11: The plot of the different PI parameters derived from the relay experiment (Astrom
and Schei with and without noise) to control the simulated noisy process noise with a step
change around 100s.

Schei Relay Experiment on Real Air heater10


The Schei relay auto tuning was used on the real air heater using the PI parameter derived in
section 5.1.4 as the starting point. The relay experiment was performed after a steady state
process output was achieved, this is to improve on the PI parameter. Note that a real time
spacer was used during the experiment and as such all-time relater parameter has to take into
account the real time spacer multiplier. Figure 5-12 shows the actual process output and the
filter output. A low pass filtered of first order and time constant of 0.8 was used. The filtered
was so chosen so that the experiment will be a representatives of a real process noisy

10
Real Time space was used in the Simulink environment and this was set to 10. Therefore all-time dependent
parameter need to be divided by 10.

60
Simulation and experimentation study

environment and the dynamic of the process will still remain as such. Figure 5-13 shows the
relay switching and the control signal. The relay experimentation was started around 350
second, the frequency counter was not effective because of the random noise and as such does
not give an accurate PI parameters. The measurement was average over the period of time as
shown in Appendix D, to get a conservative figure for the controller implementation.
Alternatively, the measurement was done manually to cross check the derived parameters as
shown in Figure 5-14. The derived parameters are Kp 1.8 and Ti is 15s.
The control signal is kept within the bound by the PI controller and such for a good performance
of the auto tuner, a fairly good controller parameters must be the starting point. More plots
from the experimentation are presented in Appendix D.

Figure 5-12: Real air heater; upper plot show the unfiltered output while the lower plot show
the filter output

61
Simulation and experimentation study

Figure 5-13:Real air heater; upper plot show the relay output while the lower plot show the
control signal during the relay experiment

Figure 5-14: Process output from the real air heater used to cross check the calculated
parameter from the auto tuner

62
Simulation and experimentation study

Figure 5-15: Process output and reference plot with the derived PI controller controlling the
real air heater with step changes at interval. Notice the time axis has been cut off from the
plot.

5.2 The Quadruple tank Process


The quadruple tank is a multivariate laboratory process that consist of four tank system with
two pumps to control the level in the lower two tanks through two valves as shown in Figure
5-16. The control input to the system are the control voltages to the two pumps while the output
are the level from tank 1 and 2. [35].
The mass balance equation for the system is derived from mass balances equation and
Bernoulli’s law equation (5-14) and can be given in state space model as shown equation
(5-15).

ℎ = 2 ℎ + 2 ℎ +


ℎ = 2 ℎ + 2 ℎ +
(5-14)
− (1 − )
ℎ = 2 ℎ +

− (1 − )
ℎ = 2 ℎ +

Where ℎ is the rate of change of water level hi for tank i, ai is the cross-section of the outlet
hole in tank i, is the pump voltage. ‘g’ is the acceleration due to gravity, Ai is the cross-
section of tank i. The constant is a valve parameter that measure the diversion of flow from
the valve to the tanks, and the range is from 0 to 1. The model parameters is as given in Table
5-6. The linearized model, linearization point and the derived state space model are given in
Appendix B . The non minimum phase characteristic as presented in [35] and [36] will be used
for the simulation study.

63
Simulation and experimentation study

1
− 0 0 0
1
0 − 0 0
= +
1 (1 − )
0 0 − 0 0
(5-15)
1 (1 − )
0 0 0 − 0

0 0 0
=
0 0 0

Where, Ti are time constant as given in

2ℎ
=
(5-16)

= 1, … ,4.

Table 5-6: Parameter of quadruple tank

parameter Value

A1, A3 28 [cm2]

A2, A4 32 [cm2]

a1, a3 0.071 [cm2]

a2, a4 0.057 [cm2]

g 981[cm/s2]

Figure 5-16: Schematic diagram of the quadruple tank process [35]

64
Simulation and experimentation study

For the experimentation the control is decentralized with two separate controller as shown in
Figure 5-17. This is a case of multiple input and multiple output (MIMO) system as presented
in [7]. The quadruple will be consider as two SISO processses whereby each tank will have an
independent loop without pairing.

Figure 5-17: The block diagram of the two input and two output system with decentralized PI
control, Hc1 and Hc2.

Åstrom relay experiment on simulated quadruple tank


The experimentation was performed on the tank as follows:
 PI control on tank 1 and tank 2 put in manual mode (experiment1)
 Thereafter, the experiment was performed for the two controller as two SISO system.
The result PI parameter derived is given in table (experiment2).
The simulation plots from the experimentation using PI on tank 1 and manually controlling
tank 2 is shown in Figure 5-18. The plot shows that the experiment converge less than 50
second. Figure 5-19 shows the plot from controlling the tank with the derived PI controller on
tank 1. There is different step changes on both tank reference value during the simulation and
the controller was able to adjust with less overshoot with these step changes. Also the control
to tank 2 was manually controlled to acts as disturbance on the system and the controller handle
the disturbance accordingly. Relay with hysteresis was used to achieve the best result.
The ultimate period and gain derived were used in Z-N closed loop formula to calculate the PI
parameters as presented in Table 5-7.
Figure 5-20 shows the plot from relay experimentation carried out with the system controlled
with two different controllers as in a case of two SISO system. The derived PI parameters from
these experiment is used to control the two SISO system and the plots shown in Figure 5-21.
The frequency, period, calculated proportional gain and integral time are shown Figure D-1 4
and Figure D-1 5 in Appendix D.
Table 5-7: The parameters derived during Åstrom relay experimentation on the quadruple
tank

Controllers Experiment 1 Experiment 2

Kp Ti Kp Ti

Tank 1 5.495 8.417 5.614 8.833

Tank 2 Manual control 5.715 11.33

65
Simulation and experimentation study

Figure 5-18: Process error and relay switching during Åstrom experimentation on quadruple
tank (closed loop control on tank 1 and open loop control on tank 2).

Figure 5-19: Controlling the tank with the PI parameters derived during the experiment (PI on
tank 1 and manual control on tank 2). Step changes for the reference and control input for
both tank 1 and 2 respectively were made at intervals.

66
Simulation and experimentation study

Figure 5-20: Process output and relay switching during Åstrom experimentation on quadruple
tank (closed loop control on both tanks).

Figure 5-21: Controlling the tank as two separate SISO system with PI derived from Åstrom
relay experimentation

Schei relay experiment on simulated quadruple tank


The relay experiment was performed on the quadruple tank as two SISO system with the PI
parameters derived from the Åstrom relay experiment in other to improve on the performance.
Based on the fact that no proper paring of input and output variables was done, the tuning
process was difficult and take longer time and correct relay biased to achieved. A relay
hysteresis of 0.1 was finally used and resulting parameters presented in Table 5-8. Tank two
relay switching was irregular and the internal working structure of the tank pairing is required

67
Simulation and experimentation study

to improve on the relay structure to achieve a better result. Figure 5-22 show the plot of the
error and control signal while Figure 5-23 show the plot of the relay and process output during
the experiment.
Table 5-8: The parameters derived during Schei relay experimentation on the quadruple tank

Controller Kp Ti[s] Amplitude of Period of Ultimate Wc[rad/s]


oscillation, [cm] Oscillation[s] gain

Tank1 0.5714 16.58 0.1003 19.9 1.27 0.3157

Tabk2 0.5681 46.58 0.1009 55.9 1.262 0.1124

Figure 5-22: The plot of simulation from the Schei relay experimentation showing the control
signal (u1 and u2) and the error signal (e1 and e2) for both tanks.

68
Simulation and experimentation study

Figure 5-23: Figure 5-24: The plot of simulation from the Schei relay experimentation
showing the process output (y1 and y2) and relay output (R1 and R2) for both tanks.

Comparing the performance of Åstrom and Schei Relay Experiment on


simulated quadruple tank
The performance criteria as discussed in section 3.4 will be used in this section to review the
response of the system with the PI parameters derived with Åstrom and Schei relay
experimentation on the quadruple tank system. Based on the derived parameters as presented
in Table 5-7 and Table 5-8 , the tank was controlled with the PI controllers and with different
step changes on both tanks as shown in Figure 5-25. Step changes on one tank acts as a
disturbance on the other tanks. The performance of the controllers is presented in Table 5-9
and from this it can be inferred that Åstrom gives the best performance in terms of stability and
robustness measured subject to the fact that the initial PI parameters for Schei was not perfectly
paired.
Table 5-9: Performance tracking for quadruple tank with different PI parameters.

Method IAE SSE %overshoot Rise Time(s) Steady state error

Tank1 Åstrom 62.33 1990 0.56% 32 0

Schei 52.79 3636 22.6% 41.1 0.002

Tank2 Åstrom 27.87 568.6 3.7% 25.1 0

Schei 12.73 1758 21.7% 53.3 0.002

69
Simulation and experimentation study

Figure 5-25: comparing Åstrom and Schei PI parameter with step changes on both reference-
tank1 and tank2- to show the effect of cross coupling of the tanks on the controllers. (Tank 1
on the upper plot and tank 2 on the lower plot).

70
Discussion and Result

6 Discussion and Result


A PID loop must be robust even if there is a change in the dynamic of the process. The PID
parameters must be able to cover a wide range of process dynamic. The phase and gain margin
must be wide enough to accommodate this changes before the system become unstable. Bode,
Nyquist, and other MATLAB function like ‘all margin’ are effective tool employed to check
the robustness of the design. The loop was implemented in time domain for the simulation and
frequency analysis was done with the transfer function model.
The Åstrom relay experimentation is an effective and simple method for parameter estimation
online and the method converge faster. The drawback is that it cannot be applied on some
process like the real air heater. This is because the relay switch from positives value to negative
value and the air heater does not accept negatives values as it does not have a cooling facilities.
The Schei relay method take much longer time than the Åstrom but it can be used for all kind
of process as its employ the control action generated through the PID loop. The step back is
that a well-tuned PID controller must be in operation for its implementation and thus the
experimentation is a factor of the previous PID performance.
The dynamics of the system was study in relation to the relay experimentation, and random
noise and the filter time constant was used as a parameters variance for both processes. From
the simulation performed on both the air heater and quadruple tank process, the following can
be inferred:
 The filter time constant affect the dynamic of the entire process, small time constant
give good filtering but increase the dead time of the process. While a large time constant
give poor filtering but at small dead time.
 The filter time constant affect the final derived controller parameter
 An Ideal relay will switch erratically under noisy condition and parameters estimation
will be difficult
 The uses of a filter in series with the relay reduces the hysteresis of the relay switching.
 The value of the relay hysteresis depend on the noise value.
 A better performance is achieved with relay with hysteresis and filter.
 Because of the filter and the hysteresis in the relay it’s difficult to access the
performance of the controller based on the gain and phase margin. The derived margins
was outside the specified range for robust design.
Several methods of recursive parameters estimation was study and since the aim of the thesis
is controller tuning and not system identification or state estimation, the relay method was
employed.
In the real experimentation carried out with the air heater the frequency counter design was
not effective as it gave erratic values (due to the noisy nature of the real experiment), this was
cross check manually to get conservative values for the PI parameters. The real experiment
on the quadruple tank could not be performed due to logistics.
The implementation of the auto tuning enable the operator to perform the tuning on demand
by selecting relay tuning or PID mode as shown in Figure C-1 1. It’s also possible to monitor
the convergence of the operation as well as the relay switching.

6.1 Åstrom versus Schei Auto tuner


The following can be inferred from the simulation study:

71
Discussion and Result

 The implementation of Åstrom is simpler and easier than Schei and take less time to
converge during the experiment.
 For a multiple input and output system, the Schei relay experimentation become more
complicated as the correct paring of input and output variables must be determined for
the optimal performance of the controller in the loop. This is the case of the quadruple
tank where the Schei derived parameters performed poorly compared to Åstrom’.
 A knowledge of the process dynamic change is required for Åstrom relay
experimentation for the relay to switch accordingly whereas the PID in the loop for
Schei relay experimentation will bring the process to the required steady state.
 Åstrom relay experimentation gives a PI performance with less percentage overshoot
 Schei relay experimentation gives a PI performance with smaller steady state error
compared to Åstrom.
 Both methods are safe as only a very small amplitude of process oscillation occurred
during the experiments.

72
Conclusions

7 Conclusions
The original Åstrom relay feedback auto tuning and the modification of the method by Schei
have been reviewed. Their performance was accessed through simulated air heater and the
quadruple tank processes.
Modification of the relay was carried out to ensure the relay switching was not erratic under
noisy condition. A relay with hysteresis performed adequate for the purpose of a noisy process.
The use of filter in series with the relay was tried but failed for Schei method. The dynamic of
the measurement noise filter and if applicable the filter in the relay loop do affect the tuning
process.
Åstrom method does not work on the real air heater as the process does not accept negative
values from the relay. The Schei method was successful applied to the real air heater. Schei
method perform better for disturbance rejection than Åstrom but the performance is based on
a prior controller parameters before the experiment.
The auto tuning by relay experimentation is simple and easy to implement method of recursive
process parameter estimation and also re-adjusting the parameters of PID controllers. It does
not pose a danger of causing the process instability as well as damage to process equipment
during the tuning operation. It can be used by an inexperienced operator as it does not required
prior knowledge of tuning process as it done by merely pushing a button.
The control algorithm implementation is manufacturer dependent and they used different
names for the same PID algorithm. Notwithstanding as an Engineer, operator or end users of
PID controller, they must be conversant with different form of PID and should know the form
deployed by a specific PID manufacturers. The conversion from one forms of PID to others
was discussed as this is crucial for optimum performance.
The choice of the tuning rule is a subject of the optimal choice of the user and this can be
decided by using Pareto optimality concept which is recommended for future work.

7.1 Further Works


There is a lot of options that could possibly improve the performance of the Relay
experimentation under noisy condition and this is recommended for further investigation.
The choice of tuning algorithms is a factor that the determined the accuracy of the final PID
parameters obtained from the relay experimentation, the thesis work could only exploit the Z-
N algorithms for simulation and real experimentation. This is an option for future work to
implement the relay experiment on different tuning algorithms. Also the degree of freedom of
the controller could be extended.
The comparison of the results from the two relay experimentation is a subject of the optimal
choice of the user and this can be decided by using Pareto optimality concept (a function of
IAE for the input and output disturbances as a function of the sensitivity index) which is not
considered within the scope of the thesis but could possibly be explored.

73
References

8 References
[1] K.Åström and T.Hägglund , PID Controllers: Theory, Design ,and Tunning, Instrument
Society of America, 1999.

[2] K.J Åstrom and Hågglund, «Automatic tuning of simple regulators with specification
on phase and amplitude margins,» Automatica, vol. 20, nr. 5, pp. 645-651, 1984.

[3] T. S. Schei, “A method for closed loop automatic tuning of PID controllers,”
Modelling, Identification and Control, vol. 13, no. 3, pp. 155-162, 1992.

[4] K. J.Åstøm and B. Wittenmark, Adaptive Control, United States of America: Addison-
Wesley Publishing Company, 1995.

[5] S. Skogestad, “Simple analytic rules for model reduction and PID controller tuning,”
Modelling,Idebtification and Control, vol. 25, no. 2, pp. 85-120, 2004.

[6] C.C Hang, K.J Aström, Q.G Wang, “Relay feedback auto-tuning of process controllers-
a tutorial review,” Journal of Process Control, no. 12, pp. 143-162, 2001.

[7] B. Josefin, «Automatic Controller Tuning Using Relay -based Model Identification,»
Sweden, 2017.

[8] S. Haur,H-D Den yu and C-C Yu, «Use of sarturation relay feedback for autotune
Identification,» Chemical Engineering Science, vol. 51, nr. 8, pp. 1187-1198, 1996.

[9] F. Haugen, “Comparing PI Tuning Methods in a Real Benchmaek Temperature Control


System,” Modeling, Identification and Control, vol. 31, no. 3, pp. 79-91, 2010.

[10] R. P. Vladimir Bobål, «Self-Tuning Control MATLAB Toolbox-Methodology and


Design,» i IFAC Computer Aided Control Systems, Belgium, 1997.

[11] D. Ruscio, «Subspace System Identification theory and application ( A lecture notes),»
Telemark Institute of Technology, Porsgrunn, 1994.

[12] NI, “National Instrument,” 29 Mar 2011. [Online]. Available: www.ni.com/white-


paper/3782/en. [Accessed 24 Feb 2018].

[13] D. Simon, Optimal State Estimation, USA: John Wiley & Sons ,Inc, 2006.

[14] S. Roshan, «Lecture notes for the course IIA 4117: Model Predictive Control,»
University of SouthEast, Norway, Porsgrunn, 2017, June.

[15] C Dalen and D. D Riscio, "A Semi-Heuristic Process-Reaction Curve PID Controller
Tuning Method," Modelling, Identification and Control, vol. 39, no. 1, pp. 37-43, 2018.

[16] J. Smuts, “Control Notes,” 20 March 2010. [Online]. Available: blog.opticontrols.com.


[Accessed 25 Febuary 2018].

74
References

[17] Seborg, Edgar,Mellichamp and Doyle, Process Dynamic and Control, United States:
John Wiley & sons, 2011.

[18] D. D. Ruscio, System Theory State Space Analysis and Control Theory, Porsgrunn,
August 1996.

[19] F. Haugen, Basic Dynamic Control, TeachTech, 2010.

[20] F. Haugen, «The Good Gain Method for Simple Experimental Tuning of PI
Controllers,» Modeling, Identification and Control, vol. 33, nr. 4, pp. 141-152, 2012.

[21] D. P. Saha, "National Programme on Tec hnology Enhanced Learning," Goverment of


India, [Online]. Available: http://nptel.ac.in/courses/103103037/24. [Accessed 24 April
2018].

[22] F. Haugen and B. Lie, “Relaxed Ziegler-Nichols Closed Loop Tuning of PI


Controllers,” Modeling, Identification and Control, vol. 34, no. 2, pp. 83-97, 2013.

[23] B. D. Tyreus and W. L. Luyben, «Tuning PI Controllers for Integrator/Dead Time


Processes,» Ind.Eng.Chem, vol. 31, pp. 2625-2628, 1992.

[24] D.D Ruscio and C. Dalen, «On Tunning PI Controllers for Integrating Plus Time
Delays System,» Modelling,Identification and Control, vol. 31, nr. 4, pp. 145-164,
2010.

[25] D.D Ruscio and C. Dalen, «Tuning PD and PID Controllers for Double Integrating Plus
Time Delay Systems,» Modeling, Identification and Control, vol. 38, nr. 2, pp. 95-110,
2017.

[26] B. Goodwine and J. Lucey , «University of Notre Dame,» Aerospace and Mechanical
Engineering, 20 10 2003. [Internett]. Available:
https://controls.ame.nd.edu/ame301/hw7. [Funnet 07 04 2018].

[27] Z. Gajic, «Nyquist,» Rutgers University, New Jersey, [Internett]. Available:


http://www.ece.rutgers.edu/~gajic/psfiles/nyquist.pdf. [Funnet 27 April 2018].

[28] F. P. R.R Pecharromån, «Improved Identification for PID Controlers Auto-Tunning,» i


European Control Conference, Germany, 1999.

[29] S. A. S.Levy, «PID autotuning using relay feedback,» Isreal, 2012.

[30] D Debabrata and J.K Bhattacharjee, «Limit Cycle Oscillalations,» Vibration Problems
ICOVP-2007. Springer Proceedings in Physics, vol. 126, 2008.

[31] R. Prokop, J. Korbel and R. Matusu, «Relay Feedback Identification of Dynamical


SISO Systems-Analysis and Settings,» i Proceedings of the 18th International
conference on systems, Santorini Island Greece, 2014.

[32] J Lee, J.S Kim, T. F. Edgar, S. W. Sung, «Relay Feedback Idebtification for Processes
under Drift and Noisy Environment,» American Institute oF Chemical Engineers, vol.
57, nr. 7, pp. 1809-1816, 2010.

75
References

[33] K.K. Tan, T.H. Lee, S.Huang, K.Y.Chua, R.Ferdous, "Improved critical point
estimation using preload relay," Journal of Process Control, no. 16, pp. 445-455, 2006.

[34] F. Haugen, «Lab Station: Air Heater,» Univeristy College of Southeast Norway, 20
September 2016. [Internett]. Available: http://home.hit.no/~finnh/air_heater/. [Funnet
26 March 2018].

[35] K. Johansson, “The Quadruple-Tank Process: A Multivariable Laboratory Process with


an Afjustable Zero,” IEE Transcactions on Control Syatems Technology, vol. 8, no. 3,
pp. 456-465, 2000.

[36] D. Ruscio, «IIA2217 System Identification and Optimal Estimation-Exercise,»


[Internett]. Available:
http://davidr.no/iia2217/ovinger/ov3_kalman_4tank/ov3_4tank.pdf. [Funnet 10 May
2018].

[38] R.Aarts, “System Identification and Parameter Estimation,” University of Twente,


Enschede, 2011.

[40] S. Nikita and M. Chidambaram, «Improved Relay Auto-Tuning of PID Controllers for
Unstable SOPTD system,» Chemical Engineering Communication, vol. 203, pp. 769-
789, 2016.

[41] T.Liu, Q-G Wang and H-P Huang, «A tutorial review on process identification from
step or relay feedback test,» Journal of Process Control, vol. 23, pp. 1597-1623, 2013.

76
Appendices

Appendices
Appendix A: Thesis’s Task Description

77
Appendices

Appendix B: MATLAB CODES FOR SIMULINK BLOCK


%% Define parameters for the intialization
Ts = 0.1;% sampling time
Td = 2;% Time delay
n = Td / Ts;% for array creation
Kh=3.6;
Tt=23;
u0 = zeros(n, 1);
PI algorithm
function [uk, ek]= PI_Temp(Ts, Kp, Ti, Tsp, Tout, ek_1, uk_1)
ek = Tsp - Tout; % error
umin = 0; % [V]
umax = 5; % [V]
g0 = Kp * (1 + (Ts / (2 * Ti)));
g1 = -Kp * (1 - (Ts / (2 * Ti)));
uk = uk_1 + g0 * ek + g1 * ek_1; %deviation form using trapezoidal method
if (uk < umin) % Anti wind up implementation
uk = umin;
elseif (uk > umax)
uk = umax;
end
end
Linear element Block
function zf = fcn(Tout,Tsp,S)
er=Tsp-Tout;
% zf=0
if er>=0.1 && S==0 % With hyteresis on the relay
zf=1;
elseif er<=-0.1
zf=-1;
else
zf=0
end
%
% if ek>=0.2
% zf=1;
% elseif ek<=-0.2
% zf=-1;
% else

78
Appendices

% zf=0
% end
Amplititude Calculation
function [p, o, y_tmp, Ymin]= fcn(m, n, y, y_temp, Ymin_hold)
% Y = main data for period calculation
% y_temp = to store three values to check maxima
% k = index to shift from y0 to y1 in Y
o = n;
Ymin = Ymin_hold;
y_tmp = y_temp;
if m>=3
if y_temp(1) > y_temp(2) && y_temp(2) > y
if n == 0
Ymin(1,1) = y_temp(2);
Ymin(2,1) = m - 1;
o = 1;
elseif n == 1
Ymin(1,2) = y_temp(2);
Ymin(2,2) = m - 1;
o = 0;
end
end
end
p = m + 1;
y_tmp(1) = y_temp(2);
y_tmp(2) = y;
AStrom Tuner Block
function [a,pu,Wc,Nr,Kp_n,Ti_n] = fcn(Y,Tsp,Ar)
a=Y(1,1)-Tsp; % amplitude of oscillation
Ts=0.1
A=abs(Ar) %Relay amp
Nr=(4*A)/(pi*a); % Altimate gain
pu= abs((Y(2,2)-Y(2,1)))*Ts %Altimate Period
Kp_n=0.45*Nr; %New Kp using Z-N
Ti_n=pu/1.2; %New Ti
Wc=2*pi/pu
Filter Block
function Toutf = fcn(Tf,Tout,Toutf_1)
Ts=0.1;

79
Appendices

a=Tf*(Tf+Ts);
Toutf=a*Tout +(1-a)*Toutf_1;
Toutf_1=Toutf;
Air Heater
function [ud, U]= delay_fun(u, uk, n) % air heater delay implementation in
ODE form
ud = u(1);
U = u;
for i=1:n-1
U(i) = u(i+1);
end
U(n)=uk;
function Tout_1=airheater_Ode(ud, Ts, Te, T_out, Kh, Tt) % Air heater in
ODE form
Tout_1 = (Ts/Tt)*(-T_out + Kh*ud + Te) + T_out;
Quadruple Tank [36]
% The quadruple tank linearized model state space matrices for minimum
% phase case
% Parameters for the quadruple tank level process
% Modifided from David Di Ruscio
A1=28; A3=28; A2=32; A4=32; % cross section of tank[cm^2]
a1=0.071; a3=0.071; a2=0.057; a4=0.057; % cross section of outlet
hole[cm^2]
kc=0.50; % ratio of voltage and level[V/cm]
g=981; %acceleration due to gravity
%linearised operating point (nominal value for minimul phase case)
h10=12.4; h20=12.7;h30=1.8; h40=1.4;u10=3.0; u20=3.0;
k1=3.33; k2=3.35;
g1=0.7; g2=0.6; %linearised operating point (nominal value for minimul
phase case)
% State space matrix
T1=(A1/a1)*sqrt(2*h10/g); T2=A2*sqrt(2*h20/g)/a2; T3=A3*sqrt(2*h30/g)/a3;
T4=A4*sqrt(2*h40/g)/a4;
A=[-1/T1,0 ,A3/(A1*T3),0;0 ,-1/T2,0 ,A4/(A2*T4);0 ,0 ,-1/T3 ,0;0 ,0 ,0 ,-
1/T4]
B=[g1*k1/A1 ,0;0 ,g2*k2/A2;0 ,(1-g2)*k2/A3;(1-g1)*k1/A4,0]
D=[kc, 0,0,0;0,kc,0,0]
Results
A = [ -0.0159 ,0 ,0.0419 ,0; 0 , -0.0111, 0 , 0.0333; 0, 0, -0.0419, 0; 0,0 , 0, -0.0333]
B=[ 0.0833, 0; 0, 0.0628; 0 ,0.0479; 0.0312 ,0]
D =[ 0.5000, 0; 0, 0; 0, 0.5000; 0, 0]

80
Appendices

Appendix C: SIMULINK BLOCK IMPLEMENTATION

Figure C-1 1: ASTROM BLOCK

81
Appendices

Figure C-1 2: SCHEI BLOCK

82
Appendices

Figure C-1 3: PI CONTROLLER BLOCK

Figure C-1 4: AIR HEATER BLOCK

Figure C-1 5: AMPLITITDE CALCULATION BLOCK

Figure C-1 6: Real Air heater connection block (DAQ assistance)

83
Appendices

Figure C-1 7: Comparing the PI parameters for different simulation

84
Appendices

Appendix D: Plots from Relay Experimentation


Plots from Schei relay experiment on Real Air heater

Figure D-1 1 The upper and the lower plots show the calculated Kp and Ti respectively
during the relay experiment on real air heater.

Figure D-1 2: The upper and the lower plots show the frequency and the period of oscillation
respectively during the relay experiment on real air heater.

85
Appendices

Figure D-1 3: The upper and the lower plots show the control voltage and the error signal
respectively during the relay experiment on real air heater
Simulation plots from Åstrom relay experiment on the quadruple tank

Figure D-1 4: The Proportional gain and integral time convergence during Åstrom relay
experimentation on the quadruple tank (PID on tank 1 and manual on tank 2)

Figure D-1 5: The period and frequency of oscillation during Åstrom relay experimentation
on the quadruple tank (as two separate SISO)

86
Appendices

Appendix E: Nyquist Plot from Relay Experimentation simulated Air Heater

Figure E1 1: Nyquist plot from the result presented in Table 5-1.None of the curve enclosed
the 0-j point, so they are stable.

87
Appendices

Imaginary Axis
Imaginary Axis

Figure E1 2: Nyquist plot from the result presented in Table 5-8.

88

You might also like