=Paper=
{{Paper
|id=Vol-1353/paper_15
|storemode=property
|title=Using Neural Networks for Identification and Control of Systems
|pdfUrl=https://ceur-ws.org/Vol-1353/paper_15.pdf
|volume=Vol-1353
|dblpUrl=https://dblp.org/rec/conf/maics/Cordeiro15
}}
==Using Neural Networks for Identification and Control of Systems==
Using Neural Networks for Identification and Control of Systems Jhonatam Cordeiro Department of Industrial and Systems Engineering North Carolina A&T State University, Greensboro, NC 27411 jcrodrig@aggies.ncat.edu Abstract where it is used are highly linear (Visioli, 2006). However, The present work addresses the utilization of Artificial Neu- the increasing complexity of some systems challenges the ral Networks (NN) for the identification and control of sys- classic feedback control theory. Challenges such as non- tems, in special to control nonlinear dynamic systems or linearities, rapid change conditions, black-box systems or systems with some degree of uncertainty. Because NNs high level of uncertainty can make classic controllers, such have an inherent ability to approximate functions and to adapt to changes in input and parameters, they can be used as the PID, have poor performance. to control systems too complex for linear controllers, such The operation of a complex system requires the control- as PID controllers. In the present work a mathematical basis ler to be smart in a way, to adapt and learn from changes in for NN is presented, the mathematical representation of a the system dynamics, noise or external output. A solution process unit, or neuron, and how they can be put together in for the control of complex system is to use control struc- order to form nets that can learn from external data. In se- quence, it is presented structures of inputs that can be used tures inspired in biological systems. Biological systems are along with NN to model nonlinear systems. The most com- adaptive and resilient to the environmental changes where mon configurations of input vectors for the training of NN they are inserted. Bacteria constantly change their DNA are highlighted. Following, a method of control is presented sequencing so that they remain unknown to the defense that take advantage of NN, where a NN is used to build a systems of other creatures. Most animals have a neural predictive nonlinear controller using a model predictive control (MPC) structure. Two nonlinear systems were used system that allows than to sense the environment and to to test the identification and control of the structures pro- rationalize a best course of action, such as when to run posed. The results shows the NN used were efficient in from or fight a predator, or in the case of humans, how to modeling and controlling the nonlinear plants. solve a mathematical equation. Fuzzy logic, Evolutive Al- gorithms and Artificial Neural Networks (NN) are among the theories developed with an inspiration in biological Introduction systems. Neural networks tries to mimic the biological The modern feedback controlling systems are responsible neural system, it presents an inherent capacity for learning, for the success of several operational systems and are ap- adapt and parallel computing (S. Haykin & Network, plied in the military, aerospace, manufacturing industry 2004). With that NNs have being gaining exposure for its and other fields (Franklin, Powell, & Emami-Naeini, successful utilization for modeling complex non-linear 2006). The function of the feedback controller is to induce systems. an input in a system so that it would respond with a desired Most NN applications are designed in an open loop, output. There are many methods to design a controller; the such as designs for pattern recognitions (Ebrahimzadeh & most popular and widely used in the industry are based on Ranaee, 2010), classification (Krizhevsky, Sutskever, & state space or frequency analysis. Such design techniques Hinton, 2012) and function approximation (Zainuddin & have yielded successful applications such as the control of Pauline, 2011). However, the use of NN in a feedback con- pitch, yaw and roll in aircrafts, satellite positioning and air trol loop has proven to be efficient when controlling non- conditioning control (Franklin et al., 2006). Proportional, linear systems. Chen, M. (Chen, Ge, & Voon Ee How, Integral and Derivative (PID) controller are still the most 2010) proposed a NN structure to control nonlinear sys- popular type of control used in the manufacturing industry, tems with multiple inputs and multiple outputs [MIMO]. mostly given its simplicity and fact that most applications Dierks, T and Sarangapani, J.(Dierks & Jagannathan, 2010) used NN in a feedback loop to control a Quadrotor Copyright held by the author. UAV and Addeh, J. et al.(Addeh, Ebrahimzadeh, Azarbad, & Ranaee, 2014) used NN for statistical process control. The present work investigates the application of NN for identification and control of systems. For the identification process, the NN is placed in parallel with the model and random step signals are generated for input. The plantโs response to the signals can be used for training the NNs. The trained NN are then used in a predictive control struc- ture. Matlab was used to implement the NNs, plants and input signals. The goal of this work is to investigate if a system can automatically experiment with a plant, learn from the experiment and control the plant, automatically and without needing a mathematical model of the plant or a fine tune the of the controller(Nรธrgรฅrd, Ravn, Poulsen, & Hansen, 2000). Figure 2. Schematics of a feedforward neural network ond layer, ๐ค๐๐ฟ is the weight from the output of ๐ฟ-th neu- Methodology ron on the first layer to the ๐-th neuron on the second lay- The processing unit of a NN is a neuron. The mathematical er. ๐ฃ0๐ฟ is the bias of the ๐ฟ-th neuron and ๐ค0๐ if the bias of model of an artificial neuron tries to mimic the behavior of the ๐-th neuron. a biological neuron. An artificial NN is based on the ap- Multilayer structures of NN, as the one shown in figure proximation models of how a biological neuron processes 2, are universal approximators, meaning that they can ap- the electric impulses it receives from other neurons or ex- proximate or model any input pattern (Hornik, ternal stimuli. The model used in the present work is the Stinchcombe, & White, 1989). This universal approxima- perceptron of Rosenblatt (Rosenblatt, 1958). Figure 1 tion feature makes NN feasible for modeling non-linear shows the schematic for this model of neuron and eq. 1 dynamics systems. By changing the NN input arrange- shows the model of a single neuron. ments, it is possible to include temporal information about the system to be modeled. Among other input arrangement, x1 the input structure used to model linear systems can be wi1 wi0 highlighted, such as the linear models of finite input re- wi1 sponse (FIR) and the autoregressive with exogenous input x2 f(.) yi (ARX)(Nรธrgรฅrd et al., 2000). Figures 3 (a) and (b) shows wi1 the use of NN with input arrangement of a FIR and ARX xn model, respectively. y(t ๏ญ 1) u (t ๏ญ d ) Figure 1. Schematic of artificial neuron u(t ๏ญd ๏ญ1) y (t ๏ญ n ) ๐ Rede y (t ) Rede y (t ) u (t ๏ญ d ) ๐ฆ๐ = ๐(โ ๐ค๐๐ ๐ฅ๐ + ๐ค๐0 ) (1) Neural Neural ๐=1 u(t ๏ญd ๏ญm) where ๐ฆ๐ is the output of neuron ๐, ๐ฅ๐ is the ๐-th input, ๐ค๐๐ u(t ๏ญ d ๏ญ m) is the weigh given to input ๐ when it is going to neuron ๐ and ๐ค๐0 is the bias of the neuron. Activation function of the (a) (b) Figure 3. NN input structure: FIR (a) and ARX (b) neuron ๐(. ) can have several forms, such as sigmoid, line- ar, step or a radial basis function (S. S. Haykin, Haykin, Figure 3 shows that the NN inputs include past values of Haykin, & Haykin, 2009). the plantโs input signal as well as the plantโs response sig- Networks of neurons can be built by aligning neurons in nal to the inputs. This input configuration gives the NN single layers and by grouping the layers, forming a multi- enough information to model the dynamics of a system. layer network. Figure 2 shows a NN with two layers of neurons. System Identification Where ๐ฅ๐ are the inputs of the network, ๐ฟ is the number In this work the ARX structure were used for the identifi- of neuron in the first layer, ๐ฃ๐ฟ๐ is the weigh from ๐-th in- cation of systems. The NN are placed in parallel with the put to ๐ฟ-th neuron. ๐ is the number of neuron on the sec- plant and a series step signals, with normally distributed amplitudes, are generated as input to the plant. The input and output response of the plant are then arranged as an input to the NN. With the appropriate inputs, the NN are trained to best mimic the output of the plant. A validation set of input signals and plant output signals are used to test the NN on the ability to represent the plant for signals not previously used in the training. Matlab was used to imple- ment the training inputs. Figure 4 illustrates an input signal Figure 5. Simplified predictive control structure used for identification, where the lower and upper bound of the signal is 0 and 1, and the steps last for 20 samples. ๐ 2 ๐ฝ(๐ก, ๐(๐ก)) = โ๐=๐1 [๐(๐ก + ๐) โ ๐ฆฬ(๐ก + ๐)]2 + ๐๐ข (2) ๐ โ๐=1 [๐ข(๐ก + ๐) โ ๐ข(๐ก + ๐ โ 1)]2 where, ๐1 , ๐2 and ๐๐ข are the minimum, maximum and control prediction horizon, respectively. ๐(๐ก) and ๐ฆฬ(๐ก) is the reference and output prediction, respectively, from time ๐ก. ๐ข(๐ก) is the control signal at time ๐ก and ๐ is a penalty weight given to the variation in control signal. The vector of control signals ๐(๐ก) are optimized at every time step ๐ก, where ๐(๐ก) = [๐ข(๐ก), ๐ข(๐ก + 1), โฆ , ๐ข(๐ก + ๐๐ข โ 1)]. The NN model of the plant is used to predict the plantโs output ๐ฆฬ(๐ก + ๐) at ๐ steps ahead of ๐ก, then the prediction is used to optimize the future control signals. Figure 6 shows the structure of a MPC where a NN is used as the plantโs model, where ๐ฬ (๐ก) = [๐ฆฬ(๐ก + ๐1 ), ๐ฆฬ(๐ก + ๐1 + 1), โฆ , ๐ฆฬ(๐ก + ๐2 )]. Figure 4. Example of a control signal used for NN training. Neural Networks approximate functions by changing the weights for the neuron inputs. Many optimization methods can be used to optimize the matrix of NN weights, but in this work the Levenberg-Marquardt is used given its better performance in comparison with other methods (Morรฉ, 1978). Control Structure Figure 6. Predictive Control with NN model Two strategies can be used for controlling dynamic sys- tems: feedback control and optimization. The feedback control loop strategy includes using the controller and the Plants plant in the same control loop, in a way that the entire sys- Two models of non-linear plants were used to test the con- tem can described as a transfer function. Using optimiza- troller structure proposed. One is the non-linear model of a tion to control systems includes defining the system as an valve (Nรธrgรฅrd et al., 2000). The plantโs mathematical objective problem where the independent variables are the model is shown on eq. 3. In order to illustrate the plantโs inputs to the plant. For this work the optimization strategy non-linearity, figure 7 shows the output of the plant for a is used and the control structure follows that of a model slope input. prediction control (MPC), as initially presented by Clarke ๐ฅ(๐ก) = 1,4138๐ฅ(๐ก โ 1) โ 0,6065๐ฅ(๐ก โ 2) + et. al. (Clarke, Mohtadi, & Tuffs, 1987). Figure 5 show a 0,1044๐ข(๐ก โ 1) + 0,0883๐ข(๐ก โ 2) simplified structure of the predictive control structure. In predictive control, the control problem is transformed ๐ฅ(๐ก) (3) into an optimization problem where the goal is to minimize ๐ฆ(๐ก) = โ0,1 + 0,9๐ฅ(๐ก )2 the error between reference and output as well as the varia- bility of control input at each interaction. The objective A nonlinear model of a tank used for chemical reaction function presented in eq. 2 is minimized was also used to test the NN MPC controller. Figure 8 Results and Discussion Both plants are single input, single output models. In order to control the plants the first step was to model the plant using NN. Valve To identify the dynamics of the nonlinear valve, an input signal was generate consisting of 6000 samples, with am- plitude varying from 0 to 1 at every 20 samples. It was assumed that a NN with two layers would be suf- ficient to model the nonlinear dynamic of the valve. The first layer had 15 neurons and the second layer has one neuron. The second layer serves as a summation of outputs from the first layer and due that it has a linear activation function, while the first layer has a hyperbolic tangent acti- Figure 7. Control and output signal of the valve. vation function. The input structure ๐(๐ก) used for the NN shows the schematics of the tank and eq. 4 illustrates the followed an ARX structure with delayed inputs and de- equation that models the tank layed outputs as illustrated in eq. 5 ๐โ(๐ก) ๐ฆ(๐ก โ 1) = ๐ค1 (๐ก) + ๐ค2 (๐ก) โ 0.2โโ(๐ก) โฎ ๐๐ก ๐ฆ(๐ก โ ๐๐ ) ๐๐ถ๐ (๐ก) ๐ค1 (๐ก) ๐ค2 (๐ก) (4) ๐(๐ก) = ๐ข(๐ก โ ๐) (5) = (๐ถ๐1 โ ๐ถ๐ (๐ก)) + (๐ถ๐2 โ ๐ถ๐ (๐ก)) โ ๐๐ก โ(๐ก) โ(๐ก) ๐ข(๐ก โ ๐ โ 1) ๐1 ๐ถ๐ (๐ก) โฎ 2 (1+๐2 ๐ถ๐ (๐ก)) [๐ข(๐ก โ ๐ โ ๐๐ + 1)] where ๐๐ =3, ๐๐ =8 and ๐ = 2. The training performance of the NN is show in figure 9, where it can be seen that the validation performance based on the Mean Squared Error (MSE) is negligible. Figure 10 illustrates the plant output and the NN output for the same set of inputs. Notice that the NN is capable of closely rep- resent the valves dynamic. Figure 8. Schematic of chemical reaction tank where โ(๐ก) is the level of liquid in the tank, ๐ถ๐ (๐ก) is the concentration of the output product, ๐ค1 (๐ก) is the flow of concentrated ๐ถ๐1 , and ๐ค2 is the flow of solvent ๐ถ๐2 . In this work, the concentration ๐ถ๐1 and ๐ถ๐2 is 24.9 and 0.1, re- spectively, following the work of Nรธrgรฅrd et. al. (Nรธrgรฅrd et al., 2000) for the same plant. The goal is to control the output concentration ๐ถ๐ (๐ก) by varying the flow ๐ค1 (๐ก). The flow ๐ค2 (๐ก) is left at a constant rate of 0.1. Figure 9. Training performance of NN to model nonlinear valve Using the NN model of the plant in the MPC control It was assumed that a NN with two layers would be suf- loop it was possible to control the output of the plant. The ficient to model the nonlinear dynamic of the tank. The optimization method used is a classic levenberg-marquardt. first layer had 12 neurons and the second layer had just one The minimum, maximum and control prediction horizon neuron. The input structure ๐(๐ก) used for the NN followed are: ๐1 = 1, ๐2 = 7 and ๐๐ข = 1. The penalty for signal an ARX structure with delayed inputs, delayed outputs and control variation is ๐ = 10. Figure 11 shows the inputs following the format in eq. 5, with ๐๐ = 4, ๐๐ =5 and ๐ = 1. and outputs of the system, using a MPC controller and the The training performance of the NN in modeling the NN as a model for prediction. The red dotted line is the reaction tank is shown in figure 12, where it can be seen reference of the system (r), the light line is the control sig- that MSE is negligible. Figure 13 illustrates the plantโs nal of the plant (u) and the bold line is the output of the output and NN prediction for the same set of inputs, it can plant. be seen that both signals overlap, suggesting that the plant model the plantโs dynamic efficiently. Figure 10. Output of valve and NN model for the same set of in- puts 0.9 Figure 12. Training performance of NN to model nonlinear reac- r tion tank 0.8 y u 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0 50 100 150 200 250 300 Samples Figure 11. Signals of reference, control and plant output for a MPC controller using a NN model for the control of a valve It can be seen that despite the non-linearity of the plant, the controller was able to efficiently control the plant, with a rapid response time. Figure 13. Concentration outputs from reaction tank and NN model for the same set of inputs Reaction Tank The NN model was used in a MPC structure to control To identify the dynamics of the nonlinear reaction tank, an the reaction tank plant. The method of levenberg- input signal was generate consisting of 4000 samples, with marquardt was used for optimization in the MPC structure. amplitude varying from 0 to 5 at every 20 samples. The minimum, maximum and control prediction horizon are: ๐1 = 1, ๐2 = 7 and ๐๐ข = 2. The penalty for signal control variation is ๐ = 0.05. Figure 14 illustrates the in- were used to train the NNs. Despite the simplicity of the puts and outputs of the system, where the red dotted line is NNs used, the models proved satisfactory to represent the the reference of the system (r), the light line is the control plants for the range of inputs used in training. signal of the plant (u) and the bold line is the output of the The NNs of the plants were used in a control loop with a plant (y). MPC structure. Given a set of control inputs, the NN were used to provide predictions of plants outputs. The output y predictions are used to calculate the error from a desired reference signal. A levenberg-marquardt optimization Reference and Output (r & y) t method was used to optimize the control inputs in order to Control Signal (u) r 22 4 minimize the plantโs output error. For both plants in this work, the NN proved to be effi- cient in modeling the non-linearity of the plant. Additional- 2 ly, the use of NN models in a MPC structure made possible the control of the nonlinear plants, where the controller 20 0 would compensate for the plantโs nonlinearities. The con- 0 20 40 60 Samples 80 100 troller had a marginal performance in controlling the reac- tion tank for low reference levels. What is explained by the fact that the NN did not capture the dynamics of the plant Figure 14. Signals of reference, control and plant output for a for those levels. During the training of the NN for model- MPC structure using a NN model for the control of a chemical ing the reaction tank, more low levels of reference should reaction tank be the used so that the NN could have more information Despite of the non-linearity of the plant, the controller about the dynamics of the plant in those levels and there- was able to execute control of the plant. However, it can be fore build a more accurate model of the plant. seen that, for lower reference levels, the controller is not The use of NN in the control of systems makes it possi- able to stabilize the output of the plant around that refer- ble for the control of nonlinear systems, black box systems ence value. This can be due the fact that the NN did not and system with changing dynamics. The same methods model the dynamics of the plant for such lower reference used in this work for identification and control of systems levels. The training set used for identification of the plant can be extended to the identification and control of other should have included more data in the lower reference lev- complex systems. els. The NN do not correctly represent the plant for such low levels of reference, therefore it predicts erroneous plantโs output. That makes the optimizer to optimize an References objective function that is not representative of the plant, Addeh, J., Ebrahimzadeh, A., Azarbad, M., & Ranaee, V. (2014). causing the marginal control performance in the lower ref- Statistical process control using optimized neural networks: A erence levels. case study. ISA transactions, 53(5), 1489-1499. For higher reference levels, the controller was able to Chen, M., Ge, S. S., & Voon Ee How, B. (2010). Robust adaptive control the concentration in the reaction tank. To maintain neural network control for a class of uncertain MIMO nonlinear the steady levels of the plantโs output, the control signal systems with input nonlinearities. Neural Networks, IEEE constantly changes in the time interval from 40s to 80s. Transactions on, 21(5), 796-812. This illustrates the optimizer trying to compensate for fu- Clarke, D. W., Mohtadi, C., & Tuffs, P. (1987). Generalized ture changes in the output and adjusting the control signal predictive controlโPart I. The basic algorithm. Automatica, ahead of time, so that the future output would follow the 23(2), 137-148. reference input. In this work, the performances of the NN Dierks, T., & Jagannathan, S. (2010). Output feedback control of in a predictive control structure are in close agreement with a quadrotor UAV using neural networks. Neural Networks, IEEE the work of Nรธrgรฅrd et. al. (Nรธrgรฅrd et al., 2000). Transactions on, 21(1), 50-66. Ebrahimzadeh, A., & Ranaee, V. (2010). Control chart pattern recognition using an optimized neural network and efficient Conclusions features. ISA transactions, 49(3), 387-393. In this paper, multilayer, feedforward neural networks Franklin, G. F., Powell, J. D., & Emami-Naeini, A. (2006). were used to identify the dynamics of two nonlinear plants, Feedback control of dynamics systems. Pretince Hall Inc. a valve and a reaction tank. Random step signals were Haykin, S., & Network, N. (2004). A comprehensive foundation. used as input in the identification of the plants, while their Neural Networks, 2(2004). responses were recorded. The set of inputs and outputs Haykin, S. S., Haykin, S. S., Haykin, S. S., & Haykin, S. S. (2009). Neural networks and learning machines (Vol. 3): Pearson Education Upper Saddle River. Hornik, K., Stinchcombe, M., & White, H. (1989). Multilayer feedforward networks are universal approximators. Neural Networks, 2(5), 359-366. Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). Imagenet classification with deep convolutional neural networks. Paper presented at the Advances in neural information processing systems. Morรฉ, J. J. (1978). The Levenberg-Marquardt algorithm: implementation and theory Numerical analysis (pp. 105-116): Springer. Nรธrgรฅrd, P. M., Ravn, O., Poulsen, N. K., & Hansen, L. K. (2000). Neural Networks for Modelling and Control of Dynamic Systems-A Practitioner's Handbook: Springer-London. Rosenblatt, F. (1958). The perceptron: a probabilistic model for information storage and organization in the brain. Psychological review, 65(6), 386. Visioli, A. (2006). Practical PID control: Springer Science & Business Media. Zainuddin, Z., & Pauline, O. (2011). Modified wavelet neural network in function approximation and its application in prediction of time-series pollution data. Applied Soft Computing, 11(8), 4866-4874.