You are on page 1of 30

Neural Network and Fuzzy

Logic Control
Paper Code-PE-EC702C
(ECE/7th Sem.)
Dr. Tarun Kumar Das
Associate Professor
ECE Dept., FIEM
FUZZY LOGIC CONTROLLER
Fuzzy Logic Controller:
 Fuzzy Logic Controller (FLC) was first developed by Mamdani and
Assilian around 1975.
 The performance of an FLC depends on its Knowledge Base (KB).
 KB consists of
(a) Data Base (DB) (data related to membership function distributions of
the variables of the process to be controlled)
(b) Rule Base (RB)
 Four ways to design a proper KB:
• Optimization of the DB only
• Optimization of the RB only
• Optimization of the DB and RB in stages
• Optimization of the DB and RB simultaneously
Major Forms of Fuzzy Logic
Controller
(1) Linguistic fuzzy modeling
Proposed by Mamdani
Characterized by its high interpretability and low accuracy
(2) Precise Fuzzy Modeling
 Proposed by Takagi and Sugeno
 Characterized by its high accuracy, but limited
interpretability
Interpretability and Accuracy of a Fuzzy
Modeling
 Interpretability is defined as its capability to express
the behavior of a system in an understandable form.
 It is generally expressed in terms of compactness,
completeness, consistency and transparency.
 The accuracy of a fuzzy model indicates how closely
it can represent the modeled system.
Mamdani Approach

A schematic view showing the working cycle of an FLC


Steps in the Working Cycle of an FLC
[1] The condition (also known as antecedent) and action
(also called consequent) variables needed to control a
process are identified and measurements are taken of all
the condition variables.
[2] The measurements are converted into appropriate fuzzy
sets to express measurement uncertainties. This process is
known as fuzzification.
[3] The fuzzified measurements are then used by inference
engine to evaluate the control rules stored in the fuzzy
rule base and a fuzzified output is determined.
Steps in the Working Cycle of an FLC
[4] The fuzzified output is then converted into a single crisp
value. This conversion is called de-fuzzification.
[5] The de-fuzzified values represent the actions to be taken
by the FLC in controlling the process.
Schematic View for the Working Principle
of an FLC
Explanation
• Let us assume that only two fuzzy control rules (out of many
rules present in the rule base) are being fired as given below
for a set of inputs: (s1∗, s2∗):
 Rule 1: IF s1 is A1 AND s2 is B1 THEN f is C1
 Rule 2: IF s1 is A2 AND s2 is B2 THEN f is C2
•If s1∗ and s2∗ are the inputs for fuzzy variables: s1 and s2 and if
μA1 and μB1 are the membership function values for A and B,
respectively, then the grade of membership of s1∗ in A1 and that of
s2∗ in B1 are represented by μA1(s1∗) and μB1(s2∗), respectively,
for rule 1.
•Similarly, for rule 2, μA2(s1∗) and μB2(s2∗) are used to represent
the membership function values.
Explanation (contd.)
• The firing strengths of the first and second rules are
calculated as follows:
 α1 = min(μA1(s1∗), μB1(s2∗))
 α2 = min(μA2(s1∗), μB2(s2∗))
• The membership value of the combined control action
C is given by
 μC(f′) = max(μ*C1(f′), μ*C2(f′))
Different methods of Defuzzification
• Center of Sums Method: In this method of
defuzzification the crisp output can be determined as
follows:

where U′f′ is the output of the


controller, A(αj) represents the
firing area of j-th rule, p is the
total number of the fired rules
and fj represents the center of
the area.
Different methods of Defuzzification
• Centroid Method: The total area of the membership function
distribution used to represent the combined control action is
divided into a number of standard sub-areas, whose area and
the center of area can be determined easily.
• The crisp output of the controller can be calculated using the
expression given below.

where N indicates the number of


small areas or regions, Ai and fi
represent the area and center of
area, respectively of i-th small
region.
Different methods of Defuzzification
• Mean of Maxima Method: From the membership function
distribution of combined control action, the range of the output
variable corresponding to the maximum value of membership
is identified.
• The mid-value of this range is considered to be the crisp output
of the controller.
Case Study-1
Navigation of a mobile robot in the presence of four moving obstacles

The obstacle O2 is
found to be the most
critical one.
Primary aim is to
develop a fuzzy logic-
based motion planner
that will be able to
generate the collision-
free path for the robot.
Case Study-1 (contd.)
• There are two inputs, namely the distance between the robot
and the obstacle (D) and angle (GSO2 ) for the motion planner
and it will generate one output, that is deviation.
• Distance is represented using four linguistic terms, namely
Very Near (VN), Near (NR), Far (FR) and Very Far (VFR).
• Another input: angle and output: deviation are expressed with
the help of five linguistic terms, such as Ahead (A), Ahead
Left (AL), Left (LT), Ahead Right (ART) and Right (RT).
Case Study-1 (contd.)
Data Base of the fuzzy logic controller
Case Study-1 (contd.)
Rule Base of the fuzzy logic controller
Problem Statement
 Determine the output - deviation for the set of inputs: distance
D = 1.04 m and angle GSO2 = 30 degrees, using Mamdani
Approach. Use different methods of defuzzification.
Solution:
• The inputs are: Distance = 1.04 m, Angle = 30 degrees
• The distance of 1.04 m may be called either NR (Near) or FR
(Far).
• Similarly, the input angle of 30 degrees can be declared either
A (Ahead) or ART (Ahead Right).
Solution (contd.)
Schematic view used to
determine the membership
value corresponding to the
distance of 1.04 m.

•Using the principle of similar triangle, we can write the following


relationship:

•From the above expression, x is found to be equal to 0.6571. Thus,


the distance of 1.04 m may be declared NR with a membership
value of 0.6571, that is, μNR = 0.6571.
Solution (contd.)

•Similarly, the distance of 1.04 m can also be called FR with a


membership value of 0.3429, that is, μFR = 0.3429.
Solution (contd.)
• In the same way, an input angle of 30 degrees may be declared
either A with a membership value of 0.3333 (that is, μA = 0.3333) or
ART with a membership value of 0.6667 (that is, μART = 0.6667).
Solution (contd.)
 For the above set of inputs, the following four rules are being
fired from a total of 20:
• If Distance is NR AND Angle is A Then Deviation is RT
• If Distance is NR AND Angle is ART Then Deviation is A
• If Distance is FR AND Angle is A Then Deviation is ART
• If Distance is FR AND Angle is ART Then Deviation is A
 The strengths (α values) of the fired rules are calculated as
follows:
• α1 = min(μNR, μA)) = min (0.6571, 0.3333)) = 0.3333
• α2 = min(μNR, μART)) = min (0.6571, 0.6667)) = 0.6571
• α3 = min(μFR, μA)) = min (0.3429, 0.3333)) = 0.3333
• α4 = min(μFR, μART)) = min (0.3429, 0.6667)) = 0.3429
Solution (contd.)

Fuzzified outputs corresponding to above four fired rules


Solution (contd.)

Union of the fuzzified outputs, corresponding to the above four fired rules

The above fuzzified output cannot be used as a control action


and its crisp value has been determined using the following
methods of defuzzification:
1. Center of Sums Method
2. Centroid Method
3. Mean of Maxima
Center of Sums Method

Defuzzification using the Center


of Sums Method

Observations:
The crisp output U of above four fired rules can be calculated as follows:

= 19.5809

Therefore, the robot should deviate by 19.5809 degrees towards right with respect to the
line joining the present position of the robot and the goal to avoid collision with the obstacle.
Centroid Method

Defuzzification using the Centroid


Method

Observations:
A= 9.7151×(−25.2860)+20.2788×0.0+2.3588×20.2870+24.8540×52.7153,
B = 9.7151 + 20.2788 + 2.3588 + 24.8540. Therefore, U turns out to be equal to 19.4450.
Thus, the robot should deviate by 19.4450 degrees towards right with respect to the line
joining the present position of the robot and the goal to avoid collision with the obstacle.
Mean of Maxima

Defuzzification using the Mean of Maxima Method


Observations:
It is observed that the maximum value of membership (that is, 0.6571) has
occurred in a range of deviation angle starting from −15.4305 to 15.4305
degrees.
Thus, its mean is coming out to be equal to 0.0. Therefore, the crisp output
U of the controller becomes equal to 0.0, that is, U = 0.0.
The robot will move along the line joining its present position and the
goal.
Case Study-2
Aircraft Landing Control Problem

The desired profile of downward velocity versus altitude

The desired downward velocity is proportional to the square of the height.


Thus, at higher altitudes, a large downward velocity is desired.
As the height (altitude) diminishes, the desired downward velocity gets smaller and
smaller.
In the limit, as the height becomes vanishingly small, the downward velocity also goes
to zero.
 In this way, the aircraft will descend from altitude promptly but will touch down very
gently to avoid damage.
Thank you

You might also like