Sunteți pe pagina 1din 25

CHAPTER TEN

FUZZY LOGIC CONTROL


© Copyrighted material.

This material may not be used except in conjunction


with the “Introduction to Robotics: Analysis, Control,
Applications” by Saeed B. Niku, John Wiley and
Sons, 2011.
The slides may not be printed or distributed to anyone,
including students, or placed on the Internet in any
form, including on BlackBoard.
Introduction

 "Tuesday, October 26, 1993 was supposed to be a


very warm day in San Luis Obispo, and in fact it
turned out to be pretty hot. When the robotics lab was
opened in the morning we found out that the steam
line had leaked into the room and much heat and
humidity had been released into the environment.
When the hydraulic power unit for the robots was
turned on, it added even more heat to the lab, raising
the temperature even further. Eventually it got so hot
that we had to bring in large fans to cool down the lab
a bit to make it a little more comfortable for students.”
Fuzzy Words

 "Tuesday, October 26, 1993 was supposed to be a


very warm day in San Luis Obispo, and in fact it
turned out to be pretty hot. When the robotics lab was
opened in the morning we found out that the steam
line had leaked into the room and much heat and
humidity had been released into the environment.
When the hydraulic power unit for the robots was
turned on, it added even more heat to the lab, raising
the temperature even further. Eventually it got so hot
that we had to bring in large fans to cool down the lab
a bit to make it a little more comfortable for students.”
Fuzzy Statements

 Fuzzy words and statements


 Difficult to define
 Hard to quantify
 Difficult to use
 Hard to control
 Example:
 IF TEMPERATURE >= 75TURN ON A/C
Crisp versus Fuzzy Values

 Crisp values
 Fuzzy values
Fuzzy Sets: Degrees of membership and
Truth

 Fuzzy sets
 Degree of membership or truth
 Belonging to more than one set
 Example:
 Clean-Water set
 Dirty-Water set
Fuzzy Rules

 Structure of a rule
 Example:
 IF RULE THEN CONSEQUENCE
 Structure of rules with multiple inputs and outputs
 Example:
 INPUT1= degree-of-membership in INPUT1-SET AND
 INPUT2= degree-of-membership in INPUT2-SET THEN
 OUTPUT=degree-of-membership in OUTPUT-SET
What is Needed

 Fuzzification
 Fuzzy rules base
 Defuzzification
Fuzzification

 The process of converting input and output


variables into membership functions, fuzzy
sets, and proper limits
Fuzzification: Membership Functions

 Gaussian membership function

0
Variable
Fuzzification: Membership Functions

 Trapezoidal membership function

0 Variable
Fuzzification: Membership Functions

 Triangular membership function

0 Variable
Fuzzification: Membership Functions

 Z-shaped and S-shaped membership functions

1 1

0 Variable 0 Variable
Fuzzification: Membership Functions

 Example

VERY-HOT
WARM
COLD

HOT
Degree of Membership

0.7
0.5

0.27

0
60 70 80 90 100
78 Temerature
Fuzzy Inference Rule Base

 Usually in one of the three following forms:


 if <condition> then <consequence>

 if <condition1 and (or) condition2> then


<consequence>
 if <condition1 and (or) condition2> then

<consequence1 and (or) consequence2>


Fuzzy Inference Rule Base, Cont.

 AND versus OR
 The result of an “and” operation is the minimum of
the two values.
 The result of an “or” operation is the maximum of

the two values.


 Example:
 IF temperature is HOT and humidity is HUMID then
power is HIGH
 IF temperature is HOT or humidity is HUMID then
power is HIGH
Fuzzy Inference Rule Base: Cont.

 Graphical representation
RULES

VERY-HOT and HIGH

and
HOT
MEDIUM

WARM

VERY-HUMID

HUMID
Defuzzification

 Defuzzification is the conversion of a fuzzy output


value to an equivalent crisp value for actual use
 Two methods are discussed here:
 Center of Gravity method
 Mamdani’s Inference method
Center of Gravity Method

 Multiply the membership degrees for each output


variable by the singleton value of the output set.
 Add all of the above together and divide by the
summation of output membership degrees.
 Example: Membership sets are 0.4 for LOW and 0.6 for
Medium for an air conditioning system, and singleton value for
LOW is 30% and for MEDIUM is 50% of full power. The output
is:

0.4  30%  0.6  50%


Output   42%
0.4  0.6
Mamdani’s Inference Method

 Truncate each output membership function at its


corresponding membership value.
 Add the remaining truncated membership functions with an
“or” function in order to consolidate them into one area
describing the output.
 Calculate the center of gravity of the consolidated area as the
crisp output value.

Function 1

Function 2

Function 3
Membership Functions
X2
Resulting Area

X1

Variable
Simulation of Fuzzy Logic Controller

 MATLAB Fuzzy Toolbox may be used.


 It generates an output surface that can be used for
further fine tuning and design
 The output should be modified to produce the desired
results by changing the sets, the limits, the number of
sets, and the rules base.
 The logic is converted and downloaded to a controller
for application.
Simulation Inputs: Example
Simulation Output: Example
Application of Fuzzy Logic

 Choose input(s) and output(s)


 Select how many fuzzy sets for each one
 Assign names and limits to each one
 Develop a rules base
 Simulate the system
 Modify the system for best or for desired results
 Convert to a proper application software and
download.

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