1
Fuzzy Controller
2
Fuzzy Inference System
Rule based system: Contains a set of fuzzy rules
Data base dictionary: Defines the membership functions
used in the rules base system
Defuzzification system: A defuzzifier to provide a crisp
result from the output membership functions.
Basic Components of Fuzzy Inference System
2
3
Fuzzy Inference SystemBasic Components of Fuzzy Inference System
Knowledge Base
Decision-Making Logic
(Decision Rules)
DefuzzificationFuzzificationFuzzy or Crisp Input
Crisp Output
Fuzzy Fuzzy
4
Fuzzy Controller
Fuzzify inputs
Calculate the firing strength
Determine the consequence of each
rule
Aggregate the consequences
Defuzzify the output
Step1:
Step2:
Step3:
Step4:
Step5:
Step6:
Values of the input variables
3
5
Fuzzy Controller
1. Input – vocabulary, fuzzification (creating fuzzy sets)
2. Fuzzy propositions – IF X is Y THEN Z (or Z is A) … there
are four types of propositions
3. Combination and evaluation – computation of the results
given the inputs
4. Action - defuzzification
Basic Components of Fuzzy Inference System
6
Fuzzy ControllerFuzzification
Transforming measurement (input) data into valuation of
subjective values (It is mapping from an observed input
space to labels of fuzzy sets)
Input data are usually crisp; or it might be fuzzy sets
µ
A
xx
µ
A A’
x
4
7
Fuzzy Rule-BaseIt is the collection of fuzzy IF-THEN rules in which the
preconditions and consequences are linguistic terms
Fuzzy rules relate inputs to outputs (control logic)
Rules are formed using linguistic variables, so it is not
precise
Output is also a linguistic value representing a fuzzy set
Determine degree of match of fuzzy input with rule
antecedent and assign this to the rule conclusion
Antecedent is the intersection or union of fuzzy inputs
It is also called the degree of truth
8
Fuzzy Rule-Base
Assume two fuzzy linguistic variables Speed and Position
Speed (fast, 0.65 and Medium , 0.35)
Position (centered, 0.4 and right , 0.6)
Find the membership for the conclusion of the rules:
If Speed = Fast and Position = Centered
then Change in speed = Faster
If Speed = Fast and Position = Right
then Change in speed = Zero
If Speed = Medium and Position = Centered
then Change in speed = Faster
Example
5
9
Fuzzy Rule-Base
If Speed = Fast (0.65) and Position = Centered (0.4)
then Change in speed = Faster (0.4)
If Speed = Fast (0.65) and Position = Right (0.6)
then Change in speed = Zero (0.6)
If Speed = Medium (0.35) and Position = Centered (0.4)
then Change in speed = Faster (0.35)
Apply “Union” or “Intersection” according to “And or “Or”
Example
10
Fuzzy Rule-Base
If rules have the same conclusion with different degree of
truth, then take the maximum for the degree of truth for the
conclusions (union of results)
Apply this for the previous example yields:
If Speed = Fast (0.65) and Position = Centered (0.4) then Change in speed = Faster (0.4)
If Speed = Medium (0.35) and Position = Centered (0.4) then Change in speed = Faster (0.35)
Change in Speed: Faster = max (0.4, 0.35) = 0.4
Example
6
11
Fuzzy Inference
If x is A then y is B
Fact x is A
rule If x is A then y is B
Consequence y is B
Given an input of A’ fuzzy set or crisp value A’
Fact x is A’
rule If x is A then y is B
Consequence y is B’
Combining and Decomposition of Fuzzy Sets
12
Fuzzy Inference
µB’ (y) = U [µA’ (x) ^ µA (x) ] ^ µB (y)
= ω ^ µB (y)
ω is called the rule firing strength
Single Rule with Single Antecedent
ω
A A’B
B’
y x
7
13
Fuzzy Inference
Assume crisp input (fuzzification)
µB’ (y) = ω ^ µB (y)
Single Rule with Single Antecedent
ω
A
A’
B
B’
y x
14
Fuzzy Inference
Rule: If x is A and y is B then z is C
Fact: x is A’ and y is B’
Conclusion: z is C’
µC’ (z) = {U [µA’ (x)^ µA (x)]} ^ {U [ µB’ (y)^ µB (y) ]} ^ µC (z)
= (ω1 ^ ω2) ^ µC (z)
(ω1 ^ ω2) is called the rule firing strength
Single Rule with Multiple Antecedent
8
15
Fuzzy InferenceSingle Rule with Multiple Antecedent
ω1
A A’
x
C’z
CB B’
y
ω2
16
Fuzzy Inference
9
17
Fuzzy Inference
Rule: If x is A1 and y is B1 then z is C1
If x is A2 and y is B2 then z is C2
Fact: x is A’ and y is B’
Conclusion: z is C’
C’ = [(A’ x B’) o R1] U [(A’ x B’) o R2]
= C1’ U C2’
Multiple Rules with Multiple Antecedent
18
Fuzzy InferenceMultiple Rules with Multiple Antecedent
ω1
A1 A1’
x
C1’z
C1B1 B1’
y
ω2
C2
z
ω3A2 A2’
x
C2’
B2 B2’
yω4
C1’C2’
10
19
Fuzzy Inference
20
Fuzzy Inference
11
21
Fuzzy InferenceCombining and Decomposition of Fuzzy Sets
22
Fuzzy InferenceCombining and Decomposition of Fuzzy Sets
12
23
Fuzzy Inference
ω1=.2
ω2=.67
ω3=.33
User input
.
.
.
.
.
.
.
.
.
Rule 1
Rule 27
Rule 6
0
1.0
0 10050
y
1.0
81
y
1.0
5 8
1.0
1500500
y
x0 0 0
L HM I
y
Area1
Area27
Value of variable 1WF = 90
Value of variable 2
SE = 3
Value of variable 3
UP = 6
Value of outputR = ?
Area6
24
Fuzzy InferenceOverall Membership Function
Overall output = Center of Area=2100
Area6
Envelop enclosing all areas (area1 to area27)
0.0
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0 500 1000 1500 2000 2500 3000 3500 4000 4500
13
25
Fuzzy InferenceDefuzzification
Defuzzification represents the way a crisp value is extracted
from a fuzzy set as a representative value
26
Fuzzy InferenceDefuzzification
Z COA = ∫µA(z)Z dz / ∫µA(z) dz
µA(z) is the aggregated membership function
14
27
Fuzzy InferenceDefuzzification
Mean of maximum
Z mom = (Z1 + Z2) /2
Smallest of maximum
Zsom is the minimum of the
maximums of Z = Z1
Largest of maximum
ZLom = Z2
Z1 Z2
28
Fuzzy ControllerExample
H TAir
conditioner
Temperature sensor
Humidity sensor
Room
Fuzzy logic controller Cooling rate
C
15
29
Fuzzy ControllerExample
TemperatureT
Low (LW) High (HG)
HumidityH
Low (LW) High (HG)
C
Negative high
(NH)
Positive high
(PH)
Negative low
(NL)
Positive low
(PL)
Cooling Rate
30
Fuzzy ControllerExample: If-then rules
Rule 1: If T is HG and H is HG then C is PH
Rule 2: If T is HG and H is LW then C is PL
Rule 3: If T is LW and H is HG then C is NL
Rule 4: If T is LW and H is LW then C is NH
16
31
Fuzzy ControllerExample
T
High
H
Low
C
Positive low
T
Low
H
High
C
Negative low
Negative high
T
Low
H
Low
C
T
High
H
High
C
Positive high
32
Fuzzy ControllerExample: Overall Output Membership Function
C