A Fuzzy PLC Control System For A Servomechanism: Iulia Dumitru, Nicoleta Arghira, Ioana Fagarasan, Sergiu Iliescu
A Fuzzy PLC Control System For A Servomechanism: Iulia Dumitru, Nicoleta Arghira, Ioana Fagarasan, Sergiu Iliescu
A Fuzzy PLC Control System For A Servomechanism: Iulia Dumitru, Nicoleta Arghira, Ioana Fagarasan, Sergiu Iliescu
Abstract: This paper presents a case study on a practical implementation of a fuzzy-PLC system for a
servomechanism. The method presented achieves smooth fuzzy control, that can be easily implemented
in a PLC system. The speed of the servomechanism is controlled.
Keywords: fuzzy control, programmable logic controller (PLC), fuzzy-PLC system, process control,
computer-controlled system.
measured output y(t) and its reference yr(t) and applies this
1. INTRODUCTION
value by an actuator to the system.
In recent years, we have assisted at rapid changes on Signals:
industries and information technologies. Nowadays, the y=system output
control of all the equipment is being performed through the System
(controlled)
yr=reference
use of computers. Most equipments use Programmable Logic v
y İ=measured error
yr u m z
Controllers (PLCs) to connect with computers and to monitor + -
Controller Actuator Process Transmitter
u=system input
each load and electricity consuming device. PLCs are widely (command)
used in industrial control because they easy to install and m=execution
signal
very flexible in applications. A PLC interacts with the z=quality signal
external world through its inputs and outputs. v=disturbance
In industrial automation applications, ladder logic, a Fig. 1: The feedback control loop
programming language running on the programmable logic For a control design, the system behaviour has to be known.
controllers is usually used for discrete event control. For For that, usually we have to describe the system by
continuous control, PID-type controllers are more often mathematical tools. Very often, we do a physical analysis and
employed (Li and Tso). In 1974, the first fuzzy control get a system of differential and algebraic equations at first.
application appeared (Mamdani, 1974). Since then, fuzzy- The second step is to determine the system inputs and
logic control (FLC) has been taken as the preferred method of outputs, to describe a so called model from the mathematical
designing controllers for dynamic systems, even where equations of the system and, if needed, to linearize it. Then,
traditional methods can be used (Mamdani, 1993). we can measure the system parameters and write down the
The paper presents the speed control of a servomechanism. complete model with numerical values (Jirka Roubal).
The fuzzy logic control (FLC) implemented on a PLC was When the model of the system is determined, a controller can
used in order to obtain a good performance of the system. be designed. There are many ways to design the controller. It
depends on the performances that should be achieved (e.g.
2. BACKGROUND OF THE FUZZY CONTROLLER stability of the system and quality of the system behaviour,
optimal behaviour of the system according to a criterion, etc.)
There are many different processes in practice and their
properties are the ones to be controlled. For instance, we Another method to develop a controller is using the fuzzy
want the rotation speed of a motor to be equal to a certain sets also known as fuzzy aggregates instead of the numbers
value for any load torque, we want planes not to fall down, for the arithmetic for the fuzzy theory. These are the
we want to increase the electric power of power plants with mathematical based objects for which corresponding
decreasing the air pollution, we want to increase the capacity operators are defined.
of hard discs so we have to control the reading machinery
more accurately etc. To control a process, the required data are provided by a
measuring system. Those data include the unit of measuring,
The regulation is based on feedback control, see Figure 1. the measured variable and possibly some other values which
The output of a system y(t) is measured by a sensor. The are not of interest in this case. The unit of measuring is the
controller computes the input of the system u(t) based on the physical unit i.e. meter, whereas the measured value is a non-
dimensional measured result. In order to regulate the
inordinate group of all possible data they could be mapped to describes a "fuzzy control command". When the IF part
the group of real numbers, the corresponding number of the contains a combined statement "IF.... AND..." --- (THEN....),
measured values can be used, for example. Those numbers the fuzzy logic AND operation is executed first and the
are representable graphically by a straight line of numbers, as degree of fulfilment is used in the overall rule evaluation. All
shown in figure 2 (Amira). these statements together are often called aggregation.
Defuzzification - The most representative numeric (non-
fuzzy) output value is calculated for the control variable from
the fuzzy control command (in the form of the resulting
membership function). Based
Fig. 2: Mapping of the data set X to the real numbers 3. THE SERVOMECHANISM
However, not using a mathematical model of the process is
also a source of uncertainty. For example, the many degrees 3.1 Mathematical description of the servomechanism
of freedom in designing fuzzy systems can be a disadvantage.
The plant is represented by a servomechanism (figure 4)
consisting of two identical motors which are connected by a
The following overview provides the advantages and
mechanical clutch. The first motor is used for the control of
disadvantages of fuzzy control (Siemens,2003):
the rotation speed or the shaft angle. The second one, further
ſ Simple implementation of verbally expressed rules (if ...,
called generator, is used for a simulation of load torque. It
then...) on a computer to solve a problem.
contains A/D–D/A converters, digital input/output channels
ſ The behaviour of the fuzzy system is understandable to
and an incremental encoder input channel (Amira).
human beings.
ſ Avoids the costly development of a mathematical The manipulated signals are the tachogenerator signal and the
description when compared with conventional methods. control signal for the servo amplifier of the motor.
ſ Possible to use for processing complicated and involved
processes.
ƀ Task definitions with not enough knowledge of the system
and little or very imprecise knowledge of the system
behaviour results in bad, possibly unusable fuzzy solutions.
ƀ Usually no adaptability and learning capability if the
system behaviour changes.
ƀ Design of a system requires experience because of the
many degrees of freedom. Fig. 4. The servomechanism (Petr Chalupa).
The following figure (figure 3) illustrates the components of
the fuzzy controller and its functional principle. Fuzzy A general diagram of the equipment is shown in figure 5.
control is based on a collection of rules, known as the rule
base .
3.2 The identification of parameters and the computing of represents the mechanical time constant of the system. The
the fuzzy controller result is:
5 ms
1
The fuzzy controller implemented for the process has the
structure, shown in figure 7.
'Y 10V x Kupm x ³T
0 M
dt 142.8min 1 (9)
x >@
The control signal of the controller is limited to the range of
Figure 7: The structure of the fuzzy controller
-10V to +10V. The integrator following the fuzzy controller
The following names are chosen for the fuzzy variables: kernel cannot operate with greater values. The definition
x x: Acceleration range of the output variable directly affects the loop
x y: SpeedError amplification and therefore determines the dynamic of the
x z: ControlSignal closed loop to an extent. In case the control signal range of
The actual transfer function of the fuzzy controller kernel is 20V is to be passed in n sampling periods of 5 ms, the
z = f(x,y), where the function f defined by fuzzy sets, fuzzy maximum output value of the fuzzy controller kernel is
variables and fuzzy rules is arbitrary. The method "Center of determined by:
Area" (coa) is used by our fuzzy controller for n * 5 *10-3 * zmax = 20V Ö zmax = 20V/(5*n*10-3) (12)
defuzzyfication. A single fuzzy set always has the same
center of area independent of its weighting by the Max-Prod- with n=20 it follows zmax=200V, the definition range of z is
method. Therefore the value of a fuzzy output variable with then:
only one fuzzy set is always equal to the value of the constant
center of area of this fuzzy set. So the output value is: z >@
out = coa( set ) = const. (5) Since the behaviour of the fuzzy controller is unknown at this
time, the definition range of each variable is divided into
If, in contrast, the fuzzy output variable has two sets, its value three segments, "positive", "null" and "negative". The set
can only be between the two center of areas of both sets with the name "null" will be defined above the zero point and
depending on the weighting of each set. In the extreme case it extends over 1/3 of the entire definition range.
the weighting of one of the two fuzzy sets of the variable is
zero, which leads to a value of the output variable equal to 4. THE FUZZY – PLC CONTROL SYSTEM
the center of area of the other fuzzy set. So the output value
is: The general view of the designed system is shown in figure 8.
out [ coa( set1 ), coa( set2 ) ] (6) Figure 8 shows the servomechanism, a PLC system with
digital/analog I/O, a connection module between the
servomechanism and the PLC, a simulation board used to • Statement List (or STL) is a textual representation,
depict the status of sensors and switches of the PLC and a PC similar to machine code. If a program is written in
with the installed software for the programming of the PLC Statement List, the individual instructions
and the implementation of the fuzzy controller. correspond to the steps with which the CPU
executes the program.
• Ladder Logic Diagram (or LAD) is a programming
language primarily used to develop software for
Programmable Logic Controllers (PLCs) used in
industrial control applications. LAD represents a
program by a graphical diagram supported on the
circuits’ diagrams of relay-based logic hardware.
Ladder allows you to track the power flow between
power rails as it passes through various contacts,
complex elements, and output coils (Ivanescu).
The standard software used for configuring and programming The Fuzzy Control++ consists of a software package that
Simatic Programmable Logic Controllers is Step 7. The enables to implement good-quality, fully automatic control
programming languages which can be used for the S7-300 are systems for processes.
Ladder Logic, Statement List, and Function Block Diagram:
Processing is performed as follows: The instantaneous input The output membership function of the presented system has
values are translated into degrees of truth (“fuzzification”), been derived as a singleton function (figure 13).
logic operations are performed on the degrees of truth (“if”
part of the rule), the degree of truth for the affected output is
determined (the “Then” part of the rule, or the “inference”),
and the numerical output value is calculated by weighting the
resulting membership functions and computer centroid
(“defuzzification”).
In Fuzzy Control++ V5.0 program, the separate input and
output membership functions are formed as well as the
symbolic representation of the rule base (figure 9). The
triangle membership function has been preferred considering
its simple structure and high efficiency at the calculations.
For the inputs, a triangle function clustered by three is used
(figure 10, figure 11) and for the output five fixed valuable Fig. 12: The output formation of membership function
membership functions have been selected.
The relation between input membership functions and output
membership functions of the designed system has been
shown in figure 13.