Pres09 B Fuzzy Rule-Based System

You might also like

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

FUZZY LOGIC CONTROL 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

January 2, 2024 Page 0/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

AUTOMATION-I
CONTROL SYSTEMS
MNG512 (111 & 112)

A Lecture on:
FUZZY RULE-BASED SYSTEM

Instructor: Dr. Raafat SHALABY


rshalaby@nu.edu.eg

January 2, 2024 Page 1/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

FORMATION OF RULES
For any linguistic variable, there are three general forms:

1- Assignment statements 2- Conditional statements 3- Unconditional statements

1- Assignment statements: are those in which the variable is assigned with the
value by the assignment operator “ = ”

• The examples of this type of statements are:


o 𝑆𝑆𝑆𝑆𝑆𝑆 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 = 𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏,
o 𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶 = ℎ𝑜𝑜𝑜𝑜
o 𝑝𝑝 = 𝑞𝑞 + 𝑟𝑟
o 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 = ℎ𝑖𝑖𝑖𝑖ℎ
The assignment statement restricts the value of a variable to a specific equality.

January 2, 2024 Page 2/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

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.

If 𝐜𝐜𝐜𝐜𝐜𝐜𝐜𝐜𝐜𝐜𝐜𝐜𝐜𝐜𝐜𝐜𝐜𝐜 𝐂𝐂 THEN 𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓𝒓 𝑹𝑹

Examples:
o If 𝑥𝑥 = 𝑦𝑦 THEN 𝑏𝑏𝑏𝑏𝑏𝑏ℎ 𝑎𝑎𝑎𝑎𝑎𝑎 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒
o If 𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀 > 60 THEN 𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝
o If 𝑊𝑊𝑊𝑊𝑊𝑊𝑊𝑊 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 > 1500 THEN 𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 𝑡𝑡ℎ𝑒𝑒 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡

• These statements are fuzzy conditional statements,

January 2, 2024 Page 3/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

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.

𝑅𝑅1 : Output is 𝐵𝐵1 &


𝑅𝑅2 : Output is 𝐵𝐵2 & …, etc.
where 𝐵𝐵1 and 𝐵𝐵2 are Fuzzy consequents.
• The linguistic connections: “𝒂𝒂𝒂𝒂𝒂𝒂”, “𝒐𝒐𝒐𝒐”, “𝒆𝒆𝒆𝒆𝒆𝒆𝒆𝒆” connects the conditional,
unconditional, and restriction statements

• 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.

IF 𝑥𝑥 = 𝑦𝑦 THEN 𝑏𝑏𝑏𝑏𝑏𝑏ℎ 𝑎𝑎𝑎𝑎𝑎𝑎 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒


ELSE
IF 𝑥𝑥 > 𝑦𝑦 THEN 𝑥𝑥 is the highest
ELSE 𝑦𝑦 is the highest
• Using the properties & operations on fuzzy sets, any compound rule structure can
be decomposed and reduced to number of simple canonical rules.
• There are various methods for decomposition of rules.
1) Multiple 𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄 antecedents 3) Conditional statements with 𝑬𝑬𝑬𝑬𝑬𝑬𝑬𝑬
2) Multiple 𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅 antecedents 4) Nested 𝑰𝑰𝑰𝑰– 𝑻𝑻𝑻𝑻𝑻𝑻𝑻𝑻 rules

January 2, 2024 Page 5/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

1- Multiple conjunction antecedents

This uses fuzzy intersection operation. (𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿 “𝐴𝐴𝐴𝐴𝐴𝐴” 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐)

�1 𝐴𝐴𝐴𝐴𝐴𝐴 𝐶𝐶
IF 𝑥𝑥 is 𝐶𝐶 �2 𝐴𝐴𝐴𝐴𝐴𝐴 … 𝐴𝐴𝐴𝐴𝐴𝐴 𝐶𝐶�𝑛𝑛 THEN 𝑦𝑦 is 𝑅𝑅
�𝑟𝑟

�𝑟𝑟 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 𝑅𝑅
The rule can be expressed as: 𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝐶𝐶 �𝑟𝑟

�1 𝐴𝐴𝐴𝐴𝐴𝐴 𝐶𝐶
�𝒓𝒓 = 𝐶𝐶
where, 𝑪𝑪 �2 𝐴𝐴𝐴𝐴𝐴𝐴 … 𝐴𝐴𝐴𝐴𝐴𝐴 𝐶𝐶�𝑛𝑛 = 𝐶𝐶
�1 ∧ 𝐶𝐶
�2 ∧ … ∧ 𝐶𝐶�𝑛𝑛

The membership for this is

𝜇𝜇𝐶𝐶 𝑟𝑟 (𝑥𝑥) = 𝒎𝒎𝒎𝒎𝒎𝒎{𝜇𝜇𝐶𝐶 1 (𝑥𝑥 ), 𝜇𝜇𝐶𝐶 2 (𝑥𝑥 ), … , 𝜇𝜇𝐶𝐶 𝑛𝑛 (𝑥𝑥 ), }

January 2, 2024 Page 6/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

2- Multiple disjunctive antecedents

This uses fuzzy union operations. (𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿 “𝑂𝑂𝑂𝑂” 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐)

�1 𝑂𝑂𝑂𝑂 𝐶𝐶
IF 𝑥𝑥 is 𝐶𝐶 �2 𝑂𝑂𝑂𝑂 … 𝑂𝑂𝑂𝑂 𝐶𝐶�𝑛𝑛 THEN 𝑦𝑦 is 𝑅𝑅
�𝑟𝑟

�𝑟𝑟 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 𝑦𝑦 𝑖𝑖𝑖𝑖 𝑅𝑅


The rule can be: 𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝐶𝐶 �𝑟𝑟

�1 𝑂𝑂𝑂𝑂 𝐶𝐶
�𝑟𝑟 = 𝐶𝐶
where, 𝐶𝐶 �2 𝑂𝑂𝑂𝑂 … 𝑂𝑂𝑂𝑂 𝐶𝐶�𝑛𝑛 = 𝐶𝐶
�1 ∨ 𝐶𝐶
�2 ∨ … ∨ 𝐶𝐶�𝑛𝑛

The membership for this can be

𝜇𝜇𝐶𝐶 𝑟𝑟 (𝑥𝑥) = 𝒎𝒎𝒎𝒎𝒎𝒎{𝜇𝜇𝐶𝐶 1 (𝑥𝑥 ), 𝜇𝜇𝐶𝐶 2 (𝑥𝑥 ), … , 𝜇𝜇𝐶𝐶 𝑛𝑛 (𝑥𝑥 ), }

January 2, 2024 Page 7/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

3- Conditional statements with ELSE:


�1 THEN (𝑦𝑦 is 𝑅𝑅
Compound statement: IF 𝑥𝑥 is 𝐶𝐶 �1 ELSE 𝑦𝑦 is 𝑅𝑅
�2 )

Splitting this into two canonical form rules, we get


�1 THEN 𝑦𝑦 is 𝑅𝑅
IF 𝑥𝑥 is 𝐶𝐶 �1 OR
�1 THEN 𝑦𝑦 is 𝑅𝑅
IF 𝑥𝑥 is NOT 𝐶𝐶 �2

4- Nested IF–THEN rules:


�1 THEN (IF 𝑥𝑥 is 𝐶𝐶
Compound statement: IF 𝑥𝑥 is 𝐶𝐶 �2 THEN 𝑦𝑦 is 𝑅𝑅
�1 )

This can be decomposed into

�1 AND 𝑥𝑥 is 𝐶𝐶
IF 𝑥𝑥 is 𝐶𝐶 �2 THEN 𝑦𝑦 is 𝑅𝑅
�1

Thus, the compound rules may be reduced to a series of relations.

January 2, 2024 Page 8/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

AGGREGATION OF FUZZY RULES


• The fuzzy rule-based system may involve more than one rule.
• The process of obtaining the overall conclusion is known as aggregation of rule.
1) Conjunctive system of rules (𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑤𝑤𝑤𝑤𝑤𝑤ℎ 𝐴𝐴𝐴𝐴𝐴𝐴)
The aggregated o/p found by the intersection of all individual rule consequents,
�1 𝐴𝐴𝐴𝐴𝐴𝐴 𝑅𝑅
where, 𝑦𝑦 = 𝑅𝑅 �2 𝐴𝐴𝐴𝐴𝐴𝐴 … 𝐴𝐴𝐴𝐴𝐴𝐴 𝑅𝑅
�𝑛𝑛 → or �1 ∧ 𝑅𝑅
𝑦𝑦 = 𝑅𝑅 �2 ∧ … ∧ 𝑅𝑅
�𝑛𝑛
The membership for this can be: 𝜇𝜇𝑅𝑅𝑟𝑟 (𝑦𝑦) = 𝒎𝒎𝒎𝒎𝒎𝒎{𝜇𝜇𝑅𝑅1 (𝑦𝑦), 𝜇𝜇𝑅𝑅2 (𝑦𝑦), … , 𝜇𝜇𝑅𝑅𝑛𝑛 (𝑦𝑦), }
2) Disjunctive system of rules (𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑤𝑤𝑤𝑤𝑤𝑤ℎ 𝑂𝑂𝑂𝑂)
The aggregated o/p found by the union of all individual rule consequents,
�1 𝑂𝑂𝑂𝑂 𝑅𝑅
where, 𝑦𝑦 = 𝑅𝑅 �2 𝑂𝑂𝑂𝑂 … 𝑂𝑂𝑂𝑂 𝑅𝑅 �1 ∨ 𝑅𝑅
�𝑛𝑛 → or 𝑦𝑦 = 𝑅𝑅 �2 ∨ … ∨ 𝑅𝑅
�𝑛𝑛
The membership for this can be: 𝜇𝜇𝑅𝑅𝑟𝑟 (𝑦𝑦) = 𝒎𝒎𝒎𝒎𝒎𝒎{𝜇𝜇𝑅𝑅1 (𝑦𝑦), 𝜇𝜇𝑅𝑅2 (𝑦𝑦), … , 𝜇𝜇𝑅𝑅𝑛𝑛 (𝑦𝑦), }

January 2, 2024 Page 9/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

FUZZY INFERENCE SYSTEM (FIS)

• This is the major unit of a FL system. also known as fuzzy expert system.

Construction of FIS

 A rule base containing several fuzzy 𝑰𝑰𝑰𝑰 … 𝑻𝑻𝑻𝑻𝑻𝑻𝑻𝑻 rules.


 A database which defines the membership functions of the fuzzy sets.

January 2, 2024 Page 10/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

Construction of FIS ………….

 A fuzzification interface which transforms the crisp inputs → linguistic values.


 A decision-making unit which performs the inference operations on the rules; and
 A defuzzification interface which transforms the fuzzy results → crisp output.

January 2, 2024 Page 11/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

Working of FIS: The steps of fuzzy reasoning performed by FIS are:


 Compare the input variables with their membership functions, → membership values
of each linguistic label. (Fuzzification)
 Combine the membership values on the premise part (i/p) (using the 𝒎𝒎𝒎𝒎𝒎𝒎)→ weight
of each rule (firing strength).
 Generate the qualified consequents of each rule depending on the firing strength.
 Aggregate the qualified consequents to produce a crisp output. (Defuzzification)

January 2, 2024 Page 12/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

FUZZY INFERENCE METHODS

Use rules whose consequent is a fuzzy set, i.e.

𝐼𝐼𝐼𝐼 𝑥𝑥1 is 𝐶𝐶𝑖𝑖1 𝐴𝐴𝐴𝐴𝐴𝐴𝑥𝑥2 𝑖𝑖𝑖𝑖 𝐶𝐶𝑖𝑖2 … 𝐴𝐴𝐴𝐴𝐴𝐴 𝑥𝑥𝑛𝑛 is 𝐶𝐶𝑖𝑖𝑖𝑖 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 𝑦𝑦 is 𝑅𝑅𝑖𝑖

𝑖𝑖 = 1,2, … , 𝑀𝑀 and 𝑀𝑀 is the number of the fuzzy 𝑥𝑥1


𝑥𝑥2 Fuzzy
𝑦𝑦
rules IFS
𝑥𝑥𝑛𝑛
the o/p membership functions need defuzzification.

 The most important type of fuzzy inference methods is Mamdani’s FI method,


 Another well-known method is the so-called Takagi–Sugeno method or the TK.

January 2, 2024 Page 13/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

Mamdani’s FI Method

Named after E. H. Mamdani who developed first fuzzy controller.

Mamdani computes the output of FIS in six steps:

1. Determining a set of fuzzy rules


2. Fuzzifying the inputs using the input membership functions
3. Combining the fuzzified inputs to establish a rule strength
4. Finding the consequence of the rule by combining the rule strength and the
output membership function
5. Combining the consequences to get an output distribution
6. Defuzzifying the output distribution (if a crisp output is needed).

January 2, 2024 Page 14/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

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:

𝟏𝟏, 𝒙𝒙 ≤ −𝟐𝟐𝟐𝟐
𝝁𝝁𝑵𝑵𝑵𝑵 (𝒙𝒙) = �−𝟏𝟏 − 𝟎𝟎. 𝟏𝟏𝟏𝟏, − 𝟐𝟐𝟐𝟐 < 𝒙𝒙 ≤ −𝟏𝟏𝟏𝟏
𝟎𝟎, 𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐
𝟐𝟐 + 𝟎𝟎. 𝟏𝟏𝟏𝟏, − 𝟐𝟐𝟐𝟐 < 𝒙𝒙 ≤ −𝟏𝟏𝟏𝟏 𝟎𝟎. 𝟏𝟏𝟏𝟏, 𝟎𝟎 < 𝒙𝒙 ≤ 𝟏𝟏𝟏𝟏
𝝁𝝁𝑵𝑵𝑵𝑵 (𝒙𝒙) = � −𝟎𝟎. 𝟏𝟏𝟏𝟏, − 𝟏𝟏𝟏𝟏 < 𝒙𝒙 ≤ 𝟎𝟎 𝝁𝝁𝑷𝑷𝑷𝑷 (𝒙𝒙) = � 𝟐𝟐 − 𝟎𝟎. 𝟏𝟏𝟏𝟏, 𝟏𝟏𝟏𝟏 < 𝒙𝒙 ≤ 𝟐𝟐𝟐𝟐
𝟎𝟎, 𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐 𝟎𝟎, 𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐
𝟏𝟏 + 𝟎𝟎. 𝟏𝟏𝟏𝟏, − 𝟏𝟏𝟏𝟏 < 𝒙𝒙 ≤ 𝟎𝟎 𝟎𝟎. 𝟏𝟏𝟏𝟏 − 𝟏𝟏, 𝟏𝟏𝟏𝟏 < 𝒙𝒙 ≤ 𝟐𝟐𝟐𝟐
𝝁𝝁𝒁𝒁 (𝒙𝒙) = � 𝟏𝟏 − 𝟎𝟎. 𝟏𝟏𝒙𝒙, 𝟎𝟎 < 𝒙𝒙 ≤ 𝟏𝟏𝟏𝟏 𝝁𝝁𝑷𝑷𝑷𝑷 (𝒙𝒙) = � 𝟏𝟏, 𝟐𝟐𝟐𝟐 < 𝒙𝒙
𝟎𝟎, 𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐 𝟎𝟎, 𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐𝒐

January 2, 2024 Page 15/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM


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 𝑁𝑁𝑁𝑁

January 2, 2024 Page 16/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

4- Combining the consequences (Rule Aggregation)


0.4 𝑁𝑁𝑁𝑁
� �
𝑢𝑢� = �0.6 𝑁𝑁𝑁𝑁 → � 0.4 𝑁𝑁𝑁𝑁

0.1 𝑁𝑁𝑁𝑁 �
0.6 𝑁𝑁𝑁𝑁

0.1 𝑁𝑁𝑁𝑁

−0.1𝑢𝑢, − 10 < 𝑢𝑢 ≤ 0
𝜇𝜇𝑁𝑁𝑁𝑁 (𝑢𝑢) = �
2 + 0.1𝑢𝑢, − 10 < 𝑢𝑢 ≤ −20

𝜇𝜇𝑁𝑁𝑁𝑁 (𝑢𝑢) = −1 − 0.1𝑢𝑢, −20 < 𝑢𝑢 ≤ −10

0.6, − 20 < 𝑢𝑢 ≤ −16


−1 − 0.1𝑢𝑢, − 16 < 𝑢𝑢 ≤ −14
𝜇𝜇𝑢𝑢 = �
0.4, − 14 < 𝑢𝑢 ≤ −4
−0.1𝑢𝑢, − 4 < 𝑢𝑢 ≤ 0

January 2, 2024 Page 17/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

0.6, − 20 < 𝑢𝑢 ≤ −16


−1 − 0.1𝑢𝑢, − 16 < 𝑢𝑢 ≤ −14
𝜇𝜇𝑢𝑢 = �
0.4, − 14 < 𝑢𝑢 ≤ −4
−0.1𝑢𝑢, − 4 < 𝑢𝑢 ≤ 0

5- Defuzzification (using Centroid)


∗ ∫ 𝑧𝑧𝑧𝑧 (𝑧𝑧)𝑑𝑑𝑑𝑑
𝑧𝑧 =
∫ 𝜇𝜇 (𝑧𝑧)𝑑𝑑𝑑𝑑

−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

January 2, 2024 Page 18/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

Takagi–Sugeno–Kang FI (TSK or TS Method)

Why TS-FIS?

o To reduce the number of rules required by the Mamdani model

o TS. model replaces the fuzzy consequent, (then part), of Mamdani rule with

function (equation) of the input variables

 Rule form: 𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝐴𝐴 𝐴𝐴𝐴𝐴𝐴𝐴 𝑦𝑦 𝑖𝑖𝑖𝑖 𝐵𝐵 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 𝑧𝑧 = 𝑓𝑓(𝑥𝑥, 𝑦𝑦)

Where, 𝐴𝐴 and 𝐵𝐵 are fuzzy sets in the antecedent, and 𝑧𝑧 = 𝑓𝑓(𝑥𝑥, 𝑦𝑦) is a crisp function in the

consequents, e.g., 𝑓𝑓(𝑥𝑥, 𝑦𝑦) = 𝑎𝑎𝑎𝑎 + 𝑏𝑏𝑏𝑏 + 𝑐𝑐

January 2, 2024 Page 19/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

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.

First-order TSK Fuzzy Model

Example: a two-input one-output TSK

o The 𝑖𝑖 𝑡𝑡ℎ rule is: 𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝐴𝐴𝑗𝑗 𝐴𝐴𝐴𝐴𝐴𝐴 y 𝑖𝑖𝑖𝑖 𝐵𝐵𝑘𝑘 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 𝑧𝑧𝑖𝑖 = 𝑝𝑝𝑖𝑖 𝑥𝑥 + 𝑞𝑞𝑖𝑖 𝑦𝑦 + 𝑟𝑟𝑖𝑖

o The strength (weight) of the 𝑖𝑖 𝑡𝑡ℎ rule is typically computed using the minimum operator:

𝑤𝑤𝑖𝑖 = min �𝜇𝜇𝐴𝐴𝑗𝑗 (𝑥𝑥 ), 𝜇𝜇𝐵𝐵𝑘𝑘 (𝑦𝑦)�

o Each rule has a crisp output

January 2, 2024 Page 20/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

o Overall output is obtained via weighted average (reduce computation time of

∑𝑖𝑖 𝑤𝑤𝑖𝑖 𝑧𝑧𝑖𝑖


defuzzification required in a Mamdani model) 𝑧𝑧 ∗ = ∑𝑖𝑖 𝑤𝑤𝑖𝑖

Where 𝑤𝑤𝑖𝑖 is weight of rule 𝑅𝑅𝑖𝑖

To further reduce computation, weighted sum may be used, I.e. 𝑧𝑧 ∗ = ∑𝑖𝑖 𝑤𝑤𝑖𝑖 𝑧𝑧𝑖𝑖

𝑧𝑧1 = 𝑝𝑝1 𝑥𝑥 + 𝑞𝑞1 𝑦𝑦 + 𝑟𝑟1

𝑧𝑧2 = 𝑝𝑝2 𝑥𝑥 + 𝑞𝑞2 𝑦𝑦 + 𝑟𝑟2


𝑤𝑤1 𝑧𝑧1 +𝑤𝑤2 𝑧𝑧2
𝑧𝑧 ∗ =
𝑤𝑤1 +𝑤𝑤2

January 2, 2024 Page 21/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

Example: A single input TSK fuzzy model can be expresses as

𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠, 𝑡𝑡ℎ𝑒𝑒𝑒𝑒 𝑦𝑦 = 0.1𝑥𝑥 + 6.4


𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚, 𝑡𝑡ℎ𝑒𝑒𝑒𝑒 𝑦𝑦 = −0.5𝑥𝑥 + 4
𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙 𝑡𝑡ℎ𝑒𝑒𝑒𝑒 𝑦𝑦 = 𝑥𝑥 − 2

I/O curves corresponding to crisp

and fuzzy input sets

January 2, 2024 Page 22/22


FUZZY LOGIC CONTROL FUZZY RULE-BASED SYSTEM

Example: A two-input TSK fuzzy model with 4 rules can be expresses as:
𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠, 𝑎𝑎𝑎𝑎𝑎𝑎 𝑦𝑦 𝑖𝑖𝑖𝑖 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠, 𝑡𝑡ℎ𝑒𝑒𝑒𝑒 𝑧𝑧 = −𝑥𝑥 + 𝑦𝑦 + 1
𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠, 𝑎𝑎𝑎𝑎𝑎𝑎 𝑦𝑦 𝑖𝑖𝑖𝑖 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙, 𝑡𝑡ℎ𝑒𝑒𝑒𝑒 𝑧𝑧 = −𝑦𝑦 + 3
𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙, 𝑎𝑎𝑎𝑎𝑎𝑎 𝑦𝑦 𝑖𝑖𝑖𝑖 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠, 𝑡𝑡ℎ𝑒𝑒𝑒𝑒 𝑧𝑧 = −𝑥𝑥 + 3
𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙, 𝑎𝑎𝑎𝑎𝑎𝑎 𝑦𝑦 𝑖𝑖𝑖𝑖 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙, 𝑡𝑡ℎ𝑒𝑒𝑒𝑒 𝑧𝑧 = 𝑥𝑥 + 𝑦𝑦 + 2

Zero-order TSK Fuzzy Model

When 𝑓𝑓 is constant, we have a zero-

order TSK fuzzy model

Minimum computation time

Rule form: 𝐼𝐼𝐼𝐼 𝑥𝑥 𝑖𝑖𝑖𝑖 𝐴𝐴 𝐴𝐴𝐴𝐴𝐴𝐴 𝑦𝑦 𝑖𝑖𝑖𝑖 𝐵𝐵 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 𝑧𝑧𝑖𝑖 = 𝑐𝑐𝑖𝑖


January 2, 2024 Page 23/22

You might also like