Professional Documents
Culture Documents
Pres09 B Fuzzy Rule-Based System
Pres09 B Fuzzy Rule-Based System
Pres09 B Fuzzy Rule-Based System
AUTOMATION 1
CONTROL SYSTEMS
MNG512 (111 & 112)
Course Outline
Part1: Math. Part 2: Automatic Control
• State-Space Fundamentals • Introduction & Basic Concepts
• Modeling of physical systems • TIME RESPONSE (TRANSIENT AND STEADY STATE)
o State Space Models • STABILITY
o Modeling in Time domain • DISTURBANCE REJECTION
• BASIC CONTROL Actions & Controllers
• PID Control Tuning and Design
• Sensitivity Analysis
• Reachability, Controllability and Observability
• Root Locus
• Fuzzy control
AUTOMATION-I
CONTROL SYSTEMS
MNG512 (111 & 112)
A Lecture on:
FUZZY RULE-BASED SYSTEM
FORMATION OF RULES
For any linguistic variable, there are three general forms:
1- Assignment statements: are those in which the variable is assigned with the
value by the assignment operator “ = ”
2- Conditional statements
o In these statements, some specific conditions are mentioned, if the conditions are
satisfied then it enters the following statements, called as restrictions.
Examples:
o If 𝑥𝑥 = 𝑦𝑦 THEN 𝑏𝑏𝑏𝑏𝑏𝑏ℎ 𝑎𝑎𝑎𝑎𝑎𝑎 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒
o If 𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀 > 60 THEN 𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝
o If 𝑊𝑊𝑊𝑊𝑊𝑊𝑊𝑊 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 > 1500 THEN 𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 𝑡𝑡ℎ𝑒𝑒 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡
3- Unconditional statements
• There is no specific condition that must be satisfied in this form of statements.
• The control may be transferred without any appropriate conditions. E.g.
• The consequent or rules’ output is denoted by the restrictions 𝑹𝑹𝟏𝟏 , 𝑹𝑹𝟐𝟐 , … , 𝑹𝑹𝒏𝒏
January 2, 2024 Page 4/22
FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM
DECOMPOSITION OF RULES
• There might be a compound rule structure involved in many applications. E.g.
�1 𝐴𝐴𝐴𝐴𝐴𝐴 𝐶𝐶
IF 𝑥𝑥 is 𝐶𝐶 �2 𝐴𝐴𝐴𝐴𝐴𝐴 … 𝐴𝐴𝐴𝐴𝐴𝐴 𝐶𝐶�𝑛𝑛 THEN 𝑦𝑦 is 𝑅𝑅
�𝑟𝑟
�𝑟𝑟 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 𝑅𝑅
The rule can be expressed as: 𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝐶𝐶 �𝑟𝑟
�1 𝐴𝐴𝐴𝐴𝐴𝐴 𝐶𝐶
�𝒓𝒓 = 𝐶𝐶
where, 𝑪𝑪 �2 𝐴𝐴𝐴𝐴𝐴𝐴 … 𝐴𝐴𝐴𝐴𝐴𝐴 𝐶𝐶�𝑛𝑛 = 𝐶𝐶
�1 ∧ 𝐶𝐶
�2 ∧ … ∧ 𝐶𝐶�𝑛𝑛
�1 𝑂𝑂𝑂𝑂 𝐶𝐶
IF 𝑥𝑥 is 𝐶𝐶 �2 𝑂𝑂𝑂𝑂 … 𝑂𝑂𝑂𝑂 𝐶𝐶�𝑛𝑛 THEN 𝑦𝑦 is 𝑅𝑅
�𝑟𝑟
�1 𝑂𝑂𝑂𝑂 𝐶𝐶
�𝑟𝑟 = 𝐶𝐶
where, 𝐶𝐶 �2 𝑂𝑂𝑂𝑂 … 𝑂𝑂𝑂𝑂 𝐶𝐶�𝑛𝑛 = 𝐶𝐶
�1 ∨ 𝐶𝐶
�2 ∨ … ∨ 𝐶𝐶�𝑛𝑛
�1 AND 𝑥𝑥 is 𝐶𝐶
IF 𝑥𝑥 is 𝐶𝐶 �2 THEN 𝑦𝑦 is 𝑅𝑅
�1
• This is the major unit of a FL system. also known as fuzzy expert system.
Construction of FIS
𝐼𝐼𝐼𝐼 𝑥𝑥1 is 𝐶𝐶𝑖𝑖1 𝐴𝐴𝐴𝐴𝐴𝐴𝑥𝑥2 𝑖𝑖𝑖𝑖 𝐶𝐶𝑖𝑖2 … 𝐴𝐴𝐴𝐴𝐴𝐴 𝑥𝑥𝑛𝑛 is 𝐶𝐶𝑖𝑖𝑖𝑖 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 𝑦𝑦 is 𝑅𝑅𝑖𝑖
Mamdani’s FI Method
Example: Consider a fuzzy controller with the rule base shown below.
Using Mamdani’s FIS, calculate the control signal corresponding to unity
error-signal which change at a rate of 16 𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢/𝑠𝑠. Consider the shown
membership function for all signals.
Solution:
1- Membership functions:
𝟏𝟏, 𝒙𝒙 ≤ −𝟐𝟐𝟐𝟐
𝝁𝝁𝑵𝑵𝑵𝑵 (𝒙𝒙) = �−𝟏𝟏 − 𝟎𝟎. 𝟏𝟏𝟏𝟏, − 𝟐𝟐𝟐𝟐 < 𝒙𝒙 ≤ −𝟏𝟏𝟏𝟏
𝟎𝟎, 𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐
𝟐𝟐 + 𝟎𝟎. 𝟏𝟏𝟏𝟏, − 𝟐𝟐𝟐𝟐 < 𝒙𝒙 ≤ −𝟏𝟏𝟏𝟏 𝟎𝟎. 𝟏𝟏𝟏𝟏, 𝟎𝟎 < 𝒙𝒙 ≤ 𝟏𝟏𝟏𝟏
𝝁𝝁𝑵𝑵𝑵𝑵 (𝒙𝒙) = � −𝟎𝟎. 𝟏𝟏𝟏𝟏, − 𝟏𝟏𝟏𝟏 < 𝒙𝒙 ≤ 𝟎𝟎 𝝁𝝁𝑷𝑷𝑷𝑷 (𝒙𝒙) = � 𝟐𝟐 − 𝟎𝟎. 𝟏𝟏𝟏𝟏, 𝟏𝟏𝟏𝟏 < 𝒙𝒙 ≤ 𝟐𝟐𝟐𝟐
𝟎𝟎, 𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐 𝟎𝟎, 𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐
𝟏𝟏 + 𝟎𝟎. 𝟏𝟏𝟏𝟏, − 𝟏𝟏𝟏𝟏 < 𝒙𝒙 ≤ 𝟎𝟎 𝟎𝟎. 𝟏𝟏𝟏𝟏 − 𝟏𝟏, 𝟏𝟏𝟏𝟏 < 𝒙𝒙 ≤ 𝟐𝟐𝟐𝟐
𝝁𝝁𝒁𝒁 (𝒙𝒙) = � 𝟏𝟏 − 𝟎𝟎. 𝟏𝟏𝒙𝒙, 𝟎𝟎 < 𝒙𝒙 ≤ 𝟏𝟏𝟏𝟏 𝝁𝝁𝑷𝑷𝑷𝑷 (𝒙𝒙) = � 𝟏𝟏, 𝟐𝟐𝟐𝟐 < 𝒙𝒙
𝟎𝟎, 𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐 𝟎𝟎, 𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐
�
0.9 𝑍𝑍
𝑒𝑒 = 1 is �
�
0.1 𝑃𝑃𝑃𝑃
2- Fuzzification →
�
0.6 𝑃𝑃𝑃𝑃
𝑑𝑑𝑑𝑑 = 16 is �
�
0.4 𝑃𝑃𝑃𝑃
3- Rule firing →
0.9 𝑍𝑍� �
𝟎𝟎. 𝟒𝟒 𝑷𝑷𝑷𝑷 �
0.4 𝑁𝑁𝑁𝑁
� � �
IF 𝒆𝒆 is � 0.9 𝑍𝑍 AND 𝒅𝒅𝒅𝒅 is �𝟎𝟎. 𝟔𝟔 𝑷𝑷𝑷𝑷 THEN 𝒖𝒖 is �0.6 𝑁𝑁𝑁𝑁
�
𝟎𝟎. 𝟏𝟏 𝑷𝑷𝑷𝑷 �
0.4 𝑃𝑃𝑃𝑃 �
0.1 𝑁𝑁𝑁𝑁
�
𝟎𝟎. 𝟏𝟏 𝑷𝑷𝑷𝑷 �
0.6 𝑃𝑃𝑃𝑃 �
0.1 𝑁𝑁𝑁𝑁
�
0.4 𝑁𝑁𝑁𝑁
� �
𝑢𝑢� = �0.6 𝑁𝑁𝑁𝑁 → � 0.4 𝑁𝑁𝑁𝑁
�
0.1 𝑁𝑁𝑁𝑁 �
0.6 𝑁𝑁𝑁𝑁
�
0.1 𝑁𝑁𝑁𝑁
−0.1𝑢𝑢, − 10 < 𝑢𝑢 ≤ 0
𝜇𝜇𝑁𝑁𝑁𝑁 (𝑢𝑢) = �
2 + 0.1𝑢𝑢, − 10 < 𝑢𝑢 ≤ −20
−16 −14 −4 0
∗ 0.6 ∫−20 𝑢𝑢𝑢𝑢𝑢𝑢−∫−16 �𝑢𝑢+0.1𝑢𝑢2 �𝑑𝑑𝑑𝑑+0.4 ∫−14 𝑢𝑢𝑢𝑢𝑢𝑢−0.1 ∫−4 𝑢𝑢2 𝑑𝑑𝑑𝑑
𝑢𝑢 = −16 −14 −4 0
0.6 ∫−20 𝑑𝑑𝑑𝑑−∫−16 (1+0.1𝑢𝑢)𝑑𝑑𝑑𝑑+0.4 ∫−14 𝑑𝑑𝑑𝑑−0.1 ∫−4 𝑢𝑢𝑢𝑢𝑢𝑢
−14
2 −16 𝑢𝑢2 0.1 3 −4 0.1 0
0.3�𝑢𝑢 �−20 −� + 𝑢𝑢 � +0.2�𝑢𝑢2 �−14 − �𝑢𝑢3 �−4
2 3 −16 3
= 0.1 2 −14 0.1
0.6[𝑢𝑢]−16
−20 −�𝑢𝑢+ 𝑢𝑢 � +0.4[𝑢𝑢]−4
−14 − [𝑢𝑢2 ]0−4
2 −16 2
1 0.1 0.1
0.3�162 −202 �−� �142 −162 �+
�−143 +163 ��+0.2�42 −142 �− �43 � −964
2 3 3
= 1 0.1 = = −11.75
0.6[−16+20]−�(−14+16)+ (14 2 −162 )�+0.4[−4+14]− [−4 2 ] 82
2 2
Why TS-FIS?
o TS. model replaces the fuzzy consequent, (then part), of Mamdani rule with
Where, 𝐴𝐴 and 𝐵𝐵 are fuzzy sets in the antecedent, and 𝑧𝑧 = 𝑓𝑓(𝑥𝑥, 𝑦𝑦) is a crisp function in the
Usually, 𝑓𝑓(𝑥𝑥, 𝑦𝑦) is a polynomial in the input variables 𝑥𝑥 and 𝑦𝑦, but it can be any function describe
the output of the model within the fuzzy region specified by the antecedence of the rule.
o The 𝑖𝑖 𝑡𝑡ℎ rule is: 𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝐴𝐴𝑗𝑗 𝐴𝐴𝐴𝐴𝐴𝐴 y 𝑖𝑖𝑖𝑖 𝐵𝐵𝑘𝑘 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 𝑧𝑧𝑖𝑖 = 𝑝𝑝𝑖𝑖 𝑥𝑥 + 𝑞𝑞𝑖𝑖 𝑦𝑦 + 𝑟𝑟𝑖𝑖
o The strength (weight) of the 𝑖𝑖 𝑡𝑡ℎ rule is typically computed using the minimum operator:
To further reduce computation, weighted sum may be used, I.e. 𝑧𝑧 ∗ = ∑𝑖𝑖 𝑤𝑤𝑖𝑖 𝑧𝑧𝑖𝑖
Example: A two-input TSK fuzzy model with 4 rules can be expresses as:
𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠, 𝑎𝑎𝑎𝑎𝑎𝑎 𝑦𝑦 𝑖𝑖𝑖𝑖 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠, 𝑡𝑡ℎ𝑒𝑒𝑒𝑒 𝑧𝑧 = −𝑥𝑥 + 𝑦𝑦 + 1
𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠, 𝑎𝑎𝑎𝑎𝑎𝑎 𝑦𝑦 𝑖𝑖𝑖𝑖 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙, 𝑡𝑡ℎ𝑒𝑒𝑒𝑒 𝑧𝑧 = −𝑦𝑦 + 3
𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙, 𝑎𝑎𝑎𝑎𝑎𝑎 𝑦𝑦 𝑖𝑖𝑖𝑖 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠, 𝑡𝑡ℎ𝑒𝑒𝑒𝑒 𝑧𝑧 = −𝑥𝑥 + 3
𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙, 𝑎𝑎𝑎𝑎𝑎𝑎 𝑦𝑦 𝑖𝑖𝑖𝑖 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙, 𝑡𝑡ℎ𝑒𝑒𝑒𝑒 𝑧𝑧 = 𝑥𝑥 + 𝑦𝑦 + 2