PLC Control Logic Error Mo
Transcript of PLC Control Logic Error Mo
7/27/2019 PLC Control Logic Error Mo
http://slidepdf.com/reader/full/plc-control-logic-error-mo 1/5
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
[email protected],{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 linerelies on control mechanism practiced. In the modern
manufacturing, PLC devices can handle whole productionline given that structured and smart PLC-program is
executed. In other words, PLC-program can managewhole 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 rigorouslycan 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 beminimized. 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 thatfeature 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 toelectrical 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 PLC’s 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 machinedown-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, bymeans 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 back-
propagation 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 feed-forward ANNs are used for prediction and forecasting, the
modeling philosophy employed is similar to that used inthe development of more conventional statistical models.
In both cases, the purpose of the model is to capture therelationship 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 attemptto minimize an error function between the historical
outputs and the outputs predicted by the model. Although
Fourth International Conference on Natural Computation
978-0-7695-3304-9/08 $25.00 © 2008 IEEE
DOI
484
Fourth International Conference on Natural Computation
978-0-7695-3304-9/08 $25.00 © 2008 IEEE
DOI
484
Fourth International Conference on Natural Computation
978-0-7695-3304-9/08 $25.00 © 2008 IEEE
DOI 10.1109/ICNC.2008.776
484
7/27/2019 PLC Control Logic Error Mo
http://slidepdf.com/reader/full/plc-control-logic-error-mo 2/5
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 it’s 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 monitoringsystem. 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 bothhardware 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 hardwareimplementation 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, detaildescription 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 PLC-
program in to ANN. Hence, their work can be considered
redundant. In addition, the application of RNN becomescomplex and takes high computing time relative to other
ANNs.
Most of works on diagnosis and fault detection of PLC-
program 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 beapplied for the fault diagnosis and monitoring of PLC-
controlled manufacturing line. First of all, diagnosis
process takes place in data-value in which PLC-programrelies 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 PLC-
program is working program in real PLC device whichallows 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 doesn’t 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. Ingreat 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
485485485
7/27/2019 PLC Control Logic Error Mo
http://slidepdf.com/reader/full/plc-control-logic-error-mo 3/5
sufficient connection weights are used [10,11].
Consequently, we use one hidden layer in this work. Thenumber 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 theconnection 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 modelarchitecture is shown below in Fig. 1.
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 andoutputs, 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 tosimulate 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. Thismethod 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. isthe estimated output, and is the corresponding residual,
t t t t e X NN O y ˆ)(ˆ +== (1)
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.
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…..X N-1
and specify the desired output d0,d1,….dM-1. If the net is
used as a classifier them all desired outputs are typicallyset to zero except for that corresponding to the class the
input is from. That desired output is 1. The input could benew 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')()1( i jijij xnt wt w δ +=+ (2)
In this equation )(t w ijis the weight from hidden node i
or from an input to node j at time t, '
jw , is either the
output of node 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,
then
))(1( j j j j j yd y y −−=δ (3)
where jd is the desired output of node j and j y is the
actual output.
If node j is an internal hidden node, then
∑−=
k
jk
m
j j j j w x x δ δ )1( '' (4)
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 fromauxiliary constant-valued inputs. Convergence issometimes faster if a momentum term is added and
weight change are smoothed by
))1()(()()1('
−−++=+ t wt w xnt wt w ijiji jijij α δ ,where 0<α <1. (5)
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 statisticalmodels. 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, feed-
forward 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 first-
order gradient descent. In this study, the general strategy
486486486
7/27/2019 PLC Control Logic Error Mo
http://slidepdf.com/reader/full/plc-control-logic-error-mo 4/5
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 2 Plotted Raw data
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 asundesirable, 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 alwayssuperior to less hidden layers, also can be seen in fig 6.
Table 1. Setting parameter of feed-forward neural
network INPUT HIDDEN
LAYER NODEnum
ITERATIO N
RESULT
2 1 2 100 BELOW 1002 1 3 45 BELOW 100
2 1 4 18 OK 100
2 1 5 16 100
2 1 6 15 100
2 1 8 14 100
Fig 6 Simulation result
Fig 7 using 1 hidden layer learning rates
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 thefigure, 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 feed-
forward neural network setting is described in the table 1.
Table 2. Setting parameter of feed-forward neural
network for sequence predictionINPUT HIDDEN
LAYER NODEnum
ITERATIO N
Error
3 1 3 50 0.0478
3 1 4 16 0.0438
3 1 5 18 0.0467
3 1 6 12 0.0457
3 1 7 15 0.0497
487487487
7/27/2019 PLC Control Logic Error Mo
http://slidepdf.com/reader/full/plc-control-logic-error-mo 5/5
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 involvesobservation 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 intodigital. 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.
References
[1] Gaˇsper Muˇsiˇc, Dejan Gradiˇsar, and Drago Matko,
“IEC 61131-3 Compliant Control Code Generation fromDiscrete Event Models”, Proceedings of the 13th
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 Knowledge-
Based 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, Proceedingsof 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, 287–309, 2000.
488488488