Vous êtes sur la page 1sur 126

Process Identification Based on a New Relay Feedback Experiment

Micheile Desarmo

A thesis submitted in confonnity with the requirements

for the degree of Master of Applied Science
Graduate Department of Chernical Engineering & Appiied Chemistry University of Toronto @Copyright by Michelle Desarmo(1998)


National Library of Canada

Acquisitions and Bibliographie Services
395 Wellington Street Ottawa ON K1A ON4

Bibliothque nationale du Canada Acquisitions et services bibliographiques

395. nie Wellington OttawaON K I A O N 4 Canada


The author has granted a nonexclusive licence allowing the National Library of C n d to aaa reproduce, loan, distribute or selI copies of this thesis in microform, paper or electronic formats.

L'auteur a accord une licence non exclusive permettant la Bibliothque nationale du Canada de reproduire, prter, distribuer ou vendre des copies de cette thse sous la forme de microfiche/film,de reproduction sur papier ou sur format lectronique. L'auteur conserve la proprit du droit d'auteur qui protge cette thse. Ni la thse ni des extraits substantiels de celle-ci ne doivent tre imprims ou autrement reproduits sans son autorisation.

The author retains ownership of the copyright in this thesis. Neither the thesis nor substantial extracts from it may be printed or otherwise reproduced without the author's permission.

To rny parents


Master of Applied Science, 1998, by Michelie Desarmo, Graduate Department of Chernical Engineering and Applied Chemistry,

University of Toronto

A novel identification experiment based on relay feedback is proposed which automaticdy
generates a nonperiodic binary process input signal by interniittently placing additional dynamics into the relay feedback loop. The input signal is rich in frequency content, perrnitting identification of a multiple-point frequency or step response model from a single experiment. The Frequency Sampling Filter (FSF) model is used to fit the models to the relay generated data using a least squares estimator. A recursive version of this algorithm

has been incorporated into a prototype software application that combines the new relay
experirnent with on-iine FSF mode1 identification. The prototype has been applied to a pilot-scale, stirred t d heater process to demonstrate the new method in practice.

Acknowledgement s
1 wish to express my sincere thanks to the many people who have supported me in various
ways during this project. 1would especially like to acknowledge the foUowing people:

* My supervisor, Dr. * Dr.


William Cluett, for his guidance throughout my work at U of T,

and also for his bancial support. Liuping Wang for her advice and extraordinary enthusiasm.

Feilow members of the Process Control Group for many interesthg conversations and lots of advice. Special thanks to:

- Alex Kalafatis for sharing his LabVIEW knowledge. - Joe Tseng for being on cd1 every time the cornputers did something unexpected.
- Sophie McQueen for al1 her help with my presentations. - Female members of the group for their fiiendship, and for organizing extracur-

ricular fun.

AU of my fiiends, for their inspiration.

Penny Seymour for fond memories of my experience as a T A in the first year lab.
My family for a l l the love, support and encouragement that they have given me
throughout my education.

Abstract Acknowledgements List of Tables List of Figures Nomenclature
1 Introduction 1.1 Motivation and Thesis Objectives . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Literature Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.1 The Astrorn-~a&nd autotuner . . . . . . . . . . . . . . . . . . . . 1.2.2 A survey of autotuning applications . . . . . . . . . . . . . . . . . . 1.2.3 Describing function approximation . . . . . . . . . . . . . . . . . . . 1.2.4 Alternative methods and improvements to the DFA . . . . . . . . . 1.2.5 Transfer function identification . . . . . . . . . . . . . . . . . . . . . 1.3 Outline of the Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Ekequency and Step Response Identification fkom Relay Data 2.1 Frequency Sampling Filter Algorithm . . . . . . . . . . . . . . . . . . . . . 2.1.1 Frequency sampling filter mode1 . . . . . . . . . . . . . . . . . . . . 2.1.2 Step response models . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.3 Formulation of the least squares problem . . . . . . . . . . . . . . . 2.1.4 PRESS statistic for mode1 order selection . . . . . . . . . . . . . . . 2.1.5 FSF/PRESS algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 A New Relay Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.1 Relaydynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.2 Proposed experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.3 Experimental design . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Application of the FSF Algorithm to Relay Feedback Data . . . . . . . . . 2.3.1 The desired input spectrum . . . . . . . . . . . . . . . . . . . . . . . 2.3.2 Properties of the FSF correlation matrix . . . . . . . . . . . . . . . .


i v

1 1 3

5 6 7 9 10
11 11 12 14 15 16 17 18 18 19

20 23 23 25


2.3.3 Choice of the parameter N . . . . . . . . . . . . . . . . . . . . . . . Experimentalresults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

27 27 31 31 31 35 35 38 40 41 45 46 47 48 49 60
68 69

3 F'urther Design Issues and Case Studies 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Characteristics of Processes with High Criticai Frequencies . . . . . . . . . 3.3 The Muence of Delay on the FSF Spectrurn . . . . . . . . . . . . . . . . . 3.3.1 First order processes . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.2 Second order processes . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.3 EffectofrelayparametersontheFSFSpectnun . . . . . . . . . . . 3 4 A Modification to the New Experiment . . . . . . . . . . . . . . . . . . . . . 3.5 Guidelines for Adjusting N for the FSF Mode1 . . . . . . . . . . . . . . . . 3.6 Noise M o d e h g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 7 BacklashEffects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8 Case Studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8.1 First order models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 8 2 Second order models . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
4 On-Line Identification and Experimental Results 41 Recursive Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.1 Formulation of the recursive least squares problern . . . . . . . . . . 4 1 2 Updating the covariance matrix via RUD factorkat ion . . . . . . . .. 4.2 The Recursive FSF Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.1 An alternative representation of the FSF mode1 . . . . . . . . . . . . 4.2.2 Recursive estimation of the FSF mode! . . . . . . . . . . . . . . . . 4.2.3 Initialization of the RLS algorithm . . . . . . . . . . . . . . . . . . . 4.3 A Prototype Software Application for On-Line Identification . . . . . . . . 4 3 1 Codevalidation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 4.4 Experimental Case Study on a Pilot Scale Stirred Tank Heater . . . . . . . 4.4.1 Operat ing conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4 2 Results of experiment # 1 . . . . . . . . . . . . . . . . . . . . . . . . .. 4.4.3 Results of experirnents # 2 and 3 . . . . . . . . . . . . . . . . . . . . 4 4 4 Remarks on practical issues . . . . . . . . . . . . . . . . . . . . . . . ..

70 71 71 73 76 77 82 83 84 85 91 99

5 Conclusions and Recornmendations 5.1 Contributions of the Thesis . . . . 5.2 Recommendations for Future Work

. . . . . . . . . . . . . . . . . . . . . . . 105 . . . . . . . . . . . . . . . . . . . . . . . 107

A The Relationship Between the Batch and Recursive FSF filters


List of Tables
4.1 S u m m q of Parameters/Options on the Interface . . . . . . . . . . . . . . . 4 2 Srimmary of Experiment # 3. the T plus delay experiment . . . . . . . . . l


List of Figures
1.1 The Basic Relay Feedback Experiment . . . . . . . . . . . . . . . . . . . . . 1.2 The Relay Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Autotuner: d = f2, E = 0.5 . . . . 1.3 Sample Data fkom the A s t r o m - ~ a ~ ~ l n d

4 4

13 19

Schematic Diagram of the FSF Mode1 . . . . . . . . . . . . . . . . . . . . . The Influence of Additiond Dynamics on Excitation F'requency . . . . . . . Block Diagram of the Proposed Experiment . . . . . . . . . . . . . . . . . . Comparison of Data Generated fkom the New and Standard Relay Experiment New Relay Experiment Applied to Two Different Models with Identical Input Sequences: [O O 1 1 1 0 1 0 1 O O 1 . . . . . . . . . . . . . . . . . . . . . . . 1 A Typical FSF Input Spectrum Obtained from the Proposed Experiment: input sequence [O 0 0 1 1 1 1 0 0 1 . . . . . . . . . . . . . . . . . . . . . . 1 Experimental Resdts for the STH . . . . . . . . . . . . . . . . . . . . . . . Identification Results for the STH . . . . . . . . . . . . . . . . . . . . . . .

21 24
26 29


3.1 New Experiment Applied to Two First Order Models with Different Deadtimes (input sequence [O O 0 1 1 1 1 0 0 1 0 1 1 1 O]) . . . . . . . . . . . . . 3.2 A Comparison of FSF Spectra for Data in Figure 3.1 . . . . . . . . . . . . . 3.3 The Effect of Deadtirne on the F'requency Response of First Order Relay Dynamics (AU time constants are 100 sec. The FSF Erequencies are shown by o.*.xt+.) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 A Comparison of the Observed and Ideal Normalized Period for First Order Modek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 A Comparison of the Observed and Ideal Normalized Period for Second Order Critically Damped Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6 The Effect of Hysteresis on the UItimate Period . . . . . . . . . . . . . . . . 3.7 Block Diagram of the Modified Relay Experiment . . . . . . . . . . . . . . . 3.8 Met hodology for the Additional Delay Experiment . . . . . . . . . . . . . . 3.9 Simulation Results for Case 1 . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10 Identification Results for Case 1 . . . . . . . . . . . . . . . . . . . . . . . . . 3.11 Simulation Results for Case 2 . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12 Identification Results for Case 2 . . . . . . . . . . . . . . . . . . . . . . . . . 3.13 Simulation Results for Case 3 . . . . . . . . . . . . . . . . . . . . . . . . . .

3.14 Identification Results for Case 3 . . . . . . . . . . . . . . . . . . . . . . . . . 3.15 Simulation Results for Case 3b . . . . . . . . . . . . . . . . . . . . . . . . . 3.16 Identification Results for Case 3b . . . . . . . . . . . . . . . . . . . . . . . . 3.17 The Effect of Normalized Deadtirne on the Magnitude of the Process Output 3.18 Simulation Results for Case 4 . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1 Identification Results for Case 4 . . . . . . . . . . . . . . . . . . . . . . . . . .9 3.20 Simulation Resuits for Case 5 . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 Identification Results for Case 5 . . . . . . . . . . . . . . . . . . . . . . . . . .1 3.22 Simulation Resuits for Case 6 . . . . . . . . . . . . . . . . . . . . . . . . . . 3.23 Identification Results for Case 6 . . . . . . . . . . . . . . . . . . . . . . . . .

42 .


45 .
4.7 4.8

49 . 4.10 41 .1 4.12
4.13 4.14

The Main Control Panel of the Prototype Interface . . . . . . . . . . . . . . The Identification Control Panel of the Prototype Intexface . . . . . . . . . Cornparison of the LabVIEW (RLS) and MATLAB (batch LS) Fkequency Response Estimates: 6 settling tMes of undifferenced data, N = 600. n = 11. 0.2 sec s a m p h g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Schematic Diagram of the Stirred Tank Heater Pilot Plant . . . . . . . . . . Input/Output Data for T2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . On-line Identification Results for T2 Using Three Settling Time Estimates (n=ll) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . On-Iine FSF spectrum for T2 ( N = 259, n = 11) . . . . . . . . . . . . . . . On-line Identification Results for T2 Using Three Mode1 Orders . . . . . . . On-line FSF spectrum for T2 (N = 259,n = 13) . . . . . . . . . . . . . . . Convergence of the T2 Model with Time (N = 259, n = 1 ) 1 - 6 settling 1: times of data = o,x.",+,solid,dotted, respect ively . . . . . . . . . . . . . . . Input/Output Data for T (no additional delay) . . . . . . . . . . . . . . . l Cornparison of Input Signal Fkequency Content for Two Processes . . . . . Convergence of the T Model with Time (N = 221 n = 11): 1 - 5 settling l times of data = o,x,",+,solid, respectively . . . . . . . . . . . . . . . . . . . Input/Output Data for the T l Plus Additional Delay Experiment: see Table

4.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.15 On-line Identification Results for the T Plus Additional Delay Experiment l .6: (see Table 4.2;continued in Figure 4 1 ) solid, dotted lines are the estimated step responses fkom differenced. non-differenced data respectively . . . . . 4.16 On-line Identification Results for the T Plus Additional Delay Experiment l (see Table 4.2; continued from Figure 4.15): solid. dotted lines are the estimated step responses from dinerenced. non-differenced data respectively . 4.17 On-line Identification Results for T2: automatically estimated set t ling tirne.
N=190 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.18 O n - h e Identification Results for Tl: automatically estimated settling time.

N=44 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.19 Biased and Unbiased Relay Data: Two runs of Experiment #1

........ .......

4.20 On-iine Identifkation Results f r T . DBerencing can be advantageous when o 2 baddash effects are signincant. Input/Output data shown in Figure 4.19 . . 103

limit cycle amplitude real part of the kth fiequency response coefficient: G ( g W)k imaginary part of the kth fiequency response coefficient, G(eJWk) relay amplitude additional delay added to the feedback loop diagonal m a t r k in the RUD factorization of P ( t ) kth diagonal of the FSF covariance matrix (FSF spectrum) conventional residuals PRESS residuals sum of squared prediction errors m t h step response coefficient discrete process fiequency response at frequency wk continuous t ime process t ransfer funct ion discrete time process transfer funct ion it h impulse response coefficient kth FSF fiIter FSF integer hannonic number RLS update gain ult imate gain FSF mode1 order process settling time, in units of sampling i n t e d s the DFA ideal switching period associated with FSF fkequency w i RLS covariance matrix frequency response weighting function tirne, in units of sarnples process settling time, in units of time process input at time, t unit upper triangular matrix in the RUD factorization of P ( t ) disturbance at tirne, t dist urbance vector without data at time,t predicted process output generated using process output at time, t process output vector backwxds shift operator delay to time constant ratio



process deadtirne

sin(wk) sampling interval relay hysteresis widt h FSF parameter vector (Bequency response parameten) FSF parameter vector estimated without using data at time,t standard deviation of the noise process t ime constant kth FSF filter output at tirne, t phase angle, in rad, at frequency W , FSF regressor vector (6ltered input signal) FSF filter (RLS formulation) associated with the imaginary part of the kth frequency response coefficient FSF filter (RLS formulation) associated with the real part of the kth fkequency response coefficient frequency, in rad/sec kth FSF fkequency, in rad



FSF Model PEI Controuer

RUD Factorization STH

Describing Function Approximation Discrete Fourier Transform Fast Fourier Transform Finite Impulse Response F'requency Sampling Filter Model Proportional Integral Derivative Controuer PRediction Error Sum of Squares Random Binary Signai Recursive Least Squares Recursive UD factorization Stirred Tank Heater

Chapter 1


Motivation and Thesis Objectives

In the early eighties, Astrom and Hagglnd (19840) proposed the use of relay feedback
combined with a describing function approximation (DFA) as a simple means to estimate the critical fkequency response of a process. The key idea behind this work was that the relay experiment can be used as a meam to automatically excite a process at its critical frequency. When combined with the DFA, the relay proved to be a very efficient way to obtain process information that could be directly applied to PID controller design. Since 1984, many variations and refmements to the original method have been developed and used in a number of applications, including autotuning of P D controllers (Astrom and Hagglnd, 1984h Leva, 1993; Kim, 1995; Khan, 1995), initialization of adaptive controllers (Hagglihd and Astrom, lggl), process identification (Li et al., 1991; Sall and Astrom, 1991)

and process monitoring (Belanger and Luyben, 1996; Chiu and Ju, 1997).
Astrom and Hagglnd's approach was particularly successhil because. although the information generated by the experiment is Limited, very Little a pn'ori knowledge is required to conduct the experiment and the data is simple to analyse and readily applicable to fa-

miliar PID controller designs (e.g. Ziegler and Nichols, 1942). The relay experiment is
attractive not o d y because it is easy to understand and implement, but also because it is
a closed loop experiment that maintains the process near its operating point. The main

limitation of current relay methods is that the generated input/output data is dominated by a single fkequency. This means that the input spectrum is not diverse enough to permit more than one or two fkequency response points on the process Nyquist plot to be accurately

ident ified.

The literature on relay feedback applications relies almost exclusively upon the use of a
describing function approximation, which estimates a single fkequency response point based on the assumption that the relay data has a dominant k t harmonic component. Although this is oRen a reasonable assumption, for cases as common as a first order process, this assumption has b e n shown to cause significant estimation errors (Friman and Waller, 1995)Regardless of accuracy, the DFA i limited by the fact that it yields oniy one frequency s response point per relay experiment. A direct consequence of this limited information is that applications have been restricted to certain control strategies (eg. PID tuning using specified gain/phase margins). In other words, the amount of information generated leaves Little room for flexibility in controller design.

In order to obtain a more flexible model, it is necessary to gather more process information by performing a series of dinerent relay experiments. Those who have attempted to constntct more generdy applicable models, such as transfer h c t i o n s , have identified different fiequency response points fkom several relay experiments, and then used these points to fit a parametric model. Selecting a model structure complicates the modelling process by requiring the user either to impose an a priori model structure' or to fit several types

of models and develop a detailed procedure for deducing which is the "true" model. This
means that the predictive capability of modeis generated by these methods is often comprornised by mode1 structure mismatch, in addition to the accuracy limitations inherited

from the DFA.

Despite this body of work, the Literature suggests that there is still a need in industry for a simple experiment that can produce a more accurate and more complete model of the process. Response tests that use random binary input signals are an alterriative means of obtaining data for process identification. The non-periodic nature of these signals implies that there is enough multifrequency information in a single experiment to construct a more complete hequency response model. Unfortunately, a priori knowledge of the process is required to design such an input signal with the correct fiequency content. Also, if a predesigned input signal is applied in an open loop experiment, there is a risk that the process variable will drift outside the desired operating region.

Thus, the main objectives of this thesis are: To develop a single, relatively simple relay feedback experiment which WU provide

s rich multifrequency excitation that i suitable for the purpose of identifjring a general
purpose process model (e-g. a frequency and/or step response model). To examine the use of the Frequency Sampling Filter (FSF) model structure and a least squares estimator as a means to improve upon the accuracy of the the same time developing a general purpose model. To achieve both of the above objectives while minirnizing the amount of a priori information required fiom the user. In other words, the objective is to automaticdy obt ain an appropriate mult iikequency input signal, while requiring no more process information than that required by the basic relay experiment (i.e. the sign of the process gain). With respect to the chosen FSF mode1 structure? only an estimate of the process settling time i required. Work will be done to detennine whether this s information can be automaticdy determined horn the relay feedback data.

DFA while at

121 ..

Literature Review
The Astrom-EIagglnd autotuner

Ziegler-Nichols (1942) controller tuning rules are based upon knowledge of the ultimate

gain and ultirnate period of the process. Such information was originally obtained by using
proportional control wit h a gradually increasing gain to induce a Limit cycle in the process output. This method was time consuming and risked operation on the verge of instability. Astrorn and Hagglnd (1984a) proposed relay feedback as an alternative to this trial and error method. They identified the critical point with a describing function approximation for the relay, and directly applied this information to a Ziegler-Nichols P

D controller design.

The block diagram in Figure 1.1 shows the basic relay feedback experiment, known as the Astrom-~a~~lnd Autotuning experiment. This experiment automatically excites the process neai- its critical frequency (conditions for the existence and stability of relay limit cycles have been presented by Astrom and Hagglnd (1984a) and Hang and Astrom (1988)). The relay block is shown in more detail
in Figure 1.2. The principle idea behind the operation of the reiay is that it creates a

Figure 1.1: The Basic Relay Feedback Experiment

Feedback Erxor

Process Input

Figure 1 2 The Relay Block .:

periodic binary input signal, u, whose amplitude, f i determined by the sign of the d: s feedback error, e. That is, the input signal switches are triggered by the zero crossings of the feedback error, In order to minimine correlation with high hequency noise, the relay

is t-ypicdy implemented with a hysteresis of width


which is generally set to be about

three times the estimated standard deviation of the noise. Therefore, to trigger a switch, the feedback error must move beyond the zero crossing by a significant amount relative to the noise Ievel,

122 ..

A survey of autotuning applications

Many applications have been developed to exploit the relay's ability to autornatically gen-

erate speciic fkequency information that is directly applicable to simple controller designs. Autotuning of PID controllers i one such area in which variations on the autotuning expers iment proposed by Astrom-EIagglnd have played a signincaot role. For example, Palmor et al. (1995) have extended the Astrom-~agglndautotuning experiment to multivariable processes. In contrast to sequential autotuning methods (Luyben, 1987; Shen et a . 1996), l: Palmor's method allows al1 loops to be sirnultaneously closed under relay feedback. Since the multivariable situation gives rise to infinitely many possible critical points (depending on the ratio of the relay amplitudes in each loop), they have concentrated on developing an iterative method for identibing the desired critical point from a user-specified parameter that indicates the relative importance of the loops. The methods developed by Leva (1993):

Kim (1995) and Khan (1995) have combined the relay with additional dynamic elements
such that the process is autornatically excited a t frequencies other tban the critical frequency. In the case of Kim's method, a simple autotuner was proposed which uses a delay element to operate the process at a specified phase margin. The dtimate gain and period are directly used as P I parameters, without the need for W h e r application of tuning rules. A more complex iterative scheme was developed by Leva, who used a low-pass filter and a variable delay element to design a phase margin specified PID controller. Khan used two relay experiments (with and without an integrator) in order to obtain hequency response information at two different frequencies. fiequency domain tiining rules were subsequently applied to these data points to determine suitable PID controller parameters. A more complex tuniag method, designed to improve the performance of an existing controller,






1 1

1 I


1 1 I








40 Time (sec)




Figure 1.3: Sample Data from the Astrom-~a&nd Autotuner: d = f2, c = 0 5 .

was suggested by Schei (1992; 1994). Here, the relay is applied around the wcisting closed

loop system in two separate experiments (with and without an integrator in the loop). A discrete transfer function is identified om the generated data and is then combined with specifications on the maximum amplitude of the sensit ivi ty and complementary sensitivi ty functions to yield new PID controller parameters.


Describing function approximation

Some typical relay feedback data is shown in Figure 1.3. It is generaily assumed that the relay generates a periodic square wave output of amplitude, d, with a dominant first

harmonie component which corresponds to the ultimate period of the process. The limit
cycle induced in the process output variable is assumed to be a sinusoidal signal with the same period. With these key assumptions, and a measurement of the output lirnit cycle amplitude, a, the DFA provides a simple way to estimate the ultimate gain of the process:

The DFA is based upon a Fourier series expamion of the relay output. Consider the
square wave relay output, which is an odd function. This signal has harmonic components

at odd multiples of the fundamental frequency. The energy associated wit h each harmonic

decreases rapidly, giving rise to the assumption that the fundamental fkequency component dominantes. The Fourier series expansion of the process input signal ~ ( t is written as: )

The harmonic terms are then assumed to be negligible:

Similady, the limit cycle of the process output, y(t), is approximated as a sinusoid which lags the input by -n rad:
y(t) z z



The ratio of these two sinusoids produces an estimate of the process response at the fundamental frequency:

Assuming that the fundamental fkequency of the limit cycle is equal to the critical frequency, the negative inverse of the process response provides an estimate of the ultimate gain of the process (Equation 1.1).


Alternative methods and improvements to the DFA

There are limitations associated with the use of the DFA. Firstly, for cases as cornmon
as a first order plus delay process, the key assumptions of the DFA break down (notice,

for example, that the process output response in Figure 1.3 is not very sinusoidal). As a result, a great deal of research has focused on improving the accuracy of DFA. In addition, the DFA is limited by the fact that it can only i d e n t e one frequency response point per experiment. The DFA's simplicity and popularity seem, in many cases, to have encouraged research with the aim to reduce, rather than emphasize, harmonic frequencies which could have otherwise been used to fit more complete modek.

Li et al. (1991) have reported convergence dificulties when attempting to fit transfer
h c t ion modeis wit h DFA generated frequency response est imates. Their convergence probiems were attributed to the inherent inaccuracy in the DFA. In fact, Friman and Waller

(1995)recently reported that errors as large as 30% in the ultimate gain and 20% in the
ultimate per-iod codd result from anaiysing relay feedback data wit h the DFA. These authors have eliminated the assumption of a dominant first harmonic by pretreating the signal with
an expression which isolates the first harmonic component of the output. Estimates of

the critical bequency were


improved with the development of an iterative experiment,

which replaces the relay with a saturathg gain element in order to minimixe the phase

Iag contribution of higher harmonies. Sung and Lee (1995) have also improved the DFA accuracy by modifying the experiment. They propose that a dit her signal be added to the relay signal such that unwanted harmonic fkequencies are reduced. Hang et al. (1993)have examined the effects of disturbances on the Iimit cycle and DFA estimate, and suggested methods for disturbance detection and self-correction. Severai papers have taken the opposite approach to improving the DFA accuracy. Rat her t han changiag the experiment to improve the DFA accuracy, many have instead selected an alternative data analysis method for the basic relay experiment. For instance. Astrom and Hagglcd (Astrorn, 1988: Hagglnd and Astriim, 1991) have modified their original method by applying waveform analysis to the process output and directly estimating a transfer function modeI. This method is intended primarily for f i s t order systems, since they are most likely to violate the DFA assumption that the h s t harmoaic component is dominant. However, it has been observed (Sall and Astrom, 1991) that this metho$ is sensitive to noise and difficult to apply to high order systems. Others, such as Chang et al. (1992)have replaced the DFA with analytical expressions for the limit cycle. Wang et al. (1997) have taken an approach similar to Chang et. al., but developed the method for use with a biased relay experiment so that steady state gain information can also be obtained. Huang et al.
(1996) point out t hat, while simple autot uning met hods are reasonable for Ziegler- Nichols

t uning , the performance of model-based controllers and integral performance criteria are sensitive to inaccurate estimates of the delay to time constant ratio. In this case, 6rst order plus delay parameters are more accurately estimated using time domain expressions for a biased relay experiment . The Discrete Fourier ~ a n s f o n n (DFT) i a alternative which has been applied by s n Lundh and Astrom (1994) in automatic initialization of adaptive control systems. Fast Fourier Transform (FFT)methods are suggested by Chiu and J u (1997) for fkequency do-

main based performance monitoring of the complementary sensitivity funct ion. Khan (1995)
fit pararnetric transfer function models wit h fkequency response points t hat were ident ified by ushg Frequency S a m p h g Filters to isolate the k t harmonic fiequency response of the relay experhent.

125 ..

Transfer fimction identification

Fitting a transfer function model normally requires an estimate of severai frequency response points. Since the Astrom-~aglndAutotuning experirnent provides oniy one point, the identification literature contains many papers that look at ways to generate additional frequency information. These met hods collect mdtifi-equency data via a series of modified relay experiments, each of which alter the excitation frequency through the placement of different, known dynamics inside the feedback loop. For example, Haggliind and Astrom (1991) have suggested the possibility of identifying multiple points on the Nyquist curve through the addition of an integrator into the relay feedback loop. Individuai fkequency response points are sequentially identified through repeated application of the DFA to each periodic data set, and a transfer function may then be fit using these points.

In a few cases (Sd and Astrom, 1991; Shen et al., 1996; Wang et al., 1997), unsymmetrical or biased relay data has b e n used to provide additiond information about the

gain. Sall and Astrom (1991) presented the method of moments as a means of estimating
the steady state gain fiom unsymmetrical, periodic relay data. The Dual Input Describing Function, which is an extension of the DFA, has also been used for this purpose by Shen et. al. Given unsymrnetricai periodic data, two frequency response points may be identified (i.e. the gain and critical point). Considering that deadtirne is often estimated fiom the initial process response, there can be enough information to fit a transfer function model from a single modified relay experiment. autotuner to the multivariable case for Luyben (1987) extended the A s t r o m - ~ a ~ ~ l n d nonlinear distillation colilmns. This work required oniy one relay experiment, but assumed that the process gain was aiready known, or could otherwise be obtained. This method was developed further (Li et al., 1991), such that the gain requirement was replaced by information korn a second relay experiment where additional delay was added to the loop. In both of these papers, a series of possible model structures were applied to the data. Each

rnodel then had to be evaluated and compared with other models to deterrnine which was best. The above methods produce more useful transfer models, but require the user to either impose a model structure (Wang et al., 1997; Sail and Astrom, i W l ) , or to fit a whole range of modeh (Luyben, 1987; Li et al., 1991; Chang et al., 1992) and then develop some method for evaluating which one is the %ruen model. The main disadvantage with this approach to m o d e h g is that, in addition to errors which may have b e n introduced by the

DFA, and the effort involved in selecting the model structure, there is dways further risk
of inaccuracy due to model structure mismatch.

13 .

Outline of the Thesis

The remainder of this thesis is organized as follows. Chapter 2 discusses the role of the FSF algorithm in the development of a new multifrequency relay experiment. Key design issues surrounding the new identifkation procedure are explained in Chapter 3, where a selection of simulation case studies are provided. A recursive least squares (RLS) implementation of
the FSF algorithm is introduced in Chapter 4. Hem, a prototype designed with LabVIEW

software, is also presented. This program combines the new relay experiment with the RZlS algorithm to provide a methodology for on-line step response identification. Experimental results obtained by applying this prototype to a pilot-scale stirred tank heater are also included. Finally, conclusions and recommendations are given in Chapter 5.

Chapter 2

Frequency and Step Response Identification from Relay Data

An automated, closed loop approach to frequency domain identification is introduced in this chapter. Frequency domain rnodel parameters, fkom which a step response model may be constructed, are estimated via the Frequency Sampling Filter (FSF) algorithm developed
by Goberdhansingh et al. (1992). The FSF algorithm combines a standard least squares

estimator with the FSF model structure, and requires a multifiequency spectrum of input excitation which, for a large class of systems, rnay be generated automatically by a modified relay experiment . This chapter is organized such that Section 2.1.1 describes the FSF/PRESS identincation algorithm. Section 2.2 explains the deveIopment of the proposed relay experiment which places additional dynamic elements into the feedback loop in order to create a broad spectrurn of excitation. Section 2.3 deah with the issues surrounding application of the FSF algorithm to data obtained fiom the new experiment.

21 .

Frequency Sampling Filter Algorithm

The FSF model, f m t introduced to the area of process ident*cation by Bit mead and Anderson (l98l), is obtained fiom a Linear transformation of the familiar Finite Impulse Response

(FIR) model. Therefore, any linear, time invariaot process which may be described by N

F R coefficients rnay be represented equivalently by N fkequency response coefficents. The

FSF model is comprised of a series of N pardel band-pass filters which act on the process
input signal. The filter outputs are then weighted by their corresponding fiequency re-

sponse coefficients and summed to form a predidion of the process output. The FSF model carries two important advantages over the FIR model. Firstly, the fkequency domain representation allows for truncation of high bequency parameters, which often have a negligible contribution to the o v e r d process step response. In most cases, the reduced FSF model order is much smaller thaa that of the equivalent FIR model. Secondly, the remaining

FSF model parameters are often estimated more accurately because truncation of the high
fkequency parameters improves the conditioning of the least squares estimation problem.

211 ..

F'requency sampling filter model

Consider a linear, time invariant, stable process which may be described by an Nth order FSF or FIR model. For a stable process with settling time Tset,the characterized by the impulse response coefficients of the process

FIR model is

where r-' is the backward shift operator and for a given sampling i n t e d , At, the model order, N, is selected as N = T,,JAt. It i assumed that hi s

O for al1 i 2 N

The FSF model is derived by substituting the following inverse discrete Fourier transform

(DFT) into Equation 2.1:

Interchanging the siimmation signs and noting t hat

we c m describe the FSF model as

where r

~ k 27rklN =

rad, k = O, f1 , . . . ,f( N - 1)/2-

A generd process model which describes the relationship between the input signal, u ( t )
and the process output, y (t), is t herefore

Figure 2.1: Schematic Diagram of the FSF Model

The schematic diagram of the FSF model structure in Figure 2.1 illustrates how the input signal, u ( t ) ,passes through N parallel band pass filters and is weighted by the process
), frequency response, G(eJWk at each filter%centre frequency, wk. The s u m of t hese weighted

frequency components forms the prediction of the process output, y (t) .

An important advantage of using the FSF model structure over the FIR model is that
the transformation fiom the time domain

(Fm) the frequency domain (FSF) pemits to

truncation of the mode1 order. When dealing with the fiequency domain model; a reduction in the number of parameters corresponds to the exclusion of high fiequency filters. Model reduction in this sense is beneficial, since we are only considering stable processes, whose high fiequency response is strongly attenuated and often subject to an unfavourable signal to noise ratio. The reduced FSF model is written as foliows:

Here, we have introduced the effective model order, n, with the assurnption that ~ ( d " )

is negligible for

9 Ikl 5 9The issue of how to determine the best model order is < .

addressed later in this chapter, when the PRESS algorithm i introduced. s

212 ..

Step response models

In process control applications, it is often desirable to express the process response as a step
response model, rather than a frequency response model. A step response model is e a d y obtained by substituting Equation 2.2 into the definition of the step response coefficients,
gm, m = O, l...,N - 1:

Interchanging the summaticns, and not ing t hat

the step response coefficients may be expressed as a weighted s u m of the fiequency response coefficients:


Wang and Cluett (1997) have shown that reduction of the FSF model order is justified by
examining the contribution of the high fiequency parameters to the overall step response model. For the zero fiequency, S(0,m ) linearly increases from 1/N to unity as m goes fkom O to (N

- 1).

For k

> 0, the step response weighting hinction, S ( k ,m), can be

broken into two separate terms which operate on the real and imaginary parts of G(eJ"). The magnitude of both the red and imaginary weighting functions decreases as frequency
(k) increases. Clearly then, G(elwo),i the most important parameter, and subsequent s

higher kequency response parameters becorne less and less significant. The fact that the step response weighting functions de-emphasize the high fkequency parameters allows for a significant reduction in the FSF model order without a significant loss of accuracy.

213 ..

Formulation of the least squares problem

Consider again Figure 2-1 the block diagram of the FSF model structure. The set of filter , outputs at sampiing instant t form the elements of the data vector # ( t ) ,d e h e d as

for the reduced FSF model. More specificdy,

where 4 k ( t )represents the output of the kth FSF filter, Hk(z):

A weighted sum of the elements in 4 provides a prediction of the process output as

foUows. A general process model may be written as

where v ( t ) represents the disturbance effect. The process may be expressed as a reduced FSF model by combining Equation 2.14 with Equations 2.6, and 2.12:

If the data set spans M sampling intervals, then Equation 2.14 may be expressed in
matrix form as:


Therefore, a standard least squares estimator, based on the data matrix,

a, and


process output signal, Y, yields a set of n parameters which correspond to each 6iter7s contribution to the overall step response. These weights are contained in the parameter vector, 8, and are simply the frequency response coefficients, G(e""k),which collectively describe a kequency response model of the process. Equation 2.16 is thus solved for 0 by minimizing the sum of squared prediction errors,

This yields the standard least squares solution of the FSF parameter vector:


PRESS statistic for mode1 order selection

The PRediction Error Sum of Squares ( P R E S S ) statistic is used as an indicator of model quality. It is defined by
1 w

where e,t are the

1 e2,


PRESS residuals:

The PRESS residuals, e-t7 are computed boom &, the FSF parameter vector which
w a

estimated by excluding the data y ( t ) and $(t).This data is excluded from the analysis

to ensure that y ( t ) and ij(t) will be independent of each other, a property of the


which is essential for model validation. By contrast, the conventional residuals are defined

Since y(t) and &(t) this case are dependent variables ( y ( t ) and $(t)are used to estimate in

8), conventional residuals are merely an indication of the quality of the model fit for the

the rnodelling data set and do not imply anything about the model's o v e r d predictive capabiiity. The PRESS statistic is evaluated for a range of Werent FSF model orders, and the reduced model order, n, is chosen such that the PRESS is minimiad. Wang and CIuett (1996) have shown that computation of the
an orthogonal decomposition algorit hm.

PRESS residuals is simple when using

215 ..

FSF/PRESS algorithm

With the standard least squares algorithm in Equation 2.22, it shouid be noted that the be parameter estimates WU consistent if the disturbanceo v ( t ) ,and input. u ( t ) : are uncorrelated. This is generdy not the case for closed loop experiments. However, in the case of
a relay experiment, a hysteresis is typicdy included in the relay to remove this correlation.

T i technique wiil u s u d y work if the disturbance is stationary. However, in the presence of hs

drifting disturbances, correlation may be present , causing bias in the parameter estimates.
For these reasons an extension of the original algorithm proposed by Goberdhansingh et al.
(1992) was developed by Patel et al. (1997). This algorithm is an iterative version of the

FSF/PRESS algorithm which simultaneously estimates process and disturbance modeis.

The algorithm is outlined as follows:

Step 1: Prefilter the inputfoutput data with the inverse of the curent noise mode1 (skip
this step the first time through)

Step 2: Estirnate the FSF parameters using the prefiltered data (similar to the original
algorit hm)

Step 3: Estimate a new noise model iom the residuals

Step 4: Repeat steps 1 through 3, until the model has converged

Since this algorithm includes proper data prefiltering, the resulting model is assumed to be unbiased. This d o w s statisticd confidence bounds to be calculated based on the cowiance of the parameter estimates. Based on the assumption that the fltered residuals

are white, Cluett et al. (1997) have derived expressions for the confidence bounds around
the model estimate within which the true fkequency and step response lie.


A New Relay Experiment

In Chapter 1, it was mentioned that additional dynamic elements could be introduced into
the relay feedback loop to influence its behaviour. Relay dynarnics w i l l now be reviewed, and used to motivate the development of a new relay feedback experiment to create a nonperiodic, multifrequency input signai that is well suited to the estimation of an FSF model. This experiment is simple to implement, requiring almost no prior knowiedge of the process to be identiiied. It should be noted, that with the new experiment, model estimation is not restricted to the FSF model structure. The data generated kom the new experiment could be used with any other model structure.

221 ..

Relay dynamics

To try and obtain mcre information than just the critical point of the process, many variations on the Astrom-~a&nd autot uning experiment have been proposed to provide addit ional hequency informat ion. These met hods typicaily involve a modioied relay experiment , in which the excitation fiequency is altered through the introduction of a known dynamic element into the feedback loop. Figure 2.2 illustrates how some common dynamic elements inauence the fiequency of the process response. The standard relay experiment excites the process at its critical point,

which is located at the intersection of the Nyquist plot and the negative real a. &


corresponds to a phase iag of 180 degrees. In practice, a hysteresis is normally included in the relay to avoid random switches generated by the output noise. The hysteresis produces excitation at a slightly lower frequency than that observed with a pure relay. Similarly,
the use of additional delay (ive. in addition to the natural deadtime of the process) in the

feedback loop also shifts the frequency response to a point below the critical frequency. Both
delay and hysteresis allow the excitation fiequency to be lowered arbitrarily. according to

how much hysteresis or deiay is applied. In contrat, the addition of an integrator produces
a fied 90 degree phase shift, such that the identified point always lies at the intersection
of the negative imaginary axis and the Nyquist plot.

Standard Relay Hysteresis Delay Integrator


Figure 2.2: The Infiuence of Additional Dynamics on Excitation F'requency


Proposed experiment

Both the standard relay and integrator plus relay experiments are attractive because they
are able to generate fiequency information at specific points on the Nyquist plot. Therefore,
in the development of the new experiment it was decided that the standard relay and inte-

grator plus relay experiments would be combined in order to ensure a good rnultifrequency input signal that did not require prior knowledge of the process. The fixed phase shift obtained from an integrator ensures that the low fkequency range is targeted. While other dynamics (e. g. delay, hysteresis) could be used to accomplish similar effects, it is difEcult to determine in advance the quantity of delay/hys teresis required to produce the desired effect. In a standard relay experiment, the switches are triggered by zero-crossings of the error signai. When an integrator is introduced to the loop, the relay is instead triggered by zero crossings of the integrated error signal. The proposed experiment combines t hese two individual experiments by alternating between the two different paths indicated by the dashed lines in Figure 2.3. In other words, the new input signal is generated by alternating

Figure 2.3: Block Diagram of the Proposed Experiment between having some input switches triggered by the feedback error, and ot hers triggered by the integrat ed feedback error. The overall effect of turning the integrator on and off (Le. alternating between the integrated and non integrated paths) is to create a nonperiodic input signal and, in a sense? "sweep" through a portion of the Nyquist plot (see, for example, Figure 2.4(a)). This input (relay output) is seen to be a binary signal which consists of a combination of faster pure relay switches and slower integrated relay switches, plus some transient switches of ~ s y i n g lengths. The standard relay experiment predominantly yields information about only a single fkequency because the data ( s e Figure 2.4(b)) is periodic. On the other hand, the new relay experiment yields a data set that contains information at several hequenciesoand is suitable for anaiysis with the FSF algorithm.

223 ..

Experirnental design

At fist glance, the new input appears to be much like a random binary signal (RBS).
However, in the new experiment, the relay output is automaticdy triggered according to the process response. In fact, the experirnental design reduces to the specification of when


(a)Nonperiodic Data Erom the New Experiment

(b) Periodic Data fkom the Standard ReIay Experiment

Figure 2.4: Cornparison of Data Generated fkom the New and Standard Relay Experiment

and when not to apply an integrator. Ln other words, the user is only required to specify a sequence of boolean values which indicate whether or not the integrator i present during a s particular switching interval. Letting 1 denote the presence of the integrator, and O denote the absence of the integrator, a sample input sequence is [O O O 1 1 1 1 1 O 1 1 O 1 O 1 O O].

For the most part, any input sequence is reasonable, so long as it contains a mixture
of zeros and ones. That having been said, there are a few guiding principles. Recall, that the main objective behind the input sequence is to automaticdy produce a process input signal with a bmad spectrum (Le. a nonperiodic signal), and emphasis on the lower hequencies. Conventional relay experiments give only one fkequency point because they discard transient data and analyse only the periodic portion of the data set. The new relay experiment instead tries to maximize transients which create a diverse multifiequency spectnun. The new experiment ais0 places an emphasis on obtaining good low fkequency information, which is important for obtaining a step response mode1 with an accurate estimate of the steady state gain.

For exampIe, a series of consecutive integrated switches can, on its own, provide a
great deal of fiequency information. The reson for this is that, during the first three to six integrated switches, there is a transient period where the switching interval gradually increases. The initial switches therefore provide a range of middle and hgh fiequency information and when the transient dies away, a low fiequency limit cycle results. Hence, to emphasize the lower fkequencies, it is necessaq to ieave the integrator in the loop for at least three to six switching intewctls. Zn the absence of the integrator, the transient period is brief (usuaily no more than about two switches) and the relay quickly settles into
a high kequency limit cycle. Series of non-integrated switches should therefore be present,

but perhaps fewer in nirmber, due to the fact that they produce only a smaU amount of transient data, and generally provide less important high frequency information. Additional diversity in the switching intervals can be obtained by alternating frequently between the two possible feedback paths. The feedback path is changed only as the error or integrated error signal crosses the hysteresis Limits. When this changeover occurs there will be a discontinuity in the signal used to trigger the relay. This can create some extra variation

in the switching frequency and further enrich the input spectrum.

A set of input sequence guidelines are now presented to siimmarize the above ideas. Note

that these guidelines are not based on any prior knowledge of the process to be identified, but rather, they are based on the idea that, for stable processes, it is generally desirable both to create a wide range of spectral information, and to emphasize the low fkequency components that are essential for a reliable estimate of step response model. Input Sequence Guidelines:

* Empbasize the presence of the integrator

rn Avoid long series of non-integrated switches (no more than three switches in a row) rn Use long series of integrated switches (three to six switches in a row)

Include a series of mixed switches (i. e. [ 1 O 1 O O 1 ) 1


Application of the FSF Algorithm to Relay Feedback Data

The conventional approach to analysing periodic relay data involves application of the DFA to identify a single point on the Nyquist plot. As described in Section 1.2, this type of approach to obtaining a transfer h c t i o n model may involve several relay experiments and may be subject to various assumptions, approximations, and model fitting criteria. Since the data collected from the new experiment contains signincant multifrequency information, the DFA is no longer an appropriate anaiysis tool. However, through direct application of the

FSF algorithm from Section 2.1.1, a frequency response model may be accurately identilied and used to construct a versatile step response mode1 of the process. The only information
required to construct the FSF model is an informative data set and an estimate of? N : the
process settling time. This section will verify that the modified relay experiment is able to automatically provide the informative data set.

231 ..

The desired input spectrum

The new experiment automatically generates the process input signal by using the relay to detect appropriate switching intervals rom the observed process response. Figure 2.5 presents simulation data fiom two ditferent processes using the same input sequence:

[O O 1 1 1 O 1O 1 O O 1 . The shape of the two data sets are very similar, t hough experiment 1
(b) runs about three times longer than experiment (a). Clearly, each process in conjunction 23




time (sec)




(a) Process ModeI: G(s) =


-21 O


100 time (sec)



(b) Proceis Model: G(s)=


Figure 2.5: New Relay Experiment Applied to Two Different Models with Identicai Input Sequences: [O 0 1 1 1 0 1 0 10 0 1 1

with the relay experiment has created an input signal specific to the time scde of its own dynamic response. The question remas to whether or not the generated input signal

fkom this generic input sequence produces a range of fkequency information that is desirable with respect to ident-g

an accurate FSF model.

R e c d from Section 2.1.1 that the key parameters of the FSF model correspond to the set of harmonic fkequencies
wk = O?&-,




67r k, Tset






* (nT'etl)?r radltime


The first few FSF frequencies are most significant in terms of their contribution to the process step response. Moreover, in terms of control applications, a good estimate of the process frequency response at w t = O (i.e. the steady state gain) is important. The ideal FSF input signal is therefore one which has good kequency content at each wk in Equation

2.28, and ernphasizes the spectral components which correspond to the centre frequencies
of the first few filters. Consider the Nyquist plot of Figure 2.2, whieh previously iilustrated the fkequency response points that are identifiable under relay feedback with and without additional dynamics in the loop. Notice that the point identified by the integrator-plus-reIay experiment is always Iocated at the intersection with the negative imaginary axis, and the point identified by the pure relay is located at the intersection with the real axis. It has been observed through a number of case studies (Chapter 3) that the centre fkequency of the first FSF often falls in the neighbourhood of the negative imaginary axis. InteHter, w l = 2n/TSet, grated switches therefore serve to emphasize low frequency content in the frequency range picked up by the first filter. Higher FSF frequencies, which are distributed dong the Nyquist plot towards the negative real axis and beyond, correspond to the fkequency information obtained fkom transients and plain relay switches.

232 ..

Properties of the FSF correlation matrix

In order to obtain an accurate mode1 it is essential that the data set be informative at aU of the "important" frequencies. F'ortunately, the correlation matrix, a*a, offers an indication

as to the quality of the input excitation. R e c d that the kth col-

of the data matrix, @

(see Equation 2.19), corresponds to the output of the kth FSF filter, whose centre frequency

I k Ith Fiter

Figure 2.6: A Typical FSF Input Spectrum Obtained fiom the Proposed Experiment: input sequence [O O O 1 1 1 1 O 0 11 is wk. The diagonal elernents of @*a representative of the amount of input signal energy are at each of the important FSF fiequencies because they are proportional to ( U ( e J W k ) ( * , the periodiogram of the input signal at those fiequencies (Wang and Cluett, 1997):

A plot of these diagonal elements (the "FSF spectrum") provides an approximation of

the input signal spectnun at the fkequencies Wk7k = 0 7 k l l & Z... ? i ~ (- 1)/2. The FSF , n spectrum will prove to be a useful indicator which can be used to assess and, if necessq, shape the input signal in order to obtain the desired fiequency content.

A standard relay experiment generates periodic, first harmonic dominant process input
data. In this situation, there is not enough diversity in the input spectrum to support more than about one or two pairs of FSF filters. The input signal in this case would produce a
@*@ matrix with essentially only one dominant diagonal element.

In contrast, the new experiment7sinput spectrum is rich over a wide range of fkequencies. Figure 2.6 illustrates the shape of a typicd FSF spectnrm that results kom a mixed input sequence. Strong spectral components in the low and middle fkequency range, corresponding to large diagonal elements in the @*@ matrix (especially at the filters corresponding to

ll = l? con6rm that the excitation is broadly distributed. k 2)? 233 ..

Choice of the parameter i V

The nature of the FSF mode1 applied in this work ailows the user to fit a mode1 with only
a minimum amount of prior knowledge about the process. The only required information

in this approach is an estirnate of N (the settling time in units of sampling intervals). More importantly, this single piece of information is only required after the data has b e n collected, allowing the user to adjust this parameter off-line to find the %estr results. Another approach is to try and estimate N directly fiom the experiment itseif. The reader will r e c d fiom Section 2.2.3 that the integrator plus relay switches have a long transient period that often settles, after several switches, into a E t cycle with a period

of approximately N sampling instants (fiequency of 2 x / N rad). A reasonable starting estimate of N / 2 can therefore be taken as the duration of the third or fourth consecutively integrated relay switching intenml.


Experimental results

Thus fa., new identifcation method has b e n motivated and discussed in a qualitative the sense. Preliminary results are presented here to summarize the above discussion and demonstrate the method's capabilities via an experimental case study. This example is intended simply as an illustrative result. huther simulation work and experimental results will be
f presented in Chapters 3 and 4 to provide a more thorough evaluation o the method.

The new relay experiment was performed on a pilot scale stirred tank heater (STH) apparatus (see Chapter 4 for more details on the STH process). This process consists of
a continously stirred water tank which contains steam coils. Cold water enters the tank,

is heated by the s t e m coils, and is then purnped out through a long piece of piping. A Ievel controller maintains the tank level at a steady d u e (22cm in this experiment) by manipulating the inlet water flowrate. The

STH has approximately first order plus delay

dynarnics, where the manipulated input is the steam valve position, and the process output is the temperature of the water exiting the tank, measured by a thermocouple placed in the outlet pipe. Experimental results were obtained by setting the relay amplitude and

5% and hysteresis width to be d = f

= 0.25"C, respectively. The input sequence was

[ i l 1iOllOO].

Figure 2.7 shows the input/output data fkom t his expriment. Approximately three settling t h e s of data were coilected for analysis with the FSF/PRESS algorithm described

in Section 2.1.5. The settling tirne of the STH was initiaily estimated as N

= 600 sec,

based on the duration of the third consecutive integnted switching interval, which begins at about t = 350 sec (the k t switch was so rapid that it was neglected). This estimate of

N yielded a step response estimate that seemed to settle out a Little faster than 600 sec,
and so N was adjusted to 570 sec. The diagonal elements of the correlation matrix (see
Figure 2.7(b)) were exaLzLined to evaluate the frequency content of the input signal. The

FSF spectrum seems to have a desirable peak in the Low frequency range, as well as good
information at

aU fiequencies. The mode1 was restricted to a maximum of eieven filters

(n = 11). The fkequency and step response models shown in Figure 2.8 were found to be in good agreement with expectations based upon past experience with the process. The 99% confidence bounds on step response also indicate that the mode1 is reasonably accurate. It is &O interesting to note that, in Figure S.B(a), the FSF fkequencies, w l and wl,are located quite close to the negative imaginaq and negative real axes, respect ively. This shows t hat one of the key assumptions of the experimental developrnent holds for t his process (i.e. that the integrator plus relay and standard relay experiments generate information in these regions). E tern of the step response developrnent, these kequencies are two of the most

important components of the input signal. The transient data, obtained by combining the relay and relay plus integrator experiments into one new meriment:


additional information about the gain and higher kequencies. The results show t hat , overail, the new relay experiment provides good excitation for step response identification in this case.




800 Io00 Time (sec)




(a) Input/Output Data

I k Ith Aller

(b) The FSF Spectrum

Figure 2 7 Experirnental Results for the STH .:



03 .




(a)Fkequency Response Model (Nyquist plot)

(b) Step Response Model

Figure 2.8: Identification Results for the STH

Chapter 3

Further Design Issues and Case Studies

This chapter will address some firrther design issues for the new relay experiment, such as
the effects of deadtime, noise modelling, and choice of the FSF parameter, N. Each of these issues will be separately motivated and discussed. The ha1 part of this chapter presents several illustrative case studies, from which many of the key design issues were originally ident ified.


Characteristics of Processes with High Critical F'requen-

The relay signal is triggered according to how quickly or slowly the process variable responds to the input signal. It is this characteristic of the relay which provides us with a closed loop experiment, and produces an input signal that depends on the particular process under examination. The new relay input experiment has been designed to generate oscillations which occur at the crossover frequency and at the fkequency where the Nyquist curve intersects the negative imaginary axis. For some processes, the new experiment will generate very fast oscillations t hat may not be useful for obtaining an accurate step response model. One class of systems that produce this kind of behaviour are fist order plus delay processes where the deadtime is s m d relative to the time constant. Consider the simulation results presented in Figure 3.1. These data sets were obtained
using the same input sequence on two s i d a r first order models. Note that the time con-








Time (sec)

-21 O



1500 Time (sec)



Figure 3.1: New Experiment Appiied to Swo Fust Order Models with Dinerent Deadtimes (input sequence [O O O 1 1 1 1 O O 1 0 1 1 1 O])

Figure 3.2: A Cornparison of FSF Spectra for Data i Figure 3.1 n

5 sec deadtirne 25 sec deadtirne 70 sec deadtime





Figure 3.3: The Effect of Deadtime on the F'requency Response of First Order Relay Dynamics (AU time constants are 100 sec. The FSF frequencies are shown by o,*,x,+.) stants for these two processes are identical (100 sec) and their settling times are close (525 and 570 sec). The only difference between these models is the amount of deadtime. Based on the assumption that the relay switching intenml is related to the time scale of the process. it might be expected that these two experiments would yield similar data and, therefore, similar FSF spectra. Yet, a comparison of the two data sets in Figure 3.1 shows a remarkable difference between the duration of the two experiments. Also notice the Merence in the shape of the two graphs of Figure 3.2, which show the distribution of input energy across the FSF filters. Figure 3.2(b) (the more sluggish process) has most of its energy at the h s t

and second pair of filters, while Figure 3.2(a) has more energy at the second and third pairs
of filters. The overall energy distribut ion is also quite different. The input energy generated
by the slow process is concentrated at the low kequencies, wMe the faster process creates a

spectrum that is richer across a wider range of fkequencies. Obviously, the only factor that

s can account for this unexpected behaviour i the amount of deadtime in the process.
The reason for this is that the crossover fiequencies for these processes are very different , and therefore yield very dinerent relay generated excitation. This effect is studied more closely in Figure 3.3. These plots represent the frequency response of a first order process with w i n g amounts of deadtime. As a reference, the location of the first several FSF

frequencies have been indicated on each plot. As deadtime decreases fkom 70 to 5 sec, the crossover frequency moves kom the neighbourhood of w:! to the neighbourhood of wzsThe case with no deadtime a t a l WU oscillate under relay feedback because, even at i, not very high fkequencies, a pure k t order process never attains a phase lag of 180 degrees. Since deadtime contributes to the phase lag, it is instrumental in determinhg the crossover frequency. As deadtime increases, the crossover is pushed to a lower frequency range, and the new relay input signal behaves more i d e d y with respect to the frequency content that
is desired for step response identiiication. In addition, the magnitudes of the Nyquist plots

in Figure 3.3 also predict that processes with high critical fiequencies will tend to respond
to a relay experirnent with s m d output amplitudes. Clearly then, there is a concern that a fust order process with srnail deadtime might generate an input signal that is deficient in low Erequency information. It is therefore necessary to consider these processes in more detail, with the idea of modifjring the relay experiment so that it wiU provide good low fkequency excitation for this special case.


The Influence of Delay on the FSF Spectrum

First order processes

The previous example has shown that process deadtime is an important factor in determining the type of input excitation obtained from the new reIay experiment. This section analyses the iduence of delay in more detail. More specifically, the following results will demonstrate that it is a c t u d y the nonnalize deadtirne, R, defined as the ratio of the deadtime and the time constant, which determines the fkequency content of the excitation obtained fkom the new experiment . Consider a first order plus delay process described by the transfer function

The settling time of this process is estimated as

At this stage, we select an arbitrary frequency, W i , definecl by

where i , referred to as the frequency index, can take on the vdue of any red number. Combinng Equations 3.3 and 3.2, fiequency may now be given in terms of the norrnalized

& deadtime, R = T :

The phase shift of the process at this arbitrary frequency is therefore

Clearly, phase shift in this case is a function of two variables: frequency (determined by
i) and normalized deadtime

(R). Since a process under relay feedback oscillates with a h e d

phase shift, R is the o d y variable that determines the oscillation frequency index number,

i. Therefore, by taking the phase shift as -r rad, and given R as a property of the process,
Equation 3.9 can be solved for the crosswer fiequency index number. This explains why the relay swit ching fiequency is determined soley by normalized deadt ime. Similarly, the frequency index number for the integrator plus relay experiment can be solved from the following equat ion:

In Sections 2.3.2 and 2.3.1, it was establihed that a desirable input signal shodd con-

tain strong information around the first two FSF filters. For the new experiment, it is
therefore desirable that the fundamental fiequency of the integrator plus relay experiment

wl be approximately equd to the fbst FSF frequency. With respect to Equation 3.10, this il
means that if the index number, i, for the integrator plus relay experirnent is less than or approximately equal to one, then the input signal generated by the new experiment wiil contain sufEcient low fiequency excitation. A range of R d u e s for which this assumption holds can be established by combining the phase shift of the first FSF frequency,



ideal (FSF) period

Figure 3.4: A Cornparison of the Observed and Ideal Normalized Period for First Order Models

with the phase shift of an integrator plus relay experiment (Equation 3.10). That is, an "ideal" R value is one which satisfies

Although an approximate range of ided R values could be established by solving Equation 3.12 numerically, we choose here to graphicdiy dernonstrate the range of ideal R values, for which the actual and desired oscillation periods are similar. Let Pl be the desired oscillation period associated with the fundamental FSF frequency, w l = 27~/T,,~:

A general relationship between R and the desired normalized oscillation period may be

In order to identify the range of R values for which a relay feedback system produces
desirable excitation from the perspective of an FSF model, a number of simulations were performed using first order models with R values raaging kom O to 2. These simulation results are shown in Figure 3.4, dong with the dashed curve representing the desired normalized oscillation period that is d e h e d by Equation 3.14. Consider the integrator plus

relay curve, compared with that of the desired normalized oscillation period. The curves intersect at R

= 0.6,

indicating that for R

< 0.6 the relay pius integrator experiment


n generate an oscillation with a period that is less than the desired period (Le. a oscillation that is faster than the ided FSF &equency). For R

> 0.6, the observed oscillation is

slightly slower than the desired FSF fiequency, and thus gives adequate infurmation about the low frequencies. The fact that the standard relay curve lies beneath the desired curve for a l R dues, confirms that the integrator is essentiai for obtaining good low frequency l informat ion.

Now that R has been isolated as the determining factor for the fiequency content of
the relay signal, it is clear why the FSF spectra varied disproportionately between the two examples presented at the beginning of this chapter (Figure 3.1). The R values of these examples were 0.25 and 0.70. Referring back to the spectral distributions in Figure 3.2, it is ciear that the one with the smaller R value of 0.25 oscillated too quickly and was therefore not rich in kequency content at the fkst filter. In contrast, the process with the Iarger

value of 0.70 produced more low kequency information near the centre frequency of the fkst filter.

332 ..

Second order processes

Up until now, this chapter has dealt exclusively with 6rst order processes. If desired,
the andysis could be extended to include other types of processes such as second order

hs systems. T i is not necessary though because higher order processes typically react to
change with a more sluggish initial response than fnst order systems. For instancet before delay effects have even been included, the phase versus fkequency profile of a pure second order model drops off much faster than it does for a first order model. This means that the critical fkequency of a high order process is n a t u r d y located in a lower fkequency rangeTherefore, it is not surprising that most processes are not nearly as sensitive to deadtirne issues as in the h s t order case. To c o b this statement, consider the observed and ideal periods for the criticdy damped second order case, which can be derived similady to the first order case above. By redefining the process settiing tirne as Tsetx 77 + Td,Equations 3.14 and 3.12 can be

relay + integrator


ideal (FSF) period


02 .

04 .


1 12 . Nomaiiied Deadtirne, R

08 .

14 .

16 .

18 .

Figure 3.5: A Cornparison of the Observed and Ideal Normalized Period for Second Order Critically Damped Models redefined for a second order criticaily damped process:

The results in Figure 3.5 show that, for this case. the h t FSF fkequency fi& between the standard relay and relay plus integrator curves for al values of R examined. Except for .i very s m d R values, the integrator plus relay oscillations will occur at a kequency t hat is slightly lower than desired. Thus, for a h o s t all cases, the critically damped second order

il model wi generate good data for identification of an FSF model.

While it is important to recognize the issues presented in this chapter, it should be emphasized that a large class of processes will satisS. the spectral guidelines as they were presented in Section 2.3.2. However, for special cases where the critical frequency is high. there is sometimes a need to consider a modified experiment which can enhance the low frequency region of the input spectrum.

333 ..

Effect of relay parameters on the FSF Spectrum

In practice, it is desirable to avoid any correlation between the process input and the noise.
Therefore, the hysteresis widt h is normdy selected to be about three times the standard deviation of the noise. In addition, the relay amplitude is usually rninimixed in order to avoid disniption in the plant. However, it is important to consider that, if the amplitude is too s m d , there wiil be a poor signal to noise ratio and the presence of valve nodinearities may becorne significant. Therefore, the relay amplitude should be set as srnail as is reasonably possible given the constraints. Fortunately, a conservative choice of relay parameters can often prove beneficial in terms of providing sdiicient low fkequency e x i t at ion. The combination of small relay arnplit ude

and large hysteresis width pushes the limit cycle to a lower fkequency. This effect is most
pronounced in processes that actually require additionai low fkequency excitation. As an illustration of this effect, the simulations used to generate Figure 3.4 have been rerun with

a increased hysteresis width and are presented along with the original results in Figure n
3.6. It is clear fiom the figure that an increased hysteresis width produces a noticeably slower relay limit cycle for processes with small R values. As R increases, or if an integrator

is added, the effect of hysteresis becomes almost negligible. Consequently, it is generally

recommended that the relay parameters be chosen conservatively, so that for process with srnail R values, the low frequency information wiil be enhanced. These recommendations are confirmed in theory by the DFA of a relay of amplitude, d?

and hysteresis width,

The negative reciprocal of the DFA is a straight line parallel to the real axis:

The operating point of the limit cycle is located at the intersection of the process Nyquist curve and t his line. The imaginazy part of Equation 3.18 t herefore determines the phase shift
created by the combined effect of the hysteresis and relay amplitude. Therefore, decreasing

the relay amplitude and/or increasing the hysteresis width is a simple way to enhance the low frequency region of the spectrurn.

Figure 3.6: The Effect of Hysteresis on the Ultimate Period


A Modification to the New Experiment

As illustrated above, a conservative choice of relay parameters can help a process with a

R value with respect to obtaining sufficient low frequency excitation. However, since

there are practical limits on how much these parameters can be adjusted, it is also worth considering a modScation to the new relay experiment. A modified experiment is now proposed which d o w s the excitation frequency to be manipulated via the addition of a user-specified delay block into the feedback loop (see the block diagram in Figure 3.7). The delay block is placed after the relay, in series with the process, so that the relay sees a modified "process" (indicated by the dashed box in the block diagram) with an R value that is larger than that of the real process. Fkom an identification perspective, the data used to construct the FSF mode1 is still the actud process input and output signals.

A general approadi to implementing the modified experiment is given in the flowchart

of Figure 3.8. It is proposed that a few settling times of data be initially collected according

to the original proposal for the new relay experiment (i.e. no delay block is present). At this point, the data may indicate whether or not additional delay is required. If the data
seems rich enough in low frequency information, the experiment may continue as usual.

Otherwise, the initial part of the data set may provide good medium and high fiequency information, and the remaining part of the experiment can focus on using the delay block

Figure 3.7: Block Diagram of the Modified Relay Expriment to obtain more low fkequency information. There are several qualitative characteristics that are indicative of a process which might benefit om the modified experiment. Rapid switching of the relay output is the most obvious indicator. In this case, a s m d process output amplitude would indicate that, either the process gain is quite small, or the switching frequency is too fast. For example, in the case of a first order process, a switching frequency that is too fast c m often be identihed by the sawtooth-like shape of the process response. If a good prior estimate of the settling time is available, then the FSF spectrum itself will indicate any weak frequency components. Finally, if the tail end of the estimated step response mode1 seems to wander or appears "droopy" , then the spectrum may not have enough low frequency information. A drooping step response may

be an indicator that the settling time estimate has been chosen too

large; but if it is reduced, and the step response still does not settle out properly, then the
s relay i likely switching too fast and not generating sufficient low frequency information.

If needed, the delay block should be added such that the delayed integrator plus relay
switching i n t e n d s are approximately one half to one quarter of the settling t ime. Since this

Start the new relay expriment with the basic mixed input sequence (Le. something like [ 1 1 1 1 0 0 1 0 1 ..-])

After 1 or 2 settiing times of data are coltected check to see if more Iow frequency information is necessary: - is the input switching npidly? does the p m e s s response have a srnail amplitude and resernble a choppy sawtooth signal? - is it known chat the process has a smdI amount of delay relative to the t m constant? ie

1s it possible to adjust the relay panmeters?

Continue with the mixed input sequence until enough data has been collected.

Decrease amplitude andfor increase s hysteresis. C Iow frequency information still needed?


Continue with the mixed input sequence until enough data has k e n collected.

With the inregraior acrivared. invoduce additional defay for 3 or 4 switches. Adjust delay until: the switching interval is mughly half the settling time. - the pmcess output amplitude increases. and appears Iess choppy or sawtooth-Iike

If the delay is satisfactory. but more data is still required. then hold the additional delay constant. while returning to the mixed input sequence.

Figure 3.8: Methodology for the Additional Delay Experiment

modified experiment i required rnainly for processes with approximate k t order dynamics, s the delay block should be specified such that the R value seen by the relay (Le. the R value of the process plus additional delay ) should be greater than about 0 6 D. the amount of .. delay required to achieve such an R value, may be determined from the ratio of the true R value, R = Td/rT and the desired R value, & , = (Td D ) / Tas follows:

Clearly then, determination of D requires an estimate of the process deadtime, and normalized deadtime.

If, after some initial data has

been collected, a delay block appears

to be necessary, a preliminary estimate of the step response mode1 can be generated. At t his point, the step response estimate wiil likely be poor, especially if there is not sufEcient low fiequency information, but the initial part of the step response often provides a reasonable estimate of Td.In the literatirre, it has also been suggested that the lengt h of the h s t (relay only) switching interval can be used as an upper limit on Td. The normalized period can be calculated from the average length ofthe steady integrator plus relay switching interval

and the Td estimate. Then a rough estimate of the R value can be identified fiom the relay
plus integrator curve in Figure 3.4. Although &st order plus s m d delay processes are the prime candidates for an additional delay experiment, there may also be some types of higher order processes (with dominant zeros or very little deadtime) that could benefit from extra delay. There is no simple way to differentiate between these two scenarios. Many literature methods have modelled high order systems as first order plus delay models, which is reasonable if the step responses are similar . Unfort m a t ely, processes wit h similar step responses do not necessarily have similar responses to relay feedback. This makes it dificult to calculate how much delay to add to the experiment. Considering that high order dynamics usually require s m d amounts of deadtime to obtain the desired excitation, the delay requirement specified by Equation 3.21 will Iikely be an overestimate if the process is not actuaUy first order. However, while too
much delay might cause the process variable to wander further than necessary (obtaining

a full step in the worst case), it wl still improve the gain estimate. Udess the process il
dynamics are well known, the addition of delay is more of a trial and error approach.

Practicdy speaking, this is often the simplest way to apply the delay block.

In terms of experimental design and implementation, a new delay vector must be defined
in addition to the previously defined input sequence. The original input sequence contained

a series of boolean values which indicated the presence or absence of the integrator during each switching period. Similady, the new delay vector contains a vdue for the deiay element during each switching i n t e d . The first several entries of the deIay vector will be set to zero, since the initial switches are used to coilect pretiminary data for determining whet her or not extra delay is required. For example, the delay vector might be [O O O O O O O O D D D . ..]. If, based on the preliminary data, no compensation is required, then D is set to zero and the experiment reduces to the original input sequence. Otherwise, low fkequency data can be collected as the integrator is left in the loop and D is manipulated-


Guidelines for Adjusting N for the FSF Mode1

In order to fit an FSF model, it is necessary to supply a settling tirne estimate, N . Since this
parameter is appiied in the m o d e h g stage, it may be easily adjusted off-line. The reader
s will recall from Chapter 2 that the set tting time estimate i used to determine the centre

frequencies of the FSF filters. Adjustrnents to N wiil therefore shift the FSF frequencies
which are extracted fiom the data set and used to estimate the model. Guidelines for "fine

tuning" of the N estimate are now presented. In Section 2.3.3 it was recommended that a starting estimate of N / 2 be chosen as the length of the t hird consecut ively integrat ed swit ching interval. There are several indicators which can be used to validate this parameter. One of the most obvious ways to evaluate the model is by examining the shape of the estimated step response. If the underlying process is known to be stable, and the step response does not seem to level off to a steady

hf state value, then N should be increased to s i t the first few filters such that they are able
to pick up more low frequency information. Conversely, if the b a l portion of the step response droops, N has ben chosen such that the first few Uters focus too much on lower fkequencies. If decreasing N does not produce the expected step response shape, then the input signal may require more low fiequency content, For example, if it appears as though

N/2 shodd be chosen larger than the longest input signal switching interval, it is possible
that more hysteresis or an additional delay block might be usefd in obtaining extra Iow fkequency information- If the process has a large R value, then the relay experiment can produce very low fiequency information. I this case, N may be overestimated but the step n response wiU not appear to droop because of the dominant low fkequency information that is available. The step response for these processes will simply appear to settle out much eariier than the estimated settling tirne.


Noise Modelling

In general, closed loop identification requires the user to account for the correlation between
the input signa. and the disturbance by estimating a noise model in addition to the process model (Ljung, 1987). Otherwise, the identification algorithm will produce biased results. Fortunately, for relay feedback data with stationary noise present, it caa often be safely assumed that the hysteresis breaks any correlation between the noise and the input signal. However, this is not the case for slower, drifting disturbances which commonly occur

in chernical processes. In fact, such a disturbance could conceivably prevent the process
variable kom returning to its setpoint value, causing the relay to cease switching, unless the setpoint was manually readjusted. The accuracy of identification methods based specifically upon the analysis of periodic data (e.g. the DFA) will clearly suffer f?om this non-periodicity induced by the presence of nonstationary disturbances. Work in the literature (Hang et al.,

1993; Hang and Astrom, 1988) has examined disturbance related errors in estimates of the
ultimate gain and period, and suggested self-correction techniques.

It is interesting to note that, in the case of the new relay experiment. the correlation
between the relay generated input signal and a drifting disturbance is not always undesirable. Although relay feedback data is collected in a closed loop setting, the relay's response
is correlated only with the sign of the error signal, and is not directly related to its magni-

tude. Hence, relay data should be Iess sensitive to noise than data from some other types of closed loop experiments. Moreover, a nonstationary disturbance can actually provide extra variation in the switches of the relay because its effect is similar to that of a biased relay, soniething that has been promoted in the literature as a means of obtaining gain information fkom a conventional relay experiment. While this correlation c be beneficial m

in terms of the richness of the input signal, it may still be correlated strongly enough to require that explicit noise m o d e h g be taken into account. The iterative version of the FSF/PRESS algorithm (see Section 2.1.5), has been successNly applied to improve parameter estimates by fitting an autoregressive noise model to the residuals of the process model. This method removes the correlation between the noise and the process input signal, and improves the accuracy of the estimated process parameters. The process mode1 order, n, selected by the

PRESS in the iterative algorit hm, often

increases as compared to the case with no noise modelling. This improves the accuracy of

high hequency parameter estimates and smooth out the resulting step response estimate.
Most notably though, the noise modelling improves the steady state gain estimate. This is especidy true for cases where the low frequency data is not particularly strong. Statistical confidence bounds may also be constructed to evaluate the quality of the model. However, the bounds constructed by the FSF/PRESS program are based upon the assumption that the model fit is good enough to produce "whiten residuals. Therefore. to get rneaningfd bounds, it is generaily necessaxy to apply the iterative algorithm.

37 .

Backlash Effects

Backlash is a nonideal behaviour which arises in the presence of a poor control valve. When backlash is present, the input signal seen by the process is a diminished version of the intended controiler output. This effect is diflicult to deal with because it is a directional noalinearity. That is, it is a nonlinearity which is o d y observed when the controller output reverses direction. Backlash is consequently a concem when considering an identification experirnent in which the input is generated using a relay. For example, if the midpoint of

s the controller output i centred in the valve's deadzone and if the controller output signal
is &5%, a backlash width of 2% will distort the actual input signal to be f 4%. Obviously, backlash wil1 affect the quality of the gain estimate determined horn binary input signal data. Since successive relay switches are always in opposite directions, the gain estimate will reflect the minimum observable response. Since the relay input signal is a clean square

wave, it is possible to rescale the recorded input signal to reflect the actual process input so
long as an estimate of the backlash width is available or obtainable. The relay might even

serve a a usefd tooi for esthating the bacldash width, and the starting position within s the deadzone. For exampIe, if the peak to peak relay amplitude is not larger than the backlash width, the reIay will not produce a periodic response. Also, if the starting position is not centred within the deadzone, the iirnit cycle will not be symmetric. These effects are discussed in further detail in Chapter 4.

38 .

Case Studies

The remainder of this chapter is devoted to providing a set of six simulation case studies to illustrate the relay dynamics observed during the proposed identification experiment. The models included in t his st udy were selected fkom EnTech's Au toma tic Con troller D ynarnic
Spec$cation (1993)

and are representative of processes commody encountered in the pulp

and paper industry. The simulations were performed in MATLAB, and then the iterative version of the

FSF/PRESS algorithm was appiied directly to each data set, with N chosen based on the
apparent settling t h e of the actud step response. For cornparison purposes, aiI simulations contain approximately the same amount of data relative to the time scale of each process (approximately 6ve settling times of data). The relay input sequence and amplitude (d =

f2) were also kept the same in order to demonstrate the relay's ability to provide suitable
information, based solely upon each process' dynamic response. White, normally distributed noise with a standard deviation of o, = 0.8 was appiied, A hysteresis width of about three tirnes the standard deviation of the noise level (e = 2.5) was used. The input sequence was:

where O indicates switches triggered by the error, and 1 indicates switches triggered by the integrated error.

381 ..

First order modek

Case 1 - Paper machine basis weight (R=2,2)

The paper machine b a i s weight model exhibits a very sluggish relay response (see Figure
3.9(a)) due to the fact that it is a delay dominant process with an

R of 2.2: which is rnuch

greater than the ideal benchmark of 0.6. It should be noted that this model triggers o d y about seven switches in five settling time of data. The reader will notice that subsequent cases have faster dynamics and use many more switches to collect the same relative amount of data. The k = 0 , l points on the FSF spectral plot (Figure 3.9(b)) c o h that the low kequency components of this input signal are especidy strong. The estimated Nyquist and step response pIots (Figures 3.10(a) and 3.10(b)) are quite close to those of the actual process response. The 6rst couple of estimated frequency points are essentiaily exact, reflecting the favourable low fiequency signal to noise ratio. Waviness in the delay portion of the step response indicates that there is some error in the estimated high fkequency points on the Nyquist plot.
Case 2 - Bleach plant pulp brightness


The input/output data obtained fkom the pulp brightness model is presented in Figure Xll(a). This process, with has R equai to unity, switches about ten times and bas slightly faster dynamics compared to the data for Case 1 (R=2.2), which contained only seven switches in the same relative time period. The input spectrum (Figure 3.11(b)) has strong low kequency information and a similar shape to the previous example, t hough the emphasized frequencies are shifted to a slightly higher frequency range. The first three points on the Nyquist plot (Figure 3.12(a)) are very accurately estimated because these fkequencies lie in the phase range primarily targeted by the relay experiment. These are also the dominant fkequencies in the FSF spectrum. Again, the high noise level gives rise to some waviness in the step response (Figure XlZ(b)).





800 Io00 Time (sec)




(a)Input/Output Data

I k lth Filter

(b) The FSF Spectrurn

Figure 3.9: Simulation Results for Case 1











(a) Requency Response Model (Nyquist plot)

(b) Step Response Model

Figure 3.10: Identification Results for Case 1

Time (sec)

(a) hput/Output Data

I k Ith Filter

(b) The FSF Spectnim

Figure 3.11: Simulation Results for Case 2


(a) Fkequency Response Model (Nyquist plot)

-. 02



60 Tirne (sec)




(b) Step Response Model

Figure 3.12: Identification Resdts for Case 2

Case 3

- BIeach plant chlorine gas flow (R=0.05)

In contrat to the previous two examples, the chlorine gas flow model has very littIe delay and responds rapidly to the relay input, which switches approximately t hirteen t imes during the experiment (see Figure Xl3(a)). The low frequency points on the Nyquist plot are quite accurate? though not quite as good as in the previous examples. It is interesthg to note that processes with small R values. such as this model, are much more sensitive to the presence of significant hysteresis levels. Consider, for example, the data in Figure 3. E ( a ) (case 3b), which was simulated under the same conditions as the data in Figure 3.13(a), except that the noise level was reduced from 0 8 to 0.08 in . order to try a smaller hysteresis width (0.25 instead of 2.5). With a srnader hysteresis width, the relay switches approximately three times faster, and it becomes apparent that the h s t couple of filters in the FSF spectrum (see Figure 3.15(b)) are lacking in fiequency content. The spectral peak that w s ideally expected at the k = 1 filter has been shifted a to the k = 2 filter, and the mid to high frequency region of the spectrum is unusually rich. Strong mid kequency information maintains a reasonable step response estirnate (Figure 3.16(b)), though the gain and first hannonic ikequencies are not quite as accurate, and wodd Uely siiffer kom a poor signal to noise ratio in the presence of a q nonstationary behaviour. Similar cornparsions have been performed for cases I and 2? though the data
was not appreciably different for these cases (the relay only switched about one extra time

in each case). It was concluded t hat a generous hysteresis width should be recommended since its effects are quite beneficial in some cases, and negligible in others.

General remarks on first order processes

If the FSF equency distribution is compared among the three fust order Nyquist plots
(Figures 3.10(a), 3.12(a) and 3.M(a)), the effects of R on the location of the FSF kequencies can be observed. For exarnple, in the development of the new experiment, the first FSF fkequency was assumed to lie in the neighbourhood of the negative irnaginary a i s . If the k t FSF fiequency lies on or below the fiequency of this irnaginary axis point, then the

(a) Input/Output Data

(b) The FSF Spectrum

Figure 3.13: Simulation Results for Case 3

-0 6l



0.4 Real




(a)Frequency Response Model (Nyquit plot)

1 .:

(I I


c O a (I 0 I
A ,"

5 02

-Estimateci response - - Confidence bounds





Time (sec)

(b) Step Response Mode1

Figure 3.14: Identification Results for Case 3

-1 2



20 Time (sec)





(a) Input/Output Data

I k Ilh Filter

(b) The FSF Spectrum

Figure 3.15: Simulation Results f r Case 3b o


$ c - 42 a

I 1 1 1

E -0.3 -0.4



1. 02







(a) Frequency Response Mode1 (Nyquist plot)

Estimateci response Confidence bounds Actual response

Tme (sec)



(b) Step Response Mode1

Figure 3.16: Identification Results for Case 3b

Case 1:R s . 2

Case 2: R=1.O r

Case 3: Fk0.05




25 30 Time (sec)





Figure 3.17: The Effect of Nomalized Deadtime on the Magnitude of the Process Output first a t e r will pick up good data. This was the basis for conclusion that an "ideai" process

has R > 0.6. A cornparison of the location of G ( j w i ) for cases 1 to 3 confirms this idea. Case 3, the only mode1 with R < 0.6, is also the only process whose G ( j w i ) response does
not lie in the lower left quadrant. Its low hequency content was therefore observed to be dependent upon the hysteresis width.

The simulations also confirrn another trend which was int roduced in Section 3.4; namely
that high frequency oscillations limit the process output amplitude and reduce the signal to noise ratio. Figure 3.17 presents the input/output data for cases 1 to 3 with a reduced level of noise and hysteresis. The obvious ciifference bekveen these simulations i the frequency s content of the signals and the magnitude of the process variable's response. Clearly, since

the input sequence, gain and first order mode1 structure are common in ail cases, the
normalized deadtirne is the factor which i responsible for the Merence between the signal s

to noise ratios.

382 ..

Second order models

Case 4 - Bleach plant steam mixer temperature: second order, overdamped

The fkst part of this chapter obsewed that high order processes tend to be more sluggkh than fkst order processes, and therefore rely much less upon deadtime to generate low fiequency data. This case study has a very s m d amount of delay, but only switches about fifteen times, coanrming that high order relay dynamics are not as strongly dominated by

high fkquencies as fkst order dynamics. The data set and spectrum (Figures 3.18(a) and

3.18(b)) demonstrate strong components at the fust three FSF fkequencies, as well as a
significant amount of information in the middle frequency range. The step response in Figure 3.19(b) is excellent, and the accuracy of the 6rst few points on the Nyquist plot in Figure 3.19(a) confirms that, under the new relay experiment, higher order dynamics generally produce an input signal with strong gain information.
Case 5 - Stock flow, flexible pipe supports: second order, underdarnped

This process has a sma,ll amount of delay, a very oscillatory step response, and a natural frequency which lies near the range of the critical fkequency. These dynamics create an input signal (see Figure 3.20(a)) which strongly emphasizes the high fiequency range. Also note that the process' natural tendency to overshoot has produced an unusually large oscillation in the process variable. This creates a favourable signal to noise ratio in the fiequency range that plays a dominant role in this process' step response. There is not a lot of variation in the length of the input switching intenmls, and this is reflected in the fact that the spectnun in Figure 3.20(b) has almost all of its energy concentrated withh a very narrow, high frequency bandwidth. This spectnun is a drastic change from the "idealn spectrum shape that was described in Chapter 2. However, if one considers that this process has a much differently shaped step respoose than most of the other processes examined, this departure from the ideal seems acceptable. It is also worth noting that the dominant ilter in this case has






250 300 Time (sec)

30 5


(a) Input/Output Data

(b) The FSF Spectnim

Figure 3.18: Simulation Resdts for Case 4


(a) Frequency Response Model (Nyquist plot)

(b) Step Response Model

Figure 3.19: Identification Results for Case 4

a centre frequency similar to the naturd resonant frequency of the system. The Nyquist
plot and step response estimates in Figures 3.21(a) and 3.21(b) certainly demonstrate that the relay experiment produces reasonable results, despite the unusual spectrum. This case study is an exampJe of the relay7s ability to generate appropriate excitation for a process where no prior information is available.
Case 6 - Stock flow with a r entrainment: second order, overdamped with lead i

This process model contains a lead term which makes it behave more Li e a &st order k process than a second order overdamped model (see Figure 3.23(b)). Also notice that the delay term i very small. In effect, this process reacts as a fst order process with a s s m d R value, and is a good example of a process that could benefit from additional delay. Note that the relay amplitude is already fairly s m d , and the high noise level has forced a large hysteresis width. Despite corservat ive relay parameters, the relay switches fkequently and Figure 3.22(b) confirms that the fbst few Mers are not dominating the spectrum, as they should be for a process with a smooth fkst-order-iike step response. Large confidence bounds which do not quite encompass the tme step response are a sign that there is not enough low kequency information. Although the PRESS chooses a reasonable model order, the results are still quite poor. This indicates that the high kequency components in the data set are strong enough to improve the predictive capability of the model, but cannot replace the essential low frequency data.




200 Tirne (sec)




(a) input/Output Data

The FSF Spectrum

Figure 3.20: Simulation Results for Case 5







(a) Frequency Response Model(Nyquist plot)



-Estimated response
Confidence bound Actual response






Tme (sec)




(b) Step Response Mode1

Figure 3.21: Identification Results for Case 5




Time (sec)




(a) Input/Output Data

(b) The FSF S p e c t m

Figure 3.22: Simulation Results for Case 6

(a) fiequency Response Model (Nyquist plot)


Estimateci response

Confidence bounds

Time (sec)

(b) Step Response Model

Figure 3.23: Identification Results for Case 6

Chapter 4

On-Line Identification and Experimental Result s

In the chernical process industry it is not uncornmon to Cind non-linear or time varying
processes which are inadequately described by a h e d set of model parameters. In such cases, o n - h e identification techniques fkequently provide the basis for an adaptive modelbased control strategy. The conventional batch least squares est irnator is generally not practicai for on-line identification because it would have to be repeatedly applied at each
sampling instant, and the computational Ioad would increase wit h each addit ional data

point. However, the recursive Ieast squares (RLS) estimator is a widely used and practical on-line tool because it only involves a simple update calculation to the curent model at each sampling instant. Increased availability of rnicroprocessors has encouraged the use and development of complex recursive identification techniques. The literature contains a wealt h of such methods (Shah and Cluett, 1991; Ljung and Soderstrom, 1983), each of which have
been developed in different fields for Merent types of applications. In the chernicd process

industry FUS methods have been widely used for self-tuning process control of non-linear and tirne varying processes.

The RLS estimator may aiso be applied to the identification of linear, thne invariant
systems. The advantage of this approach over a batch approach lies in the fact that the online ident Scation algorithm illustrates the model progression throughout the experiment , so that the user is able to recognize and correct aay problems before a great deaI of time and money has been wasted collecting iininformative data. Althougli the new relay experiment
s eliminates much of the uncertainty that i normdy associated with input signal design, it

is stilI desirable to be able to monitor the progress of the identification experiment. For instance, the user wiil not need to err on the side of caution by coliecting more data t han i s necessary to achieve a satisfactory model. Furtherrnore, it is possible to use the intermediate mode1 estimates and the FSF spectnun as a guide for making adjustments to the signal to noise ratio and fkequency content through the addition of delay or changes to the relay paramet ers, should t his be necessary.

In this thesis, the basic FSF algorithm i reformulated and extended to a numerically s
sound RLS estimator. The combination of on-line identification and the new relay experiment reduces the need for prior knowledge of the process, and therefore offers a very user friendly approach to identification. The development of the RLS FSF algorithm i presented s below, and is subsequently applied in the development of a prototype software application for on-line relay feedback identification. Experimental results obtained t hrough application of the prototype to a pilot scale stirred tank heater process are also presented to test the on-line relay ident Scation experiment in practice.

4 1 Recursive Least Squares .

Alt hough the literature contains many types of RLS estimation schemes, the identification aigorithm adopted for this work is the basic RLS estimator. The reason for selecting the simplest RLS method Lies mainly in the fact that the recursive algorithm is only needed to provide an on-going indication of modei quality. Rather than applying the recursive estimator to track parameter changes over a long period of time, or over a large operating window, this routine is intended to provide a simpler and more efficient approach to an ordinary identification experiment ,where the underlying dynamics are assurned to be linear and time invariant. Since, in this application, the

RLS estimator is not intended to be left

in place for long periods of t h e , al1 data should be treated equally and there is no need to explore the impact of a forgetting factor, which would normally be used to compensate for time varying behaviour. In this work, the forgetting factor is therefore set to a default value of unity, which implies that al1 data wiU be weighted equally. The basic RLS algorithm is now presented, and wiU be applied to the FSF model structure.

411 ..

Formulation of the recursive least squares problem

The basic RLS algorithm involves cornputing a model update, Ef(t), based only on the current input/output data (#(t) and y ( t ) ) and the model that was estimated at the previous samping instant (8(t-1)). The estimation law is


Note that the right hand side of the esimation law consists of two terms: ~ (- t 1). the parameter vector estimate from the previous sampling instant, and an update term consisting of a weighted one step ahead prediction error. In practice, Equation 4.2 should not be directly applied due to the fact that it requires computation of the inverse of the covariance matrix, P. This inverse is cornputationally costly and must be perforrned at every sampling instant. Instead, the estimation L w is usuatly implemented as (Soderstrom a

and Stoica, 1989)

) 6 ( t ) = )(t - 1 ) + K ( t ) [ y ( t - ( t - 1lT@(t)]


These equations, obtained wit h the use of the matrix inversion lemma (Ljung and Soderstrom,
2983), form a much more efficient way of computing the RLS estimate. This form of the

update law is advantageous because it contains the inverse of a scalar quantity, rather than the inverse of an nxn matrix.

4 1 -2 .

Updating the covariance matrix via RUD factorization

Efficiency is not the only computational difficulty which arises with the RLS algorit hm.

I this project, a Recursive UD (RUD) factorization method is used to ensure that the n
mode1 update has good numerical properties. The original update law in Equation 4.2 can be sensitive to the accumulation of round off errors, and may cause P ( t ) to become

indefinite. Bierman's RUD factorization reduces the effects of rounding errors and, unlike other methods, avoids square root computations. The RUD method also minimises accwacy problems wbich can occur when the data i poorly conditioned (e-g. the data set is not s sufJkiently excited or the forgetting factor has been set too s m d ) . Bierman7sRUD factorization method (Thornton and Bierman, 1977; Astrom and Wittenmark, 1990) involves the decomposition of P ( t ) as

In this decomposition, P , U and D are al1 square matrices of dimension n. The matrices U and D are restricted to be unit upper triangular and diagonal, respectively. P must contain only r e d values, and be a s r n e t i c , positive definite matrix. This method, also known as square-root free Cholesky decomposition, involves recursive updating of the factorization matrices, U and

D,rather than direct calculation of the update to the covariance rnatrix,



The Recursive FSF Algorithm

The RLS estimator with RUD factorization may be combined with the FSF model to enable o n - h e FSF model identification. However, before the FSF filters can be directly appiied to the RUD factorization, they must be redefined. The reason for requiring a reformulation of the FSF model is that use of the RUD method implies that the covariance matrix PI upon which the RUD factorization is performed, must contain only real values, but the original formulation of the FSF filters produced a complex valued data matrix. Clearly then, in order to benefit from the numerical properties of the RUD factorization, it is necessary to r e f o d a t e the least squares FSF problem such that the filters produce real outputs.

421 ..

An alternative representation o the FSF model f

A suitable reformulation of the l e s t squares FSF problem may be achieved by rearranging

the FSF parameter vector and filters such that complex conjugate pairs (adjacent filters)
are re-expressed as real and imaginaq components. The reforrnuiated FSF model is not as

intuitive as the original model, but it Iends itself weil to a recursive approach and is equally parsimonious.

R e c d the original formulation of the FSF modei at sampling instant, t:

where the 6Iter outputs are,

and the corresponding kequency respanse coefficients are

With the exception of the gain related terms,

and G(eJWO)? adjacent elements of q and 5

8 in this formulation exist as complex conjugate pairs. The gain-related terrns are already
real, so there is no need to reformulate them. However, subsequent pairs of elements in

# and 8 will be combined to eliminate cornplex numbers kom the least squares problem
(Bitmead and Anderson, 1981). Let G ( d U k ) = Ak

+ jBk

and G(eJW-k)=

+ jB-k.

Since these parameters are

complex conjugates, A-k = Ak and B-k = -Bk.With this observation it is now possible to reformulate Equation 4.7 as:

in- 1)

G(gw0)<po(t) +



[Ak<pm(t)+ Bk'~rk(t)l f

(4.11) (4.12)

The siimmation term in Equation 4.11 is the key to eliminating the complex values. The

original FSF filter outputs,

4k and qLk, which were weighted by


the frequency response

q ~ k

coefficients, G(dWk)and G ( e J W - k ) , are now replaced by real valued filter outputs,


p ~ k which ,

are weighted by the real and imaginary parts of the fkequency response

coefficients, Ak and Bk.

A new parameter vector is then defined as

and the regressor vector becomes

Together, Equations 4.17 and 4.18 form an equivalent representation of the FSF model which is well suited towards on-line identification with the factorization technique. The main differences between the batch and recursive FSF algorithms are that the parameter vector has been redefined as an estimate of r e d and imaginary parts of the frequency response parameters, and the filters have been changed to accomodate the new parameter vector. With the new formulation, a.ll of the computations are performed on real variables, allowing the RUD factorization met hod to be applied.

RLS estimator and the RUD


Recursive estimation of the FSF model

In order to implement the new FSF model, it is necessary to express the filters and the FSF spectrum in terms of an update to their values at the previous sampling instant. Since the parameter vector has been redefined, it is also necessary to consider how the step response model will be calculated. These results are now presented.

Recursive interpretation of the FSF filters

The new filters may be easily implemented in a recursive fashion by applying the backwards

shift operator, z-l, in Equations 4.13 and 4.14 to produce the following difference equations:

Recursive interpretation of the FSF spectnrm

The FSF spectrum provides important feedbadr on the quality of excitation that the relay experiment is providing to the process. It i therefore an important indicator to be able s to generate on-line. However, the regressor vector used in the RLS algorithm is different hom that of the batch algorithm which was originally used to construct the spectral plot. Therefore, it is necessary to derive the original FSF spectrum from the new regressor format, and do so in a recursive fashion. The FSF spectnun was originally determined fkom the diagonal elements of the batch correlation matrix,

@*a, which in

the n diagonal elements are proportional to the input

signal energy contributions at each of the n

FSF frequencies used to estirnate the model.

The diagonal of the correlation matrix at the sampling instant t, are:

This expression may be generated recursively kom the original filters as:

The update law for the kth diagonal element of

@*a at

time t, is therefore

Hence, at each sampling instant, the previously calculated FSF spectrum is updated by

just n scalar additions. This provides a numerically simple solution to providing an on-Lne

FSF spectrum. However, since the on-line filters have been reformulated to accommodate
the RUD method, it is still necessary to derive a relationship between the batch and recursive regressors such that the new recursive flters can provide the spectnun update (Le. each +;(t)&(t) mwt be expresseci in terms of the elements

vRk(t) p r k ( t ) ) . and

The new regressor was derived above by re-expressing pairs of conjugate fiequency parameters as pairs of real and imaginary parameters. This relationship can also be used

(see the Appendix for details) to obtain the on-line spectrum update. It may be calculated
as follows:

Note that the gain related t e m were not redefined for the recursive algorithm (Le.

Construction of the step response fiom the RLS estimate

Wit h respect to identifying a step reponse (impulse response) model, there are two straight forward options. Firstly, the recursive (real and imaginary) parameter estimates in O can simply be remanged into the equivalent batch parameter estimates in 8,and then the step reponse can be calculated a s before. The step response can also be calculated directly
rom the new parameter vector, which contains the real and imaginary components of the

frequency response model, Ak and Bk. The new expression for the step reponse estimate


Initialization of the RLS algorithm

The recursive algorithm presented thus f r has concentrated on generating an update to a the mode1 estimateci at the previous sampling instant. Obviously, there is a need to address initialization conditions for the algorithm. The effects of various choices for &O) and P ( 0 ) are discussed by Ljung and Soderstrom (1983), who note that P ( t ) must be an invertible matrix. Since the FUS estimate asymptotically approaches the batch LS estimate with the forgetting factor set to unity and P m L ( 0 ) O, it is common practice to choose +


In is the nxn identity matrix and C is a large constant. In terrns of the RUD

factorkation, where P ( t ) = ~ ( ~ ()t ) f l ( t the initialization corresponding to P ( 0 ) = C*I, t ), is

U ( 0 ) = vT(0) = In


D(0) = (C) In *
The main dBculty with this approach to initialization i that it must be applied at s the fkst sampling instant. Clearly then, use of this initialization method implies that the user must be prepared to provide an a prion' estimate of the proper settling tirne. N. The reader wiU recall that a rule of thumb was presented in Section 2.3.3 to aid in the automatic selection of N. The main difEculty with irnplementation of this recommendation is that the automatic estimate of N is based upon the duration of the third integrated relay switching interval. Hence, an estimate of N, and subsequent formulation of the data matrix, cannot be obtained untii a certain amount of data has been collected. After this point in time, a

batch LS estimate fkom the initial data could provide initial conditions for P and

6. This

method provides flexibility, and allows the RLS algorithm to be staxted at any point during the experiment, without loss of valuable data.

ln terms of the requirements for automatic estimation of N, it is desirable to obtain

this information as soon as possible, so as to minimize the computational strain of a batch estimation problern. It should also be noted that, to avoid ill-conditioning, the preliminaxy data set should contain as much frequency information as possible. Clearly then, it is ided that the input sequence be started with a series of fkequency-rich transient integrated

switches. Such an input sequence wouid provide N as soon as possible, with as diverse a spectrum as possible.


A Prototype Software Application for On-Line Identification

In Chapter 2, some preliminaq e-xperimentd resirlts were presented to illustrate the batch

LS relay identification experiment. Chapter 3 dealt with hirther testing of the batch identification method via a series of simulation case studies. Although the case study models represented common industrial processes, it is nevertheless important to recognize that simulations cannot account for real life phenomena that are difficuit to quant&

In order

for a new technique to become useful in industry, the robustness of the method must be established, to show that it works well even in the face of unpredictable disturbances and unknown nonlinearities which are always present in a real plant. The need for experimental verification of the new method was just one of two motivating factors for the development of a prototype software application, It was also felt that the combination of the on-line ident Scat ion algorithm and the new relay experiment would provide a complete process identification package. For these reasons, the prototype was designed and applied to a pilot scaie stirred tank heater (STH) process for experimental trials.

Description of the prototype

The prototype consists of two main Virtual Instrument (VI) panels; the main control panel

.) (shown in Figure 4 l ,and the FSF identification panel (shown in Figure 4.2). These W's
were created using National Instruments? LabVIEW software, which nrns in a Windows based environment. A 486 computer sen& and receives signals to and kom the process, such t hat the entire experiment may be run fiom the main control panel. When the relay experiment is active, the identification panel ruus in parallel with the

main control panel to perform on-line FSF mode1 identification. At any time during the
relay experiment, the user may switch between the main control panel and the identification panel. Prior to the identification experiment, the user may run the process in automatic

(PID control) or manual mode at a user-specified sampling interval. When the process

Figure 4 1 The Main Control Panel of the Prototype Interface .:


Figure 4.2: The Identification Control Panel of the Prototype Interface

has reached steady state, and the user wishes to commence the relay experiment, they
must simply specify a value for the relay amplitude, and then press a button to start the

experiment. After the experiment is over, the control panel WUreturn to automatic/manual operat ion. The identification panel simultaneously displays the results of up to three FSF models which are estimated in pardel. This panel, shown in Figure 4.2, dispiays some sample results. Here, the Nyquist plots, the step response plots, and the FSF spectra are displayedo providing the user with feedback as to how well each mode1 is progressing. These graphs (and data files) are periodicdy updated at a user specified fiequency. The default update
s is ten samples. Since the input/output data i imported kom the main control panel, it

is actualIy displayed on both panels. For processes with a drifting disturbance, where the

user may not wish to work directly with deviation variables, there is an option which can
be activated to clifference the input/output data prior to modeliing. The interface was designed to be as simple to use as possible, while still providing flexibility. Table 4.1 surnmarizes the default d u e s for each parameter or option. The only

relay amplitude hysteresis width Merenced/deviat ion variables settling time (N)

user d e h e d automatic estimate on demand user d e h e d

1 1
p p p

mode1 order (n) addit iooal delay setpoint bias


up to 3 user d e h e d values, or automatic estimate fi-orn obsenred switc.hiner interval default value (Il) user defined, if necessaq user defined, if necessary


Table 4.1: S u m q of Parameters/Options on the Interface essential information required fiom the user is a value for the reiay amplitude, and even

s this can be adjusted if the initial value i not reasonable. FIexibility has been maintained
so that, if the user is an expert, aII parameters/options can be directly controlled to achieve

the desired results.

For instance, the hysteresis level may be explicitly specified by the user, or there is
a hysteresis estimator function which is able to supply an automatic recommendat ion at

the push of a button. This recommendation is based on the process variable's standard deviation prior to commencing the relay experiment. In terms of the settling t h e estimate, the user can provide up to three different values of N, or a single model can be identified with an automaticaily determined value of N,
wing the batch LS initialization method discussed above in Section 4.2.3. The FSF model

order, n, may also be selected at this point, though the defadt value ( n = 11) is generally sufEcient. The input sequence itself is also provided for the user. Since a variety of input sequences have b e n tested and found to give similiar results (so long as the sequence agrees with the guidelines suggested in section 2.2.3), t here is a preprogrammed generic input sequence

which the user can select. If desired, the user can also design t heir own sequence, or choose
to morlifv the preprograrnmed sequence at any time during the experiment. The prototype also offers the user the ability to make adjustments to the reIay parameten during the identification expriment. In Chapter 3, the issue of processes with high critical fiequencies was addressed, and it was suggested t hat if adjus tments to the relay parameters id not sdciently shape the input signal, an additional delay element could be added to provide low kequency switches. An option to add extra delay is induded in

the prototype. T i delay can be added at any t h e during the relay experiment. It is &O hs possible to manipdate the setpoint which i used to trigger the relay. T h e setpoint would s norrnally be detennined by the average steady state value of the process output just prior to activating the relay. This option has b e n included because if a large step or drifting disturbance were to enter the system, it is possible that the process operating region could

shiR far enough that the setpoint no longer triggers the relay to switch. In this event it
wouid be necessary to manipulate the setpoint.

Software design
Alt hough the prototype has been applied specifically to a pilot plant, it was largely designed to be a generic prototype. The main controi panel and identification panel were designed
in LabVIEW's graphical progrnmming environment, with controls and indicators specific

to the pilot plant. However, to maintain portability, the buik of the code for these VI's is contained in Code Interface Nodes (CINs).

CINs are nodes in LabVIEW7sgraphical

programming language which represent a subroutine written in a conventional text-based language, such as C. CINs provide versatility because each node contains a generic subroutine that could be used with almost any process. In this sense, CINs contain the basic "building blocksn for the prototype, rneaning that they can be copied, and arranged into
a LabVIEW diagram to suit a specic application. For example, the most important CTN

behind the main control panel is a subroutine which manages a feedback loop under manual
mode, PID mode, or relay mode. The pilot plant has two feedback loops, so this C M a p pears twice in the LabVIEW diagram for the STH interface. The identification algorithm has sirnilady been separated into routines which perform calculations for the frequency response (this is the FUS routine), step response, and spectnim. Another advantage of programming in C is that the most of the code is readily available for further develop ment in either LabVZEW, C, or any other software p h g e that supports C. Furthermore, the computer c m execute precompiled CIN code much faster than the high level graphical LabVIEW Ianguage. For instance, the maximum possible sampling rate for the pilot plant
was a noticeable improvement over previously existing VI's which were much simpler, but

writ ten ent irely in the graphical language.

Figure 4.3: Cornparison of the LabVIEW (FUS) and MATLAB (batch LS) Frequency Response Estirnates: 6 settling tirnes of unmerenced data, N = 600. n = 11, 0.2 sec sarnpling

431 ..

Code validation

In validating the resdts obtained from the prototype, a third VI was created to bypass the main control panel. Ordinariiy, the identification panel would receive input/output data from the main control panel. The purpose of the additional VI is to read input/output data from a datafile, and pass that data to the identification panel. This way, not only c m the prototype be validated against simulation resdts, but it can also be used to analyse or reanalyse experimental or simulation data off-line. The panel shown above in Figure 4.2 contains the resdts that were used for validation.

Six settling times of data were supplied to the identification panel fkom the simulation
.. datafile of the bleach plant case study from Section 3 8 1 (case 2). Figure 4.3 compares
the prototype's estimated fiequency response to that which was origindy obtained from the case study simulation. This cornparison validates the prototype by con6rming that the

RLS fiequency response mode1 on the identification panel is virtudy identical to the result
obtained using the batch LS MATLAB code.

TC:tanpcrahue controUer

Cold Water Hot Water 1


FE Met flow tate

i 1 t

LT: tank levd L U C : cascade Ievd conttoUer

Figure 4.4: Schematic Diagram of the Stirred Tank Heater Pilot Plant


Experimental Case Study on a Pilot Scale Stirred Tank Heater

A schematic diagram representing the pilot scale Stirred Tank Heater (STH) process is given
in Figure 4.4. In this process, cool water enters the tank, gets heated up by s t e m coils inside the tank, and i pumped out through a long piece of insulated piping. The water level s

in the tank remains hced because there is a level controller rnanipulating the inlet water
flow setpoint of a flow controiler. The manipdated variable for the identification experiment is the steam valve position, and the outlet water temperature i the process variable. A s measurement of this temperature may be taken at one of three thennocouples located dong

hs the exit pipe (Tl, T2, T3 in the schematic). T i d o w s for three possible process models,
each with varying amounts of deadtirne, but with essentidy the same k t order time constant. The range of delay to time constant ratios available for experimentation
~ O W S

for identification of fast, medium and slow dynamics. Disturbances may enter the system via the steam line, the inlet water stream, and the level/flow controller.

Three relay experiments have been conducted on the temperature loop. These three

data sets have been analysecl under various conditions to illustrate the key features of the prototype, and to provide an assessrnent of the performance of the new method on a real life system. The three basic experiments were:

Experiment # 1: The default input sequence was applied, wit h output measurements
taken at T2, the second thermocouple. This data set was andysed several times o f fline so that parameter choices, such as the settling t ime estimate (N), the mode1 order
( n ) , and the option of data pretreatment, could be explored.

Experiment #2: This experiment is similar to the 6rst one (the default input sequence is
applied), except that the output measurements were taken at T l , the k t thermocouple. This i a process which, due to its s m d delay to time constant ratio, oscillates s too fast and lacks low frequency information. This case is an excellent example of an experiment which should have some extra delay added to provide more low fkequency excitation. However , for illustration purpuses, no delay was added.

Experiment #3: This experiment serves to illustrate the addit ional delay experiment .
The initial part of this run is a repeat of experiment # 2? but eventually has some extra delay added to compensate for the fast relay dynamics.


Operating conditions

For a l experiments, a sampiing rate of two seconds was chosen. The relay amplitude was i selected at f 5% (this amplitude is larger than that selected for the case study simulations because the valve has a noticeable deadzone). The hysteresis levels were 0.3OC for the T2 experiment and 0.35OC for the T experiments. These levels were selected based a n the l recommendations of the automatic hysteresis estimator function. The hysteresis level was recommended as three times the standard deviation of a 90 sample window of steady state data prior to comrnencing the experiment. The default input sequence, used for the first two experiments, was

The third experiment follows the initial part of this sequence, up until the point at which additional delay i applied (more details are given below). s

Time (sec)

Figure 4.5: Input/Output Data for T2 4.4.2

Results of experiment # 1

From past experience and also fiom step test data, it is known that the STH d y n d c s are approximately Erst order, with a settling time of about 259 samples (about 518 sec). The step tests indicate that the process deadtirne i about 48 sec and the time constant is about s 94 sec. T i means that the delay to time constant ratio is approximately 0.5, and therefore hs the dynamics are close to ideal for the new relay identification experiment. Several results wiU now be presented to illustrate the effects of various parmzters, and show how the prototype assists in their selection. The interface has the ability to estimate up to three different models in pardel, but for the purposes of this study, there are more than just three issues to address. Since the on-line identification panel can be operated independent of the main control panel, the same data set may be re-analysed off-line to allow more than three models to be examined overd. The input/output data from this experirnent (see Figure 4.5) were therefore recorded and analysed off-line, in several different
ways, to d o w for each parameter of interest to be evaluated against a common standard.

Selecting N
The most important parameter supplied by the user, and the one most subject to uncertainty, is the settling time estimate, N. In order to d o w for this uncertainty, the prototype

can generate three pardel models, each having a different value for N. For instance, based
upon the nominal settling tirne estimate, N = 259 (fom bump data): and including a 25% margin of error, three candidate models were generated: N = 323,259,195. For this run, the model order was set to a dcfault value of eleven, anci the data was differenced prior to modelling (both of t hese choices will be justified shortly). ARer collect ing approximately five settling times of data, the resulting frequency and step response models (see Figure 4.6) indicate that N = 259 gives the best results. Note that the overestimate of N produces a noticeable droop at the end of the step response, and the underestimate of N has barely enough time to settle out. F'urthermore, the underestirnate of

N doesn't capture the delay

a.U that well; it &ost

appears to be an inverse response. Recall that, ideally, the FSF

spectlvm should have a peak near the first pair of fdters, though medium fkequency content
can often give satisfactory results. Since this process has a slightly smaller than ideal R

value, the relay data would be expected to emphasize medium to low bequencies. T h e FSF spectrum for the nominal case, shown in Figure 4.7, has good frequency content across all filters, with a peak on the second p i of filters. ar

Selecting the FSF model order, n

In aU of the above models, the model order default (n = 11) was assumed to be adequate.
Three additional T2 models were estimated to confirm that this was an appropriate choice.

Each model is based upon differenced data and the nominal estimate of N. The model
orders were 13,ll and 9. Figure 4.8 presents these models for cornparison. Here, the models are shown after six settling times of data have been collected. By this point, the model estimate has essentialiy converged. Thus, improvements in the response are attribut able to the inclusion of additional flters. Notice that the step response for a model order of 9 tends to overshoot, and then droop. As well, the accuracy of the delay estimate, which is related to the high equency model parameters, tends to deteriorate as the mode1 order decreases. A model order of 11 provides a noticeable improvement over the model order of 9. However, the improvement between orders of 11 and 13 is only marginal. In terms



O. 1


03 .




(a) Requency Response Model (Nyquist plot)

(b) Step Response Model

Figure 4.6: On-line Identification Results for T2 Using Three Settling Time Estimates (n = 11)

i k lth Fiiter

Figure 4 7 O n - h e FSF spectrum for T2 (N = 259,n = 11) .: of the signal to noise ratio in each case, note that the input signal contains only a limited arnount of energy at the higher bequencies (see Figure 4.9). High frequency parameter estimates may therefore be subject to an unfavorable s i e d to noise ratio. In this respect,

an increase in model ordcr does not necessarily imply that the model will be more accurate.
The default of n = 11 is therefore justified because it minimises the number of estimated parameters, yet still produces models of reasonable accuracy.

Time convergence of the estimate

One of the practicai issues associated wit h data collection is knowing how much data will be s a c i e n t to produce a reasonable model. From a practicd perspective, it is important that the plant is not disrupted any more than is absolutely necessaxy. At the same time, stopping the experiment too early can be a problem. An important advantage of the prototype is that an indication of model quality is readily available during the experiment. This means
t hat the experiment wili not be cut too short, or run any longer than necessary.

The on-line model estimate often converges within just a few settling times of data. For instance, consider the development of the best T2 model with time, as shown in Figure

4.10. The step response looks reasonable within about three settling times of data. Beyond
this point, the step response generdy becomes a little smoother, and the gain will improve

-0 41


12 0


O. 1




(a) Requency Response Model (Nyquist plot)




300 Tirne (sec)




(b) Step Response Mode1

Figure 4.8: On-line Identification Results for T2 Using Three Model Orders

2 Figure 4. 9: On-line FSF spectrurn for T ( N = 259,n = 13)

Figure 4.10: Convergence of the T2 Model with Time (X = 259, n = 11): 1 - 6 settling times of data = o,x,*,+,solid,dotted, respectively

slightly, though it is u s u d y a relatively small change, and likely lies within uncertainty bounds. If significant gain changes are observed later in the experiment, this could be an indication that the low frequency signal to noise ratio is poor. 4.4.3

Results of experiments # 2 and 3

The T l loop has an estimated settling time of 221 sarnples (441 sec), but only about one quater the amount of delay observed a t T2. Based on step tests, t his process has an R value of only about 0.14. The Tl loop i therefore an excellent example of a process with a high s criticd frequency; a process which would probably benefit from additional low frequency excitation. The experimentd o u t h e above lists two experiments which were performed on this process. Experiment #2 (the T I analog of the T2 experiment) serves mainly to confirm that this process has very high frequency relay dynamics, and cannot produce sufficient low frequency excitation on its own. T i experiment is used as a benchmark for cornparison hs with Experiment #3 which is initidy similar, but is eventudy compensated with extra delay in order to provide the necessary Iow frequency excitation.

Conducting an experiment with additional delay

Consider the input/output data in Figure 4.11. This data was obtained using the same input sequence as was applied to the T2 case. Note that this process oscillates much faster (more than twice as fast) than the T2 process did, and yet there is only about 38 seconds difference in their settling times. Although the gain is the same for both loops, the high frequency oscillations in the Tl case limit the output amplitude to approximately half that

of the T2 response. Comparing the shapes of the T and T2 FSF spectra (see Figure l 4.12) shows that, despite identical input sequences, there is a significant difference in the
frequency content obtained in each case. The behaviour of the Tl process clearly indicates that this process requires more low fkequency excitation. The characteristics of a process with a high criticd kequency are clear early on in the experiment: rapid progression through the input sequence, a small process output amplitude that resembles a sawtooth, an FSF spectrum with a peak far to the right, and a step response with a poor gain estimate (see Figure 4-13). Once these






1000 1200 Time (sec)



1800 2000

Figure 4.1 1: Input/Output Data for T (no additional delay) l characteristics have been identified, extra delay should be introduced into the loop to slow down the switching fkequency. For such cases, improvement in the model estirnate wili not be obtained simply by collecting additional high frequency data. To illustrate this, the T l experiment was allowed to continue without extra delay. Figure 4.13 clearly shows that the s model does not converge with the proper gain because the process i not being excited at low kequencies. In this case, differencing the data actually makes things worse, because it removes much needed low frequency information from the data set. Experiment # 3 was subsequently performed to show that, with recognition of the high fiequency indicators, good results can still be obtained for such processes. This experiment initiaDy started out with the same default input sequence as the other experiments. After sixteen switching intervals, the need for extra low frequency excitation was recognized. At this point the input sequence was modified such that the integrator was activated over the next ten consecutive switches, allowing the variable delay parameter to be manipulated in order to create additional low fiequency excitation to the process. Yet, the issue of how much delay to add remains an important question, and the quality of such experiments relies on the user's judgement. As a general rule of thumb, it is best to add a small amount of delay, wait for the transient to settle (this takes about three

I k Ith Fi)ter

(a) FSF Spectrum for Experiment # 1 (T2): medium dynamics

I k Ith Fiiter

(b) FSF Spectrum for Expriment # 2 ( l : T)k


F igure 4.12: Cornparison of Input Signal Frequency Content for Two Processes

Figure 4.13: Convergence of the T Mode1 with Time (N = 221, n = 11): 1 - 5 settling l times of data = o,x,*,+,solid, respectively switches) and evaluate whether or not to add more delay. The on-line FSF spectrum is an excellent tool for determining whether or not the added delay was sufficient. When a sufncient amount of delay has been added, the most active area of the FSF spectrum should be the neighbourhood of the b couple of tilters. As the FSF frequencies vary with the t settling t h e estimate, the accuracy of this indicator will naturally depend on proper choice of N. However, unless N is very poorly estimated, the spectnim will still provide a useful indication of what frequencies are being excited. Experiment # 3 wilI now be presented in detail, to explain the methodology behind the efficient application of the delay parameter. Table 4.2 outlines the amounts of delay that were applied during the experiment. The data set obtained fkom this r u , is presented in Figure no. 4.15, top 4.15, middle 4.15, bottorn 4.16, top 4.16. bottom

Swit ching Intervals

1 - 16 17 - 19 20 - 22 23 - 26 27 - 34

- -


Extra Delay Integrator Status none [111i000110100101] 5 samples 111 1 1 10 samples [l 1 1 1 15 samples [1 1 1 1 1 15 sarn~les ~00010011~

Table 4.2: S i t m m a q of Experiment # 3, the T l plus delay experiment




1500 2000 Tirne (sec)



Figure 4.14: Input/Output Data for the T Plus Additional Delay Experiment: see Table l 4.2 Figure 4.14, where each segment of the data set is plotted with a different Line type (a solid or dotted fine), and represents the data obtained by executing one row in the table. Figures 4.15 through 4.16 give a chronological sllmmary of the results obtained at the end of each part of the experiment. Here, the mode1 order was again set to the default, and this time two models were produced based on the nominal settling time estimate, N = 221. The dXerence between the two models is that one was estimated from differenced data, and the other was not. The FSF spectrum given in the figures was taken from the undierenced input signal.

Firstly, it is interesting to examine the overall effects of adding delay into the feedback
loop. The k s t sixteen switches of data (the first segment in Figure 4.14) were obtained with no extra delay. The fast dynamics of the pmcess trigger a series of rapid switches, causing the output signal to be sawtooth-like, with a s m d amplitude. During the second, third and fourth segments, increasing amounts of delay are applied. As a result, the switches in the middle of the data set becorne progressively slower, adowing the output amplitude to grow significantly. Also note that the output response is a Little more rounded, indicating that the process will eventually settle out. As will be explainecl shortly, the experiment could have been stopped around this time because this amount of delay was satisfactory and the



I k lth Filter

200 300 Time (sec)


Figure 4.15: On-line Identification Results for the T PIUSAdditional Delay Experirnent l (see Table 4.2; continued in Figure 4.16): solid, dotted lines are the estimated step responses fiom dserenced, non-difEerenced data respectively





I k Ith Filter

Tirne (sec)

Figure 4.16: On-line Identification Results for the T 1 Plus Additional Delay Experiment (see Table 4.2; continued fkom Figure 4.15): solid, dotted lines are the estimated step responses fkom Merenced, non-differenced data respectively

step response was good. However, for illustration purposes, the experiment was continued, so that it could be demonstrated how the procm could have been further excited if more data had been needed. If, for more than about three or four switches, the integrator is lett

il on, and the delay is not manipulated there wl be a loss of rich excitation. Further rnid
and low fiequency excitation may be obtained if the integrator status is manipulated, while

the added deIay rernains constant. The f n l portion of the data set was obtained in tbis ia
manner . Examination of Figures 4.15 through 4 1 shows a clear relationship between the changes .6 made to the experiment, and the development of the on-line FSF spectrum and the step response model. The figures will now be detailed in chronological order to provide some insight as to how the spectnim was shaped. Consider the hrst set of results, obtained after the irst sixteen switches. It is obvious from the FSF spectrum that the process is almost exclusively generating high hequency excitation. Naturdy, the initial pa~% the step of response is good, but the rest of the step is quite poor. After the period with 5 samples of extra delay there was no noticeable improvement, so the delay was increased to 10 samples for the third period. At this point, the middle part of the FSF spectrum was boosted. The fourth set of results was obtained after the delay was increased to 15 samples. The spectrum here appears to have the ideal energy distribution, and the step response has drasticdy improved, with the differenced model being superior. At this point, it appears

as though the experiment could have been terminateci. The experiment was prolonged
to show that by holding the extra delay constant and manipulating the input sequence, further information can be obtained about the rniddle fiequencies of the FSF spectrum.
This additional frequency information also improves the step response estimate.

Clearly, the results of the additiond de1ay approach are far superior to those of the
basic T experiment. Note that the estimated models recovered quickly with the addition of l

sufficient delay, and there was a remarkable improvement in the shape of the FSF spectrum. The addition of delay complements a rich spectrum in the middle and high frequency region, suggesting that this modification to the experirnent may not only provide essential low frequency information, but also provide an input signal that is strong in the middle and high frequency region.


Remarks on practical issues

Automatic estimation of the setthg time

Multiple model estimates can be advant ageous when uncertain@ in paramet er choices, for example the settling time estimate, N, exists. With an intial rough estimate of a parameter, several models can be generated, and the best one can be selected at the end of the experiment. However, in cases where the process dynamics are poorly understood, speciSling even a preliminary estimate of the settling t h e may prove difficult. In t his event , the prototype inclrides an option which automatically estimates the settling time fkom an initial portion of the relay data. T i feature i based upon a d e of thumb which was hs s presented earlier in this work; namely, that an estimate of N / 2 can be taken as the length of the t hird consecutively integrated switching interval. In the above disscussion of the RLS initialization conditions, it was suggested that the k t three switches of the input sequence be integrated ones. After approximately one settling time of data has been collected, the automatic estimate of N c a n be gnerated, and then a batch LS estimator can be applied to generate initial conditions for the recursive algorithm, which is subsequent ly activated. As an illustration, consider the T2 model shown in Figure 4.17, which was estimated
using a value for N automatically generated bom the fourth switching interval of relay data

(the &st switching interval in the experimentd data was so brief, that the estimate of N was actuaily talcen during the fourth switching interval). The settling time was estimated to be N = 190, which is an underestimate, but nevertheless yields quite acceptable results.

T i option of automaticaily estimating N clearly offers a great deai of flexibility, but hs

should be applied with caution. As experiment # 2 dernonstrated, processes with high critical fkequencies switch very rapidly. Obviously, using the observed switching i n t e d to estimate N has the potential to produce very inaccurate estimates for some processes.

l Consider the T model in Figure 4.18, which was estimated using an automatically generated
value of N = 44. R e c d that the delay compensated T experiment was found to be best l
modelled by N = 221. In this instance, the automatic settling time has been set so small

that the FSF filters have been significantly shifted, and are effectively ignoring aay 10w
frequency components in the signal. Thus, the automatic settling time estimator i best applied to processes which do not s





200 Tirne (sec)




Figure 4.17: On-line Identification Results for T2: automaticaliy estimated setthg t h e , N = 190

Figure 4.18: On-line Identification Results for Tl: autornatically estimated settling time, N = 44

require additional delay. The success of this method is also subject to ot her influences, such
as nonstationary disturbances and valve nonlinearities, the effects of which are explained in

the foUowing section.

Handling valve nonlinearities

The need to Merence the data is also important when a valve nonlinearity biases the experiment. Experiment # 1 was actually

twice. The results shown earlier in this

thesis are those fiom the second nin of the experiment, where care was taken to ensure that

the mlve nonluiearities were minimii;ed. The original run is examined now to emphasize
the need for differencing the data. Figure 4.19 presents for cornparison these two ditferent data sets. Z is interesting to note that, dthough the input sequences and the operating t conditions were kept the same in both cases, the switching patterns of the relay are markedly different. The shape of the first input signal (i.e. the long-short pairs of switching intervals) is reminiscent of an input signal created by a biased relay. In fact, it is the valve backlash which creates this effect when the relay experiment does not commence centred in the backlash deadzone (more details on the effects of backlash were given in Chapter 3). T i hs direct ional nonlinearity can rnimic the effects of a nonstationary disturbance, because the input seen by the process is essentiay a biased version of the intended input. DifFerencing the data removes this unintended bias, just as it would remove a nonstationary disturbance. Figure 4.20(a) presents the differenced and undifferenced models generated fiom the original

T2 experiment (the "biased" r u ) , in which the d v e was not intiaUy centered in the
backlash deadzone. Notice that, in this case, differencing produces a much better model. In contrast, the second run ( s e Figure 4.20(b)) showed only marginal improvement with differencing because the valve was centred in the backlash deadzone, thereby minimising the directional bias. The two input signals compared above, and shown in Figure 4.19, clearly illustrate that unpredictable switching intervals are an additional side effect of a valve nonlinearities. Owing to the feeback nature of the relay experiment, the switching fiequency of the input signal

is idluenced by the process's response. If the input signal amplitude is not symmetric, as is the case when the valve exhibits backiash, then the process output wiU be biased, creating longer-shorter pairs of switches. While the input signal becomes less predictable, the qual-

Time (sec)

(a) Biased Relay Data Due to Backlash

a 8






1500 Tirne (sec)



(b) Unbiased Relay Data Because Valve was Centred in Backlash Deadzone

Figure 4.19: Biased and Unbiased Relay Data: Two nins of Experiment #1

-difierenceci data - - deviation variables



Tlme (sec)


(a) Mode1 Estimate with Biased Data



C U)

03 .

= 5
B m

-dierend data

- - deviation Mnabtes


Tirne (sec)

(b) Mode1 Estimate with Unbiased Data

Figure 4.20: On-line Identification Results for T2. Dxerencing can be advantageous when backlash effects are sigdicant. Input/Output data shown in Figure 4.19

ity of input excitation does not necessarily suffer. To the contrary, a richer spectrum, with strong low kequency cornponents, often results. In borderhe cases, the longer switching

intenmls introduced by the valve can sometimes avoid the need to consider additional delay.
The best models for the piiot plant were generated based on differenced data. Note that

n differencing was applied here mainly to remove unwanted effects of the valve dynamics. I
general, however, the motivation for differencing data originates because most industrial processes are subject to nonstationary process disturbances which are correlated with the process input signal. While a hysteresis width may be assumed to prevent a correlation
s between the process input signal and a stationary disturbance, it i not sufficient to prevent
a correlation in the presence of a nonstationary disturbance. If in doubt as to whether or

not to pretreat the data, it is advisable to exploit the prototype's ability for parallei model generation by fitting one differenced and one non-differenced model.

Chapter 5

Conclusions and Recommendat ions


Contributions of the Thesis

In tbis thesis, automated binary input signal design has been achieved through the development of a new relay experiment. A series of industrially relevant case studies were simulated to evaluate the new method. The new experiment is a dtifiequency extension of previous work (Khan, 1995) which combined the relay and the FSF algorithm, but was restricted to use of conventional periodic relay signals. In addition, the batch least squares

FSF algorithm was extended to a recursive form in order to allow on-line identification of
frequency and step response modeh. This algorithm was subsequently incorporated into a prototype software application which was developed to implement the new relay experiment and analyse its performance on a pilot plant stirred tank heater. The main conclusions from this project are siimmarized as follows. 1. In Chapter 1, a survey of current relay identification methods was presented. These methods have been very successful in industry largely because of their ease of implementation. However, an important limitation of these methods is that they only consider periodic data, which means that there is only a small amount of frequency information obtainable kom these experiments. Furthemore, the tools commonly used for m o d e h g are subject to approximations. In Chapter 2, it was shown that, the combination of a nonperiodic relay experiment with the FSF mode1 structure has
b e n shown to provide a continuous spectrum of excitation and accurate process mod-

els, yet it stiil maintains the ease of irnplementation which makes relay methods so attractive. With respect to random binary signal methods, the new relay experiment

offers the advantage of an automated input signal design.

2. The relay's ability to adapt the input signal to suit the observed pmcess response
is the key to automation of the identification experiment. Within the kamework of the design guidelines presented in Chapter 2, it has been concluded that the input sequence design does not have a noticeabIe impact on the quality of process excitation. Chapters 3 and 4 contain several examples which confm t hat the same input sequence can be applied to processes with different dynamics, and still produce excellent results. Also, it was established that the ideal relay experiment is one where the input signa1 contains strong components at all FSF hequencies, but places particuiar emphasis on the centre fkequencies of the first two pairs of filters. 3. Chapter 3 contains a more detailed analysis of the interaction between the relay and the process. Processes with srnail amounts of delay relative to the time constant have b e n identified as having high critical frequencies. For this class of processes, excellent results have been obtained by modifjring the experiment to include extra delay in the feedback loop.
4. The new relay experiment was successfully applied in simulation on a variety of models

commody obsemed in the pulp and paper industry. The on-line relay identification prototype demonstrated experimentaily that the new relay experiment has, in many cases, the potential to completely automate process identification. Moreover, the availability of on-line identification provides important feedback on the experiment's progress. 5. Pararnetric models, which require the user to specify an appropriate a priori mode1 structure, are often used in identification. The nonparametric FSF model is feIt to be more flexible because its specifications (model order, settling time estimate) can be easily automated. The experimental results show that a default FSF model order is generally sufEicient, and the settling time estimate can .often be estimated automaticdy from the observed relay switching intenmls. Moreover, the p a r d e l

m o d e h g option on the prototype d o w s the user to provide several estimates for

these parameters and decide later on which one was the b a t .

6. It should


be noted that, while the on-line FSF algorithm and the new relay

experiment complement each other well, these contributions also stand alone.

5 -2

Recommendations for Future Work

1. FUS mode1 estimation is commonly applied to nonlinear and time varying processes.

The RLS FSF algorithm has aiready been extended and applied to a pH process with excellent results (Kalafatis, 1997). A natural extension of this work would be to develop the new relay experiment for nonlinear system identification.
2. The relay has already been used as a source of extemal excitation for closed loop

identification (Schei, 1994; Schei, 1992) and performance monitoring (Koulouris and Stephanopoulos, 1997). These applications rely on the relay to excite the process at one specific fkequency. It is possible that the multifkequency excitation generated by the new relay experiment might also be a usehil tool in these types of applications. 3. Alchough input signal design for multivariable systems is poorly understoodothe relay has been applied to autotunuig of multivariable processes (Shen and Yu, 1994; Palmor et al.. 1995). Perhaps t his might be an area in which mult ifiequency relay signal5 could prove useful.

Astrom, K.J. (l988), A new auto-tuning design, in 'IFAC Adaptive Control of Chemical Processes', Copenhagen, Denmark, pp. 143-148. Astrorn, K. J. and B. Wittenmark (lggO), Cornputer-Controlled Systems, second edition, Prentice-Hd, N. J-,USA, Astrom, K.J. and T. Hagglnd (1984a), Automatic tuning of simple regulators, in 'IFAC Proceedings Series, 9th Triennial World Congres', pp. 1867-1872. vo1.4. Astriim, K. J. and T. Hagglnd (19846 ) , 'Automatic tuning of simple regulators wit h specifications on phase and amplitude margins', Avtornatica Z O ( 5 ) , 645-65 1. Belanger, P.W. and W.L. Luyben (1996)' 'A new test for evaluation of the regdatory performance of controlled processes', Ind. Eng. Chern. Res. 35, 3447-3457. Bit mead, R.R. and B .D.O. Anderson (l98l), 'Adapt ive fkequency sampling filters', IEEE Dansactions on Circuits and Systems CAS-28(6), 524-533. Chang, R.C.,S H Shen and C.C. Yu (1992), 'Derivation of transfer function fiom relay .. feedback systems, Amencan Chernical Society 31, 855-860.

Chiu, M.S. and J. Ju (1997), Fft based performance monitoring procedure for sis0 control systems, in Preprints IFAC ADCHEM', Ba&, Canada, pp. 441-445.
Cluett, W.R., L. Wang and A. Zivkovic (1997), 'Development of quality bounds for time and fkequency domain models: Application to the sheil distillat ion c01umn'~Journal of Process Control 7(1), 75-80. EnTech Control Engineering Inc. (1993), 'Automatic controuer dynamic specification'. Version 1.0.
fiiman, M. and K.V. WalIer (1995), 'Closed-loop identification by use of single-valued nonlinearities', Ind. Eng. Chem. Res. 34, 3052-3058.

Goberdhansingh, E., L. Wang and W. R. CIuett (1992), 'Robust fkequency domain identification', Chemical Eagineering Science 47(8), 1984-1999. Hagglnd, T. and K. J. Astrom (1991), Identification of systems using periodic excitation, in C.Banyasz and L.Keviczky, eds, 'IFAC Identification and System Parameter Estimation', Budapest, Hungary, pp. 727-732. vol. 2.

Hang, C.C. and K.J.Astrtirn (1988), Practical aspects of PID auto-tuners based on relay feedback, in 'IFAC Adaptive Control of Chemical Processes', Copenhagen, Denmark, pp. 149-154. Hang, C.C., K.J. Astrom and W.K. Ho (1993), 'Relay auto-tuning in the presence of static load disturbance', Automatica 29(2), 563-564.
Huang, H.P., C L . Chen, C.W. Lai and G.B.Wang (1996), 'Autotuning for model-based PID controilers', AIChE Journal 42(9), 2687-2691.

Kdafatis, A. (Ng?), Identification and Control of Wiener-Type Nonlinear Systems wit h Applications to pH Processes, PhD thesis, Dept. of Chernical Engineering, University of Toronto.

Khan, M. (1995), A new method for auto-tuning PID controllers, Master's thesis, Dept. of
Chemical Engineering, University of Toronto. Kim, Y.H.(1995), 'PI controiier tuning using modified reIay feedback method', Journal of Chemical Engineering of Japan 28(l), 118-121. Koulouris, A. and G. Stephanopoulos (1997), Stability of NN-based MPC in the presence of unbounded mode1 uncertainty, in ' i t International Conference on Chemical Process Ffh Control', California, USA, pp. 339-342. no.316 v.93. Leva, A. (1993), 'PID autotuning algorithm based on relay feedback', IEE Proceedings l4O(5), 328-338. Li, W., E. Eskinat and W.L. Luyben (1991), 'An improved autotune identification method'. Ind. Eng. Chem Res. 30, 1530-1541. Ljung, L. (1987), System Identification: Theory for the User, Prentice Hl Inc., New Jersey, al USA. Ljung, L. and T. Soderstrom (1983), Theory and Practice of Recursve Identzficution, The MIT Press, Mass., USA.

Lundh, M. and K.J. Astrom (1994), 'Automatic initialization of a robust self-tuning controuer', Automatica 3O(ll ) , 1649-1662. Luyben, W.L. (l987), 'Derivation of transfer functions for bighly nonlinear distillation columns', Ind. Eng. Chem. Res. 2 6 , 2490-2495. Palmor, Z.J., Y. Hdevi and N. Krasney (1995), 'Automatic tuning of decentralized PID controllers for TITO processes', Automatica 31(7), 1001-1010. Patel, U.J,, L. Wang, M. Foley and W.R. Cluett (1997), Application of the frequency sampling filter mode1 in process identification: an industrial case study, in 'Preprints IFAC ADCHEM', Banff, Canada, pp. 25-30.

S.E.and K.J. Astrom (iggl), Smart synthesis of a PID controller, in 'IFAC Intelligent

nining and Adaptive Control', Singapore, pp. 405-410.

Schei, T S (1992), 'A method for closed loop automatic tuning of PID controllers', Auto.. matica 28(3), 587-591.

Schei, T S (l994), 'Automatic tuning of PID controllers based on t r d e r function estima.. tion', Automatica 3O(l2), 1983-1989.

Shah, S.L. and W.R. Cluett (19911,'Recursive least squares based estimation schemes for
self-t uning control', The Canadian Journal of Chernical Engineering 69, 89-96. Shen, S.H. and C.C.Yu (1994), 'Use of reIay-feedback test for automatic tiining of multivariabIe systems', AChE Journal 40 (4), 627-646. Shen, S.H., J.S. Wu and C.C.Yu (1996), 'Use of biased-relay feedback for system identification', AIChE Journal 42(4), 1174-1180Soderstrom, T. and P. Stoica (1989): System Identification, Prentice Hd,London,UK.
Sung, S. W-and J+H. Park and I.B. Lee (1995), 'Modified relay feedback method', Ind. Eng. Chem. Res. 34, 4133-4135.

Thornton, C .L. nd G. J. Bierman (l977), 'Gram-schmidt algorithms for covariance propogation', Int. J. of Control 25(2), 243-260.
Wang, L-and W.R. Cluett (1996), 'Use of PRESS residuals in dynamic system identification', Automatica 32, 781-784.

Wang, L-and W.R. Cluett (1997), 'Fkequency sampling filters: An improved mode1 structure for stepresponse identification', Automatica 33( 5 ) , 939-944.

Wang, Q.G., C.C. Hang and B. Zou (1997)' 'Low-order modeling from relay feedback', Ind. Eng. Chem. Res. 36, 375-381.
Ziegler, J.G. and N.B. Nichols (l942), 'Optimum settings for automatic controllers', fians. ASME 64(759).

Appendix A

The Relationship Between the Batch and Recursive FSF filters

Beiow is a derivation of the result presented in Equation 4.24. This result allows a recursive version of FSF spectnim to be constructed based upon the RLS parameter vector estimate. There are several key properties of the batch parameters which give rise to Equation 4.24:

Property 1 In the batch parameter vector, 0,successive pairs of frequency response : parameters are complex conjugate pairs that correspond to *wk:

Property 2: Let

G(efwk) Ak =

+ jBk. It is then clear that

Ak = A-k and Bk = -B-&

Property 3: Similar to Property 1, successive pairs of batch filter outputs are ais0 complex conjugate pairs: 4 k = d:k (A.3)

The following identities are also important because they show how the r e d and imaginary parts of of the batch filter outputs can be separated:

where q5k = ctk

+ j&

The main relationship between the original and recursive FSF regressorsl is:

Substituthg Properties 1 and 2 yields

'~ote that the sampling instant has been dropped for ease of notation

By Property 3,

+ 6) j B k ( # k - 4;) = A k v R k f B k ~ f k +


Findy, denoting q5k = a k becomes

+ j&

and introducing Identities 1 and 2, the relationship

= &'PR&


+B d - W k )

+B k w k


By matching the left and right hand sides of this equation, it is clear that there is a simple relationship between the recursive fiters, q , and the real and imaginary components of the batch filters, a and P:

(A. 10)

(A. 11)
Substitution of this result into

4+ 0:

(A. 12)

yields the update expression presented in Equation 4.24, namely,

(A. 13)


111 11. I

i ii
L ; L ,



- = ,

I M G E lnc
1653 East Main Street Rochester, NY 14609 USA Phone: 716M82-0300 Fax: 7161288-5989

= ---- 0

0 1993. App(ii Image. In=. Au Rignts Reserved