FL 4 Fuzzy Logic Controller PDF
FL 4 Fuzzy Logic Controller PDF
Debasis Samanta
IIT Kharagpur
[email protected]
12.02.2018
Fuzzy Controller
Defuzzification actions
module Input
Output
Fuzzification
module Conditions
Figure 1
Debasis Samanta (IIT Kharagpur) Soft Computing Applications 12.02.2018 4 / 34
Fuzzy Systems : Fuzzy Logic Controller
4 a defuzzification module.
1 Mamdani approach
O2
O3
D
O1 O4
R S
D 1.0
VN NR FR VF 1.0
0.0
1.04
0.1 0.8 1.5 2.2
Distance D in mt
LT AL AA AR RT
1.0 LT AL AA AR RT
1.0
0.0 0.0
-90 -45 0 45 90 -90 90
-45 0 45
Once the fuzzy sets of all parameters are worked out, our next step in
FLC design is to decide fuzzy rule base of the FLC.
The rule base for the FLC of mobile robot is shown in the form of a
table below.
LT AL AA AR RT
VN AA AR AL AL AA
NR AA AA RT AA AA
FR AA AA AR AA AA
VF AA AA AA AA AA
Note that this rule base defines 20 rules for all possible instances.
These rules are simple rules and take in the following forms.
From the given fuzzy sets and input parameters’ values, we say
that the distance D = 1.04m may be called as either NR (near) or
FR (far).
NR FR AA AR
1.0 1.0
0.0 0.0
0.1 0.8 1.5 2.2 0 45
-45 y
x
1.04 30
NR FR AA AR
1.0 1.0
0.0 0.0
0.1 0.8 1.5 2.2 0 45
-45 y
x
1.04 30
x 1.5−1.04
Thus, 1 = 1.5−0.8 , that is, x = 0.6571
y
x
1
2
There are many rules in the rule base and all rules may not be
applicable.
For the given x = 1.04 and θ = 30o , only following four rules out of 20
rules are firable.
The strength (also called α values) of the firable rules are calculated as
follows.
α(R1) = min(µNR (x), µAA (y)) = min(0.6571, 0.3333) = 0.3333
In practice, all rules which are above certain threshold value of rule
strngth are selected for the output computation.
Suppose, s1∗ and s2∗ are the inputs for fuzzy variables s1 and s2 . µA1 ,
µA2 , µB1 , µB2 , µC1 and µC2 are the membership values for different
fuzzy sets.
A1 B1 C1
A2 B2 C 2 C
Combine output
s1* s2*
Note:
1.0
R1 :
0.3333
0.0
0.8 1.5 0 45 45 90
NR AR AA
1.0
R2 :
0.6571
0.0
0.8 1.5 0 45 -45 0 45
AA AR
1.0
R3 :
0.3333
0.0
0 45 90
0.8 1.5 0 45
1.0 AR AA
R4 :
0.3333
0.0
-45 0 45
0.8 1.5 0 45
D=1.04 Ɵ = 30
AA AR RT
-45 0 45 90
The fuzzy output needs to be defuzzified and its crisp value has to be
determined for the output to take decision.
12.5×71+25×45+25.56×0+25.56×0
v= 12.5+39.79+25+25.56 = 19.59
39.7/0
AA AR RT
1.0
0.5 A3
0.6571 0.34 A2
A4 0.3333
A1
-45 0 45 90
Consider two inputs I1 and I2 . These two inputs have the following
linguistic states :
Note:
I I 2
1 L M H NR FR VF
1.0 1.0
c) For the input set, following four rules can be fired out of all 9 rules.
R1: I1 is L and I2 is FR
R2: I1 is L and I2 is VF
R3: I1 is M and I2 is FR
R4: I1 is M and I2 is VF
d) Now, the weights for each of the above rules can be determined as
follows.
R1: w 1 = µL × µFR = 0.8 × 0.8 = 0.6
R2: w 2 = µL × µVF = 0.8 × 0.2 = 0.16
R3: w 3 = µM × µFR = 0.2 × 0.8 = 0.16
R4: w 4 = µM × µVF = 0.2 × 0.2 = 0.6
e) The functional consequent values for each rules can be calculated
as below.
y 1 = I1 + 2I2 = 6.0 + 2 × 2.2 = 10.4
y 2 = I1 + 3I2 = 6.0 + 3 × 2.2 = 12.6
y 3 = 2I1 + 2I2 = 2 × 6.0 + 2 × 2.2 = 16.4
y 4 = 2I1 + 3I2 = 2 × 6.0 + 3 × 2.2 = 18.6