fuzzy control
DESCRIPTION
Fuzzy Control. Fuzzy Control. Fuzzy Sets Design of a Fuzzy Controller Fuzzification of inputs: get_inputs() Fuzzy Inference Processing the Rules: find_rules() Centroid Defuzzification Output Defuzzification: find_output() A Fuzzy Control Example -- Floating Ping-Pong Ball. Fuzzy Logic. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/1.jpg)
Fuzzy Control
![Page 2: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/2.jpg)
Fuzzy Control
• Fuzzy Sets
• Design of a Fuzzy Controller– Fuzzification of inputs: get_inputs()– Fuzzy Inference– Processing the Rules: find_rules()– Centroid Defuzzification– Output Defuzzification: find_output()– A Fuzzy Control Example --
• Floating Ping-Pong Ball
![Page 3: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/3.jpg)
" So far as the laws of mathematics refer to reality, they are not certain,
And so far as they are certain, they do not refer to reality."
Albert EinsteinGeometrie und Erfahrung
Fuzzy Logic
![Page 4: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/4.jpg)
Fuzzy Sets
The sentence on the other sideof the line is false
The sentence on the other sideof the line is false
Is this sentence true or false?
![Page 5: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/5.jpg)
Agea1 a2
Young1
0
F igu re 14 .2 M em bersh ip func tion fo r the fuzzy se t Young
![Page 6: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/6.jpg)
![Page 7: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/7.jpg)
![Page 8: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/8.jpg)
![Page 9: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/9.jpg)
Probabiltiy vs. Fuzziness
Probability describes the uncertainty of an event occurrence.
Fuzziness describes event ambiguity.
Whether an event occurs is RANDOM.
To what degree it occurs is FUZZY.
![Page 10: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/10.jpg)
Probability:There is a 50% chance of an applebeing in the refrigerator.
Fuzzy:There is a half an apple in therefrigerator.
![Page 11: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/11.jpg)
Fuzzy logic acknowledges and exploits the tolerance for uncertainty and imprecision.
![Page 12: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/12.jpg)
Fuzzy Control
• Fuzzy Sets
• Design of a Fuzzy Controller– Fuzzification of inputs: get_inputs()– Fuzzy Inference– Processing the Rules: find_rules()– Centroid Defuzzification– Output Defuzzification: find_output()– A Fuzzy Control Example --
• Floating Ping-Pong Ball
![Page 13: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/13.jpg)
![Page 14: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/14.jpg)
INPUTS
OUTPUT
Map to Fuzzy Sets
FUZZY RULES
If A AND B then L
• • •
Defuzzification
get_inputs();
fire_rules();
find_output();
A Fuzzy Controller
![Page 15: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/15.jpg)
![Page 16: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/16.jpg)
Fuzzy Control
• Fuzzy Sets
• Design of a Fuzzy Controller– Fuzzification of inputs: get_inputs()– Fuzzy Inference– Processing the Rules: find_rules()– Centroid Defuzzification– Output Defuzzification: find_output()– A Fuzzy Control Example --
• Floating Ping-Pong Ball
![Page 17: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/17.jpg)
![Page 18: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/18.jpg)
![Page 19: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/19.jpg)
![Page 20: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/20.jpg)
Fuzzy Control
• Fuzzy Sets
• Design of a Fuzzy Controller– Fuzzification of inputs: get_inputs()– Fuzzy Inference– Processing the Rules: find_rules()– Centroid Defuzzification– Output Defuzzification: find_output()– A Fuzzy Control Example --
• Floating Ping-Pong Ball
![Page 21: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/21.jpg)
Fuzzy Inference
if x1 is A1 and x2 is B1 then y is L1 rule 1
if x1 is A2 and x2 is B2 then y is L2 rule 2
Given the fact that
x1 is A' and x2 is B' fact
the problem is to find the conclusion
y is L' conclusion
![Page 22: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/22.jpg)
![Page 23: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/23.jpg)
Fuzzy Control
• Fuzzy Sets
• Design of a Fuzzy Controller– Fuzzification of inputs: get_inputs()– Fuzzy Inference– Processing the Rules: find_rules()– Centroid Defuzzification– Output Defuzzification: find_output()– A Fuzzy Control Example --
• Floating Ping-Pong Ball
![Page 24: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/24.jpg)
![Page 25: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/25.jpg)
![Page 26: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/26.jpg)
Rules
![Page 27: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/27.jpg)
Fuzzy Control
• Fuzzy Sets
• Design of a Fuzzy Controller– Fuzzification of inputs: get_inputs()– Fuzzy Inference– Processing the Rules: find_rules()– Centroid Defuzzification– Output Defuzzification: find_output()– A Fuzzy Control Example --
• Floating Ping-Pong Ball
![Page 28: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/28.jpg)
![Page 29: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/29.jpg)
14.2.4 Centroid Defuzzification
The last step in the fuzzy controller shown in Figure 14.7 is defuzzification. Thisinvolves finding the centroid of the net output fuzzy set L' shown in Figures 14.15 and14.16. Although we have used the MIN-MAX rule in the previous section we will beginby deriving the centroid equation for the sum rule shown in Figure 14.16. This willilluminate the assumptions made in deriving the defuzzification equation that we willactually use in the fuzzy controller.
Let Li(y) be the original output membership function associated with rule i where yis the output universe of discourse (see Figure 14.15.). After applying rule i thismembership function will be reduced to the value
mi(y) = wiLi(y) (14.1)
where wi is the minimum weight found by applying rule i. The sum of these reducedoutput membership functions over all rules is then given by
M(y) = i=1
Nmi(y) (14.2)
where N is the number of rules.
![Page 30: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/30.jpg)
The crisp output value y0 is then given by the centroid of M(y) from the equation
y0 = yM(y)dy
M(y)dy (14.3)
Note that the centroid of membership function Li(y) is given by
ci = yLi(y)dy
Li(y)dy (14.4)
But
Ii = Li(y)dy (14.5)
is just the area of membership function Li(y). Substituting (14.5) into (14.4) we can write
yLi(y)dy = ciIi (14.6)
![Page 31: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/31.jpg)
Using Eqs. (14.1) and (14.2) we can write the numerator of (14.3) as
yM(y)dy = y
i=1
NwiLi(y) dy
= i=1
N
ywiLi(y) dy
= i=1
N wiciIi (14.7)
where (14.6) was used in the last step.
![Page 32: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/32.jpg)
Similarly, using (14.1) and (14.2) the denominator of (14.3) can be written as
M(y)dy =
i=1
NwiLi(y) dy
= i=1
N
wiLi(y) dy
= i=1
N wiIi (14.8)
where (14.5) was used in the last step. Substituting (14.7) and (14.8) into (14.3) we canwrite the crisp output of the fuzzy controller as
y0 =
i=1
N wiciIi
i=1
N wiIi
(14.9)
Eq. (14.9) says that we can compute the output centroid from the centroids, ci, of theindividual output membership functions.
![Page 33: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/33.jpg)
Note in Eq. (14.9) the summation is over all N rules. But the number of outputmembership functions, Q, will, in general, be less than the number of rules, N. This meansthat in the sums in Eq. (14.9) there will be many terms that will have the same values of ciand Ii. For example, suppose that rules 2, 3, and 4 in the sum all have the outputmembership function Lk as the consequent. This means that in the sum
w2c2I2 + w3c3I3 + w4c4I4
the values ci and Ii are the same values ck and Ik because they are just the centroid andarea of the kth output membership function. These three terms would then contribute thevalue
(w2 + w3 + w4)ckIk = WkckIk
to the sum, where
Wk = (w2 + w3 + w4)
is the sum of all weights from rules whose consequent is output membership function Lk.
![Page 34: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/34.jpg)
This means that the equation for the output value, y0, given by (14.9) can be rewritten as
y0 =
k=1
Q
WkckIk
k=1
Q
WkIk
(14.10)
If the area of all output membership functions, Ik are equal, then Eq. (14.10) reduces to
y0 =
k=1
Q
Wkck
k=1
Q
Wk
(14.11)
Eqs. (14.10) and (14.11) show that the output crisp value of a fuzzy controller can becomputed by summing over only the number of output membership functions rather thanover all fuzzy rules. Also, if we use Eq. (14.11) to compute the output crisp value, thenwe need to specify only the centroids, ck, of the output fuzzy membership functions. Thisis equivalent to assuming singleton fuzzy sets for the output.
We will always use singleton fuzzy sets for the output represented by thecentroids, ck. We will also use the MIN-MAX inference rule described in the previoussection. It should be clear from Figure 14.16 that in this case the centroid y0 will still begiven by Eq. (14.11) where Wk is now the output array, Out(k), shown in Figure 14.18and computed by the word firerules given in Figure 14.19.
![Page 35: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/35.jpg)
Fuzzy Control
• Fuzzy Sets
• Design of a Fuzzy Controller– Fuzzification of inputs: get_inputs()– Fuzzy Inference– Processing the Rules: find_rules()– Centroid Defuzzification– Output Defuzzification: find_output()– A Fuzzy Control Example --
• Floating Ping-Pong Ball
![Page 36: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/36.jpg)
![Page 37: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/37.jpg)
Fuzzy Control
• Fuzzy Sets
• Design of a Fuzzy Controller– Fuzzification of inputs: get_inputs()– Fuzzy Inference– Processing the Rules: find_rules()– Centroid Defuzzification– Output Defuzzification: find_output()– A Fuzzy Control Example --
• Floating Ping-Pong Ball
![Page 38: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/38.jpg)
68HC12JStamp…
![Page 39: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/39.jpg)
Fuzzy k-map for floating ping-pong ball
![Page 40: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/40.jpg)
Implementations
• High-level Languages– C– Java
• Assembly– Assembly– Assembly Built-in Fuzzy Control Instructions
• HC12
![Page 41: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/41.jpg)
Designing a Robot (Example)
![Page 42: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/42.jpg)
Designing a Robot (Example)
![Page 43: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/43.jpg)
Designing a Robot (Example)
![Page 44: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/44.jpg)
Designing a Robot (Example)
![Page 45: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/45.jpg)
Designing a Robot (Example)
![Page 46: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/46.jpg)
Designing a Robot (Example)
![Page 47: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/47.jpg)
Designing a Robot (Example)
![Page 48: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/48.jpg)
Designing a Robot (Example)
![Page 49: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/49.jpg)
Designing a Robot (Example)
![Page 50: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/50.jpg)
Designing a Robot (Example)
![Page 51: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/51.jpg)
Designing a Robot (Example)
![Page 52: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/52.jpg)
Designing a Robot (Example)
![Page 53: Fuzzy Control](https://reader035.vdocuments.us/reader035/viewer/2022062408/568144c8550346895db19131/html5/thumbnails/53.jpg)
Designing a Robot (Example)