Nonlinear On-line Identification of Dynamic Systems ... - RoboticsLab

5 downloads 0 Views 78KB Size Report
ABSTRACT: This paper presents an improved on-line identification method of non-linear time-varying dynamic systems with linear and non-linear models .
Nonlinear On-line Identification of Dynamic Systems with Restricted Genetic Optimization S. Garrido, L.Moreno and M.A. Salichs Universidad Carlos III de Madrid Legan´es 28911, Madrid (Spain) ABSTRACT: This paper presents an improved on-line identification method of non-linear time-varying dynamic systems with linear and non-linear models . This method is based on Genetic algorithms with a new technique to simulate the behaviour of the gradient method without using the concept of derivatives. This method uses an on-line identification algorithm that begins by calculating what ARX model adapts better to the system. Then the algorithm uses the orders and delay of this first model to calculate an OE, ARMAX or NARMAX model. This new model serves as a seed to initialize a Restricted Genetic Optimization, which improves the previous identification and tracks the system in its variations with the time. The main characteristics are: it is fast, robust, it works on-line and identifies nonlinear time-varying systems.

1

INTRODUCTION.

Most of the usual methods in system identification are based on least mean-squares or maximum likelihood estimates which are gradient-guided local methods and they need a differentiable loss function and a smooth space of search. They often fail in the search of a global optimum when this search space is not differentiable or non-linear in its parameters. Optimization methods based on genetic algorithms can improve the results because they do not use the linear-on-theparameters or differential properties. In 1992, Kristinsson and Dumont made a first study of the off-line system identification and control with GA’s of both continuous and discrete time systems. They showed that genetic algorithms are effective in both fields and are able to directly identify physical parameters or poles and zeros. They made simulations with minimum and non minimum phase systems and a system with unmodeled dynamics. Then, in 1993, Flockton used genetic algorithms to do another pole-zero off-line system identification with some minor improvements. Later, in 1995, K. C. Tan used a genetic algorithm with simulated anneling to make an off-line identification and linearization of non-linear time-invariant systems with an ARMAX model. He used this search technique to identify the parameters of a system described by an ARMAX model in the presence of white noise and to approximate a nonlinear multivariable system by a linear time-invariant state space model. In this same year, Hitoshi Iba introduced an off-line numerical technique, which integrated a genetic-programmingbased adaptive search of tree structures, and a local parameter tuning mechanism employing statistical search. In traditional GP, recombination can cause frequent disruption of building blocks or mutation can cause abrupt changes in semantics. To overcome these difficulties, they supplement traditional GP with a local hill-climbing search, using a parameter tuning procedure. All these methods work off-line and the system has to be time-invariant. The latter one does not use a parametric model. This paper describes a high performance improved on-line identification method of non-linear time-variable dynamic systems with linear and non-linear models. We have used OE, ARMAX and polynomial NARMAX models, but it is possible to use this method with similar models, such as Box-Jenkins, the General Linear, Pole-Zero Models or Statespace description. The main differences with the previous Genetic Algorithms methods are that it works on-line, identifies time-varying dynamic systems and uses conventional parametric models. This method is based on Genetic Algorithms, with a new mechanism to improve its performance and permit to use the algorithm on-line. This mechanism simulate the behaviour of the gradient method without using the concept of derivatives. In a first step, the method uses a least-squares method to calculate what ARX model adapts better to the system. This is used to obtain the orders and the time delay of the system.

Then the algorithm calculates an OE, ARMAX or NARMAX model by an extended least-squares method. This new model serves as a seed to initialize a Restricted Genetic Optimization, which improves the previous identification and tracks the system in its variations with the time. At each generation, we substitute the latest model by the better of the new generation as the center of the neighborhood where the search is carried out. In this way our model tracks the exact model. In this neighborhood the individuals of the new generations will be oriented mostly in the direction of bigger decrease of the lost function and at the distance which corresponds to the velocity of the real system changing with time. The results obtained with this method are very satisfactory and the time of computation is short (it is of the order of .1 second in a 120 Mhz Pentium PC).

2

INTRODUCTION TO THE RESTRICTED GENETIC OPTIMIZATION.

In the literature, the use of genetic algorithms as optimization method is off-line and the time used is quite big. We have used new mechanisms that permit us to use them as Nature does: on-line. We have demonstrate that genetic algorithms can be a fast optimization method of time-varying functions. Usually GA’s are used as a parallel, global search technique. It evaluates simultaneously many points, improving the probability of finding the global optimum. In time-varying optimization, this characteristic is interesting in the first generations, to find the correct basin of attraction, but it’s uninteresting later and it consumes a lot of computation time. For this reason it’s better a fast local optimization method, such as RGO. The mechanism of restricted search gives a name to our method. It consists of carrying out the search in a neighborhood of a point, and taking the best adapted point as the center of the search of the new generation. We get new generations oriented in the direction of the steepest slope of the cost function, and with a distance to the center as close as possible to the correct one. This distance corresponds to the velocity of the system changing. This behaviour simulates the gradient method without using derivatives and can be used when signals are very noisy. If signals are not very noisy, a gradient-based method can be used. We can carry out a search in a big neighborhood at the beginning and then reduce its radius. In fact, the method does a global search at first and a local search at the end. This method reduces the probability of finding a local minimum. In our algorithm, the following operators are implement : reproduction, cross, mutation, elitism, immigration, ranking and restricted search. A ranking mechanism was used to regulate the number of offspring that an individual can have, because if an individual is very good, it can have too many descendants and the genetic diversity of the population can decrease a lot. This bu f f 1 mechanism is implemented by using the fitness function Fn (i) = cte+V , where Vn (i) = 6k=1 (yn−k − yˆn−k )2 is the n (i) loss function and cte is a big constant (108 ).

2.1

RGO IDENTIFICATION.

The excitation input u(t) was chosen as a pseudo random binary sequence (PRBS), with coloured noise. At first, to do the parametric identification, multiple ARX models,A(q −1 )yk = z −d B(q −1 )u k + e(t), during few generations were identified, to find the degrees of polynomials and the time delay. As the model must fit the system, but without unnecessary big degrees, we use as criteria, the Minimum Description Length (MDL) Criterion was used. B(q −1 ) −1 )y = q −d B(q −1 )u + Secondly, an OE model, y(t) = F(q k k −1 ) u(t − nk) + e(t) and an ARMAX model, A(q

C(q −1 )e(t)ωk , was calculated using pseudo-linear regression. This model does not fit the real system enough, because it is non-linear, the output signal has coloured noise and the previous methods are good only with linear white-noise systems. To improve this estimation, a search of OE and ARMAX models is realized. These models must have coefficients close to the ones previously calculated and a loss function as small as possible. To make the loss function V (t) = P y=N 1 8 2 k=0 (y(t − k) − yˆ (t − k)) as small as possible, the fitness is assigned as Fn (t) = cte+V (t) , where cte (10 ) is a constant big enough to maintain a diversity in the population. This is important in the first few generations when a very good individual can have too many descendents. The probability for reproduction is calculated as Fn (t) = F(t)/F. At each generation, the last model was substituted by the best one of the new generation as the center of the neighborhood where the search is realized. In this way our model tracks the exact model. In this neighborhood the individuals of the new generations will be oriented mostly in the direction of steepest slope of the loss function (using AIC, FPE or MDL criterion) and at the distance which corresponds to the velocity of the real-system changing with time. At each iteration, the program showed the information about the best OE model and the best ARMAX model. Other models such as BJ, PEM, etc. can be used too. The good characteristics of the global convergence can be of great use if, at first, a large neighborhood is chosen to find the global minimum and not only a local one. When the right attraction bowl

Fill the buffer with u(k) and y(k) data Find the order

Make initial population

and time delay Evaluate the fitness of each individual

00 11

Find which orders and time delay fits better to the system

Collect u(k) and y(k) Calculate an OE, ARMAX and NARMAX models using

Find a first model

001111001010

extended least squares

Collect u(k) and y(k)

11 00 0001001101 11

Make initial population, taking the individuals as difference to the previous model Evaluate the fitness of initial chromosomes with validation

Clone the best of the previous generation Apply inmigration mechanism

001111001100110000111010 11001100

Apply the reproduction, crossover and mutation mechanisms Improve the model and track the system

Select the fittest chromosome Sum the fittest individual to the previous model

10 0011110011 00 001010 1010 01 11

Evaluate the fitness of the individuals of the new generation

Write the results Collect u(k) and y(k)

Figure 1: Flowchart and tracking mechanism of the RGO.

is reached, the size of the neighborhood can be reduced in order to decrease the size of the generations and to improve the algorithm speed. To prevent the premature convergence, the mutation probability parameter ,the immigration and the ranking mechanisms were used.

3 3.1

NON-LINEAR SYSTEM IDENTIFICATION PARAMETRIC IDENTIFICATION.

Usually, a model of the system based on the physical knowledge of the system is used and then the unknown parameters are calculated by hand. This method presents two problems: a previous knowledge of the system is needed, and if the signals have coloured noise, the methods based on least-squares do not work properly. If the method is implemented on line, the coloured noise could be correlated with the regressors and the method could explode. This phenomenon is known as blow-up. This is a very usual problem of the on-line methods. In some easy systems, this problem can be solved by using a great forgetting factor, near to unity, but in many nonlinear time-varying system this technique does not work.

3.1.1 NARMAX MODELS. Between the non-linear discrete-time systems, the NARMAX (Non-linear Auto-Regressive Moving Average with eXogenous inputs), model can be described as y(t) = F[y(t − 1), ..., y(t − n y ), u(t − d), ..., u(t − d − n u + 1), (t − 1), ..., (t − n  )] + (t)

(1)

where t denotes discrete time, y(t), u(t) and (t) are the output, input and prediction error, respectively, n y , n u and n  are the corresponding orders, F[.] is some non-linear function and d is the minimum delay of input [Leontaritis 85]. The polynomial NARMAX model can be expressed as y(k) = a0 +

ny X

ai y(k − i) +

i=1

nu X

bi u(k − i) +

i=1

n y nu X X

ci j y(k − i)u(k − j)

(2)

i=1 j=1

and it provides a simple and good description of a wide class of non-linear systems.

3.2

RGO IDENTIFICATION.

Firstly, during few generations, an identification of multiple ARX models is realized to find the degrees of polynomials and the time delay. Secondly, an ARMAX model is calculated, using extended linear regression. This model does not fit to the real system enough, because it is is non-linear, the output signal has coloured-noise and the previous methods are good only with linear white-noise systems. To improve this estimation, a search of NARMAX models is realized. These models must have coefficients close to the ones previously calculated and a loss function as small as possible. At each generation, the last model is substituted by the best of the new generation as center of the neighborhood where the search is realized. In this way our model tracks the exact model. In this neighborhood the individuals of the new generations will be oriented mostly in the direction of the steepest slope of the loss function (using AIC, FPE or MDL criterion) and at the distance which correspond to the velocity of the real system changing with time. This algorithm is expensive in operations, but it is quite fast. It was implemented in C language as a CMEX block of Simulink. The time to calculate the three models (with 40 coefficients for the NARMAX model) is of .1 second in a 75 Mhz Pentium PC. It is possible to apply this identification method to adaptive control systems with a time constant smaller than .1 second because it has two loops: the faster one that is the control loop and the slower one that is the identification loop. The number of coefficients of a polynomial NARMAX model y(k) = a0 +

ny X i=1

ai y(k − i) +

nu X

bi u(k − i) +

i=1

n y nu X X

ci j y(k − i)u(k − j)

(3)

i=1 j=1

grows exponentially with the order of development. For this reason expansions of order two were used, with systems of order lower than eight and with five coefficients to model the noise.

4

CASE STUDY.

In order to contrast the results, the relative RMS error is used as a performance index. q P N (yi − yˆi )2 • Error RMS: R M S err or = N1 i=1 rP

• Relative error RMS: Relative R M S err or =

n 2 i=1 (yi − yˆi ) N

rP

n 2 i=1 (yi ) N

× 100%

The ARMAX block of Simulink and the OE, ARMAX and NARMAX methods were applied to the next non-linear plants: • Plant 1: y(k) − .6y(k − 1) + .4y(k − 2) = (u(k) − .3u(k − 1) + .05u(k − 2))sin(.01k) + e(k) − .6e(k − 1) + .4e(k − 2)

(4)

with zero initial conditions. This plant is the serial connection of a linear block: y(k) =

1−.3q −1 +.5q−2 u(k) + 1−.6q−1+.4q−2 e(k) 1−.5q−1 1−.5q−1

(5)

and a sinusoidal oscillation in the gain. • Plant 2: This plant consists of a linear block: y(k) − .6y(k − 1) + .4y(k − 2) = u(k) − .3u(k − 1) + .05u(k − 2) + e(k) − .6e(k − 1) + .4e(k − 2)

(6)

in serial connection of a backslash of 0.1 by 0.1 (a ten per cent of input signal), with zero initial conditions. • Plant 3: y(k) = A1 + .02 sin(.1k)y(k − 1) + A2 y(k − 2) + A3 y(k − 3) + B1 u(k − 1) + B2 u(k − 2) + B3 u(k − 3) (7) with A1 = 2.627771, A2 = −2.333261, A3 = 0.697676, B1 = 0.017203, B2 = −0.030862 and B3 = 0.014086. • Plant 4: y(k) = (0.8 − 0.5e−y

( k−1)

y(k − 1) − (0.3 + 0.9e y

2 (k−1)

)y(k − 2) + 0.1 sin(3.1415926y(k − 1)) + u(k)

(8)

with zero initial conditions.

Figure 2: Results of identification of Plants 1 and 4 with RGO method. Top: Model output vs. system output. Bottom: Error. The assembly for all the plants is the same. The input signal is a ”prbns” signal of amplitude 1. A coloured noise was added to the output of the main block. This noise was produced by filtering a pseudo-white noise of 0.1 of peak with the 2 filter zz 2+.7z+.2 The ”prbns” input and the output of the global system are carried to the identification block, that gives the −.6+.4 coefficients of the OE, ARMAX and NARMAX models, the RMS error and other information.

ARMAX OE RGO ARMAX RGO NARMAX RGO

4.1

1st Plant 0.05000 0.05000 0.01800 0.01700

2nd Plant 1.33000 0.03000 0.01000 0.00300

3rd Plant 209.20000 0.00900 0.00080 0.00030

4th Plant 10.78000 0.05000 0.05000 0.04000

RESULTS.

The obtained results of relative RMS errors can be summarized in the next table :

5

CONCLUSIONS.

This article has developed a new on-line algorithm to identify non-linear systems, based on genetic algorithms. OE, ARMAX and polynomial NARMAX models were used, but the method can be used with the other parametric models. In these simulations, this method improves the results of the least-squares based methods a lot. It is important to remark that the RGO carries out a search with more emphasis in a preferent direction, the direction of maximum decrease, and at a preferent distance. This fact permits to reduce the search from 50 or 100 dimensions to 1 or 2. For this reason this method is comparable to the gradient method in precision and speed, with the advantage that it does not use the derivative concept and it is applicable to noisy signals and system with no derivable equations. It is better than the Montecarlo method, as well, because the latter does not reduce the number of dimensions of the search space. The results obtained proved that genetic algorithms can be used to improve the results obtained with other optimization methods that approach a function or a system. For example, least-squares methods need a linear system in the parameters and with a non-coloured output signal. When these conditions are not true, the estimate is not good but can be used as a seed to initialize the RGO method for a faster convergence.

References [1] Armingol, J.M.,Moreno,L.E., Garrido,S., de la Escalera, A.Salichs,M.A.: Mobile Robot Localization Using a NonLinear Evolutionary Filter.(1998).3rd IFAC Symp. on Intelligent Autonomous Vehicles(IAV’98). [2] Chen, S. and S. A. Billings. (1989). Representations of non-linear systems: the NARMAX model. Int. J. Control, 49, 1013-1032. [3] Flockton, S.J. and M.J. White. (1993). Pole-zero system identification using genetic algorithms. Proceedings 5th International Conference on Genetic Algorithms. 17-21 July, University of Illinois at Urbana Champaign, USA. pp. 531-535. [4] Garrido,S.,Moreno,L.E.,Balaguer,C.(1998). State Estimation for Nonlinear Systems using Restricted Genetic Optimization. 11th Int. Conference on Industrial and Engineering Applications of Artificial Intelligence and Expert Systems.(IEA-AIE’98) [5] Iba, H., H. deGaris and T. Sato. (1995). A numerical approach to Genetic Programming for System Identification. Evolutionary Computation, 3, 4, 417-452. [6] Kristinson, K. and Dumont G. (1992). System identification and control using genetic algorithms. IEEE Transactions on Systems, Man, and Cybernetics, 22(5), 1033-1046. [7] Luo,W. and S.A. Billings. (1995). Adaptive model selection and estimation for nonlinear systems using a sliding data window. Signal Processing, 46, 179-202. [8] Tan, K.C., Y. Li, D. J. Murray-Smith and K.C. Sharman (1995). System identification and linearization using genetic algorithms with simulated annealing. Proc. 1st IEE/IEEE International Conference on Genetic Algorithms in Engineering Systems: Innovations and Applications. Sheffield, UK.