Download as pdf or txt
Download as pdf or txt
You are on page 1of 44

INTELLIGENT CONTROL SYSTEM

PART II:
Fuzzy Logic
Instructor: Dr. Dang Xuan Ba
Email: badx@hcmute.edu.vn

Department of Automatic Control


Chapter 1: Introduction

Chapter 2: Fuzzy Set


Content
Chapter 3: Fuzzy Logic
System

Chapter 4: Fuzzy Logic


Application

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 2


CHAPTER 1 – INTRODUCTION OF FUZZY
LOGIC

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 3


Chapter 1: Introduction of Fuzzy System
1. Motivations

In reality, we could drive a car though we do not need much knowledge of the car.

We do not know dynamics of a day-life water tank, but possibly we could control the
water high.

Why could we do it?

The systems are easy to control?

The human is too smart?

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 4


Chapter 1: Introduction of Fuzzy System
2. History of Fuzzy System

Lotfi Aliasker Zadeh


(February 4, 1921 – September 6, 2017)

Zadeh proposed the “Fuzzy Set”

concept in 1965.

First IEEE International Conference on Fuzzy system

1990s Now
1980s and
future
1970s Mamdani Fuzzy model

1965 Takagi-Sugeno (T-S) Fuzzy model

IEEE Transaction on Fuzzy System Many applications in Japan


Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 5
Chapter 1: Introduction of Fuzzy System
3. Why do we need Fuzzy systems
• “Fuzzy” is blurred and imprecisely defined.

• The real world is too complicated to describe accurately. Therefore,


fuzziness (approximation) is introduced to obtain a reasonable model.

• Human Knowledge becomes increasingly important in a modern life.

We need a theory to formulate human knowledge in a systematic


manner, put it into the engineering and combine with mathematical model
or sensory measurement.

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 6


Chapter 1: Introduction of Fuzzy System
4. What is a Fuzzy system

Fuzzy system is a knowledge-based system (hệ thống tri thức) which consist
of a set of ”IF-THEN” fuzzy rules.

Example 1:
IF Level of Water in the Tank is high THEN open-angle of valve is small.
IF Level of Water in the Tank is low THEN open-angle of valve is big.

Example 2:
• IF the speed of the car is slow THEN Force pushing on accelerator is
strong.
• IF the speed of the car is fast THEN Force pushing on accelerator is
weak.

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 7


Chapter 1: Introduction of Fuzzy System
4. Where are Fuzzy systems applied?

• Fuzzy in washing machine

• Digital image stabilizer

• Fuzzy system in Cars

• Fuzzy system in Cement Kiln

• Fuzzy Control of Subway train

• And so on.

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 8


Chapter 1: Introduction

Chapter 2: Fuzzy Set


Content
Chapter 3: Fuzzy Logic
System

Chapter 4: Fuzzy Logic


Application

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 9


CHAPTER 2 – FUZZY SET

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 10


Chapter 2: Fuzzy Set (Tập hợp mờ)
1. Classical set (Tập hợp rõ)/ Membership function (Hàm thành viên – Hàm
liên thuộc)
Let X be a space of objects and x be a generic element of X.

Classical set A is a collection of distinct objects (đối tượng), which share


certain characteristics, in the universe X:

For example: a set of students passing the exam.


A set of negative temperatures.
X is called an Universe set (tập cơ sở).

Each individual entity (cá thể) in a set A is called a member (thành viên) or
an element (phần tử) of the set.

The classical set A splits the universe set X (tập cơ sở) in two groups:
members and non-members, it means that no partial membership exists.

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 11


Chapter 2: Fuzzy Set (Tập hợp mờ)
1. Classical set (Tập hợp rõ)/ Membership function (Hàm thành viên – Hàm
liên thuộc)
The classical set A represented in universe set X could be re-defined by
using a membership function as follows:
1 if ( x  A)
 A ( x) = 
0 otherwise
Example 1: Given the membership function of two following classical sets:
A = [1, 3] and B = {1, 2, 3}

Fig. 2. 1 Membership function Fig. 2. 2Membership function


of classical set A of classical set B

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 12


Chapter 2: Fuzzy Set (Tập hợp mờ)
1. Classical set (Tập hợp rõ)/ Basic Operation (Các phép toán cơ bản)
For two sets A and B on universe set X, we have

Union (Hội): A  B = {x | x  A or x  B} Logical OR

Intersection (Giao): A  B = {x | x  A and x  B} Logical AND

Complement (Bù): A = {x | x  A and x  X }

Difference (Hiệu): A \ B = {x | x  A and x  B}

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 13


Chapter 2: Fuzzy Set (Tập hợp mờ)
1. Classical set (Tập hợp rõ)/ Properties (Các tính chất cơ bản)
For two sets A and B on universe set X, we have

Commutativity (Giao hoán): A B = B  A A B = B  A

Associativity (Kết hợp): A  ( B  C ) = ( A  B)  C A  ( B  C ) = ( A  B)  C

Distributivity (Phân phối):


A  ( B  C ) = ( A  B)  ( A  C )
A  ( B  C ) = ( A  B)  ( A  C )

Idempotency (tính lặp): A A = A A A = A

A  = A A  = 
Identity (xác định):  
A X = X A X = A
Transitivity (bắt cầu): A  B and B  C  A  C

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 14


Chapter 2: Fuzzy Set (Tập hợp mờ)
1. Classical set (Tập hợp rõ)/ Basic Operation (Các phép toán cơ bản)
Membership functions of two classical sets can be manipulated as follows:

Union (Hội):  A B ( x) = max(  A ( x),  B ( x)) = min(1,  A ( x) +  B ( x))

Intersection (Giao):  A B ( x) = min(  A ( x),  B ( x)) =  A ( x)  B ( x)

Complement (Bù):  A ( x) = 1 −  A ( x)

Difference (Hiệu):  A \ B ( x) =  A ( x)(1 −  B ( x))

Convolution (tích):  A B ( x, y ) =  A ( x)  B ( y )

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 15


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Definition (định nghĩa)
Fuzzy set A on a universe set X is defined by a membership function in a range of [0;1].

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 16


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Definition (định nghĩa)
Fuzzy set A on a universe set X is defined by a membership function in a range of [0;1].

Fuzzy set A must satisfy the objectivity (tính khách quan) and reasonability (tính hợp
lý).

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 17


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Typical membership functions
Triangle MFs

Trapezoidal MFs

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 18


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Typical membership functions
Gaussian MFs

Generalised bell MFs

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 19


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Typical membership functions
Sigmoid MFs

Discrete MFs

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 20


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Typical membership functions

A fuzzy set A(x) on universe X is called normal fuzzy set (chuẩn) if and only if A(x) is a convex set
and height of A(x) is equal to 1.

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 21


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Complement (Bù):

A fuzzy set A is defined in the universal set X . A(x) represents the degree of how
much does an element x  X , belong to A .

Ac is used to represent the complement of fuzzy set A . Ac (x) is regarded as “the


degree of x belongs to Ac “ or “the degree of x does not belong to A”.

c(a) :[0,1] → [0,1]


Satisfying the following conditions:
One definition:
1) c(0) = 1, c(1) = 0.
𝑐 𝜇𝐴(𝑥ሻ = 𝜇𝐴𝑐 (𝑥ሻ = 1 − 𝜇𝐴(𝑥ሻ
2) a  b → c(a)  c(b).

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 22


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Complement (Bù):

Satisfying the following conditions:


One definition:
1) c(0) = 1, c(1) = 0.
2) a  b → c(a)  c(b). 𝑐 𝜇𝐴(𝑥ሻ = 𝜇𝐴𝑐 (𝑥ሻ = 1 − 𝜇𝐴(𝑥ሻ

Example 1:

Ac(x) Bc(x)
A(x) B(x)
1 1

0 0

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 23


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Complement (Bù):

Satisfying the following conditions:


One definition:
1) c(0) = 1, c(1) = 0.
2) a  b → c(a)  c(b). 𝑐 𝜇𝐴(𝑥ሻ = 𝜇𝐴𝑐 (𝑥ሻ = 1 − 𝜇𝐴(𝑥ሻ

Example 2:

0 0.5 1 0.5 0
𝐴 𝑥 ={ + + + + ቋ
1 2 3 4 5

𝑐
1 0.5 0 0.5 1
𝐴 𝑥 ={ + + + + ቋ
1 2 3 4 5

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 24


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Intersection (Giao):

Consider two fuzzy set 𝐴(𝑥ሻ and B(𝑥ሻ on the same universe X. Intersection of A(x) and B(x)
is defined the following MFs:

where
t (a, b) :[0,1]  [0,1] → [0,1]
Satisfying the following conditions:
Tính Giới hạn
Tính đơn điệu
Tính giao hoán
Tính kết hợp

Intersection (Giao): t-norm


Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 25
Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Intersection (Giao) t-norm:

• Standard Intersection (MIN) 𝑡 𝜇𝐴(𝑥ሻ, 𝜇𝐵 𝑥 = min 𝜇𝐴(𝑥ሻ, 𝜇𝐵 𝑥

• Algebraic Product (PROD): 𝑡 𝜇𝐴 𝑥 , 𝜇𝐵 𝑥 = 𝜇𝐴(𝑥ሻ 𝜇𝐵 𝑥

• Bounded Difference
(Lukasiewicz) 𝑡 𝜇𝐴 𝑥 , 𝜇𝐵 𝑥 = max(0, 𝜇𝐴 𝑥 + 𝜇𝐵 𝑥 − 1ሻ

• Others:  A ( x)  B ( x)
t (  A ( x),  B ( x)) =
2 −  A ( x ) −  B ( x) +  A ( x)  B ( x)

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 26


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Intersection (Giao) t-norm: Example 1

B(x) B(x)
A(x) A(x)
1 1

0 0

Standard intersection (MIN) Algebraic Product

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 27


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Intersection (Giao) t-norm: Example 2


• Discrete time
0.1 0.2 0.8 1 0.7 0.2 0
𝐴 𝑦 ={ + + + + + + ቋ
𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6 𝑦7
0 0.25 0.75 1 0.75 0.25 0
𝐵 𝑦 ={ + + + + + + ቋ
𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6 𝑦7
Standard intersection (MIN):
0 0.2 0.75 1 0.7 0.2 0
𝐴 𝑦 ⋂𝐵 𝑦 = { + + + + + + ቋ
𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6 𝑦7
Product:
0 0.05 0.6 1 0.525 0.05 0
𝐴 𝑦 ⋂𝐵 𝑦 = { + + + + + + ቋ
𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6 𝑦7
Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 28
Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Intersection (Giao) t-norm: Example 3

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 29


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Intersection (Giao) t-norm: example 4

T-norm with PROD rule

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 30


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Intersection (Giao) t-norm: example 4

T-norm with MIN rule

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 31


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Union (Hội): s-norm

Consider two fuzzy set 𝐴(𝑥ሻ and B(𝑥ሻ on the same universe X. Union of A(x) and
B(x) is defined the following MFs:

where
s (a, b) :[0,1]  [0,1] → [0,1]
Satisfying the following conditions:

Tính Giới hạn


Tính đơn điệu
Tính giao hoán
Tính kết hợp

Union (Hội): s-norm


Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 32
Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Union (Hội) s-norm:

• Standard Union (MAX) s (  A ( x),  B ( x)) = max(  A ( x),  B ( x))

• Algebraic Sum (SUM): s (  A ( x),  B ( x)) = min(1,  A ( x) +  B ( x))

• Einstein rule: s (  A ( x),  B ( x)) = [  A ( x) +  B ( x)] / (1 +  A ( x)  B ( x))

• Others s (  A ( x),  B ( x)) =  A ( x) +  B ( x) −  A ( x)  B ( x)

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 33


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Union (Hội) s-norm: Example 1

B(x) B(x)
A(x) A(x)
1 1

0 0

Standard union (MAX)

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 34


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Union (Hội) s-norm: Example 2

• Discrete time:
0.1 0.2 0.8 1 0.7 0.2 0
𝐴 𝑦 ={ + + + + + + ቋ
𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6 𝑦7
0 0.25 0.75 1 0.75 0.25 0
𝐵 𝑦 ={ + + + + + + ቋ
𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6 𝑦7

• Standard union:
0.1 0.25 0.8 1 0.75 0.25 0
𝐴 𝑦 ∪𝐵 𝑦 ={ + + + + + + ቋ
𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6 𝑦7

• Find the union based on the Algebraic Sum?

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 35


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Union (Hội) s-norm: Example 3

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 36


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Union (Hội) s-norm: example 4

s-norm with SUM rule

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 37


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Union (Hội) s-norm: example 4

s-norm with MAX rule

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 38


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Hybrid operation (Phép toán lai):


• DeMorgan’s laws:
• For classical set:
A  B = A  B

 A B = A  B
• For fuzzy set:
𝑐(𝑡 𝜇𝐴 𝑥 , 𝜇𝐵 𝑥 ሻ = 𝑠(𝑐 𝜇𝐴 𝑥 , 𝑐 𝜇𝐵 𝑥 ሻ
𝑐(𝑠 𝜇𝐴 𝑥 , 𝜇𝐵 𝑥 ሻ = 𝑡(𝑐 𝜇𝐴 𝑥 , 𝑐 𝜇𝐵 𝑥 ሻ

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 39


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Hybrid operation (Phép toán lai): Example 1

B(x)
A(x)
1
A B?

A B?

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 40


Chapter 2: Fuzzy Set (Tập hợp mờ)
2. Fuzzy set (Tập hợp mờ)/ Operation

Hybrid operation (Phép toán lai): Example 2

• Consider two discrete time fuzzy sets on universe


set Y={y1, y2, y3, y4, y5, y6, y7}:
0.4 0.6 0.8 1 0.7 0.2 0
𝐴 𝑦 ={ + + + + + + ቋ
𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6 𝑦7
0.3 0.5 0.9 1 0.8 0.1 0
𝐵 𝑦 ={ + + + + + + ቋ
𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6 𝑦7

A B?
A B?
Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 41
Chapter 2: Fuzzy Set (Tập hợp mờ)
3. Linguistic Variable (Biến ngôn ngữ)/ Fuzzy variable (biến mờ)

Classical variable (biến rõ):


Data type (Kiểu dữ liệu - int)

Int a = 5; Variable name (Tên biến - a)

Variable value (Giá trị a = 5)


Fuzzy variable (biến mờ):

Data type Universe set 0 if ( x  30)


 x − 30

Variable name Variable name high ( x) =  if ( x  60)
 30
1 otherwise
Membership function
( high temp, X ,  ( x) )
Variable value
high
Linguistic variable (biến ngôn ngữ):

Data type Universe set

Variable name Variable name ( temp, X , high )


Variable value Fuzzy variable
Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 42
Chapter 2: Fuzzy Set (Tập hợp mờ)
3. Linguistic Variable (Biến ngôn ngữ)/ Fuzzy variable (biến mờ)
Fuzzy variable (biến mờ):

Data type Universe set 0 if ( x  30)


 x − 30

Variable name Variable name high ( x) =  if ( x  60)
 30
1 otherwise
Membership function
( high temp, X ,  ( x) )
Variable value
high
Linguistic variable (biến ngôn ngữ):

Data type Universe set

Variable name Variable name ( temp, X , high )


Variable value Fuzzy variable

Linguistic variable (biến ngôn ngữ): example 1

Part II: Fuzzy Logic Presenter: Dr. Dang Xuan Ba 43


END OF CHAPTER II

Part I: Neural Network Presenter: Dr. Dang Xuan Ba 44

You might also like