Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Fuzzy logic
• Fuzzy Logic allows obtaining conclusions from vague,
ambiguous or imprecise information
• Linguistic variable
– A variable whose values are words or phrases in a natural or synthetic
language
– Knowledge is expressed through subjective concepts
• Tall, short, cold, hot, positive, zero, big, …
2
Fuzzy control
Fuzzy control
4
Non linear control
• The reality (the process to be controlled) is non linear
• Linear systems are, in general, a good local approximation of a
non linear system
• Linear control is, in general, sufficient (PID, for example)
• However, there is an increasing need of non linear control
– Increasing functionality/complexity
– Fast production changes
– Higher precision
– Larger operating ranges
6
Non linearities in control
• In the controller
– Feedback path
– Direct path
8
Fuzzy logic
• Introduced by Lotfi Zadeh in the early 1960s
• Fuzzy sets theory / logic for dealing with non probabilistic
uncertainties
• Application domains
– Control systems, supervision, maintenance
– Decision support systems
– Data classification, pattern recognition, computer vision
– Knowledge based systems
10
Model-based control
• Conventional or fuzzy
11
12
Crisp sets
• The set A := {x | x ∈ A}
• The characteristic function
⎧1, x∈ A
μA ( x) = ⎨
⎩0, otherwise
• Set operations:
Membership value
– Intersection
– Union
– Complement
– Subset
13
Fuzzy sets.
Membership functions and membership value
• Membership function and membership value
μ A : x → [0,1]
A = {( x, μ A ( x )) | x ∈ U }
Membership value
14
Typical membership functions
• Gaussian
Membership value
• Triangular/Trapezoidal
/Rectangular
Membership value
Fuzzy logic and fuzzy control 15
15
• Singleton
Membership value
16
Support, nucleous and α-cut
A(x)
17
• Union: OR A∪ B
μ A∪ B ( x ) = max (μ A ( x ), μ B ( x ))
18
Intersection operators
• Probabilistic AND (product operator):
μ A∩ B ( x ) = μ A ( x ) ⋅ μ B ( x )
μ A∩ B ( x ) = max (0, μ A ( x ) + μ B ( x ) − 1)
19
Union operators
• Probabilistic OR:
μ A∪ B ( x ) = μ A ( x ) + μ B ( x ) − μ A ( x ) ⋅ μ B ( x )
μ A∪ B ( x ) = min (1, μ A ( x ) + μ B ( x ))
20
Fuzzy logic
• Generalization of ordinary boolean logic
• Propositions have truth values between 0 and 1, the membership
values in the fuzzy sets
21
Fuzzy logic
• AND, OR and NOT connect simple propositions into compound
propositions
( x1 is A1i ) AND (x2 is A2i ) OR ...
IF (x1 is A1i ) AND (x2 is A2i ) OR ... THEN (u1 is B1i ) AND (u2 ...)
22
Fuzzy logic
• A very large body of theory has been developed
• Very little of this theory is needed to understand/use fuzzy
control
23
24
Architecture of a fuzzy control system
25
Inference systems
• Mamdani inference system:
– Prototype of a rule, being A and B fuzzy sets:
IF x is A THEN u is B
26
Steps of a Mamdani inference system
1. Input fuzzy set evaluation
Membership value
Fuzzy set evaluation, depending on the input crisp values
27
28
Steps of a Mamdani inference system
3. Evaluate the fuzzy output of each rule:
IF ... THEN u is Zero
Depends of the definition of each operator ...
29
Fuzzy output aggregation, including all active rules, using the max operator
30
Steps of a Mamdani inference system
5. Defuzzification. Defuzzifier: Fuzzy set B’-> number y’
– Common choice: Center of Gravity
(u)
31
32
Mamdani inference systems: internal vision
33
X, Y Z
34
Mamdani inference systems: look-up tables
(Z)
(Z)
Control
Control
X, Y Z
35
36
Takagi-Sugeno inference systems
37
38
Takagi-Sugeno inference systems: external vision
• Example:
R1: IF X is N AND Y is N THEN
u1=b01+b11X+b12Y
X, Y Z
R2: IF X is N AND Y is P THEN
u2=b02+b21X+b22Y
R3: IF X is P AND Y is N THEN
u3=b03+b31X+b32Y
R4: IF X is P AND Y is P THEN Control surface (non linear) of a
u4=b04+b41X+b42Y Takagi-Sugeno controller
39
X, Y Z
40
Summary
• Introduction to fuzzy logic and fuzzy logic based controllers
– Linguistic variables e linguistic values
– Linguistic rules
– Membership functions
– Fuzzy sets, operations with fuzzy sets
– Fuzzification, Inference and Defuzzification
– Fuzzy logic controller structures
• Mamdani
• Takagi-Sugeno
41
References
• D. Driankov, H. Hellendorn, M. Reinfrank, “An Introduction to
Fuzzy Control”. Springer-Verlag, Berlin, 1993
• L. Reznik, “Fuzzy Controllers”. Newnes, 1997
• K. M. Passino, S. Yurkovich, “Fuzzy Control”. Addison-Wesley,
Menlo Park, 1998
42
Appendix: Fuzzy relations
• The classical relation between two universes, U and V is defined as:
U × V = {( u, v ) u ∈ U , v ∈ V }
43
Fuzzy relations
• A fuzzy Relation, R, maps elements of one universe into the other
universe through the cartesian product of the two universes
– The relation strength between the pairs is measured by a membership
function:
R : U × V → [ 0,1]
• Example, using the min operator:
μ R ( u, v ) = μ A× B ( u, v ) = min ( μ A ( u ) , μ B ( v ) )
⎡0.2 ⎤
A1 = ( 0.2,0.9 ) A2 = ( 0.3,0.5,1) R = A1 × A2 = ⎢ ⎥ × [ 0.3 0.5 1]
⎣0.9 ⎦
44
Fuzzy relations
• R is a fuzzy relation between universes U and V. S is a fuzzy
relation between universes V and W. The fuzzy relation T, relating
the elements of U contained in R, with the elements of W contained
in S is given by the composition:
T = R D S = max {min ( μ R ( u , v ) , μ S ( v, w ) )}
v∈V
45