Fuzzy Logic Basics
Fuzzy Logic Basics
Fuzzy Logic
Fuzzy Logic
— Fuzzy logic is conceptually easy to understand. The
mathematical concepts behind fuzzy reasoning are
very simple.
1
05/11/2017
Crisp set
ì1, speed Î [0,30] ü
m slow (speed ) = í ý
î0, speed Ï [0,30]þ
Fuzzy set
2
05/11/2017
Crisp set
Fuzzy set
3
05/11/2017
Fuzzy Sets with Discrete Universes Fuzzy Sets with Continuous Universes
— Fuzzy set C = “desirable city to live in”
X = {Dammam, Jeddah, Riyad} (discrete universe) — Fuzzy set B = “about 50 years old”
C = {(Dammam, 0.9), (Jeddah, 0.8), (Riyad, 0.6)} X = Set of positive real numbers (continuous)
— Fuzzy set A = “sensible number of children”
X = {0, 1, 2, 3, 4, 5, 6} (discrete universe) B = {(x, mB(x)) | x in X}
A = {(0, .1), (1, .3), (2, .7), (3, 1), (4, .6), (5, .2), (6, .1)}
1
mB( x) =
æ x - 50ö
2
1+ ç ÷
è 10 ø
Standard Deviation
Mean
4
05/11/2017
1
1
zmf
pimf
smf
5
05/11/2017
Fuzzy Partition
— Fuzzy partitions formed by the linguistic
Set-Theoretic Operations
values “young”, “middle aged”, and “old”:
Set-Theoretic Operations
Set-Theoretic Operations
— Subset:
A Í B Û mA £ mB
— Complement:
A = X - A Û mA ( x ) = 1 - mA ( x )
— Union:
C = A È B Û mc ( x ) = max( mA ( x ), mB ( x )) = mA ( x )Ú mB ( x )
— Intersection:
C = A Ç B Û mc ( x ) = min( mA ( x ), mB ( x )) = m A ( x )Ù mB ( x )
6
05/11/2017
7
05/11/2017
8
05/11/2017
Defuzzification Defuzzification
1. Max membership principle: Also known as the height 2. Centroid method: This procedure (also called center of
method, this scheme is limited to peaked output functions. area, center of gravity) is the most prevalent and physically
appealing of all the defuzzification methods
9
05/11/2017
Defuzzification Defuzzification
3. Weighted average method: The weighted average method 4. Mean max membership: This method (also called
is the most frequently used since it is one of the more middle-of-maxima) is closely related to the first method,
computationally efficient methods. Unfortunately it is usually except that the locations of the maximum membership can
restricted to symmetrical output membership functions
10
05/11/2017
11
05/11/2017
12
05/11/2017
13
05/11/2017
14
05/11/2017
Configuration of FLC
Scaling Factors
— They are the factors by which the inputs to the control
system are multiplied to make them lie in the range of the
universe of discourse of these fuzzy variables.
— They play an important role in the system response because
they are similar to the parameters of the PD controller
except that the output is limited by a certain value.
— If the range of discourse normalized to the range of [-L, L]
then the scaling factors are determined from E, CE, and U
(Error, Change of Error, control signal)
L L U
KE = K CE = K = m ax
E max C E m ax U
L
Fuzzification
— The fuzzification involves two main functions:
Decision Making
— Scaling the crisp controller inputs and — It is the heart of the FLC, having the capability of simulating
human decision making on fuzzy concepts
— converting them into the corresponding
linguistic values. — Basically, decision-making logic performs the function of
processing and evaluating fuzzy control rules.
— This part makes two tasks generating rules and inferring the
output from these rules due to the system inputs.
— Rules are the most important part of any FLC. It linguistically
defines the control policy of the controller
15
05/11/2017
de&&
deteriorates.
ZO NS NS ZO PS PS
— Self organizing represents a good method in such cases. This
method depends on supervised rules by which the fuzzy rules PS NS ZO PS PS PB
16
05/11/2017
Fuzzy Inference
Fuzzy Inference
— Rules: R1: if e=E1 and ce=CE1 then u=U1
— By inference we mean obtaining the controller output fuzzy — R2: if e=E2 and ce=CE2 then u=U2
set from the controller input and the control rules by
compositional rule of inference
— The membership function for each rule and the
corresponding output fuzzy set is first obtained using
minimum or product implication operators, then, the final
output fuzzy set is obtained using union (maximum).
— Introduce the operations on fuzzy sets
Graphical Interpretation for rule by rule fuzzy decision making using
Min. fuzzy implication
http://www.flll.uni-linz.ac.at/aboutus/whatisfuzzy/introduction.html
17
05/11/2017
Low Low
Zero Negative Negative Zero Positive Positive Input is both zero
High Low Low High
Positive Zero Positive Zero and negative low.
Low Low
Positive Positive
High High
18
05/11/2017
Recommended References
1. Li-Xin Wang, Jerry M. Mendel, "Generating Fuzzy Rules by Learning from
Examples", IEEE Trans. on syst. , man, and cybern., November 1992, pp. 1414-1427
2. S.Daley, K.F. Gill, "A Design Study of a Self-Organizing Fuzzy Logic Controller",
Procd. Instn., Mech. Engns. , Vol. R00, No. c1, 1986, pp. 59-69
Videos
http://www.mathworks.com/videos/getting-started-with-fuzzy-logic-toolbox-part-1-
68764.html
http://www.mathworks.com/videos/getting-started-with-fuzzy-logic-toolbox-part-2-
68765.html
http://www.mathworks.com/videos/getting-started-with-fuzzy-logic-toolbox-part-3-
68766.html
http://www.mathworks.com/help/fuzzy/examples/defuzzification-
methods.html?prodcode=FL&language=en
19