Fuzzy Control Introduction by Kober & Babuška
Fuzzy Control Introduction by Kober & Babuška
Cognitive Robotics
3mE, Delft University of Technology, The Netherlands
12-02-2018
Lecture Outline
2 / 79
Course Information
3 / 79
Knowledge-Based Control Systems (SC42050)
4 / 79
Knowledge-Based Control Systems (SC42050)
5 / 79
Practical Assignment
Objectives:
Get additional insight through Matlab/Python implementation.
Apply the tools to practical (simulated) problems.
6 / 79
Literature Assignment
Objectives:
gain knowledge on recent research results through literature
research
learn to effectively use available search engines
write a concise paper summarizing the findings
present the results in a conference-like presentation
7 / 79
Goals and Content of the Course
8 / 79
Course Material
Lecture notes
Items available for download at:
www.dcsc.tudelft.nl/˜sc42050
Transparencies as PDF files
Demos, examples, assignments with
Matlab/Simulink
Brightspace
The entire content of the lectures and lec-
ture notes1 will be examined!
1
Chapters marked with ‘*’ are not relevant for the exam
9 / 79
Where to run Matlab
10 / 79
Prerequisites, Background Knowledge
Mathematical analysis
Linear algebra
Basics of control systems (e.g., Control Systems)
11 / 79
Motivation for
Intelligent Control
12 / 79
Pro’s and Con’s of Conventional Control
13 / 79
When Conventional Design Fails
14 / 79
Example: Stability Problems
d 3 y (t ) d 2 y (t ) dy (t )
+ + = y 2 (t )u (t )
dt 3 dt 2 dt
Use Simulink to simulate a proportional controller (nlpid.m)
15 / 79
Example: Stability Problems
d 3 y (t ) d 2 y (t ) dy (t )
+ + = y 2 (t )u (t )
dt 3 dt 2 dt
Use Simulink to simulate a proportional controller (nlpid.m)
Conclusions:
stability and performance depend on process output
re-tuning the controller does not help
nonlinear control is the only solution
15 / 79
Intelligent Control
techniques motivated by human intelligence
16 / 79
Intelligent Control
techniques motivated by human intelligence
16 / 79
Fuzzy Control I
17 / 79
Outline
2 Fuzzy relations
3 Fuzzy systems
18 / 79
Fuzzy Sets and Fuzzy Logic
Types of uncertainty:
chance, randomness (stochastic)
imprecision, vagueness, ambiguity (non-stochastic)
19 / 79
Classical Set Theory
20 / 79
Classical Set Theory
20 / 79
Classical Set Theory
20 / 79
Classical Set Theory
20 / 79
Representation of Sets
21 / 79
Set of natural numbers smaller than 5
1 2 3 4 5 6 7 8 x
22 / 79
Fuzzy sets
23 / 79
Why Fuzzy Sets?
24 / 79
Classical Set Approach
0
170 180 190 h [cm]
25 / 79
Logical Propositions
0
170 180 190 h [cm]
26 / 79
Fuzzy Set Approach
A
1
0.6
0
170 180 190 h [cm]
8
>
< 1 h is full member of A (h 190)
A (h) = > (0; 1) h is partial member of A (170 < h < 190)
: 0 h is not member of A (h 170)
27 / 79
Fuzzy Logic Propositions
0.6
0
170 180 190 h [cm]
28 / 79
Subjective and Context Dependent
0.6
0
170 180 190 h [cm]
tall in China tall in Europe tall in NBA
29 / 79
Shapes of Membership Functions
0
x
30 / 79
Representation of Fuzzy Sets
A = f 1 =A 1 ; 2 =A 2 ; : : : ; n ; A g = f i =A j i 2 (0; 1)g
n i
31 / 79
Representation of Fuzzy Sets
x 2R
1
A (x ) = ;
1 + x2
or more generally
1
(x ) = :
1 + d (x; v )
d (x; v ) . . . dissimilarity measure
32 / 79
Linguistic Variable
linguistic
low medium high terms
semantic
rule
1
membership
µ functions
0
0 10 20 30 40
t (temperature) base variable
33 / 79
Properties of fuzzy sets
34 / 79
Support of a Fuzzy Set
A
1
0
x
supp(A)
35 / 79
Core (Kernel) of a Fuzzy Set
core(A) = fx jA (x ) = 1g
A
1
0
x
core(A)
36 / 79
-cut of a Fuzzy Set
0
Aa x
A is an ordinary set
37 / 79
Convex and Non-Convex Fuzzy Sets
convex non-convex
1
A B
a
0
x
A fuzzy set is convex , all its -cuts are convex sets.
38 / 79
Non-Convex Fuzzy Set: an Example
high-risk age
1
16 32 48 64 age [years]
39 / 79
Fuzzy Numbers and Singletons
fuzzy number fuzzy
"about 3" singleton
1
0
3 8 x
40 / 79
Fuzzy set-theoretic operations
41 / 79
Complement (Negation) of a Fuzzy Set
A A
0
x
Ā (x ) = 1 A (x )
42 / 79
Intersection (Conjunction) of Fuzzy Sets
A B
1
0
x
A\B (x ) = min(A (x ); B (x ))
43 / 79
Other Intersection Operators (T-norms)
A\B (x ) = A (x ) B (x )
Lukasiewicz “and” (bounded difference):
A\B (x ) = max(0; A (x ) + B (x ) 1)
44 / 79
Union (Disjunction) of Fuzzy Sets
A B
1
0
x
A[B (x ) = max(A (x ); B (x ))
45 / 79
Other Union Operators (T-conorms)
Probabilistic “or”:
A[B (x ) = A (x ) + B (x ) A (x ) B (x )
Lukasiewicz “or” (bounded sum):
A[B (x ) = min(1; A (x ) + B (x ))
Many other t-conorms . . . [0; 1] [0; 1] ! [0; 1]
46 / 79
Demo of a Matlab tool
47 / 79
Fuzzy Set in Multidimensional Domains
x
y
48 / 79
Cylindrical Extension
x1
x2
49 / 79
Cylindrical Extension
x1
x2
49 / 79
Cylindrical Extension
x1
x2
extx2 (A) = A (x1 )=(x1 ; x2 )j(x1 ; x2 ) 2 X1 X2
49 / 79
Projection
x1
x2
A
50 / 79
Projection onto X1
A1
x1
x2
A
n o
projx1 (A) = sup A (x1 ; x2 )=x1 jx1 2 X1
x2 2X2
50 / 79
Projection onto X2
A2
x1
x2
A
n o
projx2 (A) = sup A (x1 ; x2 )=x2 jx2 2 X2
x1 2X1
50 / 79
Intersection on Cartesian Product Space
An operation between fuzzy sets are defined in different domains results
in a multi-dimensional fuzzy set.
Example: A1 \ A2 on X1 X2 :
A2
A1
x1
x2
51 / 79
Intersection on Cartesian Product Space
An operation between fuzzy sets are defined in different domains results
in a multi-dimensional fuzzy set.
Example: A1 \ A2 on X1 X2 :
A2
A1
x1
x2
51 / 79
Intersection on Cartesian Product Space
An operation between fuzzy sets are defined in different domains results
in a multi-dimensional fuzzy set.
Example: A1 \ A2 on X1 X2 :
A2
A1
x1
x2
51 / 79
Intersection on Cartesian Product Space
An operation between fuzzy sets are defined in different domains results
in a multi-dimensional fuzzy set.
Example: A1 \ A2 on X1 X2 :
A2
A1
x1
x2
51 / 79
Fuzzy Relations
R : X1 X2 X3 Xn ! [0; 1]
which assigns membership grades to all n-tuples (x1 ; x2 ; : : : ; xn ) from
the Cartesian product universe.
52 / 79
Fuzzy Relations: Example
0.8
0.6
membership grade
1 0.4
0.2
0.5 0
y
−0.2
0
1 −0.4
0.5 −0.6
0 1
0.5 −0.8
−0.5 0
−0.5 −1
y −1 −1 −1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
x x
53 / 79
Relational Composition
54 / 79
Graphical Interpretation: Crisp Function
x x
55 / 79
Graphical Interpretation: Interval Function
x x
55 / 79
Graphical Interpretation: Fuzzy Relation
x x
55 / 79
Max-Min Composition: Example
B (y ) = max
x
min A (x ); R (x; y ) ; 8y
2 3
0:0 0:0 0:0 0:4 0:8
6 7
6 0:0 0:1 1:0 0:2 0:0 7
6
6 7
7
1:0 0:4 0:1 0:0 0:0 6 0:0 1:0 0:0 0:0 0:0 7 =
6 7
6 0:0 0:9 0:0 0:0 0:0 7
4 5
0:0 0:0 0:8 0:3 0:0
56 / 79
Max-Min Composition: Example
B (y ) = max
x
min A (x ); R (x; y ) ; 8y
2 3
0:0 0:0 0:0 0:4 0:8
6 7
6 0:0 0:1 1:0 0:2 0:0 7
6
6 7
7
1:0 0:4 0:1 0:0 0:0 6 0:0 1:0 0:0 0:0 0:0 7 = 0:0 0:1 0:4 0:4 0:8
6 7
6 0:0 0:9 0:0 0:0 0:0 7
4 5
0:0 0:0 0:8 0:3 0:0
56 / 79
Fuzzy Systems
57 / 79
Fuzzy Systems
y = 3̃x1 + 5̃x2
Fuzzy inputs and states
ẋ (t ) = Ax (t ) + Bu (t ); x (0) = 2̃
Rule-based systems
58 / 79
Rule-based Fuzzy Systems
If x is A then y is B
Fuzzy relational model
If x is A then y = f (x )
59 / 79
Linguistic Model
If x is A then y is B
x is A – antecedent (fuzzy proposition)
y is B – consequent (fuzzy proposition)
60 / 79
Linguistic Model
If x is A then y is B
x is A – antecedent (fuzzy proposition)
y is B – consequent (fuzzy proposition)
Compound propositions (logical connectives, hedges):
If x1 is very big and x2 is not small
60 / 79
Multidimensional Antecedent Sets
A1 \ A2 on X1 X2 :
A2
A1
x1
x2
61 / 79
Partitioning of the Antecedent Space
A2 3
A2 2
A2 2
A2 1
A2 1
x1 x1
A11 A1 2 A1 3 A11 A1 2 A1 3
62 / 79
Inference Mechanism
Given the if-then rules and an input fuzzy set, deduce the corresponding
output fuzzy set.
63 / 79
Formal Approach
64 / 79
Modus Ponens Inference Rule
if x is A then y is B if x is A then y is B
x is A x is A0
y is B y is B0
65 / 79
Relational Representation of Rules
A B A ! B (:A _ B ) AnB 0 1
0 1 1
0 0 1
1 0 1
0 1 1
1 0 0
R : f0; 1g f0; 1g ! f0; 1g
1 1 1
66 / 79
Relational Representation of Rules
A B A^B AnB 0 1
0 0 0
0 0 0
1 0 1
0 1 0
1 0 0
R : f0; 1g f0; 1g ! f0; 1g
1 1 1
66 / 79
Fuzzy Implications and Conjunctions
R (x; y ) = I( A (x ); B (y ))
a; b) – implication function
I(
“classical” Kleene–Diene I(a; b) = max(1 a; b)
Lukasiewicz I(a; b ) = min(1; 1 a + b)
T-norms Mamdani I(a; b ) = min(a; b )
Larsen I(a; b ) = a b
67 / 79
Inference With One Rule
R (x; y ) = I(A (x ); B (y ))
68 / 79
Inference With One Rule
R (x; y ) = I(A (x ); B (y ))
2 Use relational composition to derive B 0 from A0 :
B 0 = A0 R
68 / 79
Graphical Illustration
R (x; y ) = min A (x ); B (y ) B (y ) = max
0
x
min A (x ); R (x; y )
0
µ B
R
A max(min(A’,R))
A’ B’
B
A
x
x
(A,B) y
R = min y
min(A’,R)
69 / 79
Inference With Several Rules
R (x; y ) = I(A (x ); B (y ))
i i i
70 / 79
Example: Conjunction
1 Each rule
If x̃ is Ai then ỹ is Bi
is represented as a fuzzy relation on X Y:
Ri = Ai Bi R (x ; y ) = A (x ) ^ B (y )
i i i
71 / 79
Example: Conjunction, Aggregation
1 Each rule
If x̃ is Ai then ỹ is Bi
is represented as a fuzzy relation on X Y:
Ri = Ai Bi R (x ; y ) = A (x ) ^ B (y )
i i i
i =1
71 / 79
Example: Conjunction, Aggregation, and Composition
1 Each rule
If x̃ is Ai then ỹ is Bi
is represented as a fuzzy relation on X Y:
Ri = Ai Bi R (x ; y ) = A (x ) ^ B (y )
i i i
i =1
3 Given an input value A0 the output value B 0 is:
B 0 = A0 R B (y ) = max
0 [ (x ) ^ R (x ; y )]
X A
0
71 / 79
Example: Modeling of Liquid Level
Fin
h
- If Fin is Zero then h is Zero
- If Fin is Med then h is Med
Fo u t
- If Fin is Large then h is Med
0 20 40 60 80 100 0 1 2 3
Fin h
72 / 79
R1 If Flow is Zero then Level is Zero
h
Medium
Zero
R1
m
1
Fin
m Zero Medium Large
1
Fin
73 / 79
R2 If Flow is Medium then Level is Medium
h
Medium
R2
Zerom
1
Fin
m Zero Medium Large
1
Fin
73 / 79
R3 If Flow is Large then Level is Medium
h
Medium
R3
Zerom
1
Fin
m Zero Medium Large
1
Fin
73 / 79
Aggregated Relation
h
Medium
R2 R3
R1
Zero
�
1
Fin
� Zero Medium Large
1
Fin
73 / 79
Simplified Approach
74 / 79
Water Tank Example
Fin
h
- If Fin is Zero then h is Zero
- If Fin is Med then h is Med
Fo u t
- If Fin is Large then h is Med
0 20 40 60 80 100 0 1 2 3
Fin h
75 / 79
Mamdani Inference: Example
0 50 100 0 3 6
Fin h
76 / 79
Mamdani Inference: Example
0 50 100 0 3 6
Fin h
76 / 79
If Fin is Zero then . . .
0 50 100 0 3 6
Fin h
76 / 79
If Fin is Zero then h is Zero
0 50 100 0 3 6
Fin h
76 / 79
If Fin is Medium then . . .
0 50 100 0 3 6
Fin h
76 / 79
If Fin is Medium then h is Medium
0 50 100 0 3 6
Fin h
76 / 79
Aggregation
0 50 100 0 3 6
Fin h
76 / 79
Defuzzification
y' y y' y
(a) center of gravity (b) mean of maxima
77 / 79
Center-of-Gravity Method
F
X
B (yj )yj
0
j =1
y0 = F
X
B (yj )
0
j =1
78 / 79
Defuzzification
0 50 100 0 3 6
Fin h
79 / 79