Constrained hopfield neural network for real-time predictive control (IECON'94)
Full text
Constrained Hopfield Neural Network for Real-Time Predictive Control J.M. Quero, C.L. Janer, and L.G. Franquelo,Member, IEEE Dpto de Ingenieria de Sistemas y Automitica, Univ. de Sevilla, Avda Reina Mercedes s/n, 41012 Sevilla - Spain phone: +34-5-4556873 ; fax: +34-5-4556849 ; e-mail: queroQgtex02.us.es Abslrcscd-The hardware implementation of an optimization network with restrictions to perform real-time Generalized Predictive Control (GPC) is described. The use of space-efficient stochastic architecture allows a a realization on a programmable logic device. As a result a programmable neural chip coprocessor that solves optimization problems subject to restrictions has been developped. Expressions for network parameters are provided to implement GPC. An adaptive controller is achieved using RAM memories to store the network parameters. Experimental results from a simple implementation of the controller are included. I. INTRODUCTION Robust, real-time control is essential to most processes in industry. Modern control methods have proved to be very efficient [l]. However they are high-time consuming specially when considering constraint satisfaction, therefore more powerful processors are needed. The GPC algorithm consists of optimizing a cost function in order to achieve the best expected control sequence [2]. New approaches [3] consider constraints in control sequences leading to constrained optimization problems. We suggest the use of Hopfield networks to override the computational effort to implement such controller. Applications of this class of neural networks can be found elsewhere [4]. Artificial neural networks consist of a set of very simple computing elements highly interconnected that perform an overall duty. Due to the simplicity of the computational elements it is worth trying to make specific electronic implementations rather than using a general purpose digital computer to simulate its behaviour. Electronic realization of neural networks can be faced in different ways. On one hand analog aproaches are very simple in terms of circuitry and have fast convergence times, specially when they are compared with digital implementations, hut on the other hand their programming flexibility is very low. Digital implementations perform high programming flexibility and easy interface with general purpose computers but their efficiency in terms of consumed silicon area is very low, as a floating point multiplier is needed in every neuron to calculate the presynaptic activity. One way to circumvent this problem is employing stochasticism to evaluate presynaptic products Our aim is to design a neural coprocessor which releases the control computer in the factory from this algorithmic computational burden. The simplicity of stochastic neural networks architectures [?I minimizes the amount of hardware needed, therefore allowing the use of programmable logic devices for its implementation. This paper is organized as follows. In Section I1 it is discussed how Hopfield’s Neural Network can be utilized to solve constrained linear quadratic optimization problems and how such problems can be posed in terms of adimentional quantities, yielding a formulation that can be implemented in stochastic architecture. In Section I11 it is shown that generalized predictive controllers apply a control sequence to the system that is being regulated in order to minimize a quadratic cost function. Due to the fact that all actuators have a limited range of actuations and slew rates, linear restrictions must be imposed to this optimization problem. In Section IV the stochastic architecture that has been used to implement the Hopfield neural network and why this architecture is suitable for GPC is described. Section V is devoted to the actual hardware that has been used to realize the neural network and why a programmable logic device has been used. In Section VI we consider specific examples to demonstrate the neural net coprocessor performance. Finally, conclusions are drawn in section VII. [51, PI. 11. CONSTRAINED HOPFIELD NEURAL NETWORK. The way in which neural networks could be applied to solve linear programming networks was first described by Tank and Hopfield [4]. They suggested an optimization 0-7803-1328-3/94$03.000 1994 IEEE 1727
network, that is able to minimize a cost function The General Predictive Control algorithm consists of ap plying a control sequence that minimizes a multistage cost --I T=A*V (1) function of the form Na where A' is an N-dimensional vector of coef@ients for the J(N1, Nz) = E{ tY(t + j I t) - w(t + j)12 N variables which are the components of V. This ministraints among the variables: j=N1 mization is accomplished subject to a set of M linear conNa-d + A[Au(t +j - (9) j=l (2) where E {.} is the expectationbperator and y(t+j I t) is an optimum j-step ahead prediction of the system output on data up to time t. u(t) and y(t) are the control and Gj = [Zjl, 6j2,. . ., 3jnlT (3) where the 6,, for each j, contain the N variable coefficients in a constraint equation and the Bj are the bounds. For the case of a linear quadratic optimization problem, it can be considered an energy function of the form M-1 where F(z) is a primitive of f(z) given by kz for z > 0 0 for z <= 0 (5) Consider equation 4. We shall denote the typical values of Gj;, Ij and vj by Go, IO and VO. These numbers are such that the adimentional quantities xji, pj and qj defined in 6 take absolute values ranging from 0 to 1. output sequence of the plant. NI and Nz are the minimum and maximum costing horizons. A is weighting coefficient and w(t+j) is afuture set-point or reference sequence. The objective of predictive control is to compute the future control sequence u(t), u(t+l), ... in such a way that the future plant output y(t+j) is driven close to w(t+j). This is accomplished by minimizing J(N1, Nz). However, it can be computationally prohibitive for real time applications. In practice, the normal way of using GPC is to compute u(t) and apply it to the process. If ~(t) violates the constraint it is saturated to the bounds, either by the control program or by the actuator. The case of u(t + l), --e, u(t + N) violating the constraints is not even considered as in most cases the signals are not even computed. This way of operating restricts the optimallityof the GPC when constraints are violated. Furthermore, the main purpose of the GPC, which is to optimize equation (9), is no longer valid and the best expected control is not achieved. Most processes in industry can be described by the following transfer function: Substituiting in 4 Xij = Xji (8) If VO is chosen so that = 1 we obtain the same linear-quadratic optimization problem in terms of adimentional quantities. This formulation is suitable to be implemented in a stochastic architecture as it will be seen later. 111 APPLICATION TO CONSTRAINED GENERAL PREDICTIVE CONTROL. If an optimal predictor is used, as shown in [8], the dead time can be ignored for designing purposes. If we compare the energy function (4) of a Hopfield net to the cost function (9) of the GPC, considering that the output of the neural net V;. corresponds to the control se quence uj, we obtain the expressions for the parameters of the network as funtions of the system parameters, control parameters and the system input and output sequences for a given control horizon [9]. As an example, results of this procedure are shown in Appendix I for systems described in (10). It is remarkable that equations which define the conductances Zj only depend on the systems parameters, whilst equations defining the net inputs also depend on the system input and output sequences and the reference. The values of Ci and R, are chosen arbitrarily. We+can_define the constraint subnet identifying the terms of 0, 2 Bj for each restriction. 1728
...................................... !PI--; PREDICTOR J P(Z‘ ) P-l 71’ I Figure 1: Control Scheme The resulting control scheme is shown in Fig. 1. The neural controller provides the input signal sequence to the plant. The identifier estimates the plant model parameters from its input and output signals.These values are fed into block T that represents the calculus of the polynomials to obtain the conductances of the neural controller. In block I intensity dependent sources are calculated according to the current reference. As it will be explained later, block I computations are also performed by the neural network while identification and Tij evaluations are carried out by the control computer. IV ARCHITECTURE. A constrained Hopfield neural network will be considered in this article as a set of saturating linear integrators whose inputs are linear combinations of other integrators’ values and time varying terms. The dynamics of these terms are supposed to be much slower than net dynamics so that they may be regarded as constants during integration. Analog versions of this controller can be found elsewhere [lo], but they lack of programmability. Stochastic systems use stochastic signals whose values randomly take the value 0 or 1. The average of these I . Ftmm A Ii l==l mm :...................................a Figure 2: Stochastic Neural Net Processor values can be viewed as an analog value in the range [- l,l]. Stochastic signals can be multiplied using only a simple AND gate. Therefore, product terms in the newral networks can be caculated by a stochastic multiplier. The optimization problem should be posed in terms of adimentional quatities as constants and variables are to be translated into stochastic streams of pulses. This has been done in section 11. The high-level architecture is shown in Fig. 2. It consists of a stochastic neural processor, which is basically composed of a stochastic product evaluator and a state machine controller, and two random access read and write memories. Notice that neuron activity values evolve due to either other neurons’ activity values or net inputs. At any rate these terms may be considered as products that can be computed by the stochastic product evaluator. Constrained Hopfield neural network’s interconnection weights and net inputs’ constant terms are stored in one of the memories and neuron activities and variable terms of the net inputs are stored in the remaining one. All these magnitudes may either take positive or negative values. Two kinds of neurons are involved in the network’s evolution: system neurons and restriction neurons. System neurons are saturating linear integrators that can either take positive or negative values. Restriction neurons are saturating nonlinear integrators. They take negative values when the problem restrictions are violated and force the system neurons to evolve in such a way that constrictions are fulfilled. Neurons’ information (activity value, sign and type of neuron) are serially adressed by the controller and loaded in the up/down counter N and latches S and T. The 1729
0 aooo 1000 0 -1000 -2000 ----.-.-.-. .-.- .-.- -.-. -.-.- --. I I I I I I Trf o zoo00 ~oooo 60000 eoow io0000 iaoooo uoooo 160000 iaoooo ZOQOOO -3000 I of It.r.tioP. Figure 4: Controller’s chip transient response. Figure 3: Test board photograph. stochastic product evaluator calculates the inhibitory or excitatory influence that neurons (uj, j = l..n) (and input time varying terms) have over the one which has been loaded (ui). To achieve this goal these values and their related constants are serially adressed by the controller and read. Random numbers are then generated and compared with them, producing two stochastically independent streams of pulses that are ANDed and fed to logic block B. This logic block either increments or decrements the up/dowm counter according to the signs of the three numbers involved and the kind of neuron that is being integrated. It also changes the sign bit (S latch) whenever a zero crossing takes place. When the process has finished the new computed value of of vi is written in the external memory and another neuron is loaded. v PHYSICAL REALIZATION. A neural optimization problem accelerator has been developped (Fig. 3) and tested following the described structure. The stochastic neural processor has been implemented in an Erasable Programable Logic Device. EPLDs can be designed and programed in-house, eliminating the long engineering lead times and high tooling efforts and costs of full custom or semicustom devices. They are also very appropriate for short series fabrication where an Application-Specific Integrated Circuit would be uneconomical. An Altera EPM5130 device has been chosen to develop this application [lo]. The number of system restriction neurons and network input signals are fully programmable. Two external RAMS have been used for data storage, one for neurons’ values and other for synaptic weight values. Net inputs’ time-varying terms are sampled by the host computer and written within the neuron RAM. Their associated constants are plant model parameters which were stored by the host computer in the weight RAM when the net was configured. Net configuration is accomplished by simply loading the net’s interconnection weights and net inputs’ constant terms in one of the external memories and by loading the initial neurons’ activity values and net inputs’ time varying initial values in the other one. The system’s clock may be either external, in case monitoring the net’s evolution is desired, or internal, for normal operation. Most industrial processes have slow dynamics. For this reason high speed memorim have not been used, yielding a system’s clock speed of 5MHz. VI APPLICATION. As an example the system to be controlled has a pure delay of one sampling period and is described by the following polynomials: A(.-’) = 1 - 0.4~-I - 0.32.~-~ B(z-1) = 0.1 For the first set of tests the future reference was considered to be a previously known square wave. The weighing factor A was made equal to 0.0001. The maximun control signals were constrained by f10, the slew rates were considered to be limited by f5 and a control horizon of 5 has been used. The transient response of the neural network is shown in Fig. 4 when calculating the first control signal se quence. When the stable state is reached, V(5) represents the control signal to be applied to the system. R(l) and R(2) are the outputs for the restricctions V(5) < 10 and 1730 --
-10 1 1 0 5 15 20 a5 30 35 10 I of step* Figure 5: System's closed loop behaviour. V(5) - V(4) < 5 respectively. This stable state matches theoretical result and its computation time has been 0.3 seconds. In order to check the performance of the neural controller, the response of the closed loop system has been studied when changing the reference. In Fig. 5 'ref' represents the applied refernce signal''V(5)' the steady state of the first system neuron in the controller and 'Y' the output of the plant as functions of the number of the controller's actuations. VI1 CONCLUSIONS. Digital stochastic architectures are a very efficient way to realize neural networks as they significantly reduce the needs of silicon area. We have implemented a general purpose version of a constrained Hopfield network on a programmable logic device. This coprocessor solves any constrained quadratic optimization problem. It has been used to implement the General Predictive Control problem in order to release the control computer from the heavy computational burden of this algorithm. Expressions of net parameters are provided for a common plant model which permit an adaptive control. The chip has been incorporated into a personal computer. Results obtained with this experimental chip have been reported. APPENDIX I NETWORK PARAMETERS For this system, the net parameters are given by the following equations: i=l + 2Aut-1 if j odd if j even 2n--i .. 1=J n-j+l where odd(i) = remainder(i/2) and even(i) = 1 - odd(i). REFERENCES [l] M. Gopal. Model Control System Theory. Wiley Eastern Limited 1985. [2] D. W. Clarke C. Mohtadi and P.S. Tuffs. Generalized Predictive Control. Part I The Basic Algorithm. Automatica ~01.23, pp. 137-148. 1988 [3] E. F. Camacho. Constrained Generalized Predictive Control IEEE Trans. on Automatic Control, vol 38, pp. 327-332, 1993. [4] D. W. Tank and J. J. Hopfield. Simple Neural Optimization Networks: An A/D Converter, Signal Decision Circuit, and a Linear Programming Circuit. IEEE Trans. on Circuit and Systems, ~01.35, pp. 554562, 1988 1731
[SI D.E. Van den Bout and T.K. Miller I11 A Digital Architecture Employing Stochaticism for the Simulation of Hopfield Neural Nets. IEEE Dans. on Circuit and Systems, vo1.36, pp. 732-738, 1989 [6] M. S. Melton, T. Phan, D. S. Reeves and D. E. Van den Bout The TInMANN VLSI Chip IEEE %ns. on Neural Networks, ~01.3, pp.375384, 1992. [7] Y. Kondo and Y. Sawada F’unctional Abilities of a Stochastic Logic Neural Networks IEEE Dans. on Neural Networks, vo1.3, pp.434443,1992. [8] E. F. Camacho and J.M. Quero. Precomputation of Generalized Predictive Controllers. IEEE Tkans. on Automatic Control, vol. AG36, pp. 852-859, 1991. [9] J. M. Quero and E. F. Camacho. Neural Generalized Predictive Self-tunning Controllers. Proc. IEEE Congress on Systems Control, pp 160-163, 1990 [lo] J.M. Quero, L.G. Franquelo and E.F. Camacho. “Networks for constrained Predictive Control” . IEEE Dans. on Circuits and Systems, vol. 40, 621626, 1993. [ll] Altera Corp. Altera Data Book, 1990. 1732