Nonlinear System Identification Using Genetic ... - IEEE Xplore

3 downloads 0 Views 576KB Size Report
Philadelphia, Pennsylvania June 1998. Nonlinear System Identification Using Genetic Algorithms with Application to Feedforward Control Design. Guan-Chun ...
Proceedings of the American Control Conference Philadelphia, Pennsylvania June 1998

Nonlinear System Identification Using Genetic Algorithms

with Application to Feedforward Control Design Guan-Chun Luh Department of Mechanical Engineering Tatung Institute of Technology, Taiwan, R.O.C. ABSTRACT A CAMAS-based system identification scheme is

developed to construct NARX model of nonlinear systems. Several simulated examples demonstrate that it can be applied to identify both nonlinear continuous-time systems and discrete-time systems with acceptable accuracy. Inverting the identified NARX model, a feedforward controller may be derived to track desired time varying signal of nonlinear systems. Sufficient conditions of the invertibility of NARX model are proposed to investigate the existence of the inverse model. Simulation results depict the effectiveness of the feedforward controller with the aid of simple feedback controller designed for regulation purpose.

Giorgio Rizzoni Department of Mechanical Engineering The Ohio State University, U.S.A. A model is invertible if the corresponding input-output map is one-to-one and onto. In this paper, sufficient conditions of the invertibility of NARX model are proposed. Then a feedforward controller may be derived by inverting the identified NARX model to track a desired time varying signal with the help of a simple feedback controller. Simulation studies were conducted to evaluate the performance of the controller.

2. NARX Model

For a m-input-r-output NARX model, the jth output representation is depicted as follows: I.

Y , ( t ) = c y , , (4, j = 1,2,...,m Y=

1. Introduction

where the "(1, degree polynomial NARX output" is

Inverse model has many applications in control system design. A few examples are: engine fault diagnosis [ I I], feedforward control [22] and self-tuning control [26]. In general, a closed-loop plant can not perfectly track arbitrary reference using standard feedback control such as PID controller. With the aid of feedforward controller, on the other hand, the plant will be able to achieve perfect tracking in that the feedforward controller can compensate for the system dynamics. The straight way to design the feedforward controller is to invert the dynamics of the closed-loop plant directly. For the case of linear systems, Tomizuka [22] introduced the idea of zero phase error tracking control (ZPETC) as a generation of feedforward control based on the concept of inverse systems. Several extensions of ZEf TC's were proposed later (e.g. [5,24,25]). Unlike the ZEPTC, Yanhagi and Lu [26] introduced an Ldelay approximate inverse system for self-tuning control. Note that however all these researches are aimed to solve linear systems. Usually, two approaches can be applied to derive inverse model: (i) directly obtain the inverse model using identification techniques [ 161, or (ii) inverse the forward model. System identification techniques are applied in many fields to predict the response of unknown systems using a given set of input-output data. Because most processes encountered in the real world are nonlinear to some extent, and since in many practical applications nonlinear models are preferred in order to achieve an acceptable predictive accuracy and wide operating range, nonlinear model structure is required to provide the complexity and computational power. In general, concise models are desirable in control application due to their stringent on-line requirement. Thus NARX model [ 13,141, a linear-in-the parameters nonlinear difference equation, was adopted in this study to represent a wide class of nonlinear systems due to its small number of parameters. Several ways can be applied to determine the significant terms (i.e. model structure) to be included in the NARX model. Some of these include forward-regression orthogonal estimator [ I ] , neural networks [2,19] and genetic algorithms [ 151. 0-7803-4530-4/98 $10.00 0 1998 AACC

(1)

I

f I Y , (f

-41

P+YI +Y2 +. '+VS

I-IU,(f

r=p+l

I=I

withp +q,+ q2+"-+qr=

- k, )

4 kl=l, 2,

..a,

K , and

c I... c K

K

K

k,=l

kh=l

I

k,.kh=l

and where L is the polynomial of degree and K IS the maximum number of time lags. As to the SlSO (single-input-single-output) case, the NARX model is given as follows

withp + q = 4 k , = l , 2, ...,K Take a second degree polynomial ( L i =2) with time lags n,. = nl, = 6 for example, it would contain 91 possible terms. Obviously, this is excessive and only part of these terms are significant. Leontaritis and Billings 1141 showed that 10 terms is enough with little deterioration in modeling accuracy in general. The main task in the NARX modeling hence is the determination of the model structure (i.e. the significant terms included in the model). The orthogonal least squares estimator proposed by Korenberg el al. [ I O ] and its forward-regression version [ I ] can select a subset of significant terms very efficiently. The basic idea of the algorithm is to transfer the regression equation into an equivalent orthogonal form. Then the significant terms can be selected in the simple forward regression procedure according to the criterion called "error reduction ratio (ERR)" due to the orthogonality property.

2371

3. Genetic Algorithms Genetic algorithms(GAs) have been developed by John Genetic Holland , his colleagues, and his students. algorithms are search algorithms based on the mechanics of natural selection and natural genetics. They combine survival of the fittest among string structures with a structured yet randomized information exchange to form a search algorithm with some of the innovative flair of human search [ 6 ] . GAS starts from a set of random strings, called individuals of population, and proceeds repeatedly from generation to generation through basically three genetic operators: reproduction, crossover, and mutation. In each generation, the expected number of copies reproduced by an individual parent is proportional to its fitness value. The selection procedure thus reproduces highly fitted individuals and eliminates the worse ones. Crossover operator recombines genetic materials of two individual parents to produce the offspring for the next generation. The main purpose of crossover is to exchange information between parent pairs without losing any important schemata. This procedure will be executed continuously until the crossover rate is reached. The purpose of mutation is to introduce genetic diversity into the population. A random position of a random individual is chosen and is replaced by another character from the alphabet (for example, a “0” and a “ I ” in the binary representation). The total number of bits selected to mutate is settled by the mutation rate. In general, the mutation rate is quite small and fixed. Both the crossover and mutation operators are the sources of exploration. They will disrupt some of the schemata on which they operate. In the process of genetic search, there is a tradeoff between exploitation and exploration. The difficulty of simple genetic algorithms lies in seeking the balance between exploitation and exploration which determine the convergence and diversity of the optimal search. GAMAS (Genetic Algorithms based on Migration and Artificial Selection) proposed by Potts et. al. [20] solved the problem of the balance between exploitation and exploration and alleviates the premature convergence problem. GAMAS expands the basic idea of a simple genetic algorithm to include the evolution of multiple parallel species and three additional operators: migration, artificial selection, and recycling. This study adopts their scheme rather than using simple genetic algorithms for system identification due to these advantages. 4. System Identification using Genetic Algorithms Flockton and White [4] used GAS for pole-zero identification. Kristinsson and Dumont [ 121 applied GAS to identify an ARMAX model of both continuous and discrete time systems. IBA et. al.[9] have integrated GMDH (group method of data handling) and a GA-based search strategy to established an adaptive system. Extended from linear system identification, Li and Jeon [ 151 applied genetic algorithms to identify the NARX model. They coded the model structure as a n-bits binary string and each of the n bits represents one of these terms for the model. A value 1 means the inclusion of this term in the identified model, while a 0 means the exclusion of this term from the model. There are two drawbacks of their coding: (i) the length of the bit string and the search space will be increased rapidly in the case of larger value of time lags and number of the inputs of the model; (ii) the number of the significant terms of the model is hard to be kept constant

because the number of 1 appeared in string will be changed frequently through the crossover and mutation operation. This study proposed another coding to solve these problems. Each individual is divided into several substrings according to the “maximum allowable terms” defined by the user. Typically I O terms is enough to model a system accurately as described previously. Next, each sub-string will be coded and decoded from 1 to the maximum number of possible terms according to a specified sequence. Take a second order polynomial for example, the sequence is defined as:

d.c., y(k-l), ...,y(k-n,), u(k- l), ...)u(k-n,J,y2(k-I),. ..,y2(k-ny) u2(k- 1), ..., U ( y(k- 1)* u(k- 1 ), ..., y(k-nu)*u(k-n,,) where the d.c. means constant value. In such way, the significant terms of the identified model will be kept constant. Moreover, the total length of each string will not change greatly even with large time lag and number of inputs. For example, if the number of possible terms in the model structure is 200, the number of bits of each individual for our binary coding will be 80 (i.e. eight multiply ten, assuming I O terms) while that is 200 for the case proposed by Li and Jeon. Besides, in stead of using mean-squareerror (MSE) as fitness function by Li and Jeon, the error reduction ratio (ERR) is employed in this study because ERR is more robust to the noise effect. In addition to the conventional fixed-rate mutation operator, a novel mutation operator called “truncate mutation operator” was proposed in this study to improve the performance of NARX identification both in accuracy and speed. This operator discards the identified significant terms with the smallest ERR values and then regenerates it randomly according to the mutation rate. It was found that the RSSR selection operator is the best choice no matter what the crossover and mutation operator used. Moreover, truncate mutation operator offers much faster convergence speed and better performance in NARX identification than fixed-rate mutation operator [ 181. 5. Inverse NARX Feedforward Controller

Researchers have investigated the use of feedforward controllers to enhance the performance of linear feedback systems in recent years [7,21,231. Tung and Tomizuka [25] designed a feedforward tracking controller based on the identification of low frequency dynamics. A discrete-time linear transfer function is estimated and used to design a feedforward compensator. As described previously, nonlinear models may be required in many practical applications. In the design of a nonlinear feedforward controller, finding an inverse model for the nonlinear system being controlled is essential. Figure 1 depicts the proposed control scheme consisting of a feedback controller, and a feedforward controller (inverse NARX model). Based on this scheme, the feedforward controller is placed for tracking purpose while the feedback loop is designed for regulation.

2372

I disturbance

I Figure 1 Scheme of feedforward and feedback controller

Before deriving the inverse O 'm the NARX model, the Of equations ( l ) and ( 2 ) must be investigated. It is impossible to obtain the inverse model by inverting the fomard model which is not invertible. A system is invertible if the corresponding input-output map is one-to-one and onto. Therefore, the input can be recovered from the given output. Referring to the definition of Hischorn [8],the invertibility of NARX model can be defined as follows: Definition 1: The SISO NARX model is invertible at yo if whenever u I ,u2 a r e two distinct inputs, and A t , UI, vu)f Y(t>U29 Yo) Definition 2: The MIMO NARX model is invertible aty,(O) if '2 ',I) and ('12' u22'**.9 ' ~ 2 ) are two distinct set ok inputs, and ('117

"("

*'I' u21""'

7...9

urlfit0))f~tt7 "1'

u21y'."

url~(o))

In addition to the one-to-one mapping, the mapping interval (i.e. onto property) must be defined. In this paper, sufficient conditions of the invertibility of NARX model are developed as follows [ 171: Proposition 1: The SISO NARX model, equation (21, is invertible if cp,,(kl,k2,-..,k,, kp+I , - .- , kP+&=O for q22 and max(kp+l, kp+2,..-rkP+&< 03 Proposition 2: The SISO NARX model , equation (I), is not invertible if c , (k,,, , k,,, , k,,, )#O where 1722, and k,,, =min(&, k2, k,) Proposition 3: The MIMO NARX model, equation (2), is invertible if

A sequence of 1000 random data points are generated for the identification. In the identification phase, a NARX model with second degree of polynomial is used. Both the maximum time lags Of the Output and input ny =nu = l o are chosen. In addition, it is assumed that the NARX model consists 8 possible terms. After 328 generations, the CAMAS yields the following NARX model: y(k)=0.38y(k-l)u(k-l)- 1.4657u(k-1)+3373y(k-I) +4.5677u2(k-1) + 0.2135u(k-2) + 2.3705u(k-l)u(k-3) + 0.1758y( k-3)U( k-1)+2.9923~(k- 1) U( k-2) Several different inputs were generated to evaluate the identified NARX model. Figure 3 shows one of the simulation results. The figure illustrates the comparison of the output response of the system y(k)and the predicted output j ( k ) of the NARX model. Obviously, the predicted output matches the true output quite well (error is less than +3%). 12 10

8

6 4

2

. e - ,

CJ,,,ql,c12,

( k l ~ k 2 ~ . " k p ~ k p + l ~ " ' ~ k p + Y ~ ++q~r 2) =+

f o r q , 2 2 , i = I , 2 ,..., r

o,

Proposition 4: The MIMO NARX model , as equation ( I ) shown, is not invertible if (k,,n,k,,,,...,k,,,)icO, j = 1,2,...,m with cJ,w,.Y2.

9,

'

.Cl,

and 91 Y 42 > * "791-1 7 q J + i

and k,,,

7..

',qJ'< 91 Y

= 'Y2,"

.Yr

= min(kl,k2,...,k,,)

6. Simulation Results NARX Identijkation T~ implement the nonlinear model identification, a GAbased NARX System Identification software called GANAWSI was developed using e++ with graphical interface (GUI). Three different nonlinear systems are used to evaluate the proposed scheme shown as follows: (1) Nonlinear Discrete-Time System: The block diagram of a third-order nonlinear discretetime system adopted by Fakhouri[3] for identification evaluation is used in this study as figure 2 shown. 6. I

HCk)

y(k)

Figure 2 Third-order nonlinear discrete system

0

-2

0

200

400 600 Sample

800

1000

Figure 3 System output vs. NARX model output (2)Nonlinear Continuous-Time System: The nonlinear continuous-time second-order system used to check the performance of the proposed methodology is listed below. ?(t) + 0.4j(t)y(t)+ 0.15y2(t)= 0.5u(t)+ 0.2u2([) (3) + 0.32y(t)u(t) The sample rate is 0.1 second. The maximum time lag is assumed to be 4 and the allowable number of time is set to 8 . After 1 I O generations, the identified NARX model is as follows: y(k)=l.2557y(k-l) + 0.0955y(k-2)y(k-3)+0.2744~(k-2) +0.1205y(k-2)u(k-l) +0.1484u(k-3)- 0.168y2(k-l) - 0.277ly(k-4)+ 0.1 144u(k-3)u(k-4) In addition, a white noise (with 311 SNR) was added to the input data to evaluate the effectiveness of the scheme. After 300 generations, the identified NARX model is y(k)=1.947y(k-1) - 0.95~(k-2)+0.1 1 1 3u(k-1)+0.0407U(k-2) - 0.147y2(k-1)+0.1234y(k-l)y(k-2) + 0 0228y(k-3)u(k-I) f 0 . 0 3 3 9 (k-I) ~~ Several inputs were applied to validate the identified model. Figure 4 depicts one of the simulation results. The figure shows the output response y ( t ) of the continuous-time system along with the predicted output of the NARX model with and without noise, j d ( f and ) j(,), respectively. The maximal errors between the output and the predicated ones are 50.08 and f0.14 respectively. Clearly, the nonlinear system has been accurately identified even with the presence of the noise.

2373

6.2 Feedforward Controller

Two nonlinear systems are used to validate the scheme of feedforward and feedback controller as figure 1 depicted: (1) The discrete-time system: Figure 7 shows the block diagram of the discrete-time system used in simulation. Again, a sequence of 1000 random data points are generated for the identification.

50

"0

100

150

200

-1 -1

+w /

250

Time(sec)

Figure 4 Output y(t),and NARX model output j ( t ) ,j d( t ) (3) A Simulated Nonlinear Engine System: A crank-angle synchronized engine model developed by David Maclay is used to valid the performance of GANARXSf. This engine model is written using SIMULINK toolbox developed by The Mathworks, Inc.. Figure 5 shows the block diagram of this nonlinear model. Two random sequences of 1000 data points (with 1 sample data per engine cycle), throttle input (a)and load torque (T,,), were generated for identification. Note that normalization of the inputs and output has been applied to prevent input-output pair from being numerically dominant in the identification process. After 72 generations, the GAMAS derives the following engine model w(k)=0.9 14w(k-1) - 0.950T,, (k-2)+0.1789ma (k-I) - 0.03 19w2(k-1) - 0.0033a(k-1)+0.1868w(k-l)w(k-2) - 00788w(k-2)~(k-4)-0.141 Iw(k I ) h a ( k - l )

-

0.2i' 1-i1+0.21i2

I

+ a /f+

0.12' 1-1.1 i ' + 0 . 3 i 2

1-0.42"

Block diagram of nonlinear discrete-time system After 114 generations, the following NARX model was derived,

y ( k ) = 1.037y(k-l) -0.237y(k-2) + 0.0566y(k-l)u(k-l) + 0.187u(k-I) 0.197y(k-l)y(k-2) + 0. 15y2 (k-2)

-

This NARX model is invertible and its inverse model is derived as follows: u(k-l)=[y(k)- 1.037y(k-1)+ 0.237y(k-2) +0.197y(k-l)y(k-2) -0.1494yz(k-2)]/[0.187 + 0.0566y(k-1)] Figure 8 shows the desired tracking signal yd and the error (fO.l) between the output response y and y d . For clarity purpose, part of the time section are depicted below.

2000

0

4000

6000

8000

10000

Samples

Figure 5

Engine system for simulation

where w a n d ha are the speed and mass air flow rate. Similarly, another set of input data is created to evaluate the identified model. Figure 6 shows the engine speed of the engine system along with the predicted one from the NARX model. The error between them is kept inside k2.5 radsec after 200 engine cycle. The bigger error before 200 engine cycle is due to the transient response which is caused by the unknown initial engine speed. Clearly, the identified NARX model has very good accuracy as well as quick response.

0'

500

1000 Engine CFle

1500

I 2000

Figure 6 engine speed vs. predicted speed

100

S;i;,er 204

250

I 300

Figure 8 Desired tracking signal y d and System output y (2) The continuous-time system: The continuous-time system used to validate the proposed controlling scheme i s shown in equation (Z) and

its inverse model is derived as follows:. u(k-I) = y ( k ) 1.2557y(k-I) - 0.2744u(k-2) + 0.168y2(k-l) - .1484u(k-3) - 0.0955y(k-2)y(k-3) + 0.277ly(k-4) - 0.1 144u(k-3)u(k-4)]/0.1205y(k-2)

6

80 I

50

0

-

Note that a 3/1 SNR disturbance was added to evaluate the accomplishment of disturbance rejecting. Figure 9 shows the plots of the desired output yd, and the true output y as well as error between them. For clarity purpose, part of the time section are shown in the figure. The small error (kO.08) validates the performance of the proposed nonlinear feedforward controller scheme.

2374

3

2

b.

I 0 ‘0

100

300

200

400

500

Time (sec

250

Proceedin s of the SIh International Conference on Genetic Agorithms, July 17-2 I , p, 279-286. 0 Korenber M., Billings, S. A., eiu, Y. P. and Mcllroy, J., 1988 ”Orthogonal Parameter Estimation Algorithm for ’Non-Linear Stochastic Systems,” Int. J. Control, Vol. 48, NO. 1, p.193-210. 11 Krishnasawami, V., Lul!, G.-C., and Rizzoni, G., 1995, “Nonlinear Parit Equation Based Residual Generation for Diagnosis o f Automotive Engine Faults,” Control Eng. Practice, Vol. 3,No. 10, pp. 1385-1392. 2 Kristinsson, K., and Dumont, G. A., 1992, “S stem identification and Control Using Genetic Algoritims, IEEE Transactions on Systems, Man, and Cybernetics, Vol. 22, NO. 5, p . 1033-1046. 31 Leontaritis, I. and Billin s S. A. 1985a, “In ut Output Parametric Models for%on-Linear Svstems Fa; 1: deterministic Non-Linear Systems, Int. 3. Control, Vol. 41, NO. 2, p .303-328. [14] Leontaritis, I. and Billings, S. A., 1985b, “In utOutput Parametric Models for Non-Linear Svstems Fart 11: Stochastic Non-Linear Systems, “ Int. J. Control, Vol.

260

270

280

290

f,

300

Time (sec )

I’

Figure. 9 Desired tracking signal yd(& true output y(t) under 3/1 SNR disturbance. and the error between them

f,

7. Conclusions A nonlinear system identification scheme based on GAMAS is proposed. The effectiveness of the proposed algorithm are validated by the successful identification of nonlinear continuous-time systems and discrete-time systems with acceptable accuracy. In addition, a novel mutation operator, truncate mutation, is developed to improve both the performance and convergence speed of genetic algorithms. Moreover, sufficient conditions of invertibility for NARX model are proposed. Then, feedforward controller is designed based on the inverse NARX model. The simulation results demonstrate perfect tracking of reference trajectories. Acknowledgment The authors are grateful to the National Science Council, Taiwan, R.O.C., for their support of this research under grant NSC85-22 12-E-036-003. References [ I ] Billing, S. .A., Chen, S., and Korenberg, M. J., 1989, Identification of MIMO Non-Linear Systems Using a Forward-Re ression Orthogonal Estimator, - ” int. J. Control, Vof 49, No. 6,pp.2 157-2 189 [2] $hen,. S., Billings, S. A., and Grant, P. M., 1990, Nonlinear ,, System ldentification Using Neural Networks, Int. J. Control, Vol. 5 I , No. 6, pp. 11911214. [3] Fakhouri, S. Y., 1980, “Identification of the Volterra Kernels of Nonlinear Systems,“ IEE Proceedings, Vol. 127, Pt. D, NO. 6, pp.296-304 [4] Flockton, S. J., and White, M. S., 1993, “Pole-Zero System Identification Using Genetic AI orithms,” Proceedin s of the SIh international Con erence on Genetic Akorithms, July 17-21, pp. 531-53 [5] Funahashi, Y., and Yainada, M., 1993, “Zero Phase Error Tyackiy Controllers with Optimal Gain Characteristics, Journal of Dynamic S steins, Measurement, and Control, Vol. 1 15, pp.3 1 1-3 18: [6] Goldberg, D. E., 1989, Genetic Algorithms in Seurch, 0 timization, and Machine Learning, Addison-Wesley. [7] d a c k , B., and Tomizuka, M, 1991, “The Effect of Ading Zeros to Feedforward Controllers,” Journal of D namicsystems, Measurement,,Vp!. 113, p 6-10. [8] drschorn, R. M., 1979, “Invertibility of dltivariable Nonlinear Control Systems,” IEEE Transactions on Automatic Control, Vol. 24, No. 6, pp. 855-865. [9] Iba, H., Kurita, T., Garis, H. D., Sato, T., 1993, “S stem Identification Using Structured Genetic Algoritxms,”

B

[Igfkarendra, K. S. and Parthasarathy, K., 1990, ‘Identification and Control of Dynamic Systems Using Neural Network,“ IEEE Trans. Neural Network, NN- I , [20f)h$:6J. C., Giddens, T. D., and Yadav, S. B., 1994, “The Development and Evaluation of an Improved Genetic Algorithm Based on Migration and Artificial Selection,” IEEE Transactions on Systems, Man, and C bernetics, pp. 73-82. P I 1 sao, T.-C., and Tomizuka,.M., 1987, “Adaptive Zero Phase Error Tracking Algorithm for Digital Control,” Journal of Dynamic Systems, Measurement, Vol. 109, 349-354. [22p? omizuka, M., 1987, “Zero Phase Error Tracking Algorithm for Digital Control,” Journal of Dynamic Systems, Measurement, Vol. 109, pp. 65-68. [23 Tomizuka, M, 1993,”On the Design of Digital hacking Controllers,” Journal of Dyncimic Systems, Measurement, Vol. 115, pp. 412-418. [24] Torfs, D., De Schutter, J., and Swevers, J., 1992, “Extended Bandwidth Zero Phase Error Tracking Control of Nonininimum Phase Systems,” Journal o Dynamic S sfems, Measurement. and Control, Vol. I 347-3& ung, E. D., and Tomizuka, M., 1993, “Feedforward Tracking Controller Design Based on the Identification of Low Frequency Dynamics,” Journal o D namic Systems, Measurement, and Control, Vorf 1 pp.

f

14

[25pt

349-3 56.

r”s,

[26] Yahagi, T., and Lu, J., 1993, “On Self-Tuning Control of Nonminimum Phase Discrete-Time S stems Using Approximate Inverse Systems,” Journa? of D numic pp. Systems, Measurement, and Control, Vol. 1 12-18.

2375

A,