You are on page 1of 46

Chapter 2

Design of fuzzy controller

Dr. Nam H. Nguyen

10/20/2020 Dr. Nam H. Nguyen 1


Contents

• 2.1 Fuzzy logic system


• 2.2 Fuzzy controller design
• 2.3 P fuzzy controller
• 2.4 PD fuzzy controller

10/20/2020 Dr. Nam H. Nguyen 2


2.1 Fuzzy logic system

• 2.1.1 Fuzzy system


• 2.1.2 Rule base and compositional rule of inference
• 2.1.3 Firing strength and fuzzy output
• 2.1.4 Defuzzification process
• 2.1.5 Input output characteristics

10/20/2020 Dr. Nam H. Nguyen 3


2.1.1 Fuzzy system

Fuzzy System

10/20/2020 Dr. Nam H. Nguyen 4


2.1.2 Rule base and composition rule

2.1

10/20/2020 8:35 PM Dr. Nam H. Nguyen 5


2.1.3 Compositional Rule of Inference
(2.2-a)
(2.2-b)
(2.3-a)
(2.3-b)

(2.4-a)
(2.4-b)

(2.5-a)
(2.5-b)

10/20/2020 Dr. Nam H. Nguyen 6


2.1.4 Defuzzification process

2.6
2.7

2.8

10/20/2020 Dr. Nam H. Nguyen 7


2.1.4 Defuzzification process

2.9

2.10

2.11

10/20/2020 Dr. Nam H. Nguyen 8


2.1.4 Defuzzification process

2.12

2.13

2.14

10/20/2020 Dr. Nam H. Nguyen 9


2.1.5 Input output characteristics

Rule base Defuzzification


2.5-a
2.5-b
FUZZY SYSTEM

Matching degree: MIN, PROD CENTROID: 2.9 - 11


AGGREGATION: MAX, SUM CENTROID: 2.13
IMPLICATION: MIN, PROD BISECTOR: 2.14

10/20/2020 Dr. Nam H. Nguyen 10


1.5 Sugeno fuzzy model

10/20/2020 8:35 PM Dr. Nam H. Nguyen 11


1.5 Sugeno fuzzy model

10/20/2020 Dr. Nam H. Nguyen 12


2.2 Design of fuzzy controller

• 2.2.1 Why fuzzy?


• 2.2.2 Steps for designing fuzzy controller

10/20/2020 Dr. Nam H. Nguyen 13


2.2.1 Why fuzzy?

 Conceptually easy to understand


 Mathematical concepts are simple.
 More intuitive approach
 Flexible
 Easy to add more functionality without starting again
 Tolerant of imprecise data
 Everything is imprecise
 Fuzzy reasoning builds this understanding
into the process rather than tacking it onto the end.

10/20/2020 Dr. Nam H. Nguyen 14


2.2.1 Why fuzzy

 Fuzzy logic can model nonlinear functions of arbitrary


complexity.
 Fuzzy logic can be built on top of the experience of experts.
 Fuzzy logic can be blended with conventional control
techniques.
 Fuzzy logic is based on natural language.

10/20/2020 Dr. Nam H. Nguyen 15


2.2.2 Steps for designing fuzzy controller

• Inputs:
 The error between the desired signal and the plant output
 State variables: Position, velocity, temperature
• Outputs:
 Voltage, current, power, ….
 The input to the plant
• Fuzzify inputs:
 Determine ranges for inputs (universal sets)
 Choose membership functions (types, number of
membership functions)

10/20/2020 Dr. Nam H. Nguyen 16


2.2.2 Steps for designing fuzzy controller

 Select terms, words such as small, big, very …


 Associate terms with membership functions
 Name linguistic variables
• Fuzzify outputs: (Mamdani)
 Determine ranges for outputs (univeral sets)
 Choose membership functions (type, number)
 Select terms, words.
 Associate terms with membership functions
 Name linguistic variables

10/20/2020 Dr. Nam H. Nguyen 17


2.2.2 Step for designing fuzzy controllers

10/20/2020 Dr. Nam H. Nguyen 18


2.2.2 Steps for designing fuzzy controller

• Aggregation method:
MAX, SUM
• Defuzzification method:
 Mamdani:
 Sugeno:
• Simulate fuzzy logic system
 Matlab – Fuzzy
 WinFACT – FLOP
http://www.kahlert.com/web/english/e_fuzzyneuro.php
 fuzzyTECH - http://www.fuzzytech.com/

10/20/2020 Dr. Nam H. Nguyen 19


2.2.2 Steps for designing fuzzy controller

• Hardware:
 Computer
 Microprocessor, Micro controller, DSP
 Texas Instruments (DSP) - fuzzyTECH MCU-320
Hard disk control, noise cancellation, sonar signal
classification, servo motor control
 Microchip Technologies (PIC) - fuzzyTECH MCU-MP
DC motor control, furnace, air conditioner control, car door
control, fake card detection

10/20/2020 Dr. Nam H. Nguyen 20


2.2.2 Steps for designing fuzzy controller

 Intel
Anti-lock braking system, CNC position control, Metal
heating furnace, household device, hand-writing recognization.
 Allen-Bradley / Rockwell (PLC) - fuzzyTECH IA-PLC5
 Siemens (Fuzzy166)
 Motorola
 National Instruments
 Mitsubishi
 Wonderware (Process control)

10/20/2020 Dr. Nam H. Nguyen 21


2.2.2 Steps for designing fuzzy controller

• System test
• Adjust and complete system

10/20/2020 Dr. Nam H. Nguyen 22


2.3 P fuzzy controller

• 2.3.1 System model


• 2.3.2 Function approximation
• 2.3.3 Basic functions
• 2.3.4 Example

10/20/2020 Dr. Nam H. Nguyen 23


2.3.1 System model

r e u y
Plant
Controller
(or object)

r: setpoint Controller:
y: plant output - PID
u: control signal - Fuzzy
e = r-y: the error - Neural networks
- u = f(e)

10/20/2020 Dr. Nam H. Nguyen 24


2.3.2 Function approximation

• Arbitrarily given a function y=f(x) .


• The function f can be approximated by a fuzzy system with an
arbitrary preciseness.
• ANFIS - adaptive neuro-fuzzy inference system

10/20/2020 Dr. Nam H. Nguyen 25


2.3.2 Function approximation

10/20/2020 Dr. Nam H. Nguyen 26


2.3.2 Function approximation
x Nonlinear y e
function
Y = f(x)

Fuzzy system
(ANFIS)

10/20/2020 Dr. Nam H. Nguyen 27


2.3.2 Function approximation

• Example:
• x = (0:0.1:10)';
• y = sin(2*x).*exp(x/5);
• epoch_n = 20;
• in_fis = genfis1([x y],5,'gbellmf');
• out_fis = anfis([x y],in_fis,epoch_n);
• plot(x,y,x,evalfis(x,out_fis));
• legend('Training Data','anfis Output');

10/20/2020 Dr. Nam H. Nguyen 28


2.3.3 Basic functions

10/20/2020 Dr. Nam H. Nguyen 29


2.3.3 Basic functions
u

1 1

e u
10/20/2020 Dr. Nam H. Nguyen 30
2.3.3 Basic functions

• And method: MIN


• Or method: MAX
• Defuzzification method: WTSUM/WTAVER

10/20/2020 Dr. Nam H. Nguyen 31


2.3.3 Basic functions
u
a

-b e
b
-a

1 1

e u

10/20/2020 -b b Dr. Nam H. Nguyen -a a 32


2.3.3 Basic functions

10/20/2020 Dr. Nam H. Nguyen 33


2.3.4 Example

r e u y
P fuzzy
G(s)
controller

10/20/2020 Dr. Nam H. Nguyen 34


2.3.4 Example

10/20/2020 Dr. Nam H. Nguyen 35


2.3.4 Example

10/20/2020 Dr. Nam H. Nguyen 36


2.3.4 Example

10/20/2020 Dr. Nam H. Nguyen 37


2.4 Dynamic fuzzy controller

• 2.4.1 Structure of dynamic fuzzy controller


• 2.4.2 PD fuzzy controller
• 2.4.3 Example

10/20/2020 Dr. Nam H. Nguyen 38


2.4.1 Structure of dynamic fuzzy controller

de
de/dt

r e u y
Fuzzy logic
Object
system

ie

 PD fuzzy controller
de: derivative of e(t)
 PI fuzzy controller
ie: integral of e(t)
 PID fuzzy controller
10/20/2020 Dr. Nam H. Nguyen 39
2.4.2 PD fuzzy controller

de
de/dt

r e u y
Fuzzy logic
Object
system

10/20/2020 Dr. Nam H. Nguyen 40


2.4.2 PD fuzzy controller

10/20/2020 Dr. Nam H. Nguyen 41


2.4.2 PD fuzzy controller

negative zero positive


1

e
0

10/20/2020 Dr. Nam H. Nguyen 42


2.4.2 PD fuzzy controller

negative zero positive


1

10/20/2020 Dr. Nam H. Nguyen 43


2.4.2 PD fuzzy controller

negative 1 zero positive

Small negative Small positive


0

10/20/2020 Dr. Nam H. Nguyen 44


2.4.2 PD fuzzy controller

10/20/2020 Dr. Nam H. Nguyen 45


2.4.2 PD fuzzy controller

Rule Table
Negative Zero Positive
Negative Negative Negative Small
e negative
Zero Zero Zero Zero
Positive Small Positive Positive
positive

10/20/2020 Dr. Nam H. Nguyen 46

You might also like