Sie sind auf Seite 1von 5

Fourth International Conference on Natural Computation

PLC control logic error monitoring and prediction using Neural Network
In-Sung Jung, BM Mulman, Devinder Thapa, lock-jo koo, Jae-Ho Bae, Sang-hyun Hong, Sungjoo Yeo ,C.M. Park, S.C. Park, Gi-Nam Wang Department of Industrial Engineering Ajou University 442-749, Korea Insung9908@gmail.com, {mulmanz, debu, lockjo9, jhbae, hsh3298, oriheap, cmpark, scpark, gnwang}@ajou.ac.kr

Abstract
This paper reviews monitoring and error prediction of PLC-program using Neural Network. In the PLC-device controlled manufacturing line, PLC-program holds place of underlying component. It becomes controlling mechanism. The level of automation in the production line relies on control mechanism practiced. In the modern manufacturing, PLC devices can handle whole production line given that structured and smart PLC-program is executed. In other words, PLC-program can manage whole process structure consisting set of procedures. We present a method to monitor PLC-program and PLC error prediction it using neural network. The neural network method being predictive in nature, it rigorously can monitor process signals from sensors, sensed during operation of PLC devices or execution of PLC-program. Subsequently, a neural network algorithm practiced for the analysis of signals. In this way, thorough monitoring of PLC-program can find possible errors from temporal parameters (e.g. Voltage, bias etc). In addition, possible alterations in program and irregularities can be minimized. That can result, easily to use in fault detection, maintenance, and decision support in manufacturing organization. Similarly, it can lessen down-time of machines and prevent possible risks. Keywords: PLC, Artificial Neural Network (ANN), Fault-detection, Error prediction, Monitoring

1. Introduction
In the modern manufacturing, the PLC is well-adopted to a range of automation tasks. These are typically industrial processes where changes to the system would be expected during its operational life and the production systems that feature cost of maintaining is relatively higher than cost of automation [1]. PLC is special-purpose computer, which is designed for multiple input and output arrangements, extended temperature ranges, immunity to electrical noise, and resistance to vibration and impact. The reason behind increasing popularity of PLC (Programmable Logic Controller) is flexibility in control; the possible changes in manufacturing controlling are performed through PLC-program. The PLC-program

determines automation level of a manufacturing industry. In other words, the whole process structure of production line can be modeled and controlled by providing set of instructions to PLC. In this way, PLC-program becomes underlying component of modern manufacturing. However, because of PLCs nonflexible programming system relative to high level languages, their ability in fault detection and diagnosis is limited. The continuous monitoring of PLC-program is vital to decrease machine down-times, safety-critical reasons and prevent potential risks. The diagnosis of PLC-program becomes difficult because of data characteristic involved in process: analog and discrete [2]. PLC devices execute programs scanning continuously and operate involved machines sending instructions as I/O in the discrete or digital format. However, pressure, temperature, flow, and weights are often represented with integer values. Hence, input and output signals are represented in either binary or integer values; there are always chances of alterations in the values in the real time running production line. That is, the originally sound PLC-program may behave abnormally due to the changes in input and output values. Using neural network for fault diagnosis is not common as for vision or speech processing, however many successful applications have been reported notably [3]. ANNs are a form of artificial intelligence, which, by means of their architecture, attempt to simulate the biological structure of the human brain and nervous system. Although the concept of artificial neurons was first introduced in 1943, research into applications of ANNs has blossomed since the introduction of the backpropagation training algorithm for feed-forward ANNs in 1986 [4]. ANNs may thus be considered a relatively new tool in the field of prediction and forecasting. When feedforward ANNs are used for prediction and forecasting, the modeling philosophy employed is similar to that used in the development of more conventional statistical models. In both cases, the purpose of the model is to capture the relationship between a historical set of model inputs and corresponding outputs. This is achieved by repeatedly presenting examples of the input/output relationship to the model and adjusting the model coefficients in an attempt to minimize an error function between the historical outputs and the outputs predicted by the model. Although

978-0-7695-3304-9/08 $25.00 2008 IEEE DOI 10.1109/ICNC.2008.776

484

some ANN models are not significantly different from a number of standard statistical models, they are extremely valuable as they belong to the class of data driven approaches, whereas conventional statistical methods are model driven. In the former, the data are used to determine the structure of the model as well as the unknown model parameters. The use of ANN models may thus overcome the limitations of the traditional methods. Particularly, it is found suitable for prediction since neural networks are best at identifying patterns or trends in data. In our work, we design a neural network which is trained using back propagation learning algorithm. The trained network is used to predict valid PLC-program Input and output (I/O) values and its pattern. At the end, the performance of the network in predicting these process parameters is studied

2. Literature review
More and more researchers and industrial partners are attracted to this area, fault detection and monitoring system. So far, some relevant diagnostic methods have been proposed. W. Hu, M. Schroeder, & A.G. Starr [5] have proposed knowledge-based real-time PLC diagnosis system. Their work is focused on acquiring knowledge from the pneumatic & hydraulic circuit diagrams and PLC-program. Later, simply, they retrieve PLC-data and identify possible faults. In the process observation and fault detection, Tord Alenjung, Markus, Bengt & Knut Akesson [6] have practiced discrete event systems. They have used EFA (Extended Finite Automata) as modeling tool and finding faults, particularly this work can be seen more focused on extension of finite automata and modeling. Similarly, in the work of PLC diagnosis, Z. D. Zhou, Y. P. Chen, J. Y. H. Fuh, & A. Y. C. Nee have approached distinct methodology, which combines both hardware and software. They have presented work structurally using hybrid strategy with multiple sensors and multi-associated parameters in the system [7]. However, their work can be seen as inclined to hardware implementation to avoid faults. Some notably advance works has been carried out in PLC monitoring by Hao Zhang, Jianfeng Lu, Yunjun Mu, Shuogong Zhang, Liangwei Jiang [8]. In their paper, online monitoring of PLC has been illustrated. They have developed BPMS (Bao-steel PLC Monitoring System) application for the monitoring which runs on PC. Although, their work stresses on development of PLC monitoring system, detail description of mechanism is not explained. Recently, the use of neural network in the diagnosis of PLC can be seen in the paper of Magdy M. Abdelhmeed, Houshang Darabi [9]. Particularly, they have applied RNN (Recurrent Neural Network), a type of ANN for diagnosis and debugging of PLC-program. In their work, they have proposed an algorithm for the conversion of LLD (a type

of PLC-program). The algorithm with time-delay in hidden layers outputs has been applied to convert LLD into a RNN; subsequently, they carry out fault detection process on transformed data. Although their work on monitoring is in-depth, however in real scenario diagnosis work can be carried out without transforming PLCprogram in to ANN. Hence, their work can be considered redundant. In addition, the application of RNN becomes complex and takes high computing time relative to other ANNs. Most of works on diagnosis and fault detection of PLCprogram seem to be focused on particular side. Most of the methodologies applied are concerned with discrete event system [6], where in real system PLC involves continuous or analog values. Some others apply new methods however computing time and efficiencies are ignored [9]. To overcome, these two major limitations, fully connected feed-forward neural network can be applied for the fault diagnosis and monitoring of PLCcontrolled manufacturing line. First of all, diagnosis process takes place in data-value in which PLC-program relies on. In other hand, feed-forward with widely used back-propagation learning algorithm is used in this work, explained in section 4.

3. Background
When we talk about fault-detection in PLC-program, we particularly focus on to locate alterations in the valid PLC-program sequence. These faults in PLC-program can be found continuous observations of PLC-program variables. In the controlling of manufacturing line, PLCs are deployed which are programmable. The valid PLCprogram is working program in real PLC device which allows machines to behave normally, as per instructions given. Because of different process parameters such as sensor inputs there is always chance of being modification in original valid PLC-program sequence. In other way, the objective of monitoring becomes finding errors or alterations in program sequence. When there are alterations in program sequence i.e. it doesnt match with original valid program sequence, refers that there exists fault. In our work, we adopt neural network for monitoring purpose as suitable method, with appropriate learning algorithm, back-propagation. Determining the network architecture is one of the most important and difficult tasks in the development of ANN models. In great extent, the efficiency of ANN depends upon architecture modeler, since there are some judgmental factors which have to be decided on design time of network. It requires the selection of the number of hidden layers and the number of nodes in each of these. It has been shown that a network with two layers, where the hidden layer is sigmoid and the output layer is linear, can be trained to approximate any function provided that

485

sufficient connection weights are used [10,11]. Consequently, we use one hidden layer in this work. The number of nodes in the input and output layers are restricted by the number of model inputs and outputs. The input layer of the ANN model developed in this work has two nodes, one for relay input and PLC-program input i.e. binary value. Similarly, the output layer has two nodes for valid two bits, 0 & 1. The physical interpretation of the connection weights is important; hence the smallest network that is able to map the desired relationship should be used. Consequently, the model that has the optimum number of nodes giving an optimum generalization is retrained a number of times with different weights and biases until no further improvement occurs. The model architecture is shown below in Fig. 1.

Step1: Initialize weights and offsets all weights and node offsets to small random values. Step2: Present input and desired outputs Present a continuous valued input vector X0, X1..XN-1 and specify the desired output d0,d1,.dM-1. If the net is used as a classifier them all desired outputs are typically set to zero except for that corresponding to the class the input is from. That desired output is 1. The input could be new on each trial or samples from a training set could be presented cyclically until stabilize. Step 3: Calculate Actual Output Use the sigmoid non linearity from above and formulas as in fig 3 to calculate output y0,y1.yM-1. Step 4: Adapt weights Use a recursive algorithm starting at the output nodes and working back to the first hidden layer. Adjust weights by (2) w ij ( t + 1) = w ij ( t ) + n j x i' In this equation w ij ( t ) is the weight from hidden node or from an input to node output of node then
' j

j at time t, w , is either the

i or is an input, is a gain term, and j , is an error term for node j , if node j is an output node,
j = y j (1 y j )( d j y j )
(3)

Fig. 1 Two-layer feed forward Neural Network (fully connected

4. Methodology
The steps for developing ANN models, as outlined by Maier and Dandy [12], are used as guide in this work. These include the determination of model inputs and outputs, division and preprocessing of the available data, the determination of appropriate network architecture, optimization of the connection training weights, stopping criteria, and model validation. MATLAB is used to simulate ANN operation in this work. The training method used in this work back-propagation algorithm, is considered a generalization of the delta rule for nonlinear activation functions and multilayer networks. This method is widely used supervised learning method because of its weight error correct rules, can be illustrated as follows: This prediction model could be designed as follows. is the estimated output, and is the corresponding residual, (1) t = O t = NN ( X t ) + e t y The back-propagation training algorithm is an iterative gradient designed to minimize the mean square error between the actual output of multi-layer feed forward perceptron and the desired output. It requires continuous differentiable non-linearity. The following assumes a sigmoid logistic nonlinearity.

where d j is the desired output of node j and actual output. If node j is an internal hidden node, then

y j is the
(4)

= x 'j (1 x 'j )
k

m j

jk

where k is over all nodes in the layers above node j . Internal node thresholds are adapted in a similar manner by assuming they are connection weights on links from auxiliary constant-valued inputs. Convergence is sometimes faster if a momentum term is added and weight change are smoothed by (5) w ) =w j xi' +(w )),where 0< <1. ij (t +1 ij(t) + n ij (t) w ij (t 1 Step 5: Repeat by going to step 2

5. Result & Discussion


The process of optimizing the connection weights is known as training or learning. This is equivalent to the parameter estimation phase in conventional statistical models. The aim is to find a global solution to what is typically a highly nonlinear optimization problem. As in our work, we do not consider time parameter so, feedforward network is used, rather than recurrent. The method most commonly used for finding the optimum weight combination for feed-forward neural networks is the back-propagation algorithm, which is based on firstorder gradient descent. In this study, the general strategy

486

adopted for finding the optimal parameters that control the training process is as follows. For each trial number of hidden layer nodes, random initial weights and biases are generated. The network is trained using the training data set and validated with the validation data set. all the illustrative diagrams are described as follows:

Fig 6 Simulation result

Fig 2 Plotted Raw data

Fig 7 using 1 hidden layer learning rates


Fig 3 Transformation (digitized)

Fig 4 Result of Simulation

In figure 2, the raw data from relays is plotted, strength of signal being observed in vertically and time in horizontal axis. Here, transformation of relay input values into discrete is our first objective, which is accomplished. Those values are transformed into discrete or binary value in figure 3 using threshold values described in section 4. In figure 4, simulation result can be seen where as undesirable, predicted using applying 2 hidden layers. In comparison to figure 4, the prediction is perfect in figure 5, which is produced using only one hidden layer. In this way, more hidden layers cannot be considered always superior to less hidden layers, also can be seen in fig 6. Table 1. Setting parameter of feed-forward neural network
INPUT 2 2 2 2 2 2 HIDDEN LAYER 1 1 1 1 1 1 NODE num 2 3 4 5 6 8 ITERATIO N 100 45 18 16 15 14 RESULT BELOW 100 BELOW 100 OK 100 100 100 100

Fig 8 using 2 hidden layers Learning rates In the above figure (7, 8), the number of iteration is mapped horizontally and error rate as vertically. From the figure, higher the number of iterations lower will be error rate. The error in figure 4 is less than in figure 3. Figure 4 is considered to be suitable; in 16 iterations it has got error rate less than 0.005. In addition, the setting our feedforward neural network setting is described in the table 1. Table 2. Setting parameter of feed-forward neural network for sequence prediction
INPUT 3 3 3 3 3 HIDDEN LAYER 1 1 1 1 1 NODE num 3 4 5 6 7 ITERATIO N 50 16 18 12 15 Error 0.0478 0.0438 0.0467 0.0457 0.0497

487

Fig 9 PLC programming sequence data

Fig 9 Event of PLC programming prediction In the above figure 7 is PLC logic sequence and figure 8 is to predict the sequence. It is useful for the logic sequence operation error. The error is less than 0.05. In addition, the setting our feed-forward neural network setting is described in the table 2.

6. Conclusion
Monitoring of PLC controlled factory floor involves observation of PLC-program. PLC- control program being lower level and inflexible in terms of programming, it becomes difficult to debug and troubleshoot. To detect faults and abnormality, robust methods are required for prediction. Neural network is found to be suitable method because of its inherent nature, parallel processing and predictive. In this research, useful result has been achieved Fig 4, in transformation of integer value into digital. Importantly, prediction rate has been achieved 99.995%. This method, in the future, may be further applied to other manufacturing processes too.

Acknowledgement
This research has been partially funded by BK21 (Brain Korea 21), and UDMT Korea.

Mediterranean Conference on Control and Automation Limassol, Cyprus, June 27-29, 2005 [2] K.A.E. Totton, P.R. Limb, Experience in Using Neural Network for Electronic Diagnosis, IET Conference Proceedings, Publication Date: 18-20 Nov 1991, BT Laboratories, UK [3] McDuff R J, Simpson P K, Gunning D, 1989, An Investigation of Neural Network for F-16 Fault Diagnosis: I. System Description, Proc. AutoTest Conference, 351-357 [4] D. E. Rumelhart, G. E. Hinton, and R. J. Williams, Learning internal representation by error propagation. Parallel Distributed Processing, Vol. 1, Chap. 8, MIT Press, Cambridge, MA., 1986. [5] W. Hu, M. Schroeder, & A.G. Starr, A KnowledgeBased Real-time Diagnosis System for PLC controlled Manufacturing Systems, Department of Computing, City University Londong, London, EC1V 0HB, UK [6] Tord Alenjung, Markus, Bengt & Knut Akesson, PLC-based Implementation of Process Observation and Fault Detection for Discrete Event Systems, Proceedings of the 3rd Annual IEEE conference on Automation Science and Engineering, AZ, USA, Sep 22-25, 2007 [7] Z. D. Zhou, Y. P. Chen (1), J. Y. H. Fuh, & A. Y. C. Nee (2), Integrated Condition Monitoring and Fault Detection for Modern Manufacturing Systems, (1) Huazhong University of Science and Technology, P.R. China, (2) National University of Singapore, received on January 3, 2000 [8] Hao Zhang, Jianfeng Lu, Yunjun Mu, Shuogong Zhang, Liangwei Jiang, On-line PLC Monitoring and Network Administering System for Steel Tbe Mill, Proceedings of the IEEE International Conference on Industrial Technology, 1996 [9] Magdy M. Abdelhmeed, Houshang Darabi, Diagnosis and Debugging of Programmable Logic Controller control Programs by Neural Networks, Proceedings of the 2005 IEEE [10] M.T. Hagan, H.B Demuth, and M. Beale, Neural Network Design (Boston, MA., PWS Publishing Company, 1996). [11] H.B. Demuth, and M. Beale, Neural Network Toolbox for use with MATLAB (The MathWorks, Inc, 1998). [12] H. R. Maier, and G. C. Dandy, Applications of artificial neural networks to forecasting of surface water quality variables: Issues, applications and challenges. Artificial Neural Networks in Hydrology, Dordrecht, The Netherlands, 287309, 2000.

References
[1] Gasper Music, Dejan Gradisar, and Drago Matko, IEC 61131-3 Compliant Control Code Generation from Discrete Event Models, Proceedings of the 13th

488

Das könnte Ihnen auch gefallen