SlideShare a Scribd company logo
1 of 57
Download to read offline
FUZZY LOGIC
Menoufia University
Faculty of Electronic Engineering
4/2020
2 of 57
References08
07 Fuzzy on Simulink
05 Fuzzy at the Cmd line
06 PID โ€“ Fuzzy controller
Agenda
Introduction to Fuzzy01
Fuzzification &
Defuzzification
02
Fuzzy application03
04 FIS tool
3 of 57
0
0.5
1
0 1 2 3 4 5 6 7 8 9 10
๐žต(x)
x
Classical control
theory
1 0
On off
Yes No
4 of 57
Classical set
theory
๐ด = 0.1,0.3,0.5 & ๐ต = {0.2,0.3,0.5,0.7}
๐’–๐’๐’Š๐’๐’ โˆถ ๐ด โˆช ๐ต = {0.1,0.2,0.3,0.5,0.7}
๐’Š๐’๐’•๐’†๐’“๐’”๐’†๐’„๐’•๐’Š๐’๐’ โˆถ ๐ด โˆฉ ๐ต = {0.3,0.5}
๐’…๐’Š๐’‡๐’‡๐’†๐’“๐’†๐’๐’„๐’† โˆถ ๐ด โˆ’ ๐ต = {0.1}
๐’„๐’๐’Ž๐’‘๐’๐’†๐’Ž๐’†๐’๐’•: าง๐ด = 0.9,0.7,0.5
๐’„๐’‚๐’“๐’•๐’†๐’”๐’Š๐’‚๐’ ๐’‘๐’“๐’๐’…๐’–๐’„๐’• โˆถ ๐ด ร— ๐ต
๐’…๐’†๐’Ž๐’๐’“๐’ˆ๐’†๐’โ€ฒ
๐’” ๐’๐’‚๐’˜ โˆถ ๐ด โˆฉ ๐ต โ€ฒ
= ๐ดโ€ฒ โˆช ๐ตโ€ฒ
0.1
0.3
0.5
A
0.7
0.2
B
5 of 57
Crisp set Vs Fuzzy set
6 of 57
What Fuzzy Systems?
Confused
vague
blurred
7 of 57
Fuzzy
he wrote that to handle biological systems "we need a radically
different kind of mathematics, the mathematics of fuzzy or cloudy
quantities which are not describable in terms of probability distributions"
1962
1965
Classical
control
Is a 160 m person is tall ?
True
Possibly True
8 of 57
Types of membership function
๐ ๐’™ =
๐ŸŽ , ๐’™ โ‰ค ๐’‚
๐’™ โˆ’ ๐’‚
๐’ƒ โˆ’ ๐’‚
, ๐’‚ โ‰ค ๐’™ โ‰ค ๐’ƒ
๐’„ โˆ’ ๐’™
๐’„ โˆ’ ๐’ƒ
, ๐’ƒ โ‰ค ๐’™ โ‰ค ๐’„
๐ŸŽ , ๐’™ โ‰ฅ ๐’„
Triangular
๐ ๐’™ =
๐ŸŽ , ๐’™ โ‰ค ๐’‚
๐’™ โˆ’ ๐’‚
๐’ƒ โˆ’ ๐’‚
, ๐’‚ โ‰ค ๐’™ โ‰ค ๐’ƒ
๐Ÿ , ๐’ƒ โ‰ค ๐’™ โ‰ค ๐’„
๐’„ โˆ’ ๐’™
๐’„ โˆ’ ๐’ƒ
, ๐’„ โ‰ค ๐’™ โ‰ค ๐’…
๐ŸŽ , ๐’™ โ‰ฅ ๐’…
Trapezoidal
๐ ๐’™ = ๐’†๐’™๐’‘
โˆ’ ๐’™ โˆ’ ๐’„ ๐Ÿ
๐Ÿ๐ˆ ๐Ÿ
Gaussian
9 of 57
speed [m/s]
Human
knowledge-based
Rule-based
Fuzzy
IF AND
THEN
distance
speed
acceleration
small
speed is declining
maintain
IF distance perfect AND
speed is declining
THEN increase acceleration
10 of 57
a self-parking car in 1983
Nissan has a patent saves
fuel
F U Z Z Y
App.
The fuzzy washing machines
were the first major consumer
products in Japan around
1990
the most advanced subway
system on earth in 1987
11 of 57
Fuzzy Logic
Controller
Sensor
Fuzzification
Fuzzy
Inference
System
to be
controlled
Defuzzification
Membership
function of
input fuzzy set
Rule Base
Membership
function of
output fuzzy set
Feedback
12 of 57
Defuzzification Methods
Centre of
largest area
Meanโ€“max
membership
Maxima
(MOM)
Max-membership Centre
of sums
Centroid
method
Approx. Centroid
method
13 of 57
Mean of Maxima (MOM) 1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0 1 2 3 4 5 6 7 8
๐žต
Z
๐’โˆ—
=
๐’‚ + ๐’ƒ
๐Ÿ ๐’โˆ— =
๐Ÿ” + ๐Ÿ•
๐Ÿ
= ๐Ÿ”. ๐Ÿ“ ๐’Ž
14 of 57
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0 1 2 3 4 5 6 7 8
๐žต
Z
Centroid Method 2
also called center of area, center of gravity).
it is the most prevalent and physically appealing
of all the defuzzification methods
๐’โˆ—
=
๐ŸŽ. ๐Ÿ‘ ร— (๐Ÿ + ๐Ÿ + ๐Ÿ‘) + ๐ŸŽ. ๐Ÿ“ ร— (๐Ÿ’ + ๐Ÿ“) + ๐Ÿ ร— (๐Ÿ” + ๐Ÿ•)
(๐ŸŽ. ๐Ÿ‘ ร— ๐Ÿ‘) + (๐ŸŽ. ๐Ÿ“ ร— ๐Ÿ) + (๐Ÿ ร— ๐Ÿ)
๐’โˆ—
= ๐Ÿ‘. ๐Ÿ‘๐Ÿ‘ ๐’Ž
๐’โˆ— =
ฯƒ ๐(๐’) ๐’
ฯƒ ๐(๐’)
15 of 57
The approximate COA 3
๐’โˆ— =
ฯƒ ๐(๐’) ๐‘ช
ฯƒ ๐(๐’)
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0 1 2 3 4 5 6 7 8
๐žต
Z
๐’โˆ—
=
๐ŸŽ. ๐Ÿ‘ ร— ๐Ÿ. ๐Ÿ“ + ๐ŸŽ. ๐Ÿ“ ร— ๐Ÿ“ + (๐Ÿ ร— ๐Ÿ”. ๐Ÿ“)
๐ŸŽ. ๐Ÿ‘ + ๐ŸŽ. ๐Ÿ“ + ๐Ÿ
= ๐Ÿ“. ๐Ÿ’๐Ÿ ๐’Ž
16 of 57
Autonomous driving car
distance
speed
acceleration
13 m
-2.5 m/s
?
Knowledge
Rule base
Distance to next car [ m ]
v.small small perfect big v.big
Speed
Change
[ ๐’Ž ๐Ÿ
]
declining -ve small zero +ve small +ve big +ve big
constant -ve big -ve small zero +ve small +ve big
growing -ve big -ve big -ve small zero +ve small
speed [m/s]
17 of 57
speed [m/s]
Knowledge
Rule base
Distance to next car [ m ]
v.small small perfect big v.big
Speed
Change
[ ๐’Ž ๐Ÿ
]
declining -ve small zero +ve small +ve big +ve big
constant -ve big -ve small zero +ve small +ve big
growing -ve big -ve big -ve small zero +ve small
0.4 0.25
0.4
0.6
0.6
0.75
0.75
0.25
0.25
0.4
0.25
0.6
Rule 1: IF distance is small AND speed is declining
THEN acceleration zero
Rule 2: IF distance is small AND speed is constant
THEN acceleration negative small
Rule 3: IF distance is perfect AND speed is declining
THEN acceleration positive small
Rule 4: IF distance is perfect AND speed is constant
THEN acceleration zero
max
Take
min
18 of 57
Defuzzification using approximate COA
19 of 57
Washing Machine
20 of 57
Washing Machine
40
30
?0
0.2
0.4
0.6
0.8
1
0 10 20 30 40 50 60 70 80 90 100
๐žต(weight)
Weight (g)
v.Light light Heavy V.heavy
0
0.2
0.4
0.6
0.8
1
0 10 20 30 40 50 60 70 80 90 100
ฮผ(Dirtiness)
Dirtiness (%)
Almost Clean Dirty Soiled Filthy
0
0.2
0.4
0.6
0.8
1
0 10 20 30 40 50 60 70 80 90 100
ฮผ(detergent)
Detergent (%)
v.Light little Much V.Much Maximum
Knowledge
Rule base
Weight [ Kg ]
V.Light Light Heavy V.Heavy
Dirtiness
Almost
Clean
V.Little Little Much Much
Dirty Little Little Much V.Much
Soiled Much Much V.Much Maximum
Filthy V.Much Much V.Much Maximum
weight
dirtiness
amount of
detergent output
21 of 57
heavy dirty Much
heavy soiled V.Much
0
0.2
0.4
0.6
0.8
1
0 10 20 30 40 50 60 70 80 90 100
ฮผ(Dirtiness)
Dirtiness (%)
Almost Clean Dirty Soiled Filthy
0
0.2
0.4
0.6
0.8
1
0 10 20 30 40 50 60 70 80 90 100
๐žต(weight)
Weight (g)
v.Light light Heavy V.heavy
Light dirty little
Light soiled Much
0.4
0.4
0.40.8 0.80.6
0.60.2 0.20.2
0.6
0.2
Little 0.4
Much 0.6
V.Much 0.2
IF weight is light(0.4) AND dirtiness is dirty(0.8)
THEN detergent is little(0.4)
IF weight is light(0.4) AND dirtiness is soiled(0.2)
THEN detergent is Much(0.2)
IF weight is heavy(0.6) AND dirtiness is dirty(0.8)
THEN detergent is Much(0.6)
IF weight is heavy(0.6) AND dirtiness is soiled(0.2)
THEN detergent is V.Much(0.2)
22 of 57
0
0.2
0.4
0.6
0.8
1
0 10 20 30 40 50 60 70 80 90 100ฮผ(detergent)
detergent
v.Light little Much V.Much Maximum
๐’โˆ— =
๐Ÿ’๐ŸŽ + ๐Ÿ”๐ŸŽ
๐Ÿ
= ๐Ÿ“๐ŸŽ%
๐’โˆ—
=
๐’‚ + ๐’ƒ
๐Ÿ
๐’โˆ—
=
๐ŸŽ. ๐Ÿ’ ร— ๐Ÿ๐Ÿ“ + ๐ŸŽ. ๐Ÿ” ร— ๐Ÿ“๐ŸŽ + (๐ŸŽ. ๐Ÿ ร— ๐Ÿ•๐Ÿ“)
๐ŸŽ. ๐Ÿ’ + ๐ŸŽ. ๐Ÿ” + ๐ŸŽ. ๐Ÿ
๐’โˆ— = ๐Ÿ’๐Ÿ“. ๐Ÿ–๐Ÿ‘ %
๐’โˆ— =
ฯƒ ๐(๐’) ๐’
ฯƒ ๐(๐’)
0
0.2
0.4
0.6
0.8
1
0 10 20 30 40 50 60 70 80 90 100
ฮผ(detergent)
Detergent (%)
v.Light little Much V.Much Maximum
approximate
COA
MOM
(Mean of Maxima )
23 of 57
24 of 57
Inputs
Output
25 of 57
Service = 3
Food = 8
Rule 1 : IF Service is poor OR Food is rancid
THEN Tip is cheap
Rule 2 : IF Service is good THEN Tip is average
Rule 3 : IF Service is excellent OR Food is
delicious THEN Tip is generous
0.125
0.4
0
0
0.5
0.5
0.4
0.125
26 of 57
Build Fuzzy
using
Fuzzy Logic Designer
27 of 57
28 of 57
Build Fuzzy
at
the Command Line
29 of 57
Generate new fuzzy01
Add the first input (service)02
Add its membership functions03
30 of 57
04
31 of 57
Add the rules to the FIS05
Rule 1 : IF Service is poor OR Food is rancid
THEN Tip is cheap
Rule 2 : IF Service is good THEN Tip is average
Rule 3 : IF Service is excellent OR Food is
delicious THEN Tip is generous
1 - Index of membership function for first input
5 - Fuzzy operator (1 for AND, 2 for OR)
2 - Index of membership function for second input
3 - Index of membership function for output
4 - Rule weight
32 of 57
Evaluate fuzzy06
33 of 57
Plotting07
34 of 57
35 of 57
PID Fuzzy
Controller
System
36 of 57
๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค
๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: ๐ฎ ๐ค
๐‘๐ฎ๐ฅ๐ž: ๐ข๐Ÿ ๐ž ๐ค ๐ข๐ฌ โ€ฆ ๐ญ๐ก๐ž๐ง ๐ฎ ๐ค ๐ข๐ฌ โ€ฆ
P- like FLC1
37 of 57
๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค , โˆ† ๐’†(๐’Œ)
๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: โˆ† ๐ฎ ๐ค
๐‘๐ฎ๐ฅ๐ž: ๐ข๐Ÿ ๐ž ๐ค ๐ข๐ฌ โ€ฆ ๐š๐ง๐ โˆ† ๐’† ๐’Œ ๐’Š๐’” โ€ฆ ๐ญ๐ก๐ž๐ง โˆ†๐ฎ ๐ค ๐ข๐ฌ โ€ฆ
PI- like FLC2
38 of 57
๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค , โˆ† ๐’† ๐’Œ
๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: ๐ฎ ๐ค
๐‘๐ฎ๐ฅ๐ž: ๐ข๐Ÿ ๐ž ๐ค ๐ข๐ฌ โ€ฆ ๐š๐ง๐ โˆ† ๐’† ๐’Œ ๐’Š๐’” โ€ฆ ๐ญ๐ก๐ž๐ง ๐ฎ ๐ค ๐ข๐ฌ โ€ฆ
PD- like FLC3
39 of 57
๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค , โˆ† ๐’† ๐’Œ , ฮฃ ๐’†(๐’Œ)
๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: ๐ฎ ๐ค
๐‘๐ฎ๐ฅ๐ž: ๐ข๐Ÿ ๐ž ๐ค ๐ข๐ฌ โ€ฆ ๐š๐ง๐ โˆ† ๐’† ๐’Œ ๐’Š๐’” โ€ฆ ๐š๐ง๐ ฮฃ๐’† ๐’Œ ๐’Š๐’” โ€ฆ ๐ญ๐ก๐ž๐ง ๐ฎ ๐ค ๐ข๐ฌ โ€ฆ
PID- like FLC3
40 of 57
๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค
๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: ๐ฎ ๐ค
๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค , โˆ† ๐’†(๐’Œ)
๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: ๐ฎ ๐ค
๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค , โˆ† ๐’†(๐’Œ)
๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: โˆ† ๐ฎ ๐ค
๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค , โˆ† ๐’† ๐’Œ , ฮฃ ๐’†(๐’Œ)
๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: ๐ฎ ๐ค
41 of 57
Consider a system model is describe by:
๐’š (๐’Œ) = ๐ŸŽ. ๐Ÿ” ร— ๐’š (๐’Œ โˆ’ ๐Ÿ) + ๐’–(๐’Œ โˆ’ ๐Ÿ)
PI-Like FLC is designed to regulate this system around a set point of R=2. Five fuzzy sets are used
to represent the linguistic variables NB, NS, Z, PS and PB for the controller both input and output
variables. Triangular membership functions are used to represent these fuzzy sets and defined on the
normalized domain [-1,1] as shown in Fig. 1. The suggested rule-base is depicted in table. If the
measured parameters are obtained as y(k-1)=1.5 and u(k-1)=0.5,find the controller output signal
taking into account the actual domain of the controller variables is [-2, 2].
Knowledge
Rule base
e(k)
NB NS Z PS PB
โˆ† ๐’†(๐’Œ)
NB NB NB NB NS Z
NS NB NB NS Z PS
Z NB NS Z PS PB
PS NS Z PS PB PB
PB Z PS PB PB PB
42 of 5742 of 24
๐’š (๐’Œ) = ๐ŸŽ. ๐Ÿ” ร— ๐’š (๐’Œ โˆ’ ๐Ÿ) + ๐’–(๐’Œ โˆ’ ๐Ÿ)
๐’‚๐’„๐’•๐’–๐’‚๐’ ๐’…๐’๐’Ž๐’‚๐’Š๐’ โˆˆ โˆ’๐Ÿ, ๐Ÿ
๐’•๐’‰๐’† ๐’„๐’๐’๐’•๐’“๐’๐’๐’๐’†๐’“ ๐’๐’–๐’•๐’‘๐’–๐’• ๐’”๐’Š๐’ˆ๐’๐’‚๐’
find
๐’๐’๐’“๐’Ž๐’‚๐’๐’Š๐’›๐’†๐’… ๐’…๐’๐’Ž๐’‚๐’Š๐’ โˆˆ [โˆ’๐Ÿ, ๐Ÿ]
๐‘ท๐‘ฐ โˆ’ ๐‘ณ๐’Š๐’Œ๐’† ๐‘ญ๐‘ณ๐‘ช
๐’š ๐’Œ = ๐ŸŽ. ๐Ÿ” ร— ๐’š ๐’Œ โˆ’ ๐Ÿ + ๐’– ๐’Œ โˆ’ ๐Ÿ
= ๐ŸŽ. ๐Ÿ” ร— ๐Ÿ. ๐Ÿ“ + ๐ŸŽ. ๐Ÿ“ = ๐Ÿ. ๐Ÿ’
๐’†(๐’Œ) = ๐‘น(๐’Œ) โˆ’ ๐’š(๐’Œ)
= ๐Ÿ โˆ’ ๐Ÿ. ๐Ÿ’ = ๐ŸŽ. ๐Ÿ”
๐œŸ๐’† (๐’Œ) = ๐’† (๐’Œ) โˆ’ ๐’† (๐’Œ โˆ’ ๐Ÿ)
= ๐‘น ๐’Œ โˆ’ ๐’š ๐’Œ โˆ’ ๐‘น ๐’Œ โˆ’ ๐’š ๐’Œ โˆ’ ๐Ÿ
= ๐’š ๐’Œ โˆ’ ๐Ÿ โˆ’ ๐’š ๐’Œ
= ๐Ÿ. ๐Ÿ“ โˆ’ ๐Ÿ. ๐Ÿ’ = ๐ŸŽ. ๐Ÿ
๐‘ป๐’‰๐’† ๐’‚๐’„๐’•๐’–๐’‚๐’ ๐’”๐’š๐’”๐’•๐’†๐’Ž ๐’๐’–๐’•๐’‘๐’–๐’• ๐’‡๐’๐’“ ๐’•๐’‰๐’† ๐’Ž๐’†๐’‚๐’”๐’–๐’“๐’†๐’… ๐’—๐’‚๐’๐’–๐’†๐’”:
๐’š ๐’Œ โˆ’ ๐Ÿ = ๐Ÿ. ๐Ÿ“
๐’– ๐’Œ โˆ’ ๐Ÿ = ๐ŸŽ. ๐Ÿ“
43 of 5743 of 24
๐’š (๐’Œ) = ๐ŸŽ. ๐Ÿ” ร— ๐’š (๐’Œ โˆ’ ๐Ÿ) + ๐’–(๐’Œ โˆ’ ๐Ÿ)
๐’š ๐’Œ = ๐Ÿ. ๐Ÿ’
๐’‚๐’„๐’•๐’–๐’‚๐’ ๐’…๐’๐’Ž๐’‚๐’Š๐’ โˆˆ โˆ’๐Ÿ, ๐Ÿ
๐’•๐’‰๐’† ๐’„๐’๐’๐’•๐’“๐’๐’๐’๐’†๐’“ ๐’๐’–๐’•๐’‘๐’–๐’• ๐’”๐’Š๐’ˆ๐’๐’‚๐’
find
๐’† ๐’Œ = ๐ŸŽ. ๐Ÿ”
๐’๐’๐’“๐’Ž๐’‚๐’๐’Š๐’›๐’†๐’… ๐’…๐’๐’Ž๐’‚๐’Š๐’ โˆˆ [โˆ’๐Ÿ, ๐Ÿ]
๐‘ท๐‘ฐ โˆ’ ๐‘ณ๐’Š๐’Œ๐’† ๐‘ญ๐‘ณ๐‘ช
โˆ†๐’† ๐’Œ = ๐ŸŽ. ๐Ÿ
๐‘ป๐’‰๐’† ๐’๐’๐’“๐’Ž๐’‚๐’๐’Š๐’›๐’†๐’… ๐’Š๐’๐’‘๐’–๐’• ๐’—๐’‚๐’๐’–๐’†๐’” ๐’‡๐’๐’“ ๐‘ญ๐‘ณ๐‘ช ๐’˜๐’Š๐’๐’ ๐’ƒ๐’†:
๐‘ฎ ๐’† =
๐Ÿ
๐Ÿ
= ๐ŸŽ. ๐Ÿ“ , ๐‘ฎโˆ†๐’† =
๐Ÿ
๐Ÿ
= ๐ŸŽ. ๐Ÿ“ , ๐‘ฎโˆ†๐’– =
๐Ÿ
๐Ÿ
= ๐Ÿ
๐‘ป๐’ ๐’๐’ƒ๐’•๐’‚๐’Š๐’ ๐’”๐’„๐’‚๐’๐’Š๐’๐’ˆ ๐’‡๐’‚๐’„๐’•๐’๐’“๐’”:
๐’† ๐’ ๐’Œ = ๐‘ฎ ๐’† ร— ๐’† ๐’Œ
= ๐ŸŽ. ๐Ÿ“ ร— ๐ŸŽ. ๐Ÿ” = ๐ŸŽ. ๐Ÿ‘
โˆ†๐’† ๐’(๐’Œ) = ๐‘ฎโˆ†๐’† ร— โˆ†๐’† ๐’Œ
= ๐ŸŽ. ๐Ÿ“ ร— ๐ŸŽ. ๐Ÿ = ๐ŸŽ. ๐ŸŽ๐Ÿ“
44 of 57
๐’‡๐’–๐’›๐’›๐’Š๐’‡๐’Š๐’„๐’‚๐’•๐’Š๐’๐’ โˆถ
๐ ๐’_๐’† ๐’(๐’Œ) =
๐Ÿ
๐Ÿ‘
โˆ’ ๐ŸŽ. ๐Ÿ‘
๐Ÿ
๐Ÿ‘
โˆ’ ๐ŸŽ
= ๐ŸŽ. ๐Ÿ
๐ ๐‘ท๐‘บ_๐’† ๐’(๐’Œ) =
๐ŸŽ. ๐Ÿ‘ โˆ’ ๐ŸŽ
๐Ÿ
๐Ÿ‘
โˆ’ ๐ŸŽ
= ๐ŸŽ. ๐Ÿ—
๐ ๐’_โˆ†๐’† ๐’(๐’Œ) =
๐Ÿ
๐Ÿ‘
โˆ’ ๐ŸŽ. ๐ŸŽ๐Ÿ“
๐Ÿ
๐Ÿ‘
โˆ’ ๐ŸŽ
= ๐ŸŽ. ๐Ÿ–๐Ÿ“
๐ ๐‘ท๐‘บ_๐’† ๐’(๐’Œ) =
๐ŸŽ. ๐ŸŽ๐Ÿ“ โˆ’ ๐ŸŽ
๐Ÿ
๐Ÿ‘
โˆ’ ๐ŸŽ
= ๐ŸŽ. ๐Ÿ๐Ÿ“
45 of 57
PS Z PS
PS PS PB
Z Z Z
Z PS PS
0.1
0.1
0.10.85 0.850.9
0.90.15 0.150.1
0.85
0.15
IF e (k) is Z (0.1) AND โˆ†๐’†(๐’Œ) is Z (0.85)
THEN โˆ†u(๐’Œ) is Z (0.1)
IF e (k) is Z (0.1) AND โˆ†๐’†(๐’Œ) is PS (0.15)
THEN โˆ†u(๐’Œ) is PS (0.1)
IF e (k) is PS (0.9) AND โˆ†๐’†(๐’Œ) is Z (0.85)
THEN โˆ†u(๐’Œ) is PS (0.85)
IF e (k) is PS (0.9) AND โˆ†๐’†(๐’Œ) is PS (0.15)
THEN โˆ†u(๐’Œ) is PB (0.15)
Knowledge
Rule base
e(k)
NB NS Z PS PB
โˆ† ๐’†(๐’Œ)
NB NB NB NB NS Z
NS NB NB NS Z PS
Z NB NS Z PS PB
PS NS Z PS PB PB
PB Z PS PB PB PB
Z 0.1
PS 0.85
PB 0.15
46 of 57
โˆ†๐’– ๐’ ๐’Œ =
๐ŸŽ. ๐Ÿ ร— ๐ŸŽ + ๐ŸŽ. ๐Ÿ–๐Ÿ“ ร—
๐Ÿ
๐Ÿ‘
+ (๐ŸŽ. ๐Ÿ๐Ÿ“ ร—
๐Ÿ
๐Ÿ‘
)
๐ŸŽ. ๐Ÿ + ๐ŸŽ. ๐Ÿ–๐Ÿ“ + ๐ŸŽ. ๐Ÿ๐Ÿ“
โˆ†๐’– ๐’ ๐’Œ = ๐ŸŽ. ๐Ÿ‘๐Ÿ“
โˆ†๐’– ๐’ ๐’Œ =
ฯƒ ๐(โˆ†๐’– ๐’) ๐‘ช
ฯƒ ๐(โˆ†๐’– ๐’)
approximate
COA
๐’…๐’†๐’‡๐’–๐’›๐’›๐’Š๐’‡๐’Š๐’„๐’‚๐’•๐’Š๐’๐’ โˆถ
โˆ†๐’– ๐’Œ = ๐‘ฎโˆ†๐’– ร— โˆ†๐’– ๐’ ๐’Œ
= ๐Ÿ ร— ๐ŸŽ. ๐Ÿ‘๐Ÿ“ = ๐ŸŽ. ๐Ÿ•
๐’– ๐’Œ = ๐’– ๐’Œ โˆ’ ๐Ÿ + โˆ†๐’– ๐’Œ
= ๐ŸŽ. ๐Ÿ“ + ๐ŸŽ. ๐Ÿ• = ๐Ÿ. ๐Ÿ
๐‘ป๐’‰๐’† ๐’‚๐’„๐’•๐’–๐’‚๐’ ๐’„๐’๐’๐’•๐’“๐’๐’ ๐’๐’–๐’•๐’‘๐’–๐’• ๐œŸ๐’– ๐’Œ ๐’๐’‡ ๐‘ญ๐‘ณ๐‘ช:
๐‘ป๐’‰๐’† ๐’„๐’๐’๐’•๐’“๐’๐’ ๐’”๐’Š๐’ˆ๐’๐’‚๐’ ๐’– ๐’Œ ๐’˜๐’Š๐’๐’ ๐’ƒ๐’†:
Build Fuzzy
using
Simulink
48 of 57
Tank Level Control System
5 cm ?
0
0.25
0.5
0.75
1
1.25
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
๐žต(Level)
Liquid level (cm)
low okay high
0
0.5
1
-30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30
๐žต(valvecontrol)
Valve control signal (%/s)
close fast no change open fast
Rule 1 : IF level is okay THEN valve is no change
Rule 2 : IF level is low THEN valve is open fast
Rule 3 : IF level is high THEN valve is close fast
Liquid level
Valve control
signal
49 of 57
๐‘ป๐’‚๐’๐’Œ ๐‘บ๐’š๐’”๐’•๐’†๐’Ž
๐‘บ๐’Š๐’Ž๐’–๐’๐’‚๐’•๐’Š๐’๐’
50 of 57
๐‘บ๐’–๐’ƒ๐’”๐’š๐’”๐’•๐’†๐’Ž ๐‘ฝ๐’‚๐’๐’—๐’†
๐‘บ๐’–๐’ƒ๐’”๐’š๐’”๐’•๐’†๐’Ž ๐‘ป๐’‚๐’๐’Œ
แˆถโ„Ž =
1
๐ด
๐‘ž๐‘–๐‘› โˆ’
๐‘Ž
๐ด
2๐‘”โ„Ž
๐‘จ = ๐ŸŽ. ๐Ÿ’ ๐’Ž ๐Ÿ
๐’‚ = ๐ŸŽ. ๐ŸŽ๐Ÿ๐Ÿ ๐’Ž ๐Ÿ
๐’’๐’Š,๐’Ž๐’‚๐’™ = ๐Ÿ๐ŸŽ ๐’/๐’”
๐ด: ๐‘๐‘Ÿ๐‘œ๐‘ ๐‘  โˆ’ ๐‘ ๐‘’๐‘๐‘ก๐‘–๐‘œ๐‘›๐‘Ž๐‘™ ๐‘Ž๐‘Ÿ๐‘’๐‘Ž ๐‘œ๐‘“ ๐‘กโ„Ž๐‘’ ๐‘ก๐‘Ž๐‘›๐‘˜
๐‘Ž: ๐‘๐‘Ÿ๐‘œ๐‘ ๐‘  โˆ’ ๐‘ ๐‘’๐‘๐‘ก๐‘–๐‘œ๐‘›๐‘Ž๐‘™ ๐‘Ž๐‘Ÿ๐‘’๐‘Ž ๐‘œ๐‘“ ๐‘กโ„Ž๐‘’ ๐‘๐‘–๐‘๐‘’
51 of 57
๐’๐’Š๐’’๐’–๐’Š๐’… ๐’๐’†๐’—๐’†๐’
๐’—๐’‚๐’๐’—๐’† ๐’„๐’๐’๐’•๐’“๐’๐’
๐’—๐’‚๐’๐’—๐’† ๐’๐’‘๐’†๐’๐’Š๐’๐’ˆ
52 of 57
๐‘ป๐’‚๐’๐’Œ ๐‘บ๐’š๐’”๐’•๐’†๐’Ž ๐‘บ๐’Š๐’Ž๐’–๐’๐’‚๐’•๐’Š๐’๐’
With reference
53 of 57
๐’๐’Š๐’’๐’–๐’Š๐’… ๐’๐’†๐’—๐’†๐’
๐’—๐’‚๐’๐’—๐’† ๐’„๐’๐’๐’•๐’“๐’๐’
๐’—๐’‚๐’๐’—๐’† ๐’๐’‘๐’†๐’๐’Š๐’๐’ˆ
54 of 57
With referenceWithout reference
55 of 57
References
[1] L.-X. Wang, A Course in Fuzzy Systems and Control. Prentice Hall PTR, 1997.
[2] S. N. Sivanandam, S. Sumathi, and S. N. Deepa, Introduction to Fuzzy Logic using MATLAB.
Springer, 2006.
[3] T. J. Ross, Fuzzy Logic with Engineering Applications, 2nd ed. Wiley, 2004.
[4] Essam Nabil, โ€œAutonomous driving car,โ€ March,2019, pp. 1โ€“13.[presentation].
[5] Essam Nabil, โ€œFuzzy logic control system applications,โ€ March,2019, pp. 1-30 .[presentation].
[6] Essam Nabil, โ€œTipping problem,โ€ March,2019, pp. 1โ€“18.[presentation].
56 of 57
References
[7] โ€œBuild Fuzzy Systems Using Fuzzy Logic Designer - MATLAB & Simulink.โ€ [Online]. Available:
https://www.mathworks.com/help/fuzzy/building-systems-with-fuzzy-logic-toolbox-
software.html. [Accessed: 22-Nov-2019].
[8] โ€œBuild Fuzzy Systems at the Command Line - MATLAB & Simulink.โ€ [Online]. Available:
https://www.mathworks.com/help/fuzzy/working-from-the-command-line.html.
[Accessed: 22-Nov-2019]
[9] Essam Nabil, โ€œTank control systemโ€ March,2019, pp. 1โ€“18.[presentation].
[10] Essam Nabil, โ€œPID - Like Fuzzy Logic controlโ€ March,2019, pp. 1โ€“39.[presentation].
57 of 57
Thank You
Nourhan Selem Salm
FUZZY

More Related Content

What's hot

Fuzzy Logic Seminar with Implementation
Fuzzy Logic Seminar with ImplementationFuzzy Logic Seminar with Implementation
Fuzzy Logic Seminar with ImplementationBhaumik Parmar
ย 
Fuzzy+logic
Fuzzy+logicFuzzy+logic
Fuzzy+logicMahesh Todkar
ย 
An overview of gradient descent optimization algorithms
An overview of gradient descent optimization algorithms An overview of gradient descent optimization algorithms
An overview of gradient descent optimization algorithms Hakky St
ย 
Approximation and error
Approximation and errorApproximation and error
Approximation and errorrubenarismendi
ย 
Linear regression
Linear regressionLinear regression
Linear regressionMartinHogg9
ย 
Lecture Note-1: Algorithm and Its Properties
Lecture Note-1: Algorithm and Its PropertiesLecture Note-1: Algorithm and Its Properties
Lecture Note-1: Algorithm and Its PropertiesRajesh K Shukla
ย 
Time and Space Complexity
Time and Space ComplexityTime and Space Complexity
Time and Space ComplexityAshutosh Satapathy
ย 
FUZZY LOGIC
FUZZY LOGIC FUZZY LOGIC
FUZZY LOGIC VanishriKornu
ย 
Fuzzy logic and application in AI
Fuzzy logic and application in AIFuzzy logic and application in AI
Fuzzy logic and application in AIIldar Nurgaliev
ย 
Lecture 1: Semantic Analysis in Language Technology
Lecture 1: Semantic Analysis in Language TechnologyLecture 1: Semantic Analysis in Language Technology
Lecture 1: Semantic Analysis in Language TechnologyMarina Santini
ย 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logicKomalBhat6
ย 
Digital control systems (dcs) lecture 18-19-20
Digital control systems (dcs) lecture 18-19-20Digital control systems (dcs) lecture 18-19-20
Digital control systems (dcs) lecture 18-19-20Ali Rind
ย 

What's hot (20)

Hybrid systems
Hybrid systemsHybrid systems
Hybrid systems
ย 
Fuzzy Logic Seminar with Implementation
Fuzzy Logic Seminar with ImplementationFuzzy Logic Seminar with Implementation
Fuzzy Logic Seminar with Implementation
ย 
Fuzzy+logic
Fuzzy+logicFuzzy+logic
Fuzzy+logic
ย 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
ย 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
ย 
An overview of gradient descent optimization algorithms
An overview of gradient descent optimization algorithms An overview of gradient descent optimization algorithms
An overview of gradient descent optimization algorithms
ย 
Approximation and error
Approximation and errorApproximation and error
Approximation and error
ย 
L9 fuzzy implications
L9 fuzzy implicationsL9 fuzzy implications
L9 fuzzy implications
ย 
Linear regression
Linear regressionLinear regression
Linear regression
ย 
Lecture Note-1: Algorithm and Its Properties
Lecture Note-1: Algorithm and Its PropertiesLecture Note-1: Algorithm and Its Properties
Lecture Note-1: Algorithm and Its Properties
ย 
Time and Space Complexity
Time and Space ComplexityTime and Space Complexity
Time and Space Complexity
ย 
FUZZY LOGIC
FUZZY LOGIC FUZZY LOGIC
FUZZY LOGIC
ย 
Fuzzy logic and application in AI
Fuzzy logic and application in AIFuzzy logic and application in AI
Fuzzy logic and application in AI
ย 
Fuzzy logic ppt
Fuzzy logic pptFuzzy logic ppt
Fuzzy logic ppt
ย 
Lecture 1: Semantic Analysis in Language Technology
Lecture 1: Semantic Analysis in Language TechnologyLecture 1: Semantic Analysis in Language Technology
Lecture 1: Semantic Analysis in Language Technology
ย 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
ย 
L7 fuzzy relations
L7 fuzzy relationsL7 fuzzy relations
L7 fuzzy relations
ย 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
ย 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
ย 
Digital control systems (dcs) lecture 18-19-20
Digital control systems (dcs) lecture 18-19-20Digital control systems (dcs) lecture 18-19-20
Digital control systems (dcs) lecture 18-19-20
ย 

Similar to Fuzzy logic

ELEG 421 Control Systems Transient and Steady State .docx
ELEG 421 Control Systems  Transient and Steady State .docxELEG 421 Control Systems  Transient and Steady State .docx
ELEG 421 Control Systems Transient and Steady State .docxtoltonkendal
ย 
Normal probability distribution
Normal probability distributionNormal probability distribution
Normal probability distributionNadeem Uddin
ย 
Lecture 5 backpropagation
Lecture 5 backpropagationLecture 5 backpropagation
Lecture 5 backpropagationParveenMalik18
ย 
Ideal Bose Systems
Ideal Bose SystemsIdeal Bose Systems
Ideal Bose SystemsSara Khorshidian
ย 
Static Models of Continuous Variables
Static Models of Continuous VariablesStatic Models of Continuous Variables
Static Models of Continuous VariablesEconomic Research Forum
ย 
EASY WAY TO CALCULATE MODE (STATISTICS)
EASY WAY TO CALCULATE MODE (STATISTICS)EASY WAY TO CALCULATE MODE (STATISTICS)
EASY WAY TO CALCULATE MODE (STATISTICS)sumanmathews
ย 
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...Wireilla
ย 
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...ijfls
ย 
09-FL Defuzzyfication I.pptx
09-FL Defuzzyfication I.pptx09-FL Defuzzyfication I.pptx
09-FL Defuzzyfication I.pptxssusercae49e
ย 
simple linear regression - brief introduction
simple linear regression - brief introductionsimple linear regression - brief introduction
simple linear regression - brief introductionedinyoka
ย 
SDF Hysteretic System 1 - Differential Vaiana Rosati Model
SDF Hysteretic System 1 - Differential Vaiana Rosati Model SDF Hysteretic System 1 - Differential Vaiana Rosati Model
SDF Hysteretic System 1 - Differential Vaiana Rosati Model University of Naples Federico II
ย 
Deconvolution
DeconvolutionDeconvolution
Deconvolutiongregthom992
ย 
numericai matmatic matlab uygulamalar ali abdullah
numericai matmatic  matlab  uygulamalar ali abdullahnumericai matmatic  matlab  uygulamalar ali abdullah
numericai matmatic matlab uygulamalar ali abdullahAli Abdullah
ย 
function power point presentation for class 11 and 12 for jee
function power point presentation for class 11 and 12 for jeefunction power point presentation for class 11 and 12 for jee
function power point presentation for class 11 and 12 for jeeMohanSonawane
ย 
Sparsenet
SparsenetSparsenet
Sparsenetndronen
ย 
Discrete Nonlinear Optimal Control of S/C Formations Near The L1 and L2 poi...
  Discrete Nonlinear Optimal Control of S/C Formations Near The L1 and L2 poi...  Discrete Nonlinear Optimal Control of S/C Formations Near The L1 and L2 poi...
Discrete Nonlinear Optimal Control of S/C Formations Near The L1 and L2 poi...Belinda Marchand
ย 
An Introduction to Fuzzy Logic and Neural Networks
An Introduction to Fuzzy Logic and Neural NetworksAn Introduction to Fuzzy Logic and Neural Networks
An Introduction to Fuzzy Logic and Neural Networksmilad abbasi
ย 
An Introduction to Fuzzy Sets and Neural Networks
An Introduction to Fuzzy Sets and Neural NetworksAn Introduction to Fuzzy Sets and Neural Networks
An Introduction to Fuzzy Sets and Neural NetworksMehrnaz Faraz
ย 
Crash course in control theory for neuroscientists and biologists
Crash course in control theory for neuroscientists and biologistsCrash course in control theory for neuroscientists and biologists
Crash course in control theory for neuroscientists and biologistsMatteo Mischiati
ย 
Mathcad - CMS (Component Mode Synthesis) Analysis.pdf
Mathcad - CMS (Component Mode Synthesis) Analysis.pdfMathcad - CMS (Component Mode Synthesis) Analysis.pdf
Mathcad - CMS (Component Mode Synthesis) Analysis.pdfJulio Banks
ย 

Similar to Fuzzy logic (20)

ELEG 421 Control Systems Transient and Steady State .docx
ELEG 421 Control Systems  Transient and Steady State .docxELEG 421 Control Systems  Transient and Steady State .docx
ELEG 421 Control Systems Transient and Steady State .docx
ย 
Normal probability distribution
Normal probability distributionNormal probability distribution
Normal probability distribution
ย 
Lecture 5 backpropagation
Lecture 5 backpropagationLecture 5 backpropagation
Lecture 5 backpropagation
ย 
Ideal Bose Systems
Ideal Bose SystemsIdeal Bose Systems
Ideal Bose Systems
ย 
Static Models of Continuous Variables
Static Models of Continuous VariablesStatic Models of Continuous Variables
Static Models of Continuous Variables
ย 
EASY WAY TO CALCULATE MODE (STATISTICS)
EASY WAY TO CALCULATE MODE (STATISTICS)EASY WAY TO CALCULATE MODE (STATISTICS)
EASY WAY TO CALCULATE MODE (STATISTICS)
ย 
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...
ย 
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...
ย 
09-FL Defuzzyfication I.pptx
09-FL Defuzzyfication I.pptx09-FL Defuzzyfication I.pptx
09-FL Defuzzyfication I.pptx
ย 
simple linear regression - brief introduction
simple linear regression - brief introductionsimple linear regression - brief introduction
simple linear regression - brief introduction
ย 
SDF Hysteretic System 1 - Differential Vaiana Rosati Model
SDF Hysteretic System 1 - Differential Vaiana Rosati Model SDF Hysteretic System 1 - Differential Vaiana Rosati Model
SDF Hysteretic System 1 - Differential Vaiana Rosati Model
ย 
Deconvolution
DeconvolutionDeconvolution
Deconvolution
ย 
numericai matmatic matlab uygulamalar ali abdullah
numericai matmatic  matlab  uygulamalar ali abdullahnumericai matmatic  matlab  uygulamalar ali abdullah
numericai matmatic matlab uygulamalar ali abdullah
ย 
function power point presentation for class 11 and 12 for jee
function power point presentation for class 11 and 12 for jeefunction power point presentation for class 11 and 12 for jee
function power point presentation for class 11 and 12 for jee
ย 
Sparsenet
SparsenetSparsenet
Sparsenet
ย 
Discrete Nonlinear Optimal Control of S/C Formations Near The L1 and L2 poi...
  Discrete Nonlinear Optimal Control of S/C Formations Near The L1 and L2 poi...  Discrete Nonlinear Optimal Control of S/C Formations Near The L1 and L2 poi...
Discrete Nonlinear Optimal Control of S/C Formations Near The L1 and L2 poi...
ย 
An Introduction to Fuzzy Logic and Neural Networks
An Introduction to Fuzzy Logic and Neural NetworksAn Introduction to Fuzzy Logic and Neural Networks
An Introduction to Fuzzy Logic and Neural Networks
ย 
An Introduction to Fuzzy Sets and Neural Networks
An Introduction to Fuzzy Sets and Neural NetworksAn Introduction to Fuzzy Sets and Neural Networks
An Introduction to Fuzzy Sets and Neural Networks
ย 
Crash course in control theory for neuroscientists and biologists
Crash course in control theory for neuroscientists and biologistsCrash course in control theory for neuroscientists and biologists
Crash course in control theory for neuroscientists and biologists
ย 
Mathcad - CMS (Component Mode Synthesis) Analysis.pdf
Mathcad - CMS (Component Mode Synthesis) Analysis.pdfMathcad - CMS (Component Mode Synthesis) Analysis.pdf
Mathcad - CMS (Component Mode Synthesis) Analysis.pdf
ย 

Recently uploaded

(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
ย 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
ย 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
ย 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
ย 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
ย 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
ย 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
ย 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
ย 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
ย 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
ย 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
ย 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEslot gacor bisa pakai pulsa
ย 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
ย 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
ย 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
ย 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
ย 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
ย 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
ย 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
ย 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
ย 

Recently uploaded (20)

(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
ย 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
ย 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
ย 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
ย 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
ย 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
ย 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
ย 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
ย 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
ย 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
ย 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
ย 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
ย 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
ย 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
ย 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
ย 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
ย 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
ย 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
ย 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
ย 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
ย 

Fuzzy logic

  • 1. FUZZY LOGIC Menoufia University Faculty of Electronic Engineering 4/2020
  • 2. 2 of 57 References08 07 Fuzzy on Simulink 05 Fuzzy at the Cmd line 06 PID โ€“ Fuzzy controller Agenda Introduction to Fuzzy01 Fuzzification & Defuzzification 02 Fuzzy application03 04 FIS tool
  • 3. 3 of 57 0 0.5 1 0 1 2 3 4 5 6 7 8 9 10 ๐žต(x) x Classical control theory 1 0 On off Yes No
  • 4. 4 of 57 Classical set theory ๐ด = 0.1,0.3,0.5 & ๐ต = {0.2,0.3,0.5,0.7} ๐’–๐’๐’Š๐’๐’ โˆถ ๐ด โˆช ๐ต = {0.1,0.2,0.3,0.5,0.7} ๐’Š๐’๐’•๐’†๐’“๐’”๐’†๐’„๐’•๐’Š๐’๐’ โˆถ ๐ด โˆฉ ๐ต = {0.3,0.5} ๐’…๐’Š๐’‡๐’‡๐’†๐’“๐’†๐’๐’„๐’† โˆถ ๐ด โˆ’ ๐ต = {0.1} ๐’„๐’๐’Ž๐’‘๐’๐’†๐’Ž๐’†๐’๐’•: าง๐ด = 0.9,0.7,0.5 ๐’„๐’‚๐’“๐’•๐’†๐’”๐’Š๐’‚๐’ ๐’‘๐’“๐’๐’…๐’–๐’„๐’• โˆถ ๐ด ร— ๐ต ๐’…๐’†๐’Ž๐’๐’“๐’ˆ๐’†๐’โ€ฒ ๐’” ๐’๐’‚๐’˜ โˆถ ๐ด โˆฉ ๐ต โ€ฒ = ๐ดโ€ฒ โˆช ๐ตโ€ฒ 0.1 0.3 0.5 A 0.7 0.2 B
  • 5. 5 of 57 Crisp set Vs Fuzzy set
  • 6. 6 of 57 What Fuzzy Systems? Confused vague blurred
  • 7. 7 of 57 Fuzzy he wrote that to handle biological systems "we need a radically different kind of mathematics, the mathematics of fuzzy or cloudy quantities which are not describable in terms of probability distributions" 1962 1965 Classical control Is a 160 m person is tall ? True Possibly True
  • 8. 8 of 57 Types of membership function ๐ ๐’™ = ๐ŸŽ , ๐’™ โ‰ค ๐’‚ ๐’™ โˆ’ ๐’‚ ๐’ƒ โˆ’ ๐’‚ , ๐’‚ โ‰ค ๐’™ โ‰ค ๐’ƒ ๐’„ โˆ’ ๐’™ ๐’„ โˆ’ ๐’ƒ , ๐’ƒ โ‰ค ๐’™ โ‰ค ๐’„ ๐ŸŽ , ๐’™ โ‰ฅ ๐’„ Triangular ๐ ๐’™ = ๐ŸŽ , ๐’™ โ‰ค ๐’‚ ๐’™ โˆ’ ๐’‚ ๐’ƒ โˆ’ ๐’‚ , ๐’‚ โ‰ค ๐’™ โ‰ค ๐’ƒ ๐Ÿ , ๐’ƒ โ‰ค ๐’™ โ‰ค ๐’„ ๐’„ โˆ’ ๐’™ ๐’„ โˆ’ ๐’ƒ , ๐’„ โ‰ค ๐’™ โ‰ค ๐’… ๐ŸŽ , ๐’™ โ‰ฅ ๐’… Trapezoidal ๐ ๐’™ = ๐’†๐’™๐’‘ โˆ’ ๐’™ โˆ’ ๐’„ ๐Ÿ ๐Ÿ๐ˆ ๐Ÿ Gaussian
  • 9. 9 of 57 speed [m/s] Human knowledge-based Rule-based Fuzzy IF AND THEN distance speed acceleration small speed is declining maintain IF distance perfect AND speed is declining THEN increase acceleration
  • 10. 10 of 57 a self-parking car in 1983 Nissan has a patent saves fuel F U Z Z Y App. The fuzzy washing machines were the first major consumer products in Japan around 1990 the most advanced subway system on earth in 1987
  • 11. 11 of 57 Fuzzy Logic Controller Sensor Fuzzification Fuzzy Inference System to be controlled Defuzzification Membership function of input fuzzy set Rule Base Membership function of output fuzzy set Feedback
  • 12. 12 of 57 Defuzzification Methods Centre of largest area Meanโ€“max membership Maxima (MOM) Max-membership Centre of sums Centroid method Approx. Centroid method
  • 13. 13 of 57 Mean of Maxima (MOM) 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 1 2 3 4 5 6 7 8 ๐žต Z ๐’โˆ— = ๐’‚ + ๐’ƒ ๐Ÿ ๐’โˆ— = ๐Ÿ” + ๐Ÿ• ๐Ÿ = ๐Ÿ”. ๐Ÿ“ ๐’Ž
  • 14. 14 of 57 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 1 2 3 4 5 6 7 8 ๐žต Z Centroid Method 2 also called center of area, center of gravity). it is the most prevalent and physically appealing of all the defuzzification methods ๐’โˆ— = ๐ŸŽ. ๐Ÿ‘ ร— (๐Ÿ + ๐Ÿ + ๐Ÿ‘) + ๐ŸŽ. ๐Ÿ“ ร— (๐Ÿ’ + ๐Ÿ“) + ๐Ÿ ร— (๐Ÿ” + ๐Ÿ•) (๐ŸŽ. ๐Ÿ‘ ร— ๐Ÿ‘) + (๐ŸŽ. ๐Ÿ“ ร— ๐Ÿ) + (๐Ÿ ร— ๐Ÿ) ๐’โˆ— = ๐Ÿ‘. ๐Ÿ‘๐Ÿ‘ ๐’Ž ๐’โˆ— = ฯƒ ๐(๐’) ๐’ ฯƒ ๐(๐’)
  • 15. 15 of 57 The approximate COA 3 ๐’โˆ— = ฯƒ ๐(๐’) ๐‘ช ฯƒ ๐(๐’) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 1 2 3 4 5 6 7 8 ๐žต Z ๐’โˆ— = ๐ŸŽ. ๐Ÿ‘ ร— ๐Ÿ. ๐Ÿ“ + ๐ŸŽ. ๐Ÿ“ ร— ๐Ÿ“ + (๐Ÿ ร— ๐Ÿ”. ๐Ÿ“) ๐ŸŽ. ๐Ÿ‘ + ๐ŸŽ. ๐Ÿ“ + ๐Ÿ = ๐Ÿ“. ๐Ÿ’๐Ÿ ๐’Ž
  • 16. 16 of 57 Autonomous driving car distance speed acceleration 13 m -2.5 m/s ? Knowledge Rule base Distance to next car [ m ] v.small small perfect big v.big Speed Change [ ๐’Ž ๐Ÿ ] declining -ve small zero +ve small +ve big +ve big constant -ve big -ve small zero +ve small +ve big growing -ve big -ve big -ve small zero +ve small speed [m/s]
  • 17. 17 of 57 speed [m/s] Knowledge Rule base Distance to next car [ m ] v.small small perfect big v.big Speed Change [ ๐’Ž ๐Ÿ ] declining -ve small zero +ve small +ve big +ve big constant -ve big -ve small zero +ve small +ve big growing -ve big -ve big -ve small zero +ve small 0.4 0.25 0.4 0.6 0.6 0.75 0.75 0.25 0.25 0.4 0.25 0.6 Rule 1: IF distance is small AND speed is declining THEN acceleration zero Rule 2: IF distance is small AND speed is constant THEN acceleration negative small Rule 3: IF distance is perfect AND speed is declining THEN acceleration positive small Rule 4: IF distance is perfect AND speed is constant THEN acceleration zero max Take min
  • 18. 18 of 57 Defuzzification using approximate COA
  • 19. 19 of 57 Washing Machine
  • 20. 20 of 57 Washing Machine 40 30 ?0 0.2 0.4 0.6 0.8 1 0 10 20 30 40 50 60 70 80 90 100 ๐žต(weight) Weight (g) v.Light light Heavy V.heavy 0 0.2 0.4 0.6 0.8 1 0 10 20 30 40 50 60 70 80 90 100 ฮผ(Dirtiness) Dirtiness (%) Almost Clean Dirty Soiled Filthy 0 0.2 0.4 0.6 0.8 1 0 10 20 30 40 50 60 70 80 90 100 ฮผ(detergent) Detergent (%) v.Light little Much V.Much Maximum Knowledge Rule base Weight [ Kg ] V.Light Light Heavy V.Heavy Dirtiness Almost Clean V.Little Little Much Much Dirty Little Little Much V.Much Soiled Much Much V.Much Maximum Filthy V.Much Much V.Much Maximum weight dirtiness amount of detergent output
  • 21. 21 of 57 heavy dirty Much heavy soiled V.Much 0 0.2 0.4 0.6 0.8 1 0 10 20 30 40 50 60 70 80 90 100 ฮผ(Dirtiness) Dirtiness (%) Almost Clean Dirty Soiled Filthy 0 0.2 0.4 0.6 0.8 1 0 10 20 30 40 50 60 70 80 90 100 ๐žต(weight) Weight (g) v.Light light Heavy V.heavy Light dirty little Light soiled Much 0.4 0.4 0.40.8 0.80.6 0.60.2 0.20.2 0.6 0.2 Little 0.4 Much 0.6 V.Much 0.2 IF weight is light(0.4) AND dirtiness is dirty(0.8) THEN detergent is little(0.4) IF weight is light(0.4) AND dirtiness is soiled(0.2) THEN detergent is Much(0.2) IF weight is heavy(0.6) AND dirtiness is dirty(0.8) THEN detergent is Much(0.6) IF weight is heavy(0.6) AND dirtiness is soiled(0.2) THEN detergent is V.Much(0.2)
  • 22. 22 of 57 0 0.2 0.4 0.6 0.8 1 0 10 20 30 40 50 60 70 80 90 100ฮผ(detergent) detergent v.Light little Much V.Much Maximum ๐’โˆ— = ๐Ÿ’๐ŸŽ + ๐Ÿ”๐ŸŽ ๐Ÿ = ๐Ÿ“๐ŸŽ% ๐’โˆ— = ๐’‚ + ๐’ƒ ๐Ÿ ๐’โˆ— = ๐ŸŽ. ๐Ÿ’ ร— ๐Ÿ๐Ÿ“ + ๐ŸŽ. ๐Ÿ” ร— ๐Ÿ“๐ŸŽ + (๐ŸŽ. ๐Ÿ ร— ๐Ÿ•๐Ÿ“) ๐ŸŽ. ๐Ÿ’ + ๐ŸŽ. ๐Ÿ” + ๐ŸŽ. ๐Ÿ ๐’โˆ— = ๐Ÿ’๐Ÿ“. ๐Ÿ–๐Ÿ‘ % ๐’โˆ— = ฯƒ ๐(๐’) ๐’ ฯƒ ๐(๐’) 0 0.2 0.4 0.6 0.8 1 0 10 20 30 40 50 60 70 80 90 100 ฮผ(detergent) Detergent (%) v.Light little Much V.Much Maximum approximate COA MOM (Mean of Maxima )
  • 25. 25 of 57 Service = 3 Food = 8 Rule 1 : IF Service is poor OR Food is rancid THEN Tip is cheap Rule 2 : IF Service is good THEN Tip is average Rule 3 : IF Service is excellent OR Food is delicious THEN Tip is generous 0.125 0.4 0 0 0.5 0.5 0.4 0.125
  • 26. 26 of 57 Build Fuzzy using Fuzzy Logic Designer
  • 28. 28 of 57 Build Fuzzy at the Command Line
  • 29. 29 of 57 Generate new fuzzy01 Add the first input (service)02 Add its membership functions03
  • 31. 31 of 57 Add the rules to the FIS05 Rule 1 : IF Service is poor OR Food is rancid THEN Tip is cheap Rule 2 : IF Service is good THEN Tip is average Rule 3 : IF Service is excellent OR Food is delicious THEN Tip is generous 1 - Index of membership function for first input 5 - Fuzzy operator (1 for AND, 2 for OR) 2 - Index of membership function for second input 3 - Index of membership function for output 4 - Rule weight
  • 32. 32 of 57 Evaluate fuzzy06
  • 35. 35 of 57 PID Fuzzy Controller System
  • 36. 36 of 57 ๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค ๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: ๐ฎ ๐ค ๐‘๐ฎ๐ฅ๐ž: ๐ข๐Ÿ ๐ž ๐ค ๐ข๐ฌ โ€ฆ ๐ญ๐ก๐ž๐ง ๐ฎ ๐ค ๐ข๐ฌ โ€ฆ P- like FLC1
  • 37. 37 of 57 ๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค , โˆ† ๐’†(๐’Œ) ๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: โˆ† ๐ฎ ๐ค ๐‘๐ฎ๐ฅ๐ž: ๐ข๐Ÿ ๐ž ๐ค ๐ข๐ฌ โ€ฆ ๐š๐ง๐ โˆ† ๐’† ๐’Œ ๐’Š๐’” โ€ฆ ๐ญ๐ก๐ž๐ง โˆ†๐ฎ ๐ค ๐ข๐ฌ โ€ฆ PI- like FLC2
  • 38. 38 of 57 ๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค , โˆ† ๐’† ๐’Œ ๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: ๐ฎ ๐ค ๐‘๐ฎ๐ฅ๐ž: ๐ข๐Ÿ ๐ž ๐ค ๐ข๐ฌ โ€ฆ ๐š๐ง๐ โˆ† ๐’† ๐’Œ ๐’Š๐’” โ€ฆ ๐ญ๐ก๐ž๐ง ๐ฎ ๐ค ๐ข๐ฌ โ€ฆ PD- like FLC3
  • 39. 39 of 57 ๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค , โˆ† ๐’† ๐’Œ , ฮฃ ๐’†(๐’Œ) ๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: ๐ฎ ๐ค ๐‘๐ฎ๐ฅ๐ž: ๐ข๐Ÿ ๐ž ๐ค ๐ข๐ฌ โ€ฆ ๐š๐ง๐ โˆ† ๐’† ๐’Œ ๐’Š๐’” โ€ฆ ๐š๐ง๐ ฮฃ๐’† ๐’Œ ๐’Š๐’” โ€ฆ ๐ญ๐ก๐ž๐ง ๐ฎ ๐ค ๐ข๐ฌ โ€ฆ PID- like FLC3
  • 40. 40 of 57 ๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค ๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: ๐ฎ ๐ค ๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค , โˆ† ๐’†(๐’Œ) ๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: ๐ฎ ๐ค ๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค , โˆ† ๐’†(๐’Œ) ๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: โˆ† ๐ฎ ๐ค ๐ˆ๐ง๐ฉ๐ฎ๐ญ: ๐ž ๐ค , โˆ† ๐’† ๐’Œ , ฮฃ ๐’†(๐’Œ) ๐จ๐ฎ๐ญ๐ฉ๐ฎ๐ญ: ๐ฎ ๐ค
  • 41. 41 of 57 Consider a system model is describe by: ๐’š (๐’Œ) = ๐ŸŽ. ๐Ÿ” ร— ๐’š (๐’Œ โˆ’ ๐Ÿ) + ๐’–(๐’Œ โˆ’ ๐Ÿ) PI-Like FLC is designed to regulate this system around a set point of R=2. Five fuzzy sets are used to represent the linguistic variables NB, NS, Z, PS and PB for the controller both input and output variables. Triangular membership functions are used to represent these fuzzy sets and defined on the normalized domain [-1,1] as shown in Fig. 1. The suggested rule-base is depicted in table. If the measured parameters are obtained as y(k-1)=1.5 and u(k-1)=0.5,find the controller output signal taking into account the actual domain of the controller variables is [-2, 2]. Knowledge Rule base e(k) NB NS Z PS PB โˆ† ๐’†(๐’Œ) NB NB NB NB NS Z NS NB NB NS Z PS Z NB NS Z PS PB PS NS Z PS PB PB PB Z PS PB PB PB
  • 42. 42 of 5742 of 24 ๐’š (๐’Œ) = ๐ŸŽ. ๐Ÿ” ร— ๐’š (๐’Œ โˆ’ ๐Ÿ) + ๐’–(๐’Œ โˆ’ ๐Ÿ) ๐’‚๐’„๐’•๐’–๐’‚๐’ ๐’…๐’๐’Ž๐’‚๐’Š๐’ โˆˆ โˆ’๐Ÿ, ๐Ÿ ๐’•๐’‰๐’† ๐’„๐’๐’๐’•๐’“๐’๐’๐’๐’†๐’“ ๐’๐’–๐’•๐’‘๐’–๐’• ๐’”๐’Š๐’ˆ๐’๐’‚๐’ find ๐’๐’๐’“๐’Ž๐’‚๐’๐’Š๐’›๐’†๐’… ๐’…๐’๐’Ž๐’‚๐’Š๐’ โˆˆ [โˆ’๐Ÿ, ๐Ÿ] ๐‘ท๐‘ฐ โˆ’ ๐‘ณ๐’Š๐’Œ๐’† ๐‘ญ๐‘ณ๐‘ช ๐’š ๐’Œ = ๐ŸŽ. ๐Ÿ” ร— ๐’š ๐’Œ โˆ’ ๐Ÿ + ๐’– ๐’Œ โˆ’ ๐Ÿ = ๐ŸŽ. ๐Ÿ” ร— ๐Ÿ. ๐Ÿ“ + ๐ŸŽ. ๐Ÿ“ = ๐Ÿ. ๐Ÿ’ ๐’†(๐’Œ) = ๐‘น(๐’Œ) โˆ’ ๐’š(๐’Œ) = ๐Ÿ โˆ’ ๐Ÿ. ๐Ÿ’ = ๐ŸŽ. ๐Ÿ” ๐œŸ๐’† (๐’Œ) = ๐’† (๐’Œ) โˆ’ ๐’† (๐’Œ โˆ’ ๐Ÿ) = ๐‘น ๐’Œ โˆ’ ๐’š ๐’Œ โˆ’ ๐‘น ๐’Œ โˆ’ ๐’š ๐’Œ โˆ’ ๐Ÿ = ๐’š ๐’Œ โˆ’ ๐Ÿ โˆ’ ๐’š ๐’Œ = ๐Ÿ. ๐Ÿ“ โˆ’ ๐Ÿ. ๐Ÿ’ = ๐ŸŽ. ๐Ÿ ๐‘ป๐’‰๐’† ๐’‚๐’„๐’•๐’–๐’‚๐’ ๐’”๐’š๐’”๐’•๐’†๐’Ž ๐’๐’–๐’•๐’‘๐’–๐’• ๐’‡๐’๐’“ ๐’•๐’‰๐’† ๐’Ž๐’†๐’‚๐’”๐’–๐’“๐’†๐’… ๐’—๐’‚๐’๐’–๐’†๐’”: ๐’š ๐’Œ โˆ’ ๐Ÿ = ๐Ÿ. ๐Ÿ“ ๐’– ๐’Œ โˆ’ ๐Ÿ = ๐ŸŽ. ๐Ÿ“
  • 43. 43 of 5743 of 24 ๐’š (๐’Œ) = ๐ŸŽ. ๐Ÿ” ร— ๐’š (๐’Œ โˆ’ ๐Ÿ) + ๐’–(๐’Œ โˆ’ ๐Ÿ) ๐’š ๐’Œ = ๐Ÿ. ๐Ÿ’ ๐’‚๐’„๐’•๐’–๐’‚๐’ ๐’…๐’๐’Ž๐’‚๐’Š๐’ โˆˆ โˆ’๐Ÿ, ๐Ÿ ๐’•๐’‰๐’† ๐’„๐’๐’๐’•๐’“๐’๐’๐’๐’†๐’“ ๐’๐’–๐’•๐’‘๐’–๐’• ๐’”๐’Š๐’ˆ๐’๐’‚๐’ find ๐’† ๐’Œ = ๐ŸŽ. ๐Ÿ” ๐’๐’๐’“๐’Ž๐’‚๐’๐’Š๐’›๐’†๐’… ๐’…๐’๐’Ž๐’‚๐’Š๐’ โˆˆ [โˆ’๐Ÿ, ๐Ÿ] ๐‘ท๐‘ฐ โˆ’ ๐‘ณ๐’Š๐’Œ๐’† ๐‘ญ๐‘ณ๐‘ช โˆ†๐’† ๐’Œ = ๐ŸŽ. ๐Ÿ ๐‘ป๐’‰๐’† ๐’๐’๐’“๐’Ž๐’‚๐’๐’Š๐’›๐’†๐’… ๐’Š๐’๐’‘๐’–๐’• ๐’—๐’‚๐’๐’–๐’†๐’” ๐’‡๐’๐’“ ๐‘ญ๐‘ณ๐‘ช ๐’˜๐’Š๐’๐’ ๐’ƒ๐’†: ๐‘ฎ ๐’† = ๐Ÿ ๐Ÿ = ๐ŸŽ. ๐Ÿ“ , ๐‘ฎโˆ†๐’† = ๐Ÿ ๐Ÿ = ๐ŸŽ. ๐Ÿ“ , ๐‘ฎโˆ†๐’– = ๐Ÿ ๐Ÿ = ๐Ÿ ๐‘ป๐’ ๐’๐’ƒ๐’•๐’‚๐’Š๐’ ๐’”๐’„๐’‚๐’๐’Š๐’๐’ˆ ๐’‡๐’‚๐’„๐’•๐’๐’“๐’”: ๐’† ๐’ ๐’Œ = ๐‘ฎ ๐’† ร— ๐’† ๐’Œ = ๐ŸŽ. ๐Ÿ“ ร— ๐ŸŽ. ๐Ÿ” = ๐ŸŽ. ๐Ÿ‘ โˆ†๐’† ๐’(๐’Œ) = ๐‘ฎโˆ†๐’† ร— โˆ†๐’† ๐’Œ = ๐ŸŽ. ๐Ÿ“ ร— ๐ŸŽ. ๐Ÿ = ๐ŸŽ. ๐ŸŽ๐Ÿ“
  • 44. 44 of 57 ๐’‡๐’–๐’›๐’›๐’Š๐’‡๐’Š๐’„๐’‚๐’•๐’Š๐’๐’ โˆถ ๐ ๐’_๐’† ๐’(๐’Œ) = ๐Ÿ ๐Ÿ‘ โˆ’ ๐ŸŽ. ๐Ÿ‘ ๐Ÿ ๐Ÿ‘ โˆ’ ๐ŸŽ = ๐ŸŽ. ๐Ÿ ๐ ๐‘ท๐‘บ_๐’† ๐’(๐’Œ) = ๐ŸŽ. ๐Ÿ‘ โˆ’ ๐ŸŽ ๐Ÿ ๐Ÿ‘ โˆ’ ๐ŸŽ = ๐ŸŽ. ๐Ÿ— ๐ ๐’_โˆ†๐’† ๐’(๐’Œ) = ๐Ÿ ๐Ÿ‘ โˆ’ ๐ŸŽ. ๐ŸŽ๐Ÿ“ ๐Ÿ ๐Ÿ‘ โˆ’ ๐ŸŽ = ๐ŸŽ. ๐Ÿ–๐Ÿ“ ๐ ๐‘ท๐‘บ_๐’† ๐’(๐’Œ) = ๐ŸŽ. ๐ŸŽ๐Ÿ“ โˆ’ ๐ŸŽ ๐Ÿ ๐Ÿ‘ โˆ’ ๐ŸŽ = ๐ŸŽ. ๐Ÿ๐Ÿ“
  • 45. 45 of 57 PS Z PS PS PS PB Z Z Z Z PS PS 0.1 0.1 0.10.85 0.850.9 0.90.15 0.150.1 0.85 0.15 IF e (k) is Z (0.1) AND โˆ†๐’†(๐’Œ) is Z (0.85) THEN โˆ†u(๐’Œ) is Z (0.1) IF e (k) is Z (0.1) AND โˆ†๐’†(๐’Œ) is PS (0.15) THEN โˆ†u(๐’Œ) is PS (0.1) IF e (k) is PS (0.9) AND โˆ†๐’†(๐’Œ) is Z (0.85) THEN โˆ†u(๐’Œ) is PS (0.85) IF e (k) is PS (0.9) AND โˆ†๐’†(๐’Œ) is PS (0.15) THEN โˆ†u(๐’Œ) is PB (0.15) Knowledge Rule base e(k) NB NS Z PS PB โˆ† ๐’†(๐’Œ) NB NB NB NB NS Z NS NB NB NS Z PS Z NB NS Z PS PB PS NS Z PS PB PB PB Z PS PB PB PB Z 0.1 PS 0.85 PB 0.15
  • 46. 46 of 57 โˆ†๐’– ๐’ ๐’Œ = ๐ŸŽ. ๐Ÿ ร— ๐ŸŽ + ๐ŸŽ. ๐Ÿ–๐Ÿ“ ร— ๐Ÿ ๐Ÿ‘ + (๐ŸŽ. ๐Ÿ๐Ÿ“ ร— ๐Ÿ ๐Ÿ‘ ) ๐ŸŽ. ๐Ÿ + ๐ŸŽ. ๐Ÿ–๐Ÿ“ + ๐ŸŽ. ๐Ÿ๐Ÿ“ โˆ†๐’– ๐’ ๐’Œ = ๐ŸŽ. ๐Ÿ‘๐Ÿ“ โˆ†๐’– ๐’ ๐’Œ = ฯƒ ๐(โˆ†๐’– ๐’) ๐‘ช ฯƒ ๐(โˆ†๐’– ๐’) approximate COA ๐’…๐’†๐’‡๐’–๐’›๐’›๐’Š๐’‡๐’Š๐’„๐’‚๐’•๐’Š๐’๐’ โˆถ โˆ†๐’– ๐’Œ = ๐‘ฎโˆ†๐’– ร— โˆ†๐’– ๐’ ๐’Œ = ๐Ÿ ร— ๐ŸŽ. ๐Ÿ‘๐Ÿ“ = ๐ŸŽ. ๐Ÿ• ๐’– ๐’Œ = ๐’– ๐’Œ โˆ’ ๐Ÿ + โˆ†๐’– ๐’Œ = ๐ŸŽ. ๐Ÿ“ + ๐ŸŽ. ๐Ÿ• = ๐Ÿ. ๐Ÿ ๐‘ป๐’‰๐’† ๐’‚๐’„๐’•๐’–๐’‚๐’ ๐’„๐’๐’๐’•๐’“๐’๐’ ๐’๐’–๐’•๐’‘๐’–๐’• ๐œŸ๐’– ๐’Œ ๐’๐’‡ ๐‘ญ๐‘ณ๐‘ช: ๐‘ป๐’‰๐’† ๐’„๐’๐’๐’•๐’“๐’๐’ ๐’”๐’Š๐’ˆ๐’๐’‚๐’ ๐’– ๐’Œ ๐’˜๐’Š๐’๐’ ๐’ƒ๐’†:
  • 48. 48 of 57 Tank Level Control System 5 cm ? 0 0.25 0.5 0.75 1 1.25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ๐žต(Level) Liquid level (cm) low okay high 0 0.5 1 -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30 ๐žต(valvecontrol) Valve control signal (%/s) close fast no change open fast Rule 1 : IF level is okay THEN valve is no change Rule 2 : IF level is low THEN valve is open fast Rule 3 : IF level is high THEN valve is close fast Liquid level Valve control signal
  • 49. 49 of 57 ๐‘ป๐’‚๐’๐’Œ ๐‘บ๐’š๐’”๐’•๐’†๐’Ž ๐‘บ๐’Š๐’Ž๐’–๐’๐’‚๐’•๐’Š๐’๐’
  • 50. 50 of 57 ๐‘บ๐’–๐’ƒ๐’”๐’š๐’”๐’•๐’†๐’Ž ๐‘ฝ๐’‚๐’๐’—๐’† ๐‘บ๐’–๐’ƒ๐’”๐’š๐’”๐’•๐’†๐’Ž ๐‘ป๐’‚๐’๐’Œ แˆถโ„Ž = 1 ๐ด ๐‘ž๐‘–๐‘› โˆ’ ๐‘Ž ๐ด 2๐‘”โ„Ž ๐‘จ = ๐ŸŽ. ๐Ÿ’ ๐’Ž ๐Ÿ ๐’‚ = ๐ŸŽ. ๐ŸŽ๐Ÿ๐Ÿ ๐’Ž ๐Ÿ ๐’’๐’Š,๐’Ž๐’‚๐’™ = ๐Ÿ๐ŸŽ ๐’/๐’” ๐ด: ๐‘๐‘Ÿ๐‘œ๐‘ ๐‘  โˆ’ ๐‘ ๐‘’๐‘๐‘ก๐‘–๐‘œ๐‘›๐‘Ž๐‘™ ๐‘Ž๐‘Ÿ๐‘’๐‘Ž ๐‘œ๐‘“ ๐‘กโ„Ž๐‘’ ๐‘ก๐‘Ž๐‘›๐‘˜ ๐‘Ž: ๐‘๐‘Ÿ๐‘œ๐‘ ๐‘  โˆ’ ๐‘ ๐‘’๐‘๐‘ก๐‘–๐‘œ๐‘›๐‘Ž๐‘™ ๐‘Ž๐‘Ÿ๐‘’๐‘Ž ๐‘œ๐‘“ ๐‘กโ„Ž๐‘’ ๐‘๐‘–๐‘๐‘’
  • 51. 51 of 57 ๐’๐’Š๐’’๐’–๐’Š๐’… ๐’๐’†๐’—๐’†๐’ ๐’—๐’‚๐’๐’—๐’† ๐’„๐’๐’๐’•๐’“๐’๐’ ๐’—๐’‚๐’๐’—๐’† ๐’๐’‘๐’†๐’๐’Š๐’๐’ˆ
  • 52. 52 of 57 ๐‘ป๐’‚๐’๐’Œ ๐‘บ๐’š๐’”๐’•๐’†๐’Ž ๐‘บ๐’Š๐’Ž๐’–๐’๐’‚๐’•๐’Š๐’๐’ With reference
  • 53. 53 of 57 ๐’๐’Š๐’’๐’–๐’Š๐’… ๐’๐’†๐’—๐’†๐’ ๐’—๐’‚๐’๐’—๐’† ๐’„๐’๐’๐’•๐’“๐’๐’ ๐’—๐’‚๐’๐’—๐’† ๐’๐’‘๐’†๐’๐’Š๐’๐’ˆ
  • 54. 54 of 57 With referenceWithout reference
  • 55. 55 of 57 References [1] L.-X. Wang, A Course in Fuzzy Systems and Control. Prentice Hall PTR, 1997. [2] S. N. Sivanandam, S. Sumathi, and S. N. Deepa, Introduction to Fuzzy Logic using MATLAB. Springer, 2006. [3] T. J. Ross, Fuzzy Logic with Engineering Applications, 2nd ed. Wiley, 2004. [4] Essam Nabil, โ€œAutonomous driving car,โ€ March,2019, pp. 1โ€“13.[presentation]. [5] Essam Nabil, โ€œFuzzy logic control system applications,โ€ March,2019, pp. 1-30 .[presentation]. [6] Essam Nabil, โ€œTipping problem,โ€ March,2019, pp. 1โ€“18.[presentation].
  • 56. 56 of 57 References [7] โ€œBuild Fuzzy Systems Using Fuzzy Logic Designer - MATLAB & Simulink.โ€ [Online]. Available: https://www.mathworks.com/help/fuzzy/building-systems-with-fuzzy-logic-toolbox- software.html. [Accessed: 22-Nov-2019]. [8] โ€œBuild Fuzzy Systems at the Command Line - MATLAB & Simulink.โ€ [Online]. Available: https://www.mathworks.com/help/fuzzy/working-from-the-command-line.html. [Accessed: 22-Nov-2019] [9] Essam Nabil, โ€œTank control systemโ€ March,2019, pp. 1โ€“18.[presentation]. [10] Essam Nabil, โ€œPID - Like Fuzzy Logic controlโ€ March,2019, pp. 1โ€“39.[presentation].
  • 57. 57 of 57 Thank You Nourhan Selem Salm FUZZY