Fuzzy Control SystemsFuzzy Control Systems
2
OutlineOutline
• Fuzzy control system
• Fuzzy Inference Systems
• Defuzzification method
• Mamdani fuzzy model
• Sugeno fuzzy model
• Tsukamoto fuzzy model
3
Fuzzy Control SystemsFuzzy Control Systems
模糊控制只需要有操作人員的經驗,就可以設計出
控制規則,不需要以數學模型來描述受控系統。模
糊控制系統(Fuzzy Control System)的基本架構如下
圖所示。
4
模糊推論系統
5
規則庫由一些IF... ...THEN型式的規則所組成
資料庫中定義了控制規則所使用之模糊集合的歸
屬函數
決策邏輯確立推論系統之運算元型式
模糊化(Fuzzification)是將輸入數值轉換成
所對應語言項之歸屬度(degree)
解模糊化(Defuzzification)將推論結果轉換
成輸出數值
6
解模糊化的方法
將經過模糊推論之後產生的結論,轉換為一明確數值的過程,我們稱之為 解模
糊化。
由於不同的模糊規則所採用的後鑑部會有所不同,因此,經過模糊推論後所得到
的結論,有的是以模糊集合來表示(如語意式模糊規則),而有的是以明確數值來
表示。
一、推論後得到的是模糊集合:令模糊集合 C 為模糊規則經過模糊推論後所得
到的結論,亦即 中的 。
1. 重心法 (center of gravity defuzzifier or center of area defuzzifier)
(1) 當論域為連續時:
(2) 當論域為離散時:
7
解模糊化的方法
2. 最大平均法 (mean of maxima defuzzifier)
其中
3. 修正型最大平均法 (modified mean of maxima defuzzifier)
其中
4. 中心平均法 (modified center average defuzzifier)
8
解模糊化的方法
5. 修正型重心法 (modified center average defuzzifier)
其中以 j 作為控制歸屬函數遞減的速率,當 j 越小,則歸屬函數遞減的速率越
快。
二、推論後得到明確的輸出值:令 j 代表第 j 個模糊規則的前鑑部被符合的程度
性,亦即“啟動強度(firing strength)”,yj 為第 j 個模糊規則所推論出的結果,
以下的“權重式平均法(weighted average method)”最被廣泛使用:
9
模糊控制範例模糊控制範例 (1) (1)
模糊規則一 R1:If x is A1 and y is B1 Then z is C1
模糊規則二 R2:If x is A2 and y is B2 Then z is C2
令 x0 與 y0 為感應器 x 與 y 之輸入,模糊集合 A1、 A2、 B1 、 B2 、 C1 、以及
C2 使用下列之歸屬函數:
10
模糊控制範例模糊控制範例 (2) (2)
讀入感應器輸入 以及 ,接下來我們將說明如何計算最
後的控制輸出。
首先計算感應器輸入 以及 與兩條模糊規則的符合程度為:
接下來,兩條模糊規則的啟動強度為:
將 1 對映至第一條模糊規則的後件部,可得到如圖中的灰色梯形區域 ;相同
地,將 2 對映至第二條模糊規則的後件部,可得到如圖中的黑色梯形區域 ;
將此兩個梯形區域以 “最大運算子 (max)” 取其最大值,可得最後的歸屬函數。
最後解模糊化可得:
11
圖:模糊推論過程示意圖。
12
模糊控制範例模糊控制範例 (3) (3)
1. 以連續型重心法作為解模糊化機構:首先找出 C´ 的歸屬函數為 :
因此
13
模糊控制範例模糊控制範例 (4) (4)
(2) 以離散型重心法來解模糊化:我們將輸出量化成 1,2,...,9 等 9 個離散輸出,可得
(3) 以 “最大平均法” 作為解模糊化機構:在最後的歸屬函數中,其量化值達到最大歸屬
函數值的有 3、4、以及 5,因此我們可以得到:
(4) 以修正型最大平均法作為解模糊化機構:
(5) 以中心平均法作為解模糊化機構:
14
Fuzzy Inference System (FIS)Fuzzy Inference System (FIS)
• A computing framework based on the concepts
of fuzzy set theory, fuzzy if-then rule, fuzzy
reasoning
• Fuzzy Inference System also called as:
Fuzzy Rule_Based System, Fuzzy Expert System, Fuzzy
Model, Fuzzy Associative Memory, Fuzzy Logic
Controller, Fuzzy System
15
Three Types of Fuzzy inference systemThree Types of Fuzzy inference system
• Mamdani fuzzy model
• Sugeno fuzzy model
• Tsukamoto fuzzy model
16
Mamdani Fuzzy ModelsMamdani Fuzzy Models
• Attempt to control a steam engine and boiler combination by a set of
linguistic control rules obtained from human operators.
Use max-algebraic product for T-conorm/T-norm
and max-product composition
The overall output: defuzzification
2 FISs:
• a controller to generate the heat input to the boiler
to regulate the steam pressure in the boiler
• a controller of 節流閥opening of the engine cylinder
to 控制 the speed of the engine
• . Mamdani and S. Assilian.
An experiment in linguistic synthesis with a fuzzy logic controller.
International Journal of Man-Machine Studies, 7(1):1-13, 1975.
17
Mamdani’s Fuzzy ModelsMamdani’s Fuzzy Models
max-min
T-conorm/norm
max-algebraic product
T-conorm/norm
18
Mamdani Fuzzy ModelsMamdani Fuzzy Models
Defuzzification:
• a method to extract a representative crisp value from a fuzzy set.
• defuzzification of a fuzzy set A of a universe of disourse Z:
A(z): the aggregated output MF.
• Centroid of area zCOA : expected values of prob. Distribution.
zCOA =∫Z A(z) z dz / ∫Z A(z) dz
• Bisector of area zBOA : the vertical line z=zBOA partitions the region
b/t {z=, z=, y=0, y=A(z)} into 2 regions with the same area.
∫
zBOA A(z) dz = ∫ zBOA A(z) dz where = min {z| z Z}, = max {z| z Z}
• Mean of maximum zMOM : average of the maximizing z
at which MF reach a maximum *
zMOM =∫Z z dz / ∫Z dz where Z = {z| A(z)=* }
• Smallest of maximum zSOM : the minimum of the maximizing z
• Largest of maximum zLOM : the maximum of the maximizing z
19
Mamdani Fuzzy ModelsMamdani Fuzzy Models
• Centroid of area zCOA
zCOA =∫ Z A(z) z dz / ∫Z A(z) dz
• Bisector of area zBOA
∫
zBOA A(z) dz = ∫ zBOA A(z) dz
• Mean of maximum zMOM
zMOM =∫Z z dz / ∫Z dz
• Smallest of maximum zSOM
• Largest of maximum zLOM
20
Example: Mamdani’s Fuzzy Model
• Single-input single-output Mamdani fuzzy model
If X is small then Y is small.
If X is medium then Y is medium.
If X is large then Y is large.
21
Example: Mamdani’s Fuzzy Model
• Two-input single-output Mamdani fuzzy model
If X is small and Y is small then Z is negative large.
If X is small and Y is large then Z is negative small
If X is large and Y is small then Z is positive small.
If X is large and Y is large then Z is positive large.
22
VariantsVariants
• AND operator (T-norm):
for calculating the firing strength of a rule with AND’ed antecedents
• OR operator (T-conorm):
the calculating the firing strength of a rule with OR’ed antecedents
• Implication operator
for calculating qualified consequent MFs based on given firing strength
• Aggregation operator
for aggregating qualified consequent MFs to generate an overall output MF.
• Defuzzification operator
for transforming an output MF to a crisp single output value.
• Sum-product composition (aggregation – implication operator)
The final crisp output via centroid defuzzification
= the weighted average of the centroids of consequent MFS,
where the weighting factor for each rule
= its firing strength the area of the consequent MF.
23
Theorem: Computation Shortcut for Theorem: Computation Shortcut for
Mamdani Fuzzy Inference SystemsMamdani Fuzzy Inference Systems
Under sum-product composition,
the output of a Mamdani FIS with centroid defuzzification
= the weighted average of the centroids of consequent MFS,
where each of the weighting factors
= firing strength the consequent MF’s area. (wi ai)
Pf) Use product for implication, and sum for aggregation operator.
Then, C (z) = w1C1 (z) + w2C2 (z)
The crisp output under centroid defuzzification is
24
Sugeno Fuzzy Models (TSK model)Sugeno Fuzzy Models (TSK model)
• Takagi, Sugeno and Kang
• a systematic approach to generate fuzzy rules from a given input/output data set.
• if x is A and y is B then z = f(x,y)
• z=f(x,y) : a crisp function in the consequent.
• f(x,y) : a polynomial fn; but it can be any fn.
- 1st-order Sugeno fuzzy model: f(x, y) is a 1st order polynomial.
- Zero-order Sugeno fuzzy model: f(x,y) is a constant
– A special case of Mamdani model, in which each rule’s consequent is specified
by a fuzzy single (or a pre-defuzzified consequent)
– A special case of Tsukamoto fuzzy model, in which each rule’s consequent is
specified
by an MF of a step function center at the
constant.
– Functionally, equivalent to a Radial Basis Function network
under certain minor constraints ()
• The overall output:
• weighted average z = (w1z1+w2z2) / (w1+w2) -- no defuzzification.
Or
• weighted sum z = w1z1+w2z2 -- the loss of MF linguistic meanings unless I wi 1.
25
Sugeno Fuzzy Models (TSK model)Sugeno Fuzzy Models (TSK model)
• don’t strictly follow Compositional Rule of Inference, but still employ the
matching of fuzzy sets in the antecedent part.
• Most popular candidate for sample-data-based fuzzy modeling,
w/o defuzzification.
• M. Sugeno and . Kang.
Structure identification of fuzzy model.
Fuzzy Sets and Systems, 28:15-33, 1988
• T. Takagi and M. Sugeno.
Fuzzy identification of systems and its applications to modeling and control.
IEEE Transactions on Systems, Man, and Cybernetics, 15:116-132, 1985.
26
Sugeno Fuzzy Models (TSK model)Sugeno Fuzzy Models (TSK model)
27
Example: Sugeno Fuzzy ModelsExample: Sugeno Fuzzy Models
• Comparison of Fuzzy and Nonfuzzy Rules Set
If X is small then Y = +
If X is medium then Y = - + 4
If X is large then Y = X – 2.
Antecedent MFs vs. Input-output curve
28
Example: Sugeno Fuzzy Model
• Two-input single-output Sugeno fuzzy model
If X is small and Y is small then z=-x+y+1.
If X is small and Y is large then z=-y+3.
If X is large and Y is small then z=-x+3.
If X is large and Y is large then z=x+y+2.
Antecedent/consequent MF Overall input-output surface
29
Tsukamoto Fuzzy ModelTsukamoto Fuzzy Model
• the consequent of each fuzzy if-then rule:
a fuzzy set with a monotonical MF.
• Overall output: the weighted average of each rule’s output.
• No defuzzification.
• Not as transparent as mamdani’s or Sugeno’s fuzzy model.
• Not follow strictly the compositional rule of inference: the output is always
crisp.
30
Example: Tsukamoto Fuzzy ModelExample: Tsukamoto Fuzzy Model
• Single-input Tsukamoto fuzzy model
If X is small then Y is C1 .
If X is medium then Y is C2 .
If X is large then Y is C3 .
31
Other ConsiderationOther Consideration
Common Issues concerning 3 FISs:
• How to partition an input space?
• How to construct a FIS for a particular application?
In 3 FISs,
the same Antecedent in 3 FISs - defines a local fuzzy region
vs. different Consequent (MF, a constant, a polynomial)
– describes the behavior within the region
Methods of partitioning input spaces:
• to form the antecedents - applicable to all 3 types of FISs
• Grid partition
• Tree partition
• Scatter partition
32
Input Space PartitioningInput Space Partitioning
• Grid partition:
• Often chosen in a fuzzy controller which involves only several state variables as the
inputs
• Needs only a small # of MFSs for each input.
• For large # of inputs? - exponential # of rules.-- curse of dimensionality.
• Tree partition
• Each region can be uniquely specified along a corresponding decision tree. –
relieves an exponential increase in # of rules.
• Scatter partition
• Limit the # of rules to a reasonable amount by covering a subset of the whole input
space which characterizes a region of possible occurrence of the input vectors.
• Dictated by desired i-o data pairs, thus orthogonality doesn’t hold in X,Y, or X Y.
33
Fuzzy ModelingFuzzy Modeling
• A process for constructing a FIS
• Features:
• The rule structure of FIS makes it easy to incorporate human expertise a/t the
target system directly into the modeling process – take advantage of domain
knowledge
• When the input/output data of a target system is available, conventional system
identification techniques can be used. – the important role of the use of numerical
data in fuzzy modeling.
• A process for constructing a FIS
• 1. identification of the surface structure:
- Obtain rule base which describe the behavior of the target system
. linguistic terms.
• 2. identification of deep structure:
- Determine the MFs of each linguistic term.
34
Fuzzy ModelingFuzzy Modeling
A process for constructing a FIS:
1. identification of the surface structure:
- Obtain rule base which describe the behavior of the target system
. linguistic terms.
- Rely on the knowledge of the target system whose information
provided by human experts or trial & error.
1. Select relevant input-output variables.
2. Choose a specific type of FIS.
3. Determine the number of linguistic terms associated with each input-
output variables (and the order of consequent equation for Sugeno’s
model).
4. Design a collection of fuzzy if-then rules.
35
Fuzzy ModelingFuzzy Modeling
A process for constructing a FIS:
2. identification of deep structure:
- Meaning of the linguistic terms are determined by the MFs of each
linguistic term (and the coefficients of each rule’s output
polynomial in Sugeno’s model).
1. Choose an appropriate family of parameterized MFs.
2. Interview human experts familiar with the target systems to
determine the parameters of the MFs used in the RB.
3. Refine the parameters of the MFs using regression and optimization
techniques. -- the desired input-output data set is assumed.
36
倒單擺的模糊控制
37
倒單擺的模糊控制
語言變數:
夾角angle Θ
角速度ΔΘ
施力y
五個模糊集合:
(1) positive medium (PM);
(2) positive small(PS);
(3) zero (ZE);
(4) negative small (NS);
(5) negative medium (NM)
38
模糊控制規則
39
模糊控制
40
模糊控制
41
每一語言變數的模糊集合
N3: Large negative.
N2: Medium negative.
N1: Small negative.
Z: Zero.
P1: Small positive.
P2: Medium positive.
P3: Large positive.
42
應用模糊規則
rule 2: IF temperature IS cool AND pressure IS low,
THEN throttle is P2.
43
應用模糊規則
rule 3: IF temperature IS cool AND pressure IS ok,
THEN throttle is Z.
44
模糊推論