A Fuzzy PLC Control System For A Servomechanism: Iulia Dumitru, Nicoleta Arghira, Ioana Fagarasan, Sergiu Iliescu

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

A fuzzy PLC control system for a servomechanism

Iulia Dumitru*, Nicoleta Arghira*, Ioana Fagarasan*, Sergiu Iliescu*



* Departament of Automatic Control and Industrial Informatics,
Faculty of Automatic Control and Computers,
University "POLITEHNICA" of Bucharest, Romania
(e-mail: {iulia, nicoleta, ioana, iliescu}@shiva.pub.ro)

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 .

Fig. 5. General diagram of the servomechanism (Luis J. de


Fig. 3: The components of the fuzzy controller and its Miguel).
functional principle The equivalent electrical circuit of the permanently excited
The functional principle is divided into the following steps: DC motor is shown in figure 6. Equation (1) is obtained from
this circuit, where
Fuzzification - The degrees of fulfilment for the linguistic x UA: armature voltage.
values (degrees of membership of the fuzzy sets) of the x E: electromotive force.
linguistic variables are assigned to the non-fuzzy input x IA: armature current.
values. x RA: armature resistance.
x LA: armature inductance.
Inference - For each rule of the rule base, the degree of
fulfilment of the THEN part is formed from the degree of x ȍ: armature frequency
fulfilment of the IF part by a certain method. This process is d (1)
U A  E RA I A  LA I A
also called implication. The degree of fulfilment of the dt
THEN part is equivalent to the degree of fulfilment of the
rule, which is also called the rule intensity. All these The electromotive force E is proportional to the rotational
individual rule evaluations put together result in one speed of the motor Ȧ; as equation (2) shows, where C is the
membership function for the output signal, which is also motor constant and F is the constant magnetic flux. The
termed composition. The resulting membership function magnetic exitation ĭ is related to Ȧ (rad/s) by equation (3):
E C)Z (2) With respect to the speed range of r3000 rpm, a maximum
control error signal of 6000 rpm can be reached. Therefore,
2S: (3) the definition range of y is :
Z
60
y >@    
If, however, the desired performance of the speed control is
considered, it is recommended to significantly restrict the
above mentioned intervall. The value of a fuzzy set at the
limits of the definition range of a fuzzy variable is continued
to the infinity. If for instance the above mentioned intervall is
restricted to the range r1000 and the input value is +6000,
the input variable behaves just as if the input value would be
+1000.
Fig. 6. Equivalent electrical circuit of the DC motor.
The definition range of x is limited by the maximum y
The torque M generated by the motor is proportional to the deviation during a sampling period. To calculate this value,
armature current IA, as shown in equation (4): the maximum control signal 10V is assumed.
TM = J x RA = 70ms (8)
M=KMIA (4)
KM x C x )

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)

'Y 142.8 (10)


x 28560
't 0.005
Therefore the definition range of x is:

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).

Fig. 8: The designed system •• Function Block Diagram (FBD) is a graphic


representation and uses the logic boxes familiar
from Boolean algebra to represent the logic.
4.1 The simulation board
The S7-300 is a modular control system for system solutions
The simulation board is operated with a stabilized DC voltage with a main emphasis on production engineering. The wide
of 24 V, e.g. supplied with the power supply unit of the PLC ranges of assemblies are ideally suited to cope with all
system. The sockets are used to connect the sensors and required demands and a flexible application. The S7-300
switches on the simulation board to the PLC system. The contains the following types of modules (Siemens, 2004):
safety sockets on the system simulator are connected to the •• Central processing units (CPU)
sensors and switches according to the assignment. Each of •• Power supply modules (PS)
these switches and sensors can physically act as make or •• Interface modules (IM)
break contact (Dumitru). •• Communications processors (CP); (for connecting to
PROFIBUS)
•• Digital and analog modules are now called ““signal
4.2 The PLC system modules”” (SM)
Programmable logic controllers are modular, industrially As in a real application, the S7-300 modules are plugged into
hardened computers which perform control functions through the profiled rail on the basic plate, fastened and connected to
modular input and output (I/O) modules. The modularity of each other via the rear panel bus to be system compatible.
PLC allows the user to combine generic I/O modules with a The system is quickly and safely connected electrically to the
suitable controller to form a control system specific for his inputs and outputs on the modules with the specific connector
most simply understood needs (Yasar Birbir). The operation adapter. Due to its construction, the system is open to future
of a controller by envisioning that repeatedly performs three development (Dumitru).
steps:
x Reads inputs from input modules. 4.3 The implementation of the fuzzy –– PLC system
x Solves pre-programmed control logic.
x Generates outputs to output modules based SIMATIC Step 7 V6.2 software has been used for
on the control logic solutions. Input devices programming the PLC system. Here, the required software to
and output devices of the process are obtain the desired control over the system has been created
connected to the PLC and the control using programming blocks. It is obvious that the descriptions
program is entered into the PLC memory. used in programming blocks also use the addresses obtained
In our application, the PLC system controls through analog considering the hardware descriptions.
and digital inputs and outputs the varying load-constant speed The FLC application of the system has been performed by
operation of the motor. Also, the PLC continuously monitors Fuzzy Control++ V5.0 software. First of all, inputs and
the inputs and activates the outputs according to the control output membership functions and rule chart information are
program. transferred into computer environment by using Fuzzy
Control++ V5.0 software and prepared to be available for the
The PLC used in our application, is a SIMATIC S7-300 control. Further, these will be under control of an expert
series, an industrial PLC. knowledge

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.

Fig. 9: The input and output membership function and the


symbolic representation of the rule base.
Fig. 13: The rule table

Fig. 10: The input 1 formation of membership function

Fig. 14: The diagram of input and output membership


function
The ””decision unit”” which is one of the most important stages
of fuzzy logic control can be named ””Fuzzy Engine””. Fuzzy
logic is the core part of the control. It uses fuzzy concepts and
it determines the required control by making inference
(Cemal Yilmaz).
The resulting real control signal is applied to the system by
the structure shown in Fig. 14. Here, the control conection
between fuzzy logic software and the field is supplied by
Fig. 11: The input 2 formation of membership function FB30 Function Block and DB30 Data Block.
REFERENCES
Amira, DR300 –– Laboratory Setup Speed Control with
Variable Load, User Manual.
Cemal Yilmaz, Osman Gürdal, Ilhan Kosalay, Network
induced delay of asynchronous motor connected to
Profibus-DP networks using fuzzy logic control
algorithm, Expert Systems with Applications 37 (2010)
3248––3255.
Dumitru I., Arghira N., Fagarasan I., Iliescu S., Process
Fig. 15: The application of fuzzy logic control Control Simulator using Programmable Controller
The operating time of control system calculation in FLC Technology, Proceedings of the 2010 IEEE
application will be different according to the number of International Conference on Automation, Quality and
inputs, outputs, membership functions and rules. The increase Testing, Robotics17th edition of , vol. 1, pp 89-93 ,
of the operating time will affect in negative way the ISBN 978-1-4244-6722-8/10, 28-30 May 2010, Cluj,
performance of the system. The decrease of the operating Romania
period depends on the speed of the hardware.
H.-X. Li, S.K. Tso, A fuzzy PLC with gain-scheduling
After implementing the fuzzy PLC control system for the control resolution for a thermal process - a case study,
servomechanism, the results in figure 16 were obtained. The Control Engineering Practice 7 (1999) 523-529.
speed reference was set at 300 rpm and different loads were
Ivanescu, N., T. Borangiu, S. Brotac, ““Automate
applied (at 20, 30 and 40 seconds).
programabile. Teorie si probleme rezolvate””, Editura
Printech, 2002
Jirka Roubal, Petr Augusta, Vladimr Havlena, Jindrich Fuka,
Control Design for servo amira DR300, Department of
Control Engineering, Faculty of Electrical Engineering,
Czech Technical University in Prague, 2005
Luis J. de Miguel, L. Felipe Blazquez, Fuzzy logic-based
decision-making for fault diagnosis in a DC motor,
Engineering Applications of Artificial Intelligence 18
(2005) 423––450.

Mamdani, E.H. (1974). Applications of fuzzy algorithms for


simple dynamic plant, Proc. IEE, 121(12), 1585-1588.

Mamdani, E.H. (1993). Twenty years of fuzzy control:


Experiences gained and lessons learnt. Proc. 2nd IEEE
Fig. 16: System response for a set speed reference with Int. Conf. on Fuzzy Systems, San Francisco (pp. 339-
different loads 344).

5. CONCLUSIONS Petr Chalupa, Vladimír Bobál , Jakub Novák, Petr Dostál,


Using of Self-Tuning Controllers Simulink Library for
In fuzzy control systems, the existing knowledge gained from real-time control of nonliniar servo systems,
experience with the behaviour of the process is replaced by Proceedings 23rd European Conference on Modelling
rules that qualitatively describe the process behaviour. and Simulation, ISBN: 978-0-9553018-8-9 / ISBN: 978-
0-9553018-9-6.
The parameters of the controller were designed so that the
servomechanism had a fast response and minimum steady Siemens, Fuzzy Control++, User’’s Manual.
state error. The disturbances (different loads applied to the
motor) were rejected by this type of control. Siemens –– Programmable Logic Controllers S7-300 Module
Data, 2004
The designed system, fuzzy-PLC connects classic control
with modern technology, supporting a wider spectrum of Yasar Birbir, H. Selcuk Nogay, Design and Implementation
FLC (fuzzy logic control) applications. of PLC-Based Monitoring Control System for Three-
Phase Induction Motors Fed by PWM Inverter,
International Journal of Systems Applications,
Engineering & Developement, Issue 3, Volume 2, 2008.

You might also like