SlideShare a Scribd company logo
1 of 48
Introduction to Fuzzy Logic
Control
Fuzzy Logic 2
Overview
• Crisp Variables
• Fuzzy Variables
• Fuzzy Logic Operators
• Fuzzy Control
• Case Study
Fuzzy Logic 3
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}
Fuzzy Logic 4
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}
Fuzzy Logic 5
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?
Fuzzy Logic 6
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?
Fuzzy Logic 7
Membership Functions
• Temp: {Freezing, Cool, Warm, Hot}
• Degree of Truth or "Membership"
50 70 90 110
30
10
Temp. (F°)
Freezing Cool Warm Hot
0
1
Fuzzy Logic 8
Membership Functions
• How cool is 36 F° ?
50 70 90 110
30
10
Temp. (F°)
Freezing Cool Warm Hot
0
1
Fuzzy Logic 9
Membership Functions
• How cool is 36 F° ?
• It is 30% Cool and 70% Freezing
50 70 90 110
30
10
Temp. (F°)
Freezing Cool Warm Hot
0
1
0.7
0.3
Structure of Fuzzy Logic
Controller
2/9/2004 Fuzzy Logic 10
Fuzzy logic Algorithm
Fuzzy Logic 11
Fuzzy Logic Controller
Defuzzifier
Fuzzifier
Inference
Engine
Membership
Functions
Fuzzy (IF THEN) Rules
Fuzzy Variables
Linguistic Variables
Crisp
Values
Crisp
Values
•Intuition
•Inference
•Rank ordering
•Angular fuzzy set
•Neural network
•GA
•Inductive Reasoning
•Max-membership principle
•Centroid method
•Weighted average method
•Mean-Max membership
Fuzzy Logic 13
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
Fuzzy Logic 14
Fuzzy Disjunction
• AB max(A, B)
• AB = C "Quality C is the disjunction of
Quality A and B"
0
1
0.375
A
0
1
0.75
B
• (AB = C)  (C = 0.75)
Fuzzy Logic 15
Fuzzy Conjunction
• AB min(A, B)
• AB = C "Quality C is the conjunction of
Quality A and B"
0
1
0.375
A
0
1
0.75
B
• (AB = C)  (C = 0.375)
Fuzzy Logic 16
Example: Fuzzy Conjunction
Calculate AB given that A is .4 and B is 20
0
1
A
0
1
B
.1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40
Fuzzy Logic 17
Example: Fuzzy Conjunction
Calculate AB given that A is .4 and B is 20
0
1
A
0
1
B
.1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40
• Determine degrees of membership:
Fuzzy Logic 18
Example: Fuzzy Conjunction
Calculate AB given that A is .4 and B is 20
0
1
A
0
1
B
.1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40
• Determine degrees of membership:
• A = 0.7
0.7
Fuzzy Logic 19
Example: Fuzzy Conjunction
Calculate AB given that A is .4 and B is 20
0
1
A
0
1
B
.1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40
• Determine degrees of membership:
• A = 0.7 B = 0.9
0.7
0.9
Fuzzy Logic 20
Example: Fuzzy Conjunction
Calculate AB given that A is .4 and B is 20
0
1
A
0
1
B
.1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40
• Determine degrees of membership:
• A = 0.7 B = 0.9
• Apply Fuzzy AND
• AB = min(A, B) = 0.7
0.7
0.9
Fuzzy Logic 21
Fuzzy Control
• Fuzzy Control combines the use of fuzzy
linguistic variables with fuzzy logic
• Example: Speed Control
• How fast am I going to drive today?
• It depends on the weather.
• Disjunction of Conjunctions
Fuzzy Logic 22
Inputs: Temperature
• Temp: {Freezing, Cool, Warm, Hot}
50 70 90 110
30
10
Temp. (F°)
Freezing Cool Warm Hot
0
1
Fuzzy Logic 23
Inputs: Temperature, Cloud Cover
• Temp: {Freezing, Cool, Warm, Hot}
• Cover: {Sunny, Partly, Overcast}
• Speed: {Slow, Fast}
50 70 90 110
30
10
Temp. (F°)
Freezing Cool Warm Hot
0
1
40 60 80 100
20
0
Cloud Cover (%)
Overcast
Partly Cloudy
Sunny
0
1
50 75 100
25
0
Speed (mph)
Slow Fast
0
1
Fuzzy Logic 24
Rules
• If it's Sunny and Warm, drive Fast
Sunny(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...
Fuzzy Logic 25
Example Speed Calculation
• How fast will I go if it is
• 65 F°
• 25 % Cloud Cover ?
Fuzzy Logic 26
Fuzzification:
Calculate Input Membership Levels
• 65 F°  Cool = 0.4, Warm= 0.7
50 70 90 110
30
10
Temp. (F°)
Freezing Cool Warm Hot
0
1
Fuzzy Logic 27
Fuzzification:
Calculate Input Membership Levels
• 65 F°  Cool = 0.4, Warm= 0.7
• 25% Cover Sunny = 0.8, Cloudy = 0.2
50 70 90 110
30
10
Temp. (F°)
Freezing Cool Warm Hot
0
1
40 60 80 100
20
0
Cloud Cover (%)
Overcast
Partly Cloudy
Sunny
0
1
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
Fuzzy Logic 29
Defuzzification: (weighted mean
method) Constructing the Output
• Speed is 20% Slow and 70% Fast
• Find centroids: Location where
membership is 100%
50 75 100
25
0
Speed (mph)
Slow Fast
0
1
Fuzzy Logic 30
Defuzzification:
Constructing the Output
• Speed is 20% Slow and 70% Fast
• Find centroids: Location where
membership is 100%
50 75 100
25
0
Speed (mph)
Slow Fast
0
1
Fuzzy Logic 31
Defuzzification:
Constructing the Output
• Speed is 20% Slow and 70% Fast
• Speed = weighted mean
= (0.2*25+...
50 75 100
25
0
Speed (mph)
Slow Fast
0
1
Fuzzy Logic 32
Defuzzification:
Constructing the Output
• Speed is 20% Slow and 70% Fast
• Speed = weighted mean
= (0.2*25+0.7*75)/(9)
= 47.9mph
50 75 100
25
0
Speed (mph)
Slow Fast
0
1
2/9/2004 Fuzzy Logic 33
•Fuzzy Logic Example
•Automotive Speed Controller
•3 inputs:
• speed (5 levels)
• acceleration (3 levels)
• distance to destination (3 levels)
•1 output:
• power (fuel flow to engine)
•Set of rules to determine output based on
input values
•Fuzzy Logic Example
1.0
1.0
1.0
Too
Slow
Slow Optimum
Too
Fast
Fast
Speed
Acceleration
Distance
Decelerating Constant Accelerating
Very
Close
Close Distant
Fuzzy Logic Example
Example Rules
•IF speed is TOO SLOW and acceleration is
DECELERATING, THEN INCREASE POWER GREATLY
•IF speed is SLOW and acceleration is DECREASING, THEN
INCREASE POWER SLIGHTLY
•IF distance is CLOSE, THEN DECREASE POWER
SLIGHTLY
•. . .
Output Determination
•Degree of membership in an output fuzzy set now
represents each fuzzy action.
•Fuzzy actions are combined to form a system
output.
Fuzzy Logic Example
1.0
Power
Decrease
power
greatly
Leave
power
constant
Increase
power
greatly
Increase
power
slightly
Decrease
power
slightly
.3 increase
slightly
.7 Leave
constant
Fuzzy Logic Example
Steps
Fuzzification: determines an input's % membership
in overlapping sets.
Rules: determine outputs based on inputs and rules.
Combination/Defuzzification: combine all fuzzy
actions into a single fuzzy action and transform the
single fuzzy action into a crisp, executable system
output. May use centroid of weighted sets.
Fuzzy Logic 39
Fuzzy Logic 40
•Mamdani
Fuzzy Logic 41
•Mamdani
Fuzzy Logic 42
Fuzzy Logic 43
•Sugeno
Fuzzy Logic 44
Fuzzy Logic 45
Fuzzy Logic 46
Notes: Follow-up Points
• Fuzzy Logic Control allows for the
smooth interpolation between
variable centroids with relatively
few rules
• This does not work with crisp
(traditional Boolean) logic
• Provides a natural way to model
some types of human expertise in a
computer program
Fuzzy Logic 47
Notes: Drawbacks to Fuzzy logic
• Requires tuning of membership
functions
• Fuzzy Logic control may not scale
well to large or complex problems
• Deals with imprecision, and
vagueness, but not uncertainty
Fuzzy Logic 48
Summary
• Fuzzy Logic provides way to calculate
with imprecision and vagueness
• Fuzzy Logic can be used to represent
some kinds of human expertise
• Fuzzy Membership Sets
• Fuzzy Linguistic Variables
• Fuzzy AND and OR
• Fuzzy Control

More Related Content

Similar to fuzzy-logic nit-Bharat.ppt

Similar to fuzzy-logic nit-Bharat.ppt (20)

Fuzzy logic mtech project in jalandhar
Fuzzy logic mtech project in jalandharFuzzy logic mtech project in jalandhar
Fuzzy logic mtech project in jalandhar
 
Fuzzy logic mtech project in ludhiana
Fuzzy logic mtech project in ludhiana Fuzzy logic mtech project in ludhiana
Fuzzy logic mtech project in ludhiana
 
Simulated annealing
Simulated annealingSimulated annealing
Simulated annealing
 
Lecture 5 process synchronization
Lecture 5 process synchronizationLecture 5 process synchronization
Lecture 5 process synchronization
 
Fuzzy logicintro by
Fuzzy logicintro by Fuzzy logicintro by
Fuzzy logicintro by
 
6months industrial training in fuzzy logic, ludhiana
6months industrial training in fuzzy logic, ludhiana6months industrial training in fuzzy logic, ludhiana
6months industrial training in fuzzy logic, ludhiana
 
6 weeks summer training in fuzzy logic,jalandhar
6 weeks summer training in fuzzy logic,jalandhar6 weeks summer training in fuzzy logic,jalandhar
6 weeks summer training in fuzzy logic,jalandhar
 
6months industrial training in fuzzy logic, jalandhar
6months industrial training in fuzzy logic, jalandhar6months industrial training in fuzzy logic, jalandhar
6months industrial training in fuzzy logic, jalandhar
 
6 weeks summer training in fuzzy logic,ludhiana
6 weeks summer training in fuzzy logic,ludhiana6 weeks summer training in fuzzy logic,ludhiana
6 weeks summer training in fuzzy logic,ludhiana
 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
 
Fuzzy logic - copy
Fuzzy logic - copyFuzzy logic - copy
Fuzzy logic - copy
 
fuzzy-logic.ppt
fuzzy-logic.pptfuzzy-logic.ppt
fuzzy-logic.ppt
 
LVTS APC fuzzy controller
LVTS APC fuzzy controllerLVTS APC fuzzy controller
LVTS APC fuzzy controller
 
L3-.pptx
L3-.pptxL3-.pptx
L3-.pptx
 
Class13_Quicksort_Algorithm.pdf
Class13_Quicksort_Algorithm.pdfClass13_Quicksort_Algorithm.pdf
Class13_Quicksort_Algorithm.pdf
 
Ch03 fls
Ch03 flsCh03 fls
Ch03 fls
 
Lec 5 uncertainty
Lec 5 uncertaintyLec 5 uncertainty
Lec 5 uncertainty
 
08 neural networks
08 neural networks08 neural networks
08 neural networks
 
Process Capability - Cp, Cpk. Pp, Ppk
Process Capability - Cp, Cpk. Pp, Ppk Process Capability - Cp, Cpk. Pp, Ppk
Process Capability - Cp, Cpk. Pp, Ppk
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

fuzzy-logic nit-Bharat.ppt

  • 1. Introduction to Fuzzy Logic Control
  • 2. Fuzzy Logic 2 Overview • Crisp Variables • Fuzzy Variables • Fuzzy Logic Operators • Fuzzy Control • Case Study
  • 3. Fuzzy Logic 3 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}
  • 4. Fuzzy Logic 4 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}
  • 5. Fuzzy Logic 5 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?
  • 6. Fuzzy Logic 6 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?
  • 7. Fuzzy Logic 7 Membership Functions • Temp: {Freezing, Cool, Warm, Hot} • Degree of Truth or "Membership" 50 70 90 110 30 10 Temp. (F°) Freezing Cool Warm Hot 0 1
  • 8. Fuzzy Logic 8 Membership Functions • How cool is 36 F° ? 50 70 90 110 30 10 Temp. (F°) Freezing Cool Warm Hot 0 1
  • 9. Fuzzy Logic 9 Membership Functions • How cool is 36 F° ? • It is 30% Cool and 70% Freezing 50 70 90 110 30 10 Temp. (F°) Freezing Cool Warm Hot 0 1 0.7 0.3
  • 10. Structure of Fuzzy Logic Controller 2/9/2004 Fuzzy Logic 10
  • 12. Fuzzy Logic Controller Defuzzifier Fuzzifier Inference Engine Membership Functions Fuzzy (IF THEN) Rules Fuzzy Variables Linguistic Variables Crisp Values Crisp Values •Intuition •Inference •Rank ordering •Angular fuzzy set •Neural network •GA •Inductive Reasoning •Max-membership principle •Centroid method •Weighted average method •Mean-Max membership
  • 13. Fuzzy Logic 13 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
  • 14. Fuzzy Logic 14 Fuzzy Disjunction • AB max(A, B) • AB = C "Quality C is the disjunction of Quality A and B" 0 1 0.375 A 0 1 0.75 B • (AB = C)  (C = 0.75)
  • 15. Fuzzy Logic 15 Fuzzy Conjunction • AB min(A, B) • AB = C "Quality C is the conjunction of Quality A and B" 0 1 0.375 A 0 1 0.75 B • (AB = C)  (C = 0.375)
  • 16. Fuzzy Logic 16 Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 0 1 A 0 1 B .1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40
  • 17. Fuzzy Logic 17 Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 0 1 A 0 1 B .1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40 • Determine degrees of membership:
  • 18. Fuzzy Logic 18 Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 0 1 A 0 1 B .1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40 • Determine degrees of membership: • A = 0.7 0.7
  • 19. Fuzzy Logic 19 Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 0 1 A 0 1 B .1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40 • Determine degrees of membership: • A = 0.7 B = 0.9 0.7 0.9
  • 20. Fuzzy Logic 20 Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 0 1 A 0 1 B .1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40 • Determine degrees of membership: • A = 0.7 B = 0.9 • Apply Fuzzy AND • AB = min(A, B) = 0.7 0.7 0.9
  • 21. Fuzzy Logic 21 Fuzzy Control • Fuzzy Control combines the use of fuzzy linguistic variables with fuzzy logic • Example: Speed Control • How fast am I going to drive today? • It depends on the weather. • Disjunction of Conjunctions
  • 22. Fuzzy Logic 22 Inputs: Temperature • Temp: {Freezing, Cool, Warm, Hot} 50 70 90 110 30 10 Temp. (F°) Freezing Cool Warm Hot 0 1
  • 23. Fuzzy Logic 23 Inputs: Temperature, Cloud Cover • Temp: {Freezing, Cool, Warm, Hot} • Cover: {Sunny, Partly, Overcast} • Speed: {Slow, Fast} 50 70 90 110 30 10 Temp. (F°) Freezing Cool Warm Hot 0 1 40 60 80 100 20 0 Cloud Cover (%) Overcast Partly Cloudy Sunny 0 1 50 75 100 25 0 Speed (mph) Slow Fast 0 1
  • 24. Fuzzy Logic 24 Rules • If it's Sunny and Warm, drive Fast Sunny(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...
  • 25. Fuzzy Logic 25 Example Speed Calculation • How fast will I go if it is • 65 F° • 25 % Cloud Cover ?
  • 26. Fuzzy Logic 26 Fuzzification: Calculate Input Membership Levels • 65 F°  Cool = 0.4, Warm= 0.7 50 70 90 110 30 10 Temp. (F°) Freezing Cool Warm Hot 0 1
  • 27. Fuzzy Logic 27 Fuzzification: Calculate Input Membership Levels • 65 F°  Cool = 0.4, Warm= 0.7 • 25% Cover Sunny = 0.8, Cloudy = 0.2 50 70 90 110 30 10 Temp. (F°) Freezing Cool Warm Hot 0 1 40 60 80 100 20 0 Cloud Cover (%) Overcast Partly Cloudy Sunny 0 1
  • 28. 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
  • 29. Fuzzy Logic 29 Defuzzification: (weighted mean method) Constructing the Output • Speed is 20% Slow and 70% Fast • Find centroids: Location where membership is 100% 50 75 100 25 0 Speed (mph) Slow Fast 0 1
  • 30. Fuzzy Logic 30 Defuzzification: Constructing the Output • Speed is 20% Slow and 70% Fast • Find centroids: Location where membership is 100% 50 75 100 25 0 Speed (mph) Slow Fast 0 1
  • 31. Fuzzy Logic 31 Defuzzification: Constructing the Output • Speed is 20% Slow and 70% Fast • Speed = weighted mean = (0.2*25+... 50 75 100 25 0 Speed (mph) Slow Fast 0 1
  • 32. Fuzzy Logic 32 Defuzzification: Constructing the Output • Speed is 20% Slow and 70% Fast • Speed = weighted mean = (0.2*25+0.7*75)/(9) = 47.9mph 50 75 100 25 0 Speed (mph) Slow Fast 0 1
  • 34. •Fuzzy Logic Example •Automotive Speed Controller •3 inputs: • speed (5 levels) • acceleration (3 levels) • distance to destination (3 levels) •1 output: • power (fuel flow to engine) •Set of rules to determine output based on input values
  • 35. •Fuzzy Logic Example 1.0 1.0 1.0 Too Slow Slow Optimum Too Fast Fast Speed Acceleration Distance Decelerating Constant Accelerating Very Close Close Distant
  • 36. Fuzzy Logic Example Example Rules •IF speed is TOO SLOW and acceleration is DECELERATING, THEN INCREASE POWER GREATLY •IF speed is SLOW and acceleration is DECREASING, THEN INCREASE POWER SLIGHTLY •IF distance is CLOSE, THEN DECREASE POWER SLIGHTLY •. . .
  • 37. Output Determination •Degree of membership in an output fuzzy set now represents each fuzzy action. •Fuzzy actions are combined to form a system output. Fuzzy Logic Example 1.0 Power Decrease power greatly Leave power constant Increase power greatly Increase power slightly Decrease power slightly .3 increase slightly .7 Leave constant
  • 38. Fuzzy Logic Example Steps Fuzzification: determines an input's % membership in overlapping sets. Rules: determine outputs based on inputs and rules. Combination/Defuzzification: combine all fuzzy actions into a single fuzzy action and transform the single fuzzy action into a crisp, executable system output. May use centroid of weighted sets.
  • 46. Fuzzy Logic 46 Notes: Follow-up Points • Fuzzy Logic Control allows for the smooth interpolation between variable centroids with relatively few rules • This does not work with crisp (traditional Boolean) logic • Provides a natural way to model some types of human expertise in a computer program
  • 47. Fuzzy Logic 47 Notes: Drawbacks to Fuzzy logic • Requires tuning of membership functions • Fuzzy Logic control may not scale well to large or complex problems • Deals with imprecision, and vagueness, but not uncertainty
  • 48. Fuzzy Logic 48 Summary • Fuzzy Logic provides way to calculate with imprecision and vagueness • Fuzzy Logic can be used to represent some kinds of human expertise • Fuzzy Membership Sets • Fuzzy Linguistic Variables • Fuzzy AND and OR • Fuzzy Control