Anda di halaman 1dari 57

Introduction to fuzzy

logic
Outline
Introduction
Fuzzy logic controller block diagram
Rule bases
Fuzzification
Inference
defuzzification
Introduction
The word fuzzy refers to things which are not
clear, distinct, precise or vague.
Any event, process, or function that is
changing continuously cannot always be
defined as either true or false, which means
that we need to define such activities in a
Fuzzy manner.
Fuzzy logic is not logic that is fuzzy, but that is
used to describe fuzziness.
continued…….
Definition of fuzzy logic
A form of knowledge representation suitable
for notions that cannot be defined precisely
It resembles the human decision-making
methodology.
It deals with vague and imprecise information.
This is gross oversimplification of the real-
world problems and based on degrees of truth
rather than usual true/false or 1/0 like
Boolean logic.
Continued……..
in fuzzy systems, the values are indicated by a
number in the range from 0 to 1.
Here 1 represents absolute truth and 0.0
represents absolute falseness

0 01 0 1 1 0 0 0.2 0.4 0.6 0.8 1 1


(a) Boolean Logic. (b) Multi-valued Logic
.
continued ….
Fuzzy logic reflects how people think.
 It attempts to model our sense of words, our
decision making and our common sense.
As a result, it is leading to new, more human,
intelligent systems.
It was introduced in 1965 by zadeh in his
research.
Fuzzy control system block
diagram
The elements of the FLC is as explained below
 A rule-base
 (a set of If-Then rules), which contains a fuzzy logic
quantification of the expert’s linguistic description of how to
achieve good control.

An inference mechanism


 (also called an “inference engine” or “fuzzy inference” module),
which emulates the expert’s decision making in interpreting and
applying knowledge about how best to control the plant.
 A fuzzification
 interface, which converts controller inputs into information
that the inference mechanism can easily use to activate
and apply rules.
 A defuzzification
 interface, which converts the conclusions of the inference
mechanism into actual inputs for the process.
Each of the elements of fuzzy logic controller
are explained with the help of simple problem
of balancing an inverted pendulum on a cart
as shown in the figure below
1. Choosing the controller inputs, outputs
and reference
• This is the information that the expert uses as
an input to make decision
• Suppose the inputs be
The error and
Rate of change of error
• the FLC output is
 the force (F)
• The reference input is r(t)=0
2. Specifying the fuzzy control system
Rule bases
rule bases
Linguistic variables
Will be describing each of the time varying fuzzy
controller inputs and outputs
 it is simply a notation that helps to facilitate the
construction of the fuzzy controller via fuzzy logic.
Continued…………
Linguistic values
That is, the values that linguistic variables take on
over time change dynamically
Are kind of abbreviations
Continued…………
Linguistic numeric values
Is the use of integers to indicate the size of
linguistic variables
Quantifies only the sign of the variable and
indicates its magnitude with respect to the other
variables
The system dynamics
quantification with linguistic
variables
 For the inverted pendulum each of the following statements
quantifies a different configuration of the pendulum
statement configuration
“error is poslarge” pendulum is at a significant
angle to the left of the vertical
“error is negsmall” pendulum is just slightly to the
right of the vertical
“error is zero” pendulum is very near the
vertical position
“error is poslarge and change- the pendulum is to the left of
in-error is possmall” the vertical and the pendulum
is moving counter clockwise).
“error is negsmall and the pendulum is slightly to
change-in-error is possmall” the right of the vertical and,
the pendulum is moving
counter clockwise
Rules
 The above linguistic quantification helps to specify a
set of rules (rule base)
Captures the expert’s knowledge how to control
the plant
For three positions of the inverted pendulum
shown below we have the following set of rules
IF Then
error is neglarge and change- force is poslarge
in-error is neglarge

error is zero and change-in- force is negsmall


error is possmall

error is poslarge and change- force is negsmall


in-error is negsmall

Each of the above rule is linguistic rule since it is formed from


linguistic variables and values
Continued…..
 The general form of the linguistic rules listed above is
If premise Then consequent
The premises are associated with the fuzzy controller
inputs and are on the left-hand-side of the rules.
The consequents (sometimes called “actions”) are
associated with the fuzzy controller outputs and are on
the right-hand-side of the rules
 each premise can be composed of the conjunction of
several “terms” . Eg. “error is poslarge and change-in-
error is negsmall” is a premise that is the conjunction of
two terms).
Rule-bases
 since we only specify a finite number of linguistic
variables and linguistic values, there is only a finite
number of possible rules
 For the pendulum problem, with two inputs and five
linguistic values for each of these, there are at most
5^2 = 25 possible rules (all possible combinations of
premise linguistic values for two inputs).
 if the number of inputs are less than three tabular
representation helps to develop the rule base
Rule-base for the inverted
pendulum
Fuzzy Quantification of
Knowledge
 Previously we have quantified the linguistic variables
in abstract way
 Knowledge that the expert has about how to control
the plant
 Next we will see how to use the fuzzy logic to fully
quantify the meaning of the linguistic descriptions
Membership functions
 The figure below is a plot of a function µ versus e(t)
that takes on special meaning
 The function µ quantifies the certainty that e(t) can
be classified linguistically as “possmall.”
 The membership function quantifies, in a continuous
manner, whether values of e(t) belong to (are
members of) the set of values that are “possmall,”
 This is why it is called a membership function
 The vertical axis is indicating certainty the horizontal
axis is given the name universe of discourse for e(t)
Membership functions
Fuzzy set
 for the above case the set of values that is described
by µ as being “positive small”
 Let A denote this fuzzy set. Notice that from the
previous Figure we are absolutely certain that
e(t)=π/4 is an element of A, but we are less certain
that e(t)= π/16 is an element of A.
 Membership in the set , as specified by the
membership function, is fuzzy; hence we use the
term “fuzzy set.”
 A “crisp” (as contrasted to “fuzzy”)
Membership functions
continued…..
 We will have membership functions for all linguistic
values
 15 membership functions for our inverted pendulum
case
 We plot all membership functions for a variable in a
graph
 For the inputs the outermost membership functions
“saturate” at a value of one
Continued…..
they characterize “greater than” (for the right
side) and “less than” (for the left side).
But this is not the case for the output variable
we seek to take actions that specify an exact
value for the process input
The rule-base of the fuzzy controller holds the
linguistic variables, linguistic values, their
associated membership functions, and the set
of all linguistic rules
Membership functions for the
inverted pendulum
Fuzzification
fuzzification
the act of obtaining a value of an input
variable (e.g., e(t)) and
finding the numeric values of the membership
function(s) that are defined for that variable
For example, if e(t)=π/4 and de(t)/dt = π/16
fuzzy inference
process
Matching
Fuzzy inference system involves two steps
1. The premises of all the rules are compared with
the fuzzified controller inputs (Matching)
Determine the certainty that each rule applies
2. Conclusions (actions) are determined using the
rules determined
Premise quantification
Before we have quantified the linguistic values
using membership functions
Now we want to quantify the premises which
are derived from the input variables by
conjunction
Eg ” if error is zero and change-in-error is
possmall”
Continued……
 The main item to focus on is how to quantify
the logical “and” operation
To see how to quantify the “and” operation let
us assume that e(t)=π/8 and de(t)/dt=π/32
Continued……
 So what is the certainty of the premise
” if error is zero and change-in-error is possmall”

It is indicated by
And are many ways to evaluate

 This should be considered for all values of the FLC i/ps.


Continued……
 In general we will have a different premise
membership function for each of the rules in
the rule-base,
and each of these will be a function of inputs
so that given specific values of the inputs we
obtain a quantification of the certainty that
each rule in the rule-base applies to the
current situation
Determining which rules are
on
 We say that a rule is “on at time t” if its premise
membership function µpremise > 0.
 In the next step, the inference mechanism will seek to
combine the recommendations of all the rules to come up
with a single conclusion.
Continued…..
 the membership functions for the above case will is shown
below
Continued…..
 this implies the rules with the premises having the terms below will
only be turned on.

 And these rules are

 since for the pendulum example we have at most


two membership functions overlapping, we will
never have more than four rules on at a time.
 This completes he matching phase
The inference step : determining
the conclusions
we will combine all the recommendations
from all the rules that are on and
determine the force input to the cart
Recommendation from “rule(
1)”
 we are 0 .25 certain that this rule applies to the
current situation
 For rule (1) the consequent is “force is zero”
 The membership functions for this consequent and
for the conclusion reached is shown in the figures
below
Continued…
we will combine all the recommendations
from all the rules that are on and
determine the force input to the cart
Recommendation from “rule(
2)”
Defuzzification
Conversion decisions into
actions
 is the final component of the fuzzy controller
 operates on the implied fuzzy sets produced
by the inference mechanism and
 combines their effects to provide the “most
certain” controller output (plant input).
Can be considered as “decoding” the fuzzy set
information produced by the inference
process into numeric fuzzy controller outputs
Continued…….
 To understand defuzzification draw all the
implied fuzzy sets on one axis
 We want to find the one output, which we
denote by that best represents the
conclusions of the fuzzy controller
Combining
recommendations
 There are actually many approaches to
defuzzification. We will consider two here
“center of gravity” (COG) defuzzification method
 “center-average” defuzzification method.
“Center of gravity” (COG)
method
This the popular method
Let bi denote the center of the membership
function
 (i.e., where it reaches its peak of the
consequent of rule (i).
For our example
B1=0 and
B2=-10
Continued…
Let
Continued…
 Three points about the COG method
 Practically, we cannot have output membership functions
that have infinite area
 We must be careful to define the input and output
membership functions so that the sum in the denominator
of the above equation is not equal to zero
 While at first glance it may not appear integral of µ(i) is
easy to compute for our example it is given by

for a symmetric triangle having width of w and “chopped


off” at a height of h
Continued…
 for our example
“Center-average” method
First, consider the use of the product.
Basically, the center-average method replaces the
areas of the implied fuzzy sets that are used in
COG with the values of µpremise(i)
“Center-average” method
First, consider the use of the product.
Basically, the center-average method replaces the
areas of the implied fuzzy sets that are used in
COG with the values of µpremise(i)
“Graphical Depiction of Fuzzy
Decision Making

Anda mungkin juga menyukai