18-Fuzzy_Logic
18-Fuzzy_Logic
and
FUZZY LOGIC
OVERVIEW
Future
WHAT IS FUZZY LOGIC?
Definition of fuzzy
Fuzzy – “not clear, distinct, or precise; blurred”
Slow Fast
Speed = 0 Speed = 1
bool speed;
get the speed
if ( speed == 0) {
// speed is slow
}
else {
// speed is fast
}
FUZZY LOGIC REPRESENTATION
Slowest
For every problem
[ 0.0 – 0.25 ]
must represent in
terms of fuzzy sets.
Slow
What are fuzzy [ 0.25 – 0.50 ]
sets?
Fast
[ 0.50 – 0.75 ]
Fastest
[ 0.75 – 1.00 ]
FUZZY LOGIC REPRESENTATION CONT.
1923: “Bertie” Russell releases a paper on Vagueness. How do we define objects that are partly in
two normally mutually exclusive sets?
1965: Zadeh coins the daft name “Fuzzy” for a logic based on Vague set membership, instantly
putting humourless scientist’s backs up.
1972: Professor Toshire Terano ( 1972 ) Organized the world's first working group on fuzzy systems.
1981: 1st commercial applications using fuzzy logic to control systems by F.L. Smidth & Co..
A B
AB AB A
Example of operations on Fuzzy sets
Applications
ABS Brakes
Expert Systems
Control Units
Bullet train between Tokyo and
Osaka
Video Cameras
Automatic Transmissions
Fuzzification
We then label these sets using human terms. Encapsulates terms with no
consensus definition, but we might use surveys to define them.
Defuzzification
To get the crisp value in terms of the membership functions we calculate the
representative value from a union of the sets. There are five methods to do
this: Centroid of area, Bisector of area, Mean of maximum, Smallest of
maximum and Largest of maximum. The most common method is to
calculate CENTROID or “gravitational centre”:
Ejemplo
Inference Engine
Solution
Suppose we have made some observations of the system (moving body) and we
estimate the values of the two inputs, mass and velocity, as crisp values. For
example, let input(i) = 0.35 kg (mass) and input(j) = 55 m s−1 (velocity). We
model the inputs as delta functions, and use the Mamdani implication as in the
previous example.
Example
1
Degree of membership
Membership
Young Middle Old function
0.5 Aged
0 50 90 Age
38yr old = 10% Young + 90% Middle Aged
Fuzzy Logic models
Membership
function
0.5 Happy Bored
0 5 10
Foot itchiness
0.6 bored to tears + 0.4 happy
Decide on rules
If BORED then LECTURE LONG.
If HAPPY the LECTURE SHORT.
Short Long
0 2
hours
Transfer the degrees to the output sets
1
0.6 Bored
Short Long
0.4 Happy
0 2 Hours
0.4
0 2 Hours
Calculate the average
0.6
0.4
0 2
Some Examples
Temperature 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
100 If Hot
90 then
Blast
80
If Warm
then
70
Fast
60
If Just
50 Right then
Medium
40 IF Cool
then
30 Slow
if Cold
20 then
Stop
10
45 50 55 60 65 70 75 80 85 90
Mapping Inputs to Outputs
1
0
100
st
90 Bla t
80 Fa
st
70
60
M ed
ium
50
40
Slo
w
30
20
10
St
o p
t
l
Ho
o
ar
Co
W
Co
Rig t
ht
Jus
ld
45 50 55 60 65 70 75 80 85 90
FUZZY LOGIC VS. NEURAL
NETWORKS
How does a Neural Network work?
Neural Networks
systems.
BENEFITS OF USING FUZZY LOGIC
ANTI LOCK BREAK SYSTEM ( ABS )
Nonlinear and dynamic in nature
Inputs for Intel Fuzzy ABS are derived from
Brake
4 WD
Feedback
Wheel speed
Ignition
Outputs
Pulsewidth
Error lamp
CONCLUSION
http://www.csc.uvic.ca/~mcheng/
460/notes/fuzzy_logic.pdf