contenth. bevrani spring semester, 2010 content introduction basic concepts fctl 2 fuzzy control...

12
2010/07/12 1 Graduate School of Science and Technology H. Bevrani Spring Semester, 2010 Content Introduction Basic Concepts F C t l 2 Fuzzy Control Examples Fuzzy AGC “The class of tall men” …, or “the class of beautiful women”, do not constitute classes or sets in the usual mathematical sense of these terms. Yet, the fact remains that such imprecisely defined classes3 such imprecisely defined classes play an important role in human thinking, particularly in the domains of pattern recognition, communication of information, and abstraction. Lotfi A. Zadeh, 1965 “Fuzzy” ? Oxford Dictionary: blurred, indistinct, confused, imprecisely defined Fuzzy Systems ? Knowledge-based or rule-based systems: If-Then rules “As complexity rises, precise statements lose meaning and meaningful statements lose precision.” Lotfi A. Zadeh, 1965 5 “The theory of fuzzy sets is a theory of graded concepts, a theory in which everything is a matter of degree.” Lotfi Zadeh, 1973 Unlike two-valued Boolean logic fuzzy logic is based on 6 Unlike two valued Boolean logic, fuzzy logic is based on degrees of membership. It deals with degrees of truth. (a) Boolean Logic. (b) Multi-valued Logic. 0 1 1 0 0.2 0.4 0.6 0.8 1 0 0 1 1 0

Upload: others

Post on 22-Mar-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ContentH. Bevrani Spring Semester, 2010 Content Introduction Basic Concepts FCtl 2 Fuzzy Control Examples Fuzzy AGC “The class of tall men” …, or “the class of beautiful women”,

2010/07/12

1

Graduate School of Science and Technology

H. Bevrani

Spring Semester, 2010

Content

Introduction

Basic Concepts

F C t l

2

Fuzzy Control

Examples

Fuzzy AGC

“The class of tall men” …, or “the class of beautiful women”, do not constitute classes or sets in the usual mathematical sense of these terms. Yet, the fact remains that such imprecisely defined “classes”

3

such imprecisely defined classes play an important role in human thinking, particularly in the domains of pattern recognition, communication of information, and abstraction. Lotfi A. Zadeh, 1965

“Fuzzy” ?

Oxford Dictionary: blurred, indistinct, confused, imprecisely defined

Fuzzy Systems ?

Knowledge-based or rule-based systems: If-Then rules

“As complexity rises, precise statements lose meaningand meaningful statements lose precision.”

Lotfi A. Zadeh, 1965

5

“The theory of fuzzy sets is a theory of graded concepts, a theory in which everything is a matter of degree.” Lotfi Zadeh, 1973

Unlike two-valued Boolean logic fuzzy logic is based on

6

Unlike two valued Boolean logic, fuzzy logic is based on degrees of membership. It deals with degrees of truth.

(a) Boolean Logic. (b) Multi-valued Logic.0 1 10 0.2 0.4 0.6 0.8 100 1 10

Page 2: ContentH. Bevrani Spring Semester, 2010 Content Introduction Basic Concepts FCtl 2 Fuzzy Control Examples Fuzzy AGC “The class of tall men” …, or “the class of beautiful women”,

2010/07/12

2

7

T a ll M e n

D e g re e o fM e m b e rsh ip1 .0

0 .4

0 .6

0 .8

C risp S e ts

Set of tall men: It covers all men, but their degrees of membership depend on their height.

1 5 0 2 1 01 7 0 1 8 0 1 9 0 2 0 01 6 0

H e ig h t , c mD e g re e o fM e m b e rsh ip

1 5 0 2 1 01 8 0 1 9 0 2 0 0

1 .0

0 .0

0 .2

0 .4

0 .6

0 .8

1 6 0 1 7 0

0 .0

0 .2

H e ig h t , c m

F u z z y S e ts

0 if x < xo

1 if x ≥ xo

(x) =

xo

10

x1 x2

0 if x ≤ x1

(x) = 0 (x) < 1 if x1< x < x2

1 if x ≥ x2

<

Tall men set: consists of three sets: short, average and tall men.

Tall M en

Degree ofM embership

Short Average ShortTall

1.0

0 2

0.4

0.6

0.8

Crisp Sets

150 210170 180 190 200160

Height, cmDegree ofM embership

150 210180 190 200

1.0

0.0

0.2

0.4

0.6

0.8

160 170

0.0

0.2

Fuzzy Sets

Short Average

Tall

Tall

1968, Zadeh: Fuzzy algorithms

1970, Zadeh & Bellman: Fuzzy decision making

1965, Zadeh: “Fuzzy Sets” paper

12

1973, Zadeh: Fuzzy control

1970, Zadeh & Bellman: Fuzzy decision making

1971, Zadeh: Fuzzy ordering

1975, Mamdani: 1st application (Steam engine)

Page 3: ContentH. Bevrani Spring Semester, 2010 Content Introduction Basic Concepts FCtl 2 Fuzzy Control Examples Fuzzy AGC “The class of tall men” …, or “the class of beautiful women”,

2010/07/12

3

1975-80: Slowly progressed!

1980, Sugeno: Control of a Fuji Water Purification Plant

1983, Sugeno & Nishida: Self-parking Car

13

1983, Sugeno & Nishida: Self parking Car

1984, Togai & Watanabe: 1st VLSI based Fuzzy controller

1987, Hitachi Co.: Sendai Subway System

1988, Hirota & …: Fuzzy Robot arm

1989: Lab. for Int. Fuzzy Eng. Research-Japan

1990: Fuzzy Logic System Institute (FLSI)-Japan

14

1993: 1st Issue of the IEEE Trans. On Fuzzy Sys.

1992: 1st IEEE Int. Conf. on Fuzzy Systems

1996, Hiyama: Fuzzy Power System Stabilizer

15 16

Fuzzy Control

Fuzzy Decision Making

Fuzzy Mathematics

17

Fuzzy Logic and AI

Fuzzy Decision Making

Uncertainty and Information

Flexible

Don’t need precise data

Easy to understand

18

Based on natural language

Don t need precise data

Can model nonlinear functions

Page 4: ContentH. Bevrani Spring Semester, 2010 Content Introduction Basic Concepts FCtl 2 Fuzzy Control Examples Fuzzy AGC “The class of tall men” …, or “the class of beautiful women”,

2010/07/12

4

Fuzzy-based Automatic Car Speed Control

Example 1:Example 2: Digital Image Stabilizer

If all the points in the picture are moving in the

Same direction, Then the hand is shaking and

20

compensate it.

If only some points in the picture are moving,

Then the hand is not shaking and leaves it alone.

Open-loopControl

Closed-loopControl

Pure

Takagi-Sugeno-Kang (TSK)

With Fuzzifier and Defuzzifier

U and V are fuzzy sets.In Eng. Systems, inputs/outputs are real values .

U and V are real-valued variables.

Problem: Using mathematical formula against using the human knowledge

Page 5: ContentH. Bevrani Spring Semester, 2010 Content Introduction Basic Concepts FCtl 2 Fuzzy Control Examples Fuzzy AGC “The class of tall men” …, or “the class of beautiful women”,

2010/07/12

5

x and y are real-valued variables.

Not A

A AA

B

Intersection Union

Complement Containment

BA BAA B

0x

1

( x )

0x

1N o t A

A0

x

1

0x

1

B

A

B

A

( x )

C o m p lem en t x C o n ta in m en t

0x

1

0x

1

A B

In te rsec tio n

0x

1

0x

A B

U n io n0

1

A BA B

x

( x ) ( x )

Containment:

Consider U = {1, 2, 3} and sets A and B

A = 0.3/1 + 0.5/2 + 1/3B = 0.5/1 + 0.55/2 + 1/3

then A is a subset of B, or A B

Complement:Crisp Sets: Who does not belong to the set?Fuzzy Sets: How much do elements not belong to the set?

Union:Crisp Sets: Which element belongs to either set?Fuzzy Sets: How much of the element is in either set?

Fuzzification: crisp to fuzzy

Fuzzification is the process where the crisp quantities are converted to fuzzy.

The conversion of fuzzy values is represented by y p ythe membership functions.

There are various methods to assign membership values or the membership functions to fuzzy variables.

Page 6: ContentH. Bevrani Spring Semester, 2010 Content Introduction Basic Concepts FCtl 2 Fuzzy Control Examples Fuzzy AGC “The class of tall men” …, or “the class of beautiful women”,

2010/07/12

6

Fuzziness in a fuzzy set is characterized by its membership functions. Membership value is between 0 and 1.

Membership Function

Popular functions:

Triangular Trapezoid Gaussian

Intuition: is based on the human’s own intelligence and understanding to develop the membership functions.

Inference: The membership function is formed from the facts known and knowledge.

Rank Ordering: e. g., best car between

Membership Value Assignments

g gfive cars among 100 people.

Angular: is defined on the universe of angles, hence is repeating shapes every 2Π cycles.

NN: is used to determine the membership values of any input data in the different regions.

GA: The method involved in computing membership functions using GA.

The output of an entire fuzzy process can be union of two or more fuzzy membership functions. To explain this, consider a fuzzy output, which is formed by two parts:

Defuzzification

•It convert fuzzy sets into a crisp output

Defuzzification Methods

(1) Lambda-cut sets,

(2) Centroid method,

(3) Height method,

(4) Weighted average method,

(5) Mean–max method,

(6) Centre of sums,

(7) Centre of largest area,

Centroid method Is the most popular one. It finds a point representing the

centre of gravity (COG)

b

A dxxx

1.0

0.6

0.8

Degree ofMembership

35

b

a

A

a

A

dxx

dxxx

COG

4.675.05.05.05.02.02.02.02.01.01.01.0

5.0)100908070(2.0)60504030(1.0)20100(

COG

0.0

0.2

0.4

0.6

0 20 30 40 5010 70 80 90 10060

Z67.4

In 1973, Lotfi Zadeh published his second most influential paper: Capturing human knowledge in fuzzy rules.

A fuzzy rule can be defined as a conditional statement in the form:

Fuzzy Rules

statement in the form:

IFx is A, THEN y is B

where x and y are linguistic variables; and Aand B are linguistic values determined by fuzzy sets on the universe of discourses X and Y, respectively.

Page 7: ContentH. Bevrani Spring Semester, 2010 Content Introduction Basic Concepts FCtl 2 Fuzzy Control Examples Fuzzy AGC “The class of tall men” …, or “the class of beautiful women”,

2010/07/12

7

Example: IF height is tallTHEN weight is heavy

In a fuzzy system, all rules fire to some extent. If the antecedent is true to some degree of membership, then the consequent is also true to that same degree.

Tall menHeavy men

180

Degree ofMembership1.0

0.0

0.2

0.4

0.6

0.8

Height, cm

190 200 70 80 100160

Weight, kg

120

Degree ofMembership1.0

0.0

0.2

0.4

0.6

0.8

38

Design Steps

• Fuzzification (of the input variables)

• Rule evaluation (Inference)

• Aggregation (of the rule outputs)

• Defuzzification

Consider five temperature control switches:

Example: Air conditioner

1. Specify the problem and define linguistic variables •Temperature, Fan Speed

COLD, COOL, PLEASANT, WARM, HOT.

The corresponding speeds of the motor controlling the fan on the air-conditioner has the graduations:

MINIMAL, SLOW, MEDIUM, FAST, BLAST.

The rules governing the air-conditioner are as follows:

RULE 1: IF TEMP is COLD THENSPEED is MINIMAL

RULE 2: IF TEMP is COOL THENSPEED is SLOW

2. Construct fuzzy rules

RULE 3: IF TEMP is PLEASANT THEN SPEED is MEDIUM

RULE 4: IF TEMP is WARM THENSPEED is FAST

RULE 5: IF TEMP is HOT THENSPEED is BLAST

Temperature fuzzy set

Temp (0C).

COLD COOL PLEASANT WARM HOT

0 Y* N N N N

5 Y Y N N N

10 N Y N N N

12.5 N Y* N N N

15 N Y N N N

17.5 N N Y* N N

Temp Temp ((00C).C).

COLDCOLD COOLCOOL PLEASANTPLEASANT WARMWARM HOTHOT

0< (T)<1

(T)=1

Y : temp value belongs to the set (0<A(x)<1)

Y* : temp value is the ideal member to the set (A(x)=1)

N : temp value is not a member of the set (A(x)=0)

20 N N N Y N

22.5 N N N Y* N

25 N N N Y N

27.5 N N N N Y

30 N N N N Y* (T)=0

Page 8: ContentH. Bevrani Spring Semester, 2010 Content Introduction Basic Concepts FCtl 2 Fuzzy Control Examples Fuzzy AGC “The class of tall men” …, or “the class of beautiful women”,

2010/07/12

8

The analytically expressed membership for the temperatureare:

COLD: for 0 ≤ t ≤ 10 COLD(t) = – t / 10 + 1

Cool: for 0 ≤ t ≤ 12.5 COOL(t) = t / 12.5

Pleasant: for 12.5 ≤ t ≤ 17.5 PLEASENT(t) = – t / 5 + 3.5

etc… all based on the linear equation: y = ax + b

Temperature Fuzzy Sets

0 6

0.7

0.8

0.9

1

alu

e Cold

Cool

0

0.1

0.2

0.3

0.4

0.5

0.6

0 5 10 15 20 25 30

Temperature Degrees C

Tru

th V

a

Pleasent

Warm

Hot

Rev/sec

(RPM)

MINIMAL SLOW MEDIUM FAST BLAST

0 Y* N N N N

10 Y N N N N

20 Y Y N N N

30 N Y* N N N

40 N Y N N N

50 N N Y* N N

60 N N N Y N

Speed fuzzy set

60 N N N Y N

70 N N N Y* N

80 N N N Y Y

90 N N N N Y

100 N N N N Y*

Y : temp value belongs to the set (0<A(x)<1)

Y* : temp value is the ideal member to the set (A(x)=1)

N : temp value is not a member of the set (A(x)=0)

The analytically expressed membership for the speedare:

MINIMAL: for 0 ≤ v ≤ 30 COLD(t) = – v / 30 + 1COLD

SLOW: for 10 ≤ v ≤ 30 SLOW(t) = v / 20 – 0.5

for 30 ≤ v ≤ 50 SLOW(t) = – v / 20 + 2.5

etc… all based on the linear equation: y = ax + b

Speed Fuzzy Sets

0.6

0.8

1

Val

ue MINIMAL

SLOW

0

0.2

0.4

0.6

0 10 20 30 40 50 60 70 80 90 100

Speed

Tru

th V MEDIUM

FAST

BLAST

3. Evaluate fuzzy rules

Example: Use the system to compute the optimal fan speed, for temperature of 16oC.

• Fuzzification• Inference• Composition • Defuzzification

Page 9: ContentH. Bevrani Spring Semester, 2010 Content Introduction Basic Concepts FCtl 2 Fuzzy Control Examples Fuzzy AGC “The class of tall men” …, or “the class of beautiful women”,

2010/07/12

9

• Fuzzification

Affected fuzzy sets: COOL and PLEASANT

COOL(T) = – T / 5 + 3.5 PLSNT(T) = T /2.5 - 6COOL( )

= – 16 / 5 + 3.5

= 0.3

PLSNT( )

= 16 /2.5 - 6

= 0.4

Temp=16 COLD COOL PLEASANT WARM HOT

0 0.3 0.4 0 0

• Inference

RULE 1: IF temp is cold THEN speed is minimal

RULE 2:RULE 2: IF temp is cool THEN speed is slow

RULE 3: IF temp is pleasant THEN speed is medium

RULE 4: IF temp is warm THEN speed is fast

RULE 5: IF temp is hot THEN speed is blast

• Inference

RULE 2: IF temp is cool (0.3) THEN speed is slow (0.3)

RULE 3: IF temp is pleasant (0.4) THEN speed is medium (0.4)

• Composition

speed is slow (0.3) speed is medium (0.4) +

• Defuzzification

COG = 0.125(12.5) + 0.25(15) + 0.3(17.5+20+…+40+42.5) + 0.4(45+47.5+…+52.5+55) + 0.25(57.5)

0.125 + 0.25 + 0.3(11) + 0.4(5) + 0.25

= 45.54rpm

Fuzzy Modeling

+ fuzzy logic Static fuzzy system+ fuzzy logic

+ fuzzy logic

Static fuzzy system

Dynamic fuzzy system

Page 10: ContentH. Bevrani Spring Semester, 2010 Content Introduction Basic Concepts FCtl 2 Fuzzy Control Examples Fuzzy AGC “The class of tall men” …, or “the class of beautiful women”,

2010/07/12

10

Modeling Example

The input-output relationship of the model: smoothed fuzzy description (circles) and piecewise linear description (dashed lines).

Fuzzy Control

FLC Internal

Structuree(t)

e(t)u(t) u(t)

C S ye uw

A typical fuzzy logic controller is described by the relationship between change of control u(t), at a given time t, on the one hand

u(t) = f(e(t), e(t))

and the change in the error e(t): e(t) = e(t) – e (t – 1)

Z-1

Z-1

e(t)

Fuzzy Control Design Steps

Define control problem andsystem characteristics

Define variables andFuzzy sets

Define Defuzzification Method

Define Inference Rules

Design Example

Inverted Pendulum Problem

X ref X

State variables: Angle of the Pendulum, Rate of change of the angle,

Position of the cart or cart speed

Control problem: Keep pendulum upright by moving cart left or right.

Fuzzy Control System

Input variables: Angle of the Pendulum, Rate of change of the angle

Output variables: Position of the cart or cart speed (produced by a PWM signal)

60

Page 11: ContentH. Bevrani Spring Semester, 2010 Content Introduction Basic Concepts FCtl 2 Fuzzy Control Examples Fuzzy AGC “The class of tall men” …, or “the class of beautiful women”,

2010/07/12

11

MN SN ZE SP MP

03 +3d

Input fuzzy sets for angle of the pole and rate of change of angle

Membership functions

LN MN SN ZE SP MP LP

-100 0 100 Speed of vehicle

0-3 +3

-4 +4

d

Output fuzzy set

Pendulum Angle

Inputs

Cart Speed

Pendulum AngularVelocity

Output

Fuzzy Rules

IF angle is zero and angular velocity is zero THEN speed shall be zero.

The fuzzy rules are

If is MN and d is MN then output is LNIf is ZE and d is ZE then output is ZEIf is ZE and d is ZE then output is ZEIf is SP and d is SP then output is MPetc.

The rules are best summaries by the Fuzzy Associative Memory (FAM) table.

Fill in the blanks in the table.

\ d MP SP ZE SN MNMP LPSP MP ?SPSP MPZE ZESNMN LN

?

?

MN

SP

if angle is zero and angular velocity is zero then

Defuzzification

Page 12: ContentH. Bevrani Spring Semester, 2010 Content Introduction Basic Concepts FCtl 2 Fuzzy Control Examples Fuzzy AGC “The class of tall men” …, or “the class of beautiful women”,

2010/07/12

12

if angle is zero and angular velocity is zero then

if angle is zero and angular g gvelocity is negative low then

if angle is positive low andangular velocity is zero then

if angle is positive low and angular velocity is negative low then

Defuzzificationmust now be

done on fused output.

Fuzzy Logic AGC

1. Fuzzy logic controller

A general scheme for fuzzy logic based AGC

A general scheme for adaptive fuzzy logic AGC

2. Fuzzy based PI (PID) controller

t

IP τdτACEktACEktu0

)()()(

n

iIP TiACETkkTACEkkTu

1

)()()(

)1()( TkACEkTACE )(

)1()()1()()( kTACEk

T

TkACEkTACEkTkukTukTu IP

Fuzzy PI control scheme

3. Fuzzy Tuner

Fuzzy logic for tuning of PI based AGC system