Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Copyright © IFAC System Identification, Kitakyushu,

Fukuoka, Japan, 1997

NNSYSID & NNCTRL - MATLAB® TOOLS FOR SYSTEM IDENTIFICATION


AND CONTROL WITH NEURAL NETWORKS

M. Norgaard", N.K. Poulsen·, o. Ravn··

**Department of Mathematical Modelling, building 321. pmn, nkp@imm.dtu.dk


*Department ofAutomation, building 326. or@iau.dtu.dk
Technical University ofDenmark (DTU), 2800 Lyngby, Denmark

Abstract: Two MA TLAB® packages have been implemented: the Neural Network Based
System Identification toolbox (NNSYSID) and the Neural Network Based Control System
Design Toolkit (NNCTRL). The NNSYSID toolbox has been developed to assist identifi-
cation of nonlinear dynamic systems and it offers the possibility to work with a number of
different nonlinear model structures based on neural networks. The NNCTRL toolkit is an
add-on to the NNSYSID toolbox and contains tools for design and simulation of control
systems based on neural networks. This paper gives an overview of the contents of
NNSYSID and NNCTRL.

Keywords: Software tools, system identification, nonlinear models, adaptive control, non-
linear control systems, neural networks.

1. INTRODUCTION simulation of control systems. Both packages are


based on the so-called muti-layer perceptron (MLP)
Neural networks have increasingly become a neural networks since these are considered
popular tool for identification and control of particularly appropriate for this type of applications.
unknown nonlinear systems. The networks offer a
generic nonlinear model structure that posseses All functions in the NNSYSID toolbox have been
some valuable characteristics which make them written as "m-functions," but some CMEX dupli-
suitable for blackbox modelling. There exist several cates have been coded for speeding up the most time
software packages for solving different types of consuming functions. The NNCTRL toolkit consists
problems with neural networks, but although system of a combination of script-files and m-functions.
identification and control system design represent Both sets of tools require MathWorks' Signal Proc-
two major fields of application no commercial tools essing Toolbox. In addition to this it is in the
are available which deal explicitly with this type of NNCTRL toolkit an advantage if SIMULINK® is
problems. available for building models of dynamic systems.
The NNSYSID toolbox is a necessary requirement
NNSYSID is a MA TLAB® toolbox for system for being able to run the NNCTRL toolkit but not
identification with neural networks. It offers a large vice versa.
number of model structures, it provides highly
effective training algorithms, functions for A number of demonstration programs have been
validating trained network models, and pruning implemented with the GUI facilities of MA TLAB.
algorithms for fmding a proper network architecture. These demonstrate most of the functions and give a
The NNCTRL toolkit is an add-on to NNSYSID and quick introduction to the different tools. Both
contains different tools to support design and NNSYSID and NNCTRL are accompanied by

931
• NNARMAX2 structure . .Y(tIB) = g(<p(t),B) and rmding the minimum of the criterion (i.e., training
the network). The only type of criterion imple-
<p(t) = [y(t -1) . .. y(t - na) mented is a regularized mean square error type crite-
u(t - nb - n k + 1) rion:

e(t-l) .. . &(t-nc)f 1 N 2 I
WN(B,ZN) = -I(y(t)- .Y(tIB)) +_BT DB
2N 1=) 2N
• NNSSIF structure (state space innovations fonn).
Predictor: The matrix D is a diagonal matrix, which is usually
set to D=al. For a discussion of regularization by
x(t + 1) = g(<p(t),B) simple weight decay, see for example (Larsen and
.Y(tIB) = CCB)x(t)
Hansen, 1994) and (Sjoberg and Ljung, 1992). The
toolbox provides the following four possibilities: no
with regularization, one common weight decay coeffi-
cient, one weight decay for the input-to-hidden layer
<p(t) = [iT (t) UT (t) eT (t)f weights and one for the hidden-to-output layer
weight, and individual weight decay for all weights.
To obtain an an observable model structure, a set of
pseudo-observability indices must be specified just For multi-output systems it is possible to train
as in (Ljung, 1991). NNARX and state-space models according to the
criterion:
• NNJOL structure (Input-Output Linearization).

y(t18) = f(y(t -1), ... , y(t - na),u(t - 2), .. . , u(t - nb ),8f )


+ g(y(t -1), ... ,y(t - na), u(t - 2), ... ,u(t - n b ),8g )u(t -1)
+_I_BTDB
f and g are two separate networks. This structure 2N
differs from the previous ones in that it is not moti- The function nnigls implements the iterated gener-
vated by a linear model structure. NNIOL models alized least squares procedure for iterative estima-
are particularly interesting for control by input- tion of network weights and noise covariance ma-
output linearization. trix. The inverse of the estimated covariance matrix
is in this case used as weighting matrix in the crite-
For NNARX and NNIOL models there is an algebraic rion.
relationship between prediction and past data. The
remaining models are more complicated since they The main engine for solving the optimization prob-
all contain a feedback from network output (the pre- lem is a version of the Levenberg-Marquardt method
diction) to network input. In the neural network ter- (Fletcher, 1987). This is a batch method providing a
minology these are called recurrent networks. The very robust and rapid convergence. Moreover, it
feedback may lead to instability in certain regimes does not require a number of exotic design parame-
of the operating range, which can be very problem- ters which makes it very easy to use. In addition it is
atic. This will typically happen if either the model for some of the model structures also possible to
structure or the data material is insufficient. The train the network with a recursive prediction error
NNARMAXI structure has been constructed to over- algorithm (Ljung, 1987). This may have some ad-
come this by using a linear moving average filter on vantages over batch algorithms when the networks
the past prediction errors. are trained on very large data sets. Either due to re-
dundancy in the data set or because lack of computer
When a particular class of model structure has been storage is a problem. The recursive algorithm has
selected, the next choice to be made is the number of been implemented with three different types of for-
past signals used as regressors (i.e., the "model or- getting: Exponential forgetting, constant trace, and
der" or "lag space"). It is desirable that the user has the EFRA algorithm (Salgado et aI., 1988).
sufficient physical insight to choose these properly.
However, the toolbox provides the function /ipschit, The functions for identifying models based on recur-
which somtimes can be useful. It implements a rent networks provide the use of skipping to prevent
method based on so-called "lipschitz coefficients" transient effects from corrupting the training.
proposed in (He and Asada, 1993), but is restricted
to the detenninstic case. The toolbox contains the following functions for
generating models from a specified model structure:
4. ESTIMATE A MODEL

The model estimation stage includes choosing a cri-


terion of fit and an iterative search algorithm for

933
If a neural network model of the system to be con- Nonlinear Dynamic Systems. Proc. of the ACC,
trolled is available, one can linearize the model at S.F., California, pp. 2520-2523.
each sampling instant and use the linear model for Hunt, KJ., D. Sbarbaro, R. Zbikowski and P.J.
control design. This has been utilized for imple- Gawthrop (1992). Neural Networks for Control
mentation of an approximate pole placement con- Systems - A Survey. Automatica, Vol. 28, No. 6,
troller, an approximate minimum variance control- pp. 1083-1112.
ler, and an approximate generalized predictive con- van Luenen, W.T. (1993). Neural Networks for
troller (Smensen, 1994), (Nmgaard, 1996), (Nm- Control: on Knowledge Representation and
gaard et al. 1996b). Learning. Ph.D. Thesis, Control Laboratory of
Electrical Engineering, University of Twente,
Nonlinear Predictive Control: Enschede, the Netherlands.
Based on a neural network model of the system to Ljung, L (1987). System Identification - Theory for
be controlled it is possible to control a system with a the User. Prentice-Hall.
non linear predictive control scheme. To minimize Ljung, L. (1991). System Identification Toolbox
the GPC criterion at each sample, a Levenberg- User's Guide. The MathWorks, Inc.
Marquardt method and a Quasi-Newton method are Larsen, J. and L.K. Hansen (1994). Generalization
provided (Nmgaard, 1996), (Nmgaard and Smen- Performance of Regularized Neural Network
sen, 1995). Models. Proc. of the IEEE Workshop on Neural
networks for Signal, Piscataway, NJ, pp. 42-51.
9. CONCLUSIONS Nmgaard, M. (1995). Neural Network Based System
Identification Toolbox. Tech. report 95-E-773,
MA TLAB tools for system identification and control Department of Automation, DTU.
of unknown nonlinear systems with neural networks Nmgaard, M. (1996a). The NNCTRL Toolkit. Tech.
has been presented. The tools are easy to apply and report 96-E-830, Dep. of Automation, DTU.
have been developed using principles and conven- Nmgaard, M. (1996b). System Identification and
tions familiar to people coming from the conven- Control with Neural Networks. Ph.D. disserta-
tional system identification and (adaptive) control tion, Department of Automation, DTU.
community. The software has successfully been Nmgaard, M. and P.H. Smensen (1995). General-
used in a number of practical applications. ized Predictive Control of a Nonlinear System
using Neural Networks. Preprints, 1995 Interna-
ADDENDUM tional Symposium on ArtifiCial Neural Networks,
Hsinchu, Taiwan, pp. BI-33-40.
The NNSYSID toolbox and the NNCTRL toolkit are N0rgaard, M., P.H. Smensen, N.K. Poulsen, O.
both freeware and can be downloaded from the web- Ravn and L.K. Hansen (1996). Intelligent Pre-
site at The Department of Automation, DTU. The dictive Control of Nonlinear Processes Using
addresses are: Neural Networks. Proc. Of the 1996 IEEE Int.
http://www.iau.dtu.dklProjects/projlnnsysid.htrnl Symp. on Intelligent Control (ISIC) , Dearbom,
http://www.iau.dtu.dklProjects/projlnnctrl.htrnl Michigan, USA, pp. 374-379.
Salgado, M.E., G. Goodwin and R.H. Middleton
REFERENCES (1988). Modified Least Squares Algorithm In-
corporating Exponential Forgetting And Reset-
Billings, S.A., H.B. Jamaluddin and S. Chen (1992). ting. Int. J Control, Vo147, pp. 477-49l.
Properties of Neural Networks With Applica- Sjoberg J. and L. Ljung (1992). Overtraining,
tions to Modelling non-linear Dynamical Sys- Regularization, and Searching for Minimum in
tems. Int. J Control, Vol. 55, No 1, pp. 193-224. Neural Networks. Preprint IFAC Symp. on
Demuth, H. and M. Beale (1993). Neural Network Adaptive Systems in Control and Signal Proc-
Toolbox. The MathWorks, Inc. essing, Grenoble, France. pp. 669-674.
Fletcher, R. (1987). Practical Methods of Optimiza- Sjoberg, J., H. Hjaimerson and L. Ljung (1994).
tion. Wiley, 1987. Neural Networks in System Identification. Pre-
Hansen, L.K. and M. W. Pedersen (1994). Con- prints 10th IFAC symposium on SYSID, Copen-
trolled Growth of Cascade Correlation Nets. hagen, Denmark. Vo1.2, pp. 49-71.
Proc. ICANN '94, Sorrento, Italy., Eds. M . Smensen, O. (1994). Neural Networks in Control
Marinaro & P.G. Morasso, pp. 797-800. Applications. Ph.D. Thesis, Aalborg University,
Hassibi, B. and D.G. Stork (1993). Second Order Department of Control Engineering.
Derivatives for Network Pruning: Optimal Brain Smensen, P.H., M. Nmgaard, J. Larsen and L.K.
Surgeon. NIPS 5, Eds. SJ. Hanson et aI., 164, Hansen (1996). Cross-Validation with LULOO.
San Mateo, Morgan Kaufmann. Proc. of the 1996 Int. Con! on Neural In! Proc-
He, X. and H. Asada (1993). A New Method for essing, Hong Kong, Vol. 2, pp. 1305-1310.
Identifying Orders of Input-Output Models for

936

You might also like