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