0% found this document useful (0 votes)
87 views108 pages

Fuzzy Control Introduction by Kober & Babuška

The document outlines the course 'Knowledge-Based Control Systems' at Delft University of Technology, detailing the structure, objectives, and assignments involved. It covers topics such as fuzzy control, neural networks, and reinforcement learning, with specific assignments for literature and practical applications. The course aims to provide insights into intelligent control systems and their applications in various fields.

Uploaded by

lubnamoin65
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views108 pages

Fuzzy Control Introduction by Kober & Babuška

The document outlines the course 'Knowledge-Based Control Systems' at Delft University of Technology, detailing the structure, objectives, and assignments involved. It covers topics such as fuzzy control, neural networks, and reinforcement learning, with specific assignments for literature and practical applications. The course aims to provide insights into intelligent control systems and their applications in various fields.

Uploaded by

lubnamoin65
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 108

Lecture 1: Introduction & Fuzzy Control I

Jens Kober Robert Babuška

Knowledge-Based Control Systems (SC42050)

Cognitive Robotics
3mE, Delft University of Technology, The Netherlands

12-02-2018
Lecture Outline

1 General information about the course


2 Introduction
3 Fuzzy control I

2 / 79
Course Information

3 / 79
Knowledge-Based Control Systems (SC42050)

 Lecturers: - Jens Kober, lectures 1-6


- Tim de Bruin, lectures 7 & 8
- Hans Hellendoorn, lecture 9
 Assistants: Thijs Greevink
 Lectures: (9 lectures = 18 hours)
 Monday (15:45 – 17:30) in lecture hall Chip at EWI
 Wednesday (15:45 – 17:30) in lecture hall Chip at EWI

4 / 79
Knowledge-Based Control Systems (SC42050)

 Examination: (check yourself the dates and times!):


 April 20th 2018, 9:00-12:00.
 June 29th 2018, 9:00-12:00.
Exam constitutes 60% of the final grade, remaining 40% are two
assignments: Literature and Practical assignment

 To obtain the credits of this course:


Each activity must be approved.

5 / 79
Practical Assignment

Objectives:
 Get additional insight through Matlab/Python implementation.
 Apply the tools to practical (simulated) problems.

The assignment consists of three problems: fuzzy control, neural


networks, and reinforcement learning.

Work in groups of two students, more information later.

Will be handed out on February 19th 2018


Report deadline April 11th 2018

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

Deadlines – March 21st, March 28th, and April 3rd 2018


Symposium: Reserve the whole afternoon Tuesday April 3rd 2018

Work in groups of four students.

Choose subject via Brightspace ! SC42050 ! Literature assignment –


Do it this week!

7 / 79
Goals and Content of the Course

knowledge-based and intelligent control systems


1 Fuzzy sets and systems
2 Data analysis and system identification
3 Knowledge based fuzzy control
4 Artificial neural networks
5 Gaussian Processes (new)
6 Control based on fuzzy and neural models
7 Basics of reinforcement learning
8 Reinforcement learning for control
9 Applications

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

 Own PC: Campus Licence.


 Computer rooms at 3mE.
 Computer rooms of other faculties (e.g., at Drebbelweg)

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

+ systematic approach, mathematically elegant


+ theoretical guarantees of stability and robustness

time-consuming, conceptually difficult


control engineering expertise necessary
often insufficient for nonlinear systems

13 / 79
When Conventional Design Fails

 no model of the process available


! mathematical synthesis and analysis impossible
! experimental tuning may be difficult
 process (highly) nonlinear
! linear controller cannot stabilize
! performance limits

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

 fuzzy systems (represent human knowledge, reasoning)


 artificial neural networks (adaptation, learning)
 genetic algorithms (optimization)
 particle swarm optimization
 etc.

16 / 79
Intelligent Control
techniques motivated by human intelligence

 fuzzy systems (represent human knowledge, reasoning)


 artificial neural networks (adaptation, learning)
 genetic algorithms (optimization)
 particle swarm optimization
 etc.

 Fuzzy knowledge-based control


 Fuzzy data analysis, modeling, identification
 Learning and adaptive control (neural networks)
 Reinforcement learning

16 / 79
Fuzzy Control I

17 / 79
Outline

1 Fuzzy sets and set-theoretic operations

2 Fuzzy relations

3 Fuzzy systems

4 Linguistic model, approximate reasoning

18 / 79
Fuzzy Sets and Fuzzy Logic

Relatively new methods for representing uncertainty and reasoning


under uncertainty.

Types of uncertainty:
 chance, randomness (stochastic)
 imprecision, vagueness, ambiguity (non-stochastic)

19 / 79
Classical Set Theory

A set is a collection of objects with a common property.

20 / 79
Classical Set Theory

A set is a collection of objects with a common property.


Examples:

 Set of natural numbers smaller than 5: A = f1; 2; 3; 4g

20 / 79
Classical Set Theory

A set is a collection of objects with a common property.


Examples:

 Set of natural numbers smaller than 5: A = f1; 2; 3; 4g


 Unit disk in the complex plane: A = fz jz 2 C; jz j  1g

20 / 79
Classical Set Theory

A set is a collection of objects with a common property.


Examples:

 Set of natural numbers smaller than 5: A = f1; 2; 3; 4g


 Unit disk in the complex plane: A = fz jz 2 C; jz j  1g
 A line in R2 : A = f(x; y )jax + by + c = 0; (x; y; a; b; c ) 2 Rg

20 / 79
Representation of Sets

 Enumeration of elements: A = fx1 ; x2 ; : : : ; xn g


 Definition by property: A = fx 2 X jx has property Pg
 Characteristic function: A (x ) : X ! f0; 1g
(
A (x ) = 1 x is member of A
0 x is not member of A

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?

 Classical sets are good for well-defined concepts (maths, programs,


etc.)
 Less suitable for representing commonsense knowledge in terms of
vague concepts such as:
 a tall person, slippery road, nice weather, . . .
 want to buy a big car with moderate consumption
 If the temperature is too low, increase heating a lot

24 / 79
Classical Set Approach

set of tall people A = fhjh  180g


A
1

0
170 180 190 h [cm]

25 / 79
Logical Propositions

“John is tall” . . . true or false

John’s height: hJohn = 180:0 A (180:0) = 1 (true)


hJohn = 179:5 A (179:5) = 0 (false)
A
1

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

“John is tall” . . . degree of truth


John’s height: hJohn = 180:0 A (180:0) = 0:6
hJohn = 179:5 A (179:5) = 0:56
hP aul = 201:0 A (201:0) = 1
A
1

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

triangular trapezoidal bell-shaped


1

0
x

30 / 79
Representation of Fuzzy Sets

 Pointwise as a list of membership/element pairs:

A = fA (x1 )=x1 ; : : : ; A (xn )=xn g = fA (xi )=xi jxi 2 X g


 As a list of -level/ -cut pairs:

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

 Analytical formula for the membership function:

x 2R
1
A (x ) = ;
1 + x2
or more generally
1
(x ) = :
1 + d (x; v )
d (x; v ) . . . dissimilarity measure

Various shorthand notations: A (x ) : : : A(x ) : : : a

32 / 79
Linguistic Variable

TEMPERATURE linguistic variable

linguistic
low medium high terms
semantic
rule
1
membership
µ functions

0
0 10 20 30 40
t (temperature) base variable

Basic requirements: coverage and semantic soundness

33 / 79
Properties of fuzzy sets

34 / 79
Support of a Fuzzy Set

supp(A) = fx jA (x ) > 0g

A
1

0
x
supp(A)

support is an ordinary set

35 / 79
Core (Kernel) of a Fuzzy Set

core(A) = fx jA (x ) = 1g

A
1

0
x
core(A)

core is an ordinary set

36 / 79
-cut of a Fuzzy Set

A = fx jA (x ) > g or A = fx jA (x )  g


A
1
a-level
a

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]

High-risk age for car insurance policy.

39 / 79
Fuzzy Numbers and Singletons
fuzzy number fuzzy
"about 3" singleton
1

0
3 8 x

Fuzzy linear regression: y = 3̃x1 + 5̃x2

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)

Probabilistic “and” (product operator):

A\B (x ) = A (x )  B (x )
Lukasiewicz “and” (bounded difference):

A\B (x ) = max(0; A (x ) + B (x ) 1)

Many other t-norms . . . [0; 1]  [0; 1] ! [0; 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

A = fA (x; y )=(x; y )j(x; y ) 2 X  Y g

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

Classical relation represents the presence or absence of interaction


between the elements of two or more sets.

With fuzzy relations, the degree of association (correlation) is


represented by membership grades.

An n-dimensional fuzzy relation is a mapping

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

Example: R : x  y (“x is approximately equal to y ”)


R (x; y ) = e (x y )2
1

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

Given fuzzy relation R defined in X  Y and fuzzy set A defined in X ,


derive the corresponding fuzzy set B defined in Y :

B = A  R = projY extX Y (A) \ R
max-min composition:
 
B (y ) = max
x
min A (x ); R (x; y )
Analogous to evaluating a function.

54 / 79
Graphical Interpretation: Crisp Function

crisp argument interval argument


y y

x x

55 / 79
Graphical Interpretation: Interval Function

crisp argument interval argument


y y

x x

55 / 79
Graphical Interpretation: Fuzzy Relation

crisp argument fuzzy argument


y y

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

 Systems with fuzzy parameters

y = 3̃x1 + 5̃x2
 Fuzzy inputs and states

ẋ (t ) = Ax (t ) + Bu (t ); x (0) = 2̃
 Rule-based systems

If the heating power is high


then the temperature will increase fast

58 / 79
Rule-based Fuzzy Systems

 Linguistic (Mamdani) fuzzy model

If x is A then y is B
 Fuzzy relational model

If x is A then y is B1 (0:1); B2 (0:8)


 Takagi–Sugeno fuzzy 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

conjunctive other connectives


x2 x2
A2 3

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.

 Formal approach based on fuzzy relations.

 Simplified approach (Mamdani inference).

 Interpolation (additive fuzzy systems).

63 / 79
Formal Approach

1 Represent each if–then rule as a fuzzy relation.

2 Aggregate these relations in one relation representative for the


entire rule base.

3 Given an input, use relational composition to derive the


corresponding output.

64 / 79
Modus Ponens Inference Rule

Classical logic Fuzzy logic

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

If–then rules can be represented as a relation, using implications or


conjunctions.
Classical implication

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

If–then rules can be represented as a relation, using implications or


conjunctions.
Conjunction

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

Fuzzy implication is represented by a fuzzy relation:

R : [0; 1]  [0; 1] ! [0; 1]

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

1 Construct implication relation:

R (x; y ) = I(A (x ); B (y ))

68 / 79
Inference With One Rule

1 Construct implication relation:

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

1 Construct implication relation for each rule i :

R (x; y ) = I(A (x ); B (y ))
i i i

2 Aggregate relations Ri into one:

R (x; y ) = aggr(R (x; y ))


i

The aggr operator is the minimum for implications and the


maximum for conjunctions.
3 Use relational composition to derive B 0 from A0 :
B 0 = A0  R

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

2 The entire rule base’s relation is the union:


K
[
R= Ri R (x ; y ) = 1max [ (x ; y )]
i K R 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

2 The entire rule base’s relation is the union:


K
[
R= Ri R (x ; y ) = 1max [ (x ; y )]
i K R 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

Zero Medium Large Zero Medium


1 1

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

1 Compute the match between the input and the antecedent


membership functions (degree of fulfillment).
2 Clip the corresponding output fuzzy set for each rule by using the
degree of fulfillment.
3 Aggregate output fuzzy sets of all the rules into one fuzzy set.
This is called the Mamdani or max-min inference method.

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

Zero Medium Large Zero Medium


1 1

0 20 40 60 80 100 0 1 2 3
Fin h

75 / 79
Mamdani Inference: Example

m Zero Medium Large m Zero Medium


1 1

0 50 100 0 3 6
Fin h

76 / 79
Mamdani Inference: Example

m Zero Medium Large m Zero Medium


1 1

0 50 100 0 3 6
Fin h

Given a crisp (numerical) input (Fin ).

76 / 79
If Fin is Zero then . . .

m Zero Medium Large m Zero Medium


1 1

0 50 100 0 3 6
Fin h

Determine the degree of fulfillment (truth) of the first rule.

76 / 79
If Fin is Zero then h is Zero

m Zero Medium Large m Zero Medium


1 1

0 50 100 0 3 6
Fin h

Clip consequent membership function of the first rule.

76 / 79
If Fin is Medium then . . .

m Zero Medium Large m Zero Medium


1 1

0 50 100 0 3 6
Fin h

Determine the degree of fulfillment (truth) of the second rule.

76 / 79
If Fin is Medium then h is Medium

m Zero Medium Large m Zero Medium


1 1

0 50 100 0 3 6
Fin h

Clip consequent membership function of the second rule.

76 / 79
Aggregation

m Zero Medium Large m Zero Medium


1 1

0 50 100 0 3 6
Fin h

Combine the result of the two rules (union).

76 / 79
Defuzzification

conversion of a fuzzy set to a crisp value

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

m Zero Medium Large m Zero Medium


1 1

0 50 100 0 3 6
Fin h

Compute a crisp (numerical) output of the model (center-of-gravity


method).

79 / 79

You might also like