PLC Control and Matlab/Simulink Simulations.
A Translation Approach
Teresa Deveza *, J. F. Martins **
* Universidade de Évora, Évora, Portugal
** CTS/UNINOVA and FCT/UNL, Lisboa, Portugal
teresa.deveza@gmail.com; jf.martins@fct.unl.pt
Abstract — This paper proposes a translation methodology
to emulate PLC control program in the Matlab/Simulink
environment. The translation package automatically
translates the PLC control program into Matlab/Simulink
software language. The PLC control program is translated
into a Matlab function block, within the Matlab/Simulink
environment, that will control the model of the industrial
process as long as the simulation runs. The translation
package inputs are: the type of PLC, the PLC’s number of
inputs and outputs and the PLC control program file. The
translation package output will be a Matlab/Simulink
compatible m-file with the correspondent PLC control
program translation. Universidade de Évora students are
successfully using this package, so that they can test their
PLC control programs together with Matlab/Simulink
process models.
Index Terms — Automation, Education, Industrial
Control, Simulation, Modeling.
I. I
NTRODUCTION
The practical test of an automation and control process
controlled by programmable logic controllers (PLC) is a
well-known problem [1-3]. There are several solutions
that can be implemented: scale models, batteries of led’s
and switches and Human Machine Interfaces (HMI),
Supervisory Control and Data Acquisition (SCADA)
systems or simulation tools. The use of scale models of
real processes is very expensive and difficult to adapt to
different processes. There is no question that this is the
best way to teach PLC controlled process, allowing the
students to test their projects in an almost real
environment, however their cost often prohibits its use.
The use of led’s and switches sets is extremely confusing
end uninteresting. This approach, only valid when small
processes are considered, severely reduces the student’s
motivation. Some HMI and SCADA systems allow this
feature but there are very expensive, not intended for this
purpose and usually consider property protocols. Some
PC-based process simulation tools have been developed,
using microcontroller technologies and designed to work
with any type of PLC [4]. Other commercial PLC
simulation tools are also available (PC-SIM, SIMTSX,
PSIM just to name a few). However, often these solutions
are not suitable to be integrated with other simulation
tools.
The use of Matlab/Simulink [5] has not been a regular
approach for teaching industrial automation and PLC
controlled processes. Assuming that the model of the
industrial process is implemented in the Matlab/Simulink
this paper presents a tool that can be used to implement
the PLC control program in Matlab/Simulink
environment. The basic idea is to consider the PLC
control program as a Matlab function block, within the
Matlab/Simulink environment, that will control the model
of the industrial process as long as the simulation runs.
The main objective of this work is to automatically
translate the PLC control program, written as an
instruction list, into Matlab/Simulink software language.
II. I
NDUSTRIAL PROCESS MODELLING
The implementation of an industrial production line
involves a large investment. Every decision at the design
stage should be made with extremely care in order to
assure that the automated manufacturing process will
successfully achieve the desired results.
The problem of industrial process modeling is not easy
or unique, and several approaches can be taken. These
processes can be considered as a discrete event system,
where the states of the dynamic system involved changes
accordingly to the occurrences of various and distinct
events. It is important, to keep the manufactures and
process integrators competitiveness, that the industrial
production systems keep being constantly improved. To
achieve this objective an efficient modeling approach is a
fundamental issue.
A modern production line is a highly integrated system
composed of automated workstations such as robots with
tool-changing capabilities, a hardware handling system
and storage system, PLC controlled processes, and a
computer control system that controls the operations of
the entire system. Every controlled industrial process can
be modeled as a transfer function (continuous and/or
discrete) with a set of inputs and a set of outputs, as
presented in Fig. 1. The inputs refer to the control signals
that are applied to the process actuators, and the outputs
refer to the variables that are acquired through the process
network of sensors and detectors.
978-1-4244-2728-4/09/$25.00 ©2009 IEEE