Sunteți pe pagina 1din 37

5/13/2018 1

Introduction
 Fuzzy logic:
 A way to represent variation or imprecision in logic
 A way to make use of natural language in logic
 Approximate reasoning
 Humans say things like "If it is sunny and warm today, I
will drive fast"
 Linguistic variables:
 Temp: {freezing, cool, warm, hot}
 Cloud Cover: {overcast, partly cloudy, sunny}
 Speed: {slow, fast}

2/9/2004 Fuzzy Logic 2


INTRODUCTION CON’D…
 Fuzzy logic has rapidly become one of the most successful
of today's technologies for developing sophisticated control
systems.
 Fuzzy logic addresses such applications perfectly as it
resembles human decision making with an ability to
generate precise solutions from certain or approximate
information.
 It fills an important gap in engineering design methods left
vacant by purely mathematical approaches (e.g. linear
control design), and purely logic-based approaches (e.g.
expert systems) in system design.

5/13/2018 3
 While other approaches require accurate equations to model
real-world behaviors, fuzzy design can accommodate the
ambiguities of real-world human language and logic.

 It provides both an intuitive method for describing systems


in human terms and automates the conversion of those
system specifications into effective models.

5/13/2018 4
What do you mean by fuzzy ??!!
 Fuzzy logic is a superset of Boolean logic that has been
extended to handle the concept of partial truth- truth values
between "completely true" and "completely false".
 The essential characteristics of fuzzy logic are as follows:-
 exact reasoning is viewed as a limiting case of approximate
reasoning.
 everything is a matter of degree.
 Any logical system can be fuzzified
 knowledge is interpreted as a collection of elastic or fuzzy
constraint on a collection of variables
 The third statement hence, define Boolean logic as a subset
of Fuzzy logic.

5/13/2018 5
Fuzzy Sets

 A paradigm is a set of rules and regulations which defines boundaries


and tells us what to do to be successful in solving problems within these
boundaries.

 For example the use of transistors instead of vacuum tubes is a


paradigm shift - likewise the development of Fuzzy Set Theory from
conventional bivalent set theory is a paradigm shift.

 Bivalent Set Theory can be somewhat limiting if we wish to describe a


'humanistic' problem mathematically.

5/13/2018 6
How do fuzzy sets differ from classical sets?

 In classical set theory we assume that all sets rare well-


defined (or crisp), that is given any object in our universe
we can always say that object either is or is not the
member of a particular set.
 CLASSICAL SETS
 The set of people that can run a mile in 4 minutes or less.
 The set of children under age seven that weigh more than 1oo
pounds.
 FUZZY SETS
 The set of fast runners.
 The set of overweight children.

5/13/2018 7
WHY FUZZY CONTROL?

 Fuzzy Logic is a technique to embody human like thinking


into a control system.
 A fuzzy controller is designed to emulate human deductive
thinking, that is, the process people use to infer conclusions
from what they know.
 Traditional control approach requires formal modeling of
the physical reality.

5/13/2018 8
How far can fuzzy logic go???

 It can appear almost anyplace where computers and


modern control theory are overly precise as well as in tasks
requiring delicate human intuition and experience-based
knowledge. What does the future hold?
 Computers that understand and respond to normal human
language.
 Molecule-sized soldiers of health that will roam the blood-
stream, killing cancer cells and slowing the aging process.

5/13/2018 9
Crisp (Traditional) Variables
 Crisp variables represent precise quantities:
 x = 3.1415296
 A {0,1}
 A proposition is either True or False
 ABC

 King(Richard)  Greedy(Richard) 
Evil(Richard)
 Richard is either greedy or he isn't:
 Greedy(Richard) {0,1}

2/9/2004 Fuzzy Logic 10


1. Fuzzy Sets

 What if Richard is only somewhat


greedy?
 Fuzzy Sets can represent the degree to
which a quality is possessed.
 Fuzzy Sets (Simple Fuzzy Variables)
have values in the range of [0,1]
 Greedy(Richard) = 0.7
 Question: How evil is Richard?

2/9/2004 Fuzzy Logic 11


2. Fuzzy Linguistic Variables

 Fuzzy Linguistic Variables are used to


represent qualities spanning a particular
spectrum
 Temp: {Freezing, Cool, Warm, Hot}
 Membership Function
 Question: What is the temperature?
 Answer: It is warm.
 Question: How warm is it?

2/9/2004 Fuzzy Logic 12


3. Membership Functions

 Temp: {Freezing, Cool, Warm, Hot}


 Degree of Truth or "Membership"

2/9/2004 Fuzzy Logic 13


Membership Functions cont’d…

 How cool is 36 F° ?

2/9/2004 Fuzzy Logic 14


Membership Functions cont’d…

 How cool is 36 F° ?
 It is 30% Cool and 70% Freezing

0.7

0.3

2/9/2004 Fuzzy Logic 15


Fuzzy Logic

 How do we use fuzzy membership functions in


predicate logic?
 Fuzzy logic Connectives:
 Fuzzy Conjunction, 
 Fuzzy Disjunction, 
 Operate on degrees of membership in fuzzy sets

2/9/2004 Fuzzy Logic 16


Fuzzy Disjunction

 AB max (A, B)


 AB = C "Quality C is the disjunction
of Quality A and B"

(AB = C)  (C = 0.75)
2/9/2004 Fuzzy Logic 17
Fuzzy Conjunction

 AB min (A, B)


 AB = C "Quality C is the conjunction
of Quality A and B"

(AB = C)  (C = 0.375)
2/9/2004 Fuzzy Logic 18
Example: Fuzzy Conjunction

Calculate AB given that A is .4 and B is 20

Determine degrees of membership:

2/9/2004 Fuzzy Logic 19


Example: Fuzzy Conjunction

Calculate AB given that A is .4 and B is 20

0.9
0.7

Determine degrees of membership:


A = 0.7 B = 0.9
Apply Fuzzy AND
AB = min(A, B) = 0.7

2/9/2004 Fuzzy Logic 20


Fuzzy Control

 Fuzzy Control combines the use of fuzzy


linguistic variables with fuzzy logic

Example_2: Speed Control

 How fast am I going to drive today?


 It depends on the weather.
 Disjunction of Conjunctions
2/9/2004 Fuzzy Logic 21
Inputs: Temperature

 Temp: {Freezing, Cool, Warm, Hot}

2/9/2004 Fuzzy Logic 22


Inputs: Temperature, Cloud Cover

 Temp: {Freezing, Cool, Warm, Hot}

 Cloud Cover: {Sunny, Partly, Overcast}

2/9/2004 Fuzzy Logic 23


Output: Speed

 Speed: {Slow, Fast}

2/9/2004 Fuzzy Logic 24


Rules
 If it's Sunny and Warm, drive Fast
Sunny(Cloud Cover)Warm(Temp) Fast(Speed)

 If it's Cloudy and Cool, drive Slow


Cloudy(Cover)Cool(Temp) Slow(Speed)

 Driving Speed is the combination of output of


these rules...

2/9/2004 Fuzzy Logic 25


Example Speed Calculation

 How fast will I go if it is


 65 F°
 25 % Cloud Cover ?

2/9/2004 Fuzzy Logic 26


Fuzzification: Calculate Input Membership Levels

 65 F°  Cool = 0.4, Warm= 0.7

0.7

0.4

2/9/2004 Fuzzy Logic 27


Fuzzification:
Calculate Input Membership Levels

 25% Cover Sunny = 0.8, Cloudy = 0.2

Sunny Partly Cloudy Overcast


1

0.8

0.2
0
0 20 40 60 80 100
Cloud Cover (%)

2/9/2004 Fuzzy Logic 28


...Calculating...

 If it's Sunny and Warm, drive Fast


Sunny(Cover) Warm(Temp)Fast(Speed)
0.8  0.7 = 0.7
 Fast = 0.7

 If it's Cloudy and Cool, drive Slow


Cloudy(Cover) Cool(Temp)Slow(Speed)
0.2  0.4 = 0.2
 Slow = 0.2

2/9/2004 Fuzzy Logic 29


Defuzzification:
Constructing the Output
 If Speed is 30% Slow and 70% Fast:

 Find centroids: Location where membership is 100%

2/9/2004 Fuzzy Logic 30


Defuzzification:
Constructing the Output cont’d…

 If Speed is 30% Slow and 60% Fast


0.7 fast or 0.3 slow

0.9 slow or 0.1 fast

 Speed = weighted mean


= (0.3*25+0.6*75)/(0.9)
= 63.8 mph
2/9/2004 Fuzzy Logic 31
Example 3: Modeling inverted
pendulum on a cart
Given:
M, m, b, I and l
Find:
F, x and theta
Design requirements:
Error must be less than or
equal to 5%
This ex. Is Taken from:
201053112919993 on
Google
Type: non linear equation
5/13/2018 32
Example 3: inverted pendulum on a
cart con’d…

5/13/2018 33
Example 3: inverted pendulum on a
cart con’d…

5/13/2018 34
Example 3: inverted pendulum on a
cart con’d…

5/13/2018 35
Example 3: inverted pendulum on a
cart con’d…
Can we control this non linear
equation using fuzzy Logic
Controller (FLC)?

See you on chapter 5

5/13/2018 36
5/13/2018 37

S-ar putea să vă placă și