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

Soran University

Faculty of Engineering

Chemical Engineering Department

Fuzzy Logic Control (FLC) System

Supervised by:

Assis. Prof. Dr. Badiea Abdullah Mahyoub

Prepared by:

Narin Aziz Aali

2020-2021
Abstract

Fuzzy logic control (FLC) system is an effective tool for dealing with the
complicated processes. The researches and investigations on the fuzzy logic
control systems have progressed continually. The quantity and diversity of fuzzy
logic applications have grown substantially in recent years, these applications
cover a wide range of consumer products including microwaves, washing
machine, and cameras to the industrial scale processes such as portfolio choosing,
decision support system, along with medical instrument controlling. This paper
aims to provide a comprehensive review about the basic concepts of fuzzy logic
control system, the main reasons behind using this control system, its advantages
and drawbacks along with presenting two case studies in which fuzzy control
system were used.

Key words: Fuzzy Logic Control (FLC), Air Condition System, Fluid Level
Control

1
1. Introduction

Fuzzy logic system is a well-known soft computing tool that progresses the
practicable algorithm through embedding an organized human comprehension and
knowledge. Fuzzy logic system is a logical framework which offers a model that
is designed for human elucidation approaches which are imprecise (fuzzy) rather
than exact. On the basis of knowledge and information demonstrated in human
languages, the fuzzy logic systems may be used in designing expert and intelligent
systems(1). Fuzzy logic systems are sort of an artificial intelligence, though in
terms of history and applications are newer and younger than the artificial
intelligence-based expert systems in comparison. Fuzzy logic systems deal with
issues and problems which possess lack of exactness and accuracy, ambiguity,
estimations, unreliability, uncertainties, qualitative disorganization, along with
incomplete veracity.

Professor L. A. Zadeh in the University of California at Berkeley, introduced


the fuzzy logic via his paper about (Fuzzy sets) in the year 1965, he demonstrated
a technique for modeling the systems based on the fuzzy IF-THEN rule along with
linguistically variables, but his work was not acknowledged till Dr. E. H.
Mamdani, Professor in London University, used the fuzzy logic concepts
practically for controlling an automatic steam-engine in 1974(1). Many researches
and studies have been carried out for years for enhancing the fuzzy logic system
accuracy, with the main conclusions being that the fuzzy hybrid modeling may
effectively improve the fuzzy logic system accuracy. Novel advances have been
achieved in the adaptive fuzzy operator domain(2), wavelet fuzzy modeling(3) along
with modeling of genetic fuzzy systems(4,5). Sugeno categorized the fuzzy systems
into three categories based on the subsequent sections of IF-THEN rules(6). First,

2
Mamdani fuzzy systems, which are described through IF-THEN rules correlated
with the linguistically variables as below:

Rule R i : IF x1 is ℳ1 i x2 is ℳ2 i … xm is ℳm i

THEN γ is ℋ i i = 1/ 2/3 … n

Where ℋ i and ℳj i , j = 1/2/3 … m, represent the fuzzy sets ,and the number
of the fuzzy rules is showed by (n). Second fuzzy system is Takagi-Sugeno (T-S)
fuzzy system, which have the following functional consequent:

Rule R i : IF x1 is ℳ1 i x2 is ℳ2 i … xm is ℳm i

THEN γ is f i (x1 /x2 / … xm ) i = 1/2/3 … n

The function (f i ) has a linear form generally as below:

f i (x1 /x2 / … xm ) = bi + a1 i x1 + a2 i x2 + ⋯ + am i xm

Where the coefficients (bi / aj i with j = 1/2/3 … m) represents the constants.


Third fuzzy system is singleton fuzzy system, in which fuzzy rules of the system
have the following form:

Rule R i : IF x1 is ℳ1 i x2 is ℳ2 i … xm is ℳm i

THEN γ is bi i = 1/2/3 … n

Where (bi ) represents a singleton like a real number. The singleton fuzzy
system is lately being called as piecewise multi-affine (PMA) system, because the
system input-output relationship regarding an affine incontrol system is
discovered to be in a form of a multi-affine function(7). These kind of fuzzy
systems are used to be called piecewise bilinear systems (PB), or biaffine systems
more exactly, because for the two dimensional case the system output is expressed
like below(6,8):

3
γ = ax1 + bx2 + cx1 x2 + d (1)

Because the fuzzy variables are employed in both of the consequent along with
the premise, the Mamdani fuzzy systems are comprehensible linguistically. The
T-S fuzzy systems, on the other hand, do not own the linguistic variables as solely
the functional membership functions (MFs) are applied without any labels.
Piecewise multi-affine systems (PMA) are a clarified particular case of both of the
previous fuzzy system types. As a matter of fact, piecewise multi-affine systems
(PMA) are Mamdani fuzzy systems but with a singleton consequent, they may
also be attained from the T-S fuzzy systems in the case when just the constants
present in the consequent. The T-S fuzzy systems are just apprehensive with the
fuzzy sets in the premise, on the other hand, the Mamdani fuzzy systems are
extremely apprehensive with the logic and fuzzy sets.

Piecewise multi-affine systems (PMA) are independent of the logic and fuzzy
sets, because neither membership functions (MFs) nor linguistic variables are
required to be used. In the piecewise multi-affine systems (PMA), these premises
functions have a triangular form and solely play roles like an interpolation
parameter, and they are not always regarded like a membership functions in the
typical fuzzy meaning. On the other hand, the piecewise multi-affine systems
(PMA) obtained from the Mamdani fuzzy systems can preserve their stature in the
fuzzy control, and if required, linguistic labels might be added to the singletons. It
is worth noting that all three categories of fuzzy systems have widespread
estimation capacity for non-linear functions. T-S fuzzy system models may
dramatically minimize the fuzzy rule numbers, mainly in the case of high
dimensional complicated systems(9,10). Researchers encountered many criticisms
from the traditional control theories over the first 10 years following the successful
implementation of fuzzy control by Mamdani as reported, and this was due to the

4
absence of the stability analysis for the fuzzy control back then (6,11). T-S fuzzy
systems were presented in 1985 for addressing these problems and criticisms.
Because the T-S fuzzy systems, in their consequents are related with the linear
type models, both of the model-based stability analysis process and control design
process may be carried out for fuzzy system through applying traditional
Lyapunovbased techniques. The T-S fuzzy modeling may be utilized to precisely
describe a nonlinear type system within a compact set of state space, in which the
nonlinearities are fixed within the membership functions (MFs). As a result,
making a non-conservative stability analysis for a given nonlinear system through
T-S fuzzy modeling techniques is nearly impossible(12,13).

For the purpose of overcoming this issues of T-S fuzzy models, piecewise
multi-affine (PMA) models were introduced. piecewise multi-affine (PMA)
models are totally parametric like linear type systems, however, in their nature
they are estimated models for nonlinear systems, based on this advantage, for
piecewise multi-affine (PMA) models, the required and adequate stability analysis
can be obtained like in the linear system conditions(14–16). In the recent years, fuzzy
logic control literature has grown quite rapidly, which makes it impossible to offer
a full and comprehensive review of the extensive variation of the applications that
have been developed.

5
2. Overview of Fuzzy Logic Control System (FLC)

Fuzzy logic is one of the Soft Computing techniques. Soft Computing is a


computational approach which is forbearing to sub optimality, imprecision,
vagueness, ambiguity, resulting in fast, convenient, and adequate solutions. In
order to formulate and develop a design for the fuzzy logic controller (FLC) for a
practicable application problem, the most essential step is identifying the state
variables that control the plant effectively. The figured out state variables go
through the fuzzification block for fuzzzifying the inputs since the fuzzy logic
control system deals only with fuzzy inputs. The fuzzy rule base applies rules on
the linguistic variables only, the numerical inputs must be changed to fuzzy
linguistic variables, and as the machines are able of dealing with crisp data like
the binary system (0 and 1) and can be assisted in handling ambiguous
linguistically data like low, high, medium in the case when the crisp inputs and
outputs are changed into linguistic variables beside the fuzzy components (1). The
linguistic variable possesses a label along with a meaning. This step of converting
the numerical state variable (crisp data) in to the fuzzy input linguistic variable or
membership functions (fuzzy set data) is called the Fuzzification process (figure
1)(17).

The used variables are mainly composing of state error, change rate of state
error (state error differentiation), or state error area (state error integration). The
membership functions (MFs) are graphical depictions of an element's extent of
belonging to the fuzzy set. Base on the required accuracy, various membership
functions for the input and output can be used. Triangular and trapezoidal
membership functions are the commonly used membership functions, Bell and
Gaussian shaped membership functions are also available. The control precision
enhances as the number of membership functions increase, and the control

6
operates efficiently. Time delay and complication because of the calculations rises
with the number of used membership functions for the linguistic variables. As a
result, the number of the membership functions to be utilized is a decision which
must be taken based on the required control capability and quickness.

Figure 1: Fuzzy logic controller(17).

Figure 2: Fuzzy logic control system(18).

7
The second step is the fuzzy inference process in which membership functions
and the control rules are combined together to obtain the fuzzy control output. The
derived outputs are organized in to a table which called lookup table. Fuzzy
inference process can be designed through applying two different methods,
Mamdani and Sugeno. The obtained outputs of these two methods differ slightly.
Fuzzy control system is shown in figure 2. The methods of Mamdani are the most
widely applied methods, this method anticipates the output variable to be the fuzzy
sets and it is preferable to use a single linguistic variable's membership function
rather than a large number of fuzzy sets, that may be monotonous in some
circumstances(1,17). This method in which a single linguistic variable is utilized in
output is known as Singleton output method. In designing the fuzzy inference
process with Sugeno method the output membership function is either a constant
or linear. Fuzzification of the inputs and implementing the fuzzy operators in the
Sugeno method are resemble to those of Mamdani method. If the input one is (𝑥)
and input two is (𝑦), then the output has a linear form as(1,19):

𝑂 = 𝐾𝑥 + 𝐿𝑦 + 𝑀 (2)

The output (𝑂) will be a constant for the Sugeno model of a zero order as:

𝐾=𝐿=𝑀 (3)

In fuzzy inference process, the fuzzy control rules are the most essential and
critical, these rules are as close as that of human being’s intuition and inference
for the action course. The third step is Defuzzification process which is reverse of
Fuzzification process, it is the process of converting the fuzzy control outputs from
the linguistic variables into crisp variables (crisp outputs). For working out the
relevant control outputs different methods including center of gravity (COG),

8
bisector of area, mean of maximum (MOM) have been applied, each of the control
outputs have to be organized into the lookup table. A fuzzy control output has to
be selected from the lookup table created in the previous step depending on the
present input for real life applications. Real life implementations are commonly
related with input variables of more than one dimension. In this case, the
membership functions for each of the dimensional variable must be developed
individually, and the related operation must be performed if the system has multi-
output variables(19). Fuzzy sets rely on the specific rules, the most essential
prerequisite for fuzzy logic is the rule base. The rule base is usually comprised of
several cases of (If-Then) rules. The fuzzy sets and the membership functions are
defined firstly. After that, the (If-Then) rules are decided for the membership
functions for the specific control, the outputs are manipulated through these rules
on the inputs. Typical (If-Then) rule comprises of two sections: antecedent and
conclusion or result. The antecedent part refers to (If) statement and the conclusion
part refers to (Then) statement in this manner: If − (antecedent) & Then −
(consequent). For instance: If the temperature is low, then increase the settings on
the air conditioner. In fuzzy logic, the AND, OR, and NOT Boolean logic
operators also exist, which are generally described as minimum, maximum, and
complement. These are called Zadeh operators once they are described in this
manner, due to being defined like this firstly in the original papers of Zadeh. For
(x) and (y) fuzzy variables(20,21):

NOT x = (1 − truth(x)) (4)

x AND y = minimum(truth(x), truth(y)) (5)

x OR y = maximum(truth(x), truth(y)) (6)

Other operators, such as hedges, are much more linguistic by nature and can
be used also, these are usually adverbs like very or somewhat, that adjust the set
9
meaning through a mathematical equation. In the fuzzy set each one of the
elements has a specific membership degree, in which it belongs to the certain fuzzy
set as below:

A = {(x μA (x))|xϵU} (7)

Considering two Fuzzy sets A and B in which (A, B) ϵ (U). The Universe of
Discourse is represented by (U), the principal set operations include: Complement,
Intersection and Union. The fuzzy set's Complement is described as a fuzzy set
with membership function revealed below:

μA (x) = 1 − μA (x)
̅̅̅ (8)

Intersection is described as the largest fuzzy set in both of A and B that


comprises both of the elements in set A and B, it can be represented as (A ∩ B) ,
the membership function for Intersection is given as:

μA∩B (x) = μA (x) ∩ μB (x) (9)

Union is described as the smallest set that includes all of the elements in set A
or B, it can be represented as (A+B) or A ∪ B and its membership is given as:

μA∪B (x) = μA (xμB ) ∪ (x) (10)

A fuzzy expert system is a system which employs fuzzy logic rather than
Boolean logic. The most widespread use of fuzzy logic is fuzzy expert systems,
they are utilized in variety of fields, like Financial systems, Pattern recognition,
along with Linear and nonlinear control(17).

10
3. Why Fuzzy Logic Control System?

Fuzzy logic control system is applied in variety of fields due to many reasons,
including the following(22,23):

 The concepts of fuzzy logic control system are easily understood.


 Fuzzy logic control system is both adaptable and flexible.
 Towards vague and imprecise type of data, fuzzy logic control system
is tolerant.
 Nonlinear functions with arbitrary complication may be modelled
using fuzzy logic concepts.
 Experience of specialists may be used to create fuzzy logic systems.
 Fuzzy logic control system can be used in conjunction with other
traditional control approaches.
 Fuzzy logic control system is suitable for cases where an estimated,
but quick response is required.

4. Advantages of Fuzzy Logic Control (FLC)

Fuzzy logic control system exhibits several advantages including the following
ones(23,24):

 Fuzzy logic control systems are easy for understanding, due to the
simple concepts of the control.
 Fuzzy logic control system has human-like instincts and intuitions,
giving it the ability to adjust the complications in the controlling.
 Fuzzy logic control system functions efficiently with disruptive and
noisy inputs.

11
 Fuzzy control system can be operated with multi-inputs and provide
multi-outputs because it only operates on rule basis. It is an easier task to create
the rule base for fuzzy logic control than optimizing the proportional integral
derivative (PID) control parameters.
 Whenever any sensor fails, fuzzy logic control system can be
programmed to switch-off securely and safely rather than keeping it on the
operating mode, that may be dangerous to the safety of the plant.
 Fuzzy logic control systems do not comprise of complex
mathematical analysis as a result, they are designed in a very easy manner.
 Fuzzy logic systems do not demand sensors with high precision and
accuracy but compensate for the exactness and precision making use of the
intuitive control that makes this approach considerably economical.
 Fuzzy logic system functions effectively even in highly nonlinear
systems adjusting to the circumstance. On the other hand, designing the other
conventional controllers for adapting in nonlinearity situation is considerably
a difficult task.
 Fuzzy system has a very simple user interface. Once the final user is
not a specialist, end-user interpretation is much easier.
 Easy calculation process, substantially presenting toolboxes along
with devoted integrated circuits.
 Ambiguousness, fuzzy logic represents a natural manner of revealing
the unknown knowledge and information. The available tools to the fuzzy logic
system assists in concluding various actions and responses based on the
probability or necessity of specific plant conditions.

12
5. Disadvantages of Fuzzy Logic Control (FLC)

Beside its advantages, fuzzy logic control system has some drawbacks
including(24,25):

 Experimental, in the industrial applications of a large scale manually


adjustment is required, re-adjusting is a time consuming process even when it
is implemented to a related plant in a different location.
 In adjusting (tuning) the fuzzy logic control system, the robust
performance trade-off is not commonly considered. In fuzzy logic system,
robustness is frequently presumed like a basic characteristic, but this is a
misconception. A normal manually adjusted fuzzy logic controller occur to be
robust owing to the fact that they do not use the full degree of the nonlinear
properties of the plant, so its efficiency is far from being strict and time
optimized, the nonaggressive manually adjusted proportional integral
derivative controller share similar features.
 Various localized parameters.
 Various unclear choices. Based on the conjunction, inference,
disjunction, and defuzzification process, hundreds of different configurations
of fuzzy logic system can arise, some of these alternative systems even stem
from the origin definition of fuzziness meaning.
 Various real applications are identical to the interpolation schemes of
lookup table.
 Commercial packages utilize files with nonstandard formats, and
have considerably huge software workload for an elementary application.
 Dimensionality, in models having multi-dimensions, the Cartesian
product of partitions is the most common method for establishing antecedents.
This is considerably ineffective also memory exhaustive setting for most of the

13
functions including linear functions. Other methods, like multi-layer neural
networks, can acquire and generalize even more effectively with much smaller
set of parameters including the number of neurons or rules, but in terms of cost
possibly the training development is slower and slighter understandability.
 Fuzzy logic control system requires a lot of data.
 Fuzzy logic control systems necessitate a high level of human
knowledge and proficiency.
 Regular updating of the rules with time is required in fuzzy logic
system.
 Fuzzy logic systems are comprehensible only in the case of being
simple.

6. Application of Fuzzy Logic Control System

The fuzzy logic system is used in a variety of disciplines, as listed


below(23,26,27):

 Subsystems of automobiles and other vehicles, including automated


transmissions, and cruise control.
 Air conditioning systems.
 Cameras.
 Digital image processing work like edge detection.
 Rice cookers.
 Elevators.
 Appliances such as washing machines and other household devices.
 Artificial intelligence in video games.
 Pattern recognition within the Remote Sensing.

14
 Algorithms for hydrometeor categorization in polarimetric weather
radar.
 Mineral deposit approximations.
 Fuzzy logic control systems have also been included in some of the
microprocessor and microcontroller.

7. Case Study

7.1 Air Conditioning Control System

In this study, a fuzzy logic controller was developed for Air Condition control
system for the purpose of controlling operation mode, fin direction, fan speed,
compressor motor speed for maintaining the room temperature at the set point or
close to it along with saving energy and preventing the system form damage. This
system comprises of four basic sensors for feedback control: the first one for input
electric volt that applied for keeping the system devices from damage caused by
varying voltages, second one for temperature, third one for humidity, and the
fourth one for dew point. MATLAB is used to simulate the Fuzzy logic algorithm
for the Air Conditioning Control System in this study. The Air Conditioning Fuzzy
logic control System takes into account four variables as below(28):

1. User temperature (16℃→30℃ continual control mode).


2. Actual temperature.
3. dew point temperature.
4. Electricity Volt.

Before directing the system data to fuzzification step, the user temperature is
subtracted from the actual temperature. These variables are subjected to a fuzzy

15
arithmetic and criteria step, with the final result being Defuzzified to obtain the
following crisp results as illustrated in figure (3):

1. Compressor Speed.
2. Fan Speed.
3. Mood of Operation.
4. Fin Direction.

Figure 3: Basic block diagram of FLC system(28).

In this system, the membership function for each of the input variables and
output variables are defined individually. The input variables include following:

 User temperature (UT): User temperature which received through the


electronic, thermostat, are represented via three membership functions as low,
optimal, and high as shown in table (1).

16
Table 1: Classification of user temperature (UT)

1 x ≤ 22
25−x
μlow (x) = { 22 ≤ x ≤ 25 (11)
3
0 other wise
x−22
22 ≤ x ≤ 25
3
μoptimal (x) = {28−x (12)
25 ≤ x ≤ 28
3

x−25
25 ≤ x ≤ 28
3
μhigh (x) = f(x) = { 1 28 ≤ x ≤ 30 (13)
0 other wise

17
 Temperature difference (Tdif): The difference in between the actual
room temperature and the user temperature are represented through four
membership functions as negative, zero, positive, and large as shown in table
(2).

Table 2: Classification of Temperature Difference (Tdif)

1 − 1 ≤ x ≤ −0.9
μnegative (x) = { −0.9x − 0.9 ≤ x ≤ 0 (14)
0 other wise
2(x + 0.5) − 0.5 ≤ x ≤ 0
μzero (x) = { (15)
2(0.5 − x) 0 ≤ x ≤ 0.5

x 0≤x≤1
μpositive (x) = { (16)
2−x 1≤x≤2

18
1−x 1≤x≤2
μnegative (x) = {1 2≤x≤3 (17)
0 other wise

 Dew Point (Td): The term dew point defines information regarding
dew point temperature within the room, two membership functions are used for
dew point as optimal, humid as shown in table (3).

Table 3: Classification of Dew Point (Td)

1 10 ≤ x ≤ 11
14−x
μoptimal (x) = { 3
11 ≤ x ≤ 14 (18)
0 other wise

19
x−12
12 ≤ x ≤ 15
3
μhumid (x) = { 1 15 ≤ x ≤ 18 (19)
0 other wise

 Electric Volt (EV): Electric volt defines the information regarding


alternating volt which differs, after that based on that difference through
controlling in fan and compressor for standing by or functioning like rule listed.
Two membership functions as low, regular are used as shown in table (4).

Table 4: Classification of Electric Volt (EV)

1 130 ≤ x ≤ 160
180−x
μlow (x) = { 20 160 ≤ x ≤ 180 (20)
0 other wise

20
x−170
170 ≤ x ≤ 190
20
μregular (x) = {1 190 ≤ x ≤ 220 (21)
0 other wise

The output membership functions are given as below:

 Compressor Speed (SC): Compressor speed is specified as low,


medium and high, with a range of (0 −100 %), for evaluating the membership
function through scaling the ranges from (0-100) depending on the speed, the
calculated membership functions along with the range are shown in table (5).

Table 5: Classification of Compressor Speed (SC)

21
1 0 ≤ x ≤ 30
50−x
μlow (x) = { 30 ≤ x ≤ 50 (22)
20
0 other wise
x−40
40 ≤ x ≤ 60
20
μmedium (x) = { 80−x 60 ≤ x ≤ 80 (23)
20
0 other wise
x−70
70 ≤ x ≤ 90
20
μfast (x) = { 1 90 ≤ x ≤ 100 (24)
0 other wise

 Fan Speed (Fc): Fan speed is specified as low, medium and high with
a range of (0−100 %), for calculating the membership functions through
scaling the ranges from (0-100) depending on the speed, the calculated
membership functions along with the range are shown in table (6).

Table 6: Classification of Fan Speed (FC)

22
1 0 ≤ x ≤ 30
50−x
μlow (x) = { 30 ≤ x ≤ 50 (25)
20
0 other wise
x−40
40 ≤ x ≤ 60
20
μmedium = { 80−x
60 ≤ x ≤ 80 (26)
20
0 other wise
x−70
70 ≤ x ≤ 90
20
μfast (x) = { 1 90 ≤ x ≤ 100 (27)
0 other wise

 Mode of operation (Mo): The mode of operation determines whether


the air conditioner functions solely as a dehumidifier or as a regular air
conditioner.

23
 Fin direction (Fn): Fin directions manages the air from air condition towards
or aside from inhabitant. Presuming the top mounted air condition case, θ =
0° can be taken into account like towards and θ = 90° like aside from the
inhabitant.

It was concluded from this study that fuzzy control system exhibited a good
performance concerning the controlling process of the air conditioning system.

24
7.2 Fluid Level Control

In this study a fuzzy logic based system was designed for the purpose of
controlling the fluid level in a tank at the desired set point in a short period of time
through an adjustment in the output valve. The system comprises of two inputs
which are error and change in the error, along with one output which is output
valve. For controlling the inlet flow and the outlet flow of the fluid within the tank,
the controller has to read the level of fluid along with its flowrate at every single
sampling period. MATALB program was applied for designing a simulation of
the system. The MATALB fuzzy logic toolkit was used for designing the fuzzy
logic controller, and the tank simulations were carried out in Simulink. The
function of the controller is controlling the water tank inlet valve based on the
amount of the fluid needed in the tank depending on the outlet flow. Base on the
various probabilities of inputs, the output valve is controlled through fuzzy logic
controller. Mamdani method was used in designing the fuzzy logic controller for
this system(29).

First Input:

The first input is defined like E (Error) which has three membership functions
as negative, ok and positive shown in figure (5). The first membership function is
negative and ranging from (−1 to 0), the second membership function is ok and
ranging from (−0.6746 to 0.659), and the third membership function is positive
which ranges from (0 to 1).

Second Input:

The second input is defined as CE (Change in the Error), it has two


membership functions as negative and positive shown in figure (5). The first

25
membership function is negative and ranging from (−0.1 to 0), and the second
membership function is positive ranging from (0 to 0.1).

Output:

The output is defined as OV (Output Valve), which has five membership


functions as close slowly, open slowly, no change, close fast and open fast shown
in figure (4). The first membership function is (close fast) and ranging from (−1
to −0.8), second membership function is (close slowly) and ranging from (−0.6
to −0.4), third membership function is (no change) and ranging from (−0.1 to
0.1), fourth membership function is (open slowly) and ranging from (0.4 to 0.6),
and fifth membership function is (open fast) ranging from (0.8 to 1).

Figure 4: Output of fuzzy logic based system(29).

26
Figure 5: Inputs of fuzzy logic based system(29).

27
Rules for Opening and Closing Valve of Tank:

The fuzzy logic controller design depends on the rules which are described in
the MATLAB/fuzzy rule editor, the applied rules depend on the mamdani
inference method as shown in figure (6). The design of the controller is based on
the five rules as bellow:

Rule 1

If there is no distinction between the inlet flow and outlet flow of the fluid
within the tank, then the error is (ok) and there will be no adjust in the valve
position.

Rule 2

If the distinction between the outlet flow and the inlet flow of the fluid within
the tank is positive, for instance the water flows out from the tank more than it is
being added to it, then for balancing the inlet flow and the outlet flow the valve
will be opened fast.
IF (E) is positive (P) and CE is ZE then OV is open fast (OF).

Rule 3

If the distinction between the outlet flow and inlet flow of the fluid within the
tank is negative, for instance the inlet flow of water is more than its outlet flow,
then for balancing that difference and reducing the inlet flow the valve will be
closed fast. IF E is negative (N) and CE is ZE then OV is close fast (CF).

Rule 4

If there is no distinction between the outlet flow and inlet flow of the fluid
within the tank just a slight distinction between water entering and leaving the

28
tank, then for balancing the flow the valve will close slowly.
IF E is OK and CE is P then OV is close slow (CS).

Rule 5

If the error between the outlet flow and inlet flow of the fluid within the tank
is (ok) but the water is flowing out from the tank a little more than its flowing in,
then for balancing the water flow the valve will open slowly.
IF E is OK AND CE is N then OV is open slow (OS).

The above rules can be written in table (7)

Figure 6: Rule editor in MATLAB/Fuzzy logic toolkit(29).

29
Table 7: Rules for implementation of fuzzy controller

Calculation of OV

The rule viewer demonstrates how the overall result is affected by the shape of
the membership functions, as shown in figure (7). The output valve (OV)
mathematical calculations shown on the rule viewer are represented below:

Considering two points from the rule viewer as 0.3486 on the first input along
with 0.7545 on the second input, in the first rule the index of 𝑒(𝑡) is at 0.38, so
𝐷𝑒𝑔𝑟𝑒𝑒 𝑜𝑓 𝑓𝑟𝑒𝑒𝑑𝑜𝑚 = 𝐷𝑂𝐹1 = 𝛼1 = 0.38

In 2𝑛𝑑 rule, index of “e(t)” is at 0.38

Degree of freedom = 𝐷𝑂𝐹2 = 𝛼1 = 0.38

In 3𝑟𝑑 rule, index of “e(t)” is at 0

Degree of freedom = 𝐷𝑂𝐹3 = 𝛼1 = 0

In 4𝑡ℎ rule, index of “e(t)” is at 0.38 and that of “change” is 1

Degree of freedom = 𝐷𝑂𝐹4 = 𝛼1 ⋀ 𝛼2 = 0.38 ⋀ 1 = 0.38

In 5𝑡ℎ rule, index of “e(t)” is at 0.39 and that of “change” is 0

Degree of freedom = 𝐷𝑂𝐹5 = 𝛼1 ⋀ 𝛼2 = 0.38 ⋀ 0 = 0

Integration for all DOFs by Mamdani method:

30
𝛼𝑜𝑢𝑡 = 𝐷𝑂𝐹1 ⋀ 𝐷𝑂𝐹2 ⋀𝐷𝑂𝐹3 ⋀ 𝐷𝑂𝐹4 ⋀ 𝐷𝑂𝐹5 (28)

𝛼𝑜𝑢𝑡 = 0.38 + 0.38 + 0 + 0.38 + 0

𝛼𝑜𝑢𝑡 = 0.114

Figure 7: Rule viewer of fuzzy logic controller(29).

In this study same process has been carried out by using PID controller, and
the results were compared to those of fuzzy logic controller (FLC), it can be seen
form figure (8) that PID controller has less rise time but a longer overshoot and
more settling time at about 15 seconds. However, fuzzy logic controller has a little
overshoot also a steady-state error along with stabilizing quickly which gives an
accurate and precise level control at desired value. The suggested fuzzy logic
controller gives smooth operation in the transient period. The output of PID
controller stabilizes in 15 seconds while that of fuzzy logic controller just in 4
seconds. As a result, it is concluded through this study that
the traditional PID controller could not be applied for controlling the non-linear
processes such as level control. The fuzzy output may be made more precise

31
through fine tuning like adjustment of the range parameters. The implementation
of fuzzy controller and PID controller in Simulink are shown in figure (9).

Figure 8: Simulation results of fuzzy logic and PID controllers(29).

Figure 9: Implementation of fuzzy controller and PID controller in


Simulink(29).

32
Conclusions

Fuzzy logic control (FLC) has shown to be a useful technique for handling
systems with uncertainties, inaccuracy along with complex systems. In several
industrial circumstances, in which the process models are either imprecise or
completely absent, fuzzy logic system in able to integrate the control along with
managing the tasks in a user friendly manner and accommodating the proportional
integral derivative (PID) approaches. Despite the fact that fuzzy logic control
systems exhibit a variety of advantages in many different situations but they
require a lot of data, necessitate a high level of human knowledge, and they are
understandable only in the case of being simple. Fuzzy logic control systems are
frequently used in combination with other systems and hybrid fuzzy systems
appeared to be more effective than pure fuzzy systems in variety of applications.
From this review it can be concluded that further improvements are required
regarding the design and modeling of fuzzy logic control along with enhancing its
performance.

33
References

(1) Bai Y, Wang D. Fundamentals of Fuzzy Logic Control — Fuzzy Sets,


Fuzzy Rules and Defuzzifications BT - Advanced Fuzzy Logic
Technologies in Industrial Applications. 2006;17–36.

(2) Terzi Ö, Erol Keskin M, Dilek Taylan E. Estimating Evaporation Using


ANFIS. J Irrig Drain Eng. 2006;132(5):503–7.

(3) Partal T, Kişi Ö. Wavelet and neuro-fuzzy conjunction model for


precipitation forecasting. J Hydrol. 2007;342(1–2):199–212.

(4) Guan J, Aral MM. Remediation System Design with Multiple Uncertain
Parameters Using Fuzzy Sets and Genetic Algorithm. J Hydrol Eng.
2005;10(5):386–94.

(5) Han JC, Huang GH, Zhang H, Zhuge YS, He L. Fuzzy constrained
optimization of eco-friendly reservoir operation using self-adaptive genetic
algorithm: A case study of a cascade reservoir system in the Yalong River,
China. Ecohydrology. 2012;5(6):768–78.

(6) Guerra TM, Sala A, Tanaka K. Fuzzy control turns 50: 10 years later.
Fuzzy Sets Syst. 2015;281:168–82.

(7) A.-T. Nguyen, M. Sugeno, V. Campos and MD. LMI-based stability


analysis for piecewise multi-affine systems. IEEE Comput Intell Mag.
2017;25(3):707–714.

(8) Kim E. A new computational approach to stability analysis and synthesis


of linguistic fuzzy control system. IEEE Trans Fuzzy Syst.
2004;12(3):379–388.

(9) Li L, Chadli M, Ding SX, Qiu J, Yang Y. Diagnostic Observer Design for
T-S Fuzzy Systems: Application to Real-Time-Weighted Fault-Detection
34
Approach. IEEE Trans Fuzzy Syst. 2018;26(2):805–16.

(10) Lam HK. A review on stability analysis of continuous-time fuzzy-model-


based control systems: From membership-function-independent to
membership-function-dependent analysis. Eng Appl Artif Intell [Internet].
2018;67(September):390–408. Available from:
https://doi.org/10.1016/j.engappai.2017.09.007

(11) A. Sala, T.-M. Guerra and RB. Perspectives of fuzzy systems and control.
Fuzzy Sets Syst. 2005;156(3):432–444.

(12) Kazuo Tanaka HOW. Fuzzy Control Systems Design and Analysis: A
Linear Matrix Inequality Approach. 2004. 320 p.

(13) Sala A. On the conservativeness of fuzzy and fuzzy-polynomial control of


nonlinear systems. Annu Rev Control. 2009;33(1):48–58.

(14) Nguyen AT, Tanaka K, Dequidt A, Dambrine M. Static output feedback


design for a class of constrained Takagi–Sugeno fuzzy systems. J Franklin
Inst [Internet]. 2017;354(7):2856–70. Available from:
http://dx.doi.org/10.1016/j.jfranklin.2017.02.017

(15) Campos VCS, Torres LAB, Palhares RM. Using information on


membership function shapes in asymptotically exact triangulation
approaches. Proc IEEE Conf Decis Control. 2012;6205–10.

(16) Sugeno M, Taniguchi T. On Improvement of Stability Conditions for


Continuous Mamdani-Like Fuzzy Systems. IEEE Trans Syst Man, Cybern
Part B Cybern. 2004;34(1):120–31.

(17) Bhattacharjee D, Kim W, Chattopadhyay A, Waser R, Rana V. Multi-


valued and Fuzzy Logic Realization using TaOx Memristive Devices. Sci
Rep [Internet]. 2018;8(1):2–11. Available from:

35
http://dx.doi.org/10.1038/s41598-017-18329-3

(18) Roland S.Burns. Advanced Control Engineering. Adv Control Eng. 2001;

(19) Shukla PK, Tripathi SP. On the design of Interpretable Evolutionary Fuzzy
Systems (I-EFS) with improved accuracy. Proc Turing 100 - Int Conf
Comput Sci ICCS 2012. 2012;11–4.

(20) Chen G. Introduction to Fuzzy Sets, Fuzzy Logic, and Fuzzy Control
Systems. 2001.

(21) Alcalá R, Alcalá-Fdez J, Herrera F, Otero J. Genetic learning of accurate


and compact fuzzy rule based systems based on the 2-tuples linguistic
representation. Int J Approx Reason. 2007;44(1):45–64.

(22) Alcalá R, Alcalá-Fdez J, Casillas J, Cordón O, Herrera F. Hybrid learning


models to get the interpretability - Accuracy trade-off in fuzzy modeling.
Soft Comput. 2006;10(9):717–34.

(23) Ross TJ. Fuzzy Logic with Engineering Applications: Third Edition. Fuzzy
Logic with Engineering Applications: Third Edition. 2010.

(24) Sala A, Albertos P. Fuzzy Logic Controllers: Advantages and Drawbacks.


Annu Rev Control. 2009;33(1):48–58.

(25) Ramirez EM, Mayorga R V. On the Parameter Optimization of Fuzzy


Inference Systems. Eng Technol. 2008;2(6):735–48.

(26) Zeng J, An M, Smith NJ. Application of a fuzzy based decision making


methodology to construction project risk assessment. Int J Proj Manag.
2007;25(6):589–600.

(27) Etik N, Allahverdi N, Sert IU, Saritas I. Fuzzy expert system design for
operating room air-condition control systems. Expert Syst Appl [Internet].

36
2009;36(6):9753–8. Available from:
http://dx.doi.org/10.1016/j.eswa.2009.02.028

(28) Mohamed S, Mohamed W. Developing of Fuzzy Logic Controller for Air


Condition System. Int J Comput Appl. 2015;126(15):1–8.

(29) Shahid H, Murawwat S, Ahmed I, Naseer S, Fiaz R, Afzaal A, et al.


Design of a Fuzzy Logic Based Controller for Fluid Level Application.
World J Eng Technol. 2016;04(03):469–76.

37

You might also like