Professional Documents
Culture Documents
Dr Alexiei Dingli
Definition of fuzzy
Formal Definition
TRADITIONAL REPRESENTATION
OF LOGIC
bool speed;
get the speed
if ( speed == 0) {
// speed is slow
}
else {
// speed is fast
}
Slowest
[ 0.0 0.25 ]
Slow
[ 0.25 0.50 ]
Fast
[ 0.50 0.75 ]
Fastest
[ 0.75 1.00 ]
Fuzzy Sets
Membership Functions
Temp: {Freezing, Cool, Warm, Hot}
Degree of Truth or "Membership"
1
Freezing
Cool
Warm
Hot
30
50
70
90
0
10
Temp. (F)
110
Membership Functions
How cool is 36 ?
Freezing
Cool
Warm
Hot
30
50
70
90
0
10
Temp. (F)
110
Membership Functions
How cool is 36 F ?
It is 30% Cool and 70% Freezing
Freezing
Cool
Warm
Hot
50
70
90
0.7
0.3
0
10
30
Temp. (F)
110
Fuzzy Logic
Fuzzy Disjunction
AB = max(A, B)
AB = C "Quality C is the disjunction of Quality A and B"
B
A
1
1
0.75
0.375
(AB = C) (C = 0.75)
Fuzzy Conjunction
AB = min(A, B)
AB = C "Quality C is the conjunction of Quality A and B"
B
A
1
1
0.75
0.375
(AB = C) (C = 0.375)
A
1
.1 .2 .3 .4 .5 .6 .7 .8 .9
1 5 10 15 20 25 30 35 40
A
1
.1 .2 .3 .4 .5 .6 .7 .8 .9
1 5 10 15 20 25 30 35 40
A
1
0.7
.1 .2 .3 .4 .5 .6 .7 .8 .9
1 5 10 15 20 25 30 35 40
A
1
0.9
0.7
.1 .2 .3 .4 .5 .6 .7 .8 .9
1 5 10 15 20 25 30 35 40
A
1
0.9
0.7
.1 .2 .3 .4 .5 .6 .7 .8 .9
1 5 10 15 20 25 30 35 40
Fuzzy Control
Disjunction of Conjunctions
Inputs: Temperature
Temp: {Freezing, Cool, Warm, Hot}
1
Freezing
Cool
Warm
Hot
30
50
70
90
0
10
Temp. (F)
110
Freezing
Cool
Warm
Hot
30
50
70
90
0
10
110
Temp. (F)
Sunny
Overcast
0
0
20
40
60
80
100
Output: Speed
Fast
Slow
0
0
25
50
75
Speed (mph)
100
Rules
Fuzzification:
Calculate Input Membership Levels
65 F Cool = 0.4, Warm= 0.7
1
Freezing
Cool
Warm
Hot
30
50
70
90
0
10
110
Temp. (F)
Sunny
Overcast
0
0
20
40
60
80
100
...Calculating...
Defuzzification:
Constructing the Output
Fast
Slow
0
0
25
50
75
100
Speed (mph)
2/9/2004
Fuzzy Logic
30
Defuzzification:
Constructing the Output
Fast
Slow
0
0
25
50
75
100
Speed (mph)
Defuzzification:
Constructing the Output
Fast
Slow
0
0
25
50
75
100
Speed (mph)
Defuzzification:
Constructing the Output
Fast
Slow
0
0
25
50
75
100
Speed (mph)
Fuzzy Logic
33
Some Examples
Temperature Controller
TEMPERATURE CONTROLLER
The problem
Brake
4 WD
Feedback
Wheel speed
Ignition
Outputs
Pulsewidth
Error lamp
Structure of Controller
Fuzzification
Scales and maps input variables to fuzzy sets
Inference Mechanism
Approximate reasoning
Deduces the control action
Defuzzification
Convert fuzzy output values to control signals
Rule Base
Air Temperature
Fan Speed
Rules
s
Bla
If Hot
then
Blast
Fa
s
If Warm
then
Fast
70
60
50
40
If Just Right
then
Medium
Med
ium
IF Cool
then
Slow
Sl
ow
30
if Cold
then Stop
20
o
St
10
t
Ho
ar
W
Jus
Rig t
ht
ld
Co
Co
ol
0
45
50
55
60
65
70
75
80
85
90
CONCLUSION
Questions?