intelligent control methods lecture 11: fuzzy control 2 slovak university of technology faculty of...

26
Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

Upload: nichole-show

Post on 01-Apr-2015

220 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

Intelligent Control Methods

Lecture 11: Fuzzy control 2

Slovak University of TechnologyFaculty of Material Science and Technology in Trnava

Page 2: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

2

Fuzzy system uses rules of the type:

rule ::= If <antecedent> then <consekvent>

antecedent ::= <atomic fuzzy assertion>

{and|or <atomic fuzzy assertion>}

consequent ::= <atomic fuzzy assertion>

<atomic fuzzy assertion> ::= <variable> is <linguistic value>

Example:

if (v is small) and (d is medium) then (F is small)

Page 3: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

3

Linguistic variable:

Variable, which has a verbal value. Example: (speed – small, medium, big)

Definition:

Linguistic variable is a tetrad (x, Lx, Ux, Mx), where:x – the name of the variable (speed, v, e)

Lx – set of verbal values (small, medium, big)

Ux – definition scope (possible values of the variable (physical interval of the speed expressed by numbers, e.g. 0 – 120))

Mx – function, which expresses the verbal values by fuzzy sets in definition scope

Page 4: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

4

Linguistic variable example:

v – the name of linguistic variable „speed“

Lx – the set of verbal values

(N – nearly null, M - mini, S - medium, V - big)

Ux – universe (definition scope) <0 – 120>

Mx – function, which maps the verbal values in universe by fuzzy sets, e.g.:

120

0

/)30,10,( vvLN 120

0

/)60,40,30,10,( vvM

120

0

/)90,70,60,40,( vvS 120

0

/)90,70,( vvV

Page 5: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

5

Combination of assertions:<atomic fuzzy assertion> ::= <variable> is <linguistic value>

Konjunction:Let p and q are atomic fuzzy assertions p: „x is A“ and q: „y is B“, where A

and B are defined in the same universe.

The value of assertion (x is A) and (y is B) is given by konjunction of fuzzy sets A and B, i.e. by value AB = min (A,B).

Disjunction:The value of assertion (x is A) or (y is B) is given by disjunction of fuzzy

sets A and B, i.e. by value AB = max (A,B).

Negation:The negation of the assertion „x is A“ (i.e. „x is not A“) is given by

complement A’ of fuzzy set A, i.e. by value A’ = 1- A.

Page 6: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

6

Combination of assertions in different universes (1):

Let a and b are linguistic variables defined in universes Ua, Ub.

Let p and q are assertions „a is F1“ and „b is F2“.

The cylindric extension of sets F1 a F2 into cartesian product Ua x Ub is necessary before the assertion combination.

aU

F aaF /)(11

bU

F bbF /)(22

Page 7: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

7

Combination of assertions in different universes (2):

Let a and b are linguistic variables defined in definition scopes Ua, Ub.

Let p and q are assertions „a is F1“ and „b is F2“.

Conjunction:

Combined assertion (a is F1) and (b is F2) is given by fuzzy relation defined on cartesian product Ua x Ub

baxUU

FFr bababa ),/())(),(min(),(21

Page 8: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

8

Combination of assertions in different universes (3):

Let a and b are linguistic variables defined in universes Ua, Ub.

Let p and q are assertions „a is F1“ and „b is F2“.

Disjunction:

Combined assertion (a is F1) or (b is F2) is given by fuzzy relation defined on cartesian product Ua x Ub

baxUU

FFr bababa ),/())(),(max(),(21

Page 9: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

9

Fuzzy implication:

baxUU

FFb babaFceFceR ),/())(),(1max()()'(2121

Fuzzy implication is a construction if (fuzzy assertion) then (fuzzy assertion), where (fuzzy assertion) is atomic or combined one.

„if (a is F1) then (b is F2)“

Boolean implication: pq = (not p) or q

((not p) is given as 1-p, or is calculated as max after cylindric extension)

))(),(1max(),(21baba FFRb

Page 10: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

10

Fuzzy implication (2):

baxUU

FFM babaFceFceR ),/())(),(min()()(2121

Boolean implication is not used. It is replaced by implication by Lukasziewicz, Zadeh, Larsen and by others. The most used implication is expression, which is not an implication (it is only called implication) – implication by Mandami.

pq = p and q (!!!)

))(),(min(),(21baba FFRM

Page 11: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

11

Implication example „if (a is F1) then (b is F2)“

F1 = 0,1/a1 + 0,4/a2 +0,7/a3 + 1,0/a4

F2 = 0,2/b1 + 0,5/b2 +0,9/b3

  b1 b2 b3

a1 0,1 0,1 0,1

a2 0,4 0,4 0,4

a3 0,7 0,7 0,7

a4 1,0 1,0 1,0

  b1 b2 b3

a1 0,9 0,9 0,9

a2 0,6 0,6 0,6

a3 0,3 0,3 0,3

a4 0 0 0

  b1 b2 b3

a1 0,2 0,5 0,9

a2 0,2 0,5 0,9

a3 0,2 0,5 0,9

a4 0,2 0,5 0,9

ce(F1) ce(F1’) ce(F2)

Boolean implication: ce(F1’) ce(F2):

  b1 b2 b3

a1 0,9 0,9 0,9

a2 0,6 0,6 0,9

a3 0,3 0,5 0,9

a4 0,2 0,5 0,9

Mandami implication: ce(F1) ce(F2):

  b1 b2 b3

a1 0,1 0,1 0,1

a2 0,2 0,4 0,4

a3 0,2 0,5 0,7

a4 0,2 0,5 0,9

Page 12: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

12

Valuation of list of rules:

))(),(min(),( )()(

21)( baba k

Fk

FR kM

baxUU

kF

kF

kM babaR ),/())(),(min( )()()(

21

k. (one) rule:

n

k

kRR1

)(

Value of all rules:

))(),(min(max),(max),( )()(

21)( bababa k

Fk

FRR k k k

Page 13: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

13

Fuzzy systems

Systems, which variables (input, state, output) are defined by linguistic values (by fuzzy sets)

Structure of (technical) fuzzy system:

Fuzzificati-on modul

Inference engine

and rules base

Defuzzica-tion modul

Database

Crisp Fuzzy Fuzzy CrispInput values input values output values output values

Page 14: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

14

Database and base of rules:

Database consists of data about fuzzy sets of all fuzzy variables (the definition scope, the form given by membership function).

Base of rules consists of inference rules (in the form of Mandami fuzzy implications).

Page 15: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

15

Fuzzification:

It transforms the crisp value of variable into fuzzy one.

F(x)

1 F

xx = 1.614

F(x) = 0.6

NB NM ZO PM PB

v = -3.67

v = - 3.67

NB 0.7

NM 0.3

ZO 0

PM 0

PB 0

Page 16: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

16

Inference engine:

It evaluates the set of rules. The result is a fuzzy set.

Page 17: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

17

Inference engine on example of fuzzy PI-controller:

IF e is Ae AND e is Ae THEN u is Bu

E.g.:

IF e is PS AND e is PM THEN u is PB

NB NB NB NB NM NS ZO

NB NB NB NM NS Z0 PS

NB NB NM NS Z0 PS PM

NB NM NS Z0 PS PM PB

NM NS Z0 PS PM PB PB

NS Z0 PS PM PB PB PB

Z0 PS PM PB PB PB PB

e

NB NM NS ZO PS PM PB

NB

NM

NS

e ZO

PS

PM

PB

Page 18: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

18

Inference engine on example of fuzzy PI-controller (2):

e = 0.024

e = 0.016

e e

NB 0 0

NM 0 0

NS 0 0

ZO 0,4 0.3

PS 0.6 0.7

PM 0 0

PB 0 0

NB NM NS ZO PS PM PB

e = 0.024-0,2 0,2 e

Let Ue = <-0.2, 0.2> Ue = <-0.1, 0.1> Uu = <-5.0, 5.0>

NB NM NS ZO PS PM PB

e = 0.016-0,1 0,1 e

NB NM NS ZO PS PM PB

-5 5 u

Page 19: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

19

Inference engine on example of fuzzy PI-controller (3):

e = 0.024

e = 0.016

e e

NB 0 0

NM 0 0

NS 0 0

ZO 0,4 0.3

PS 0.6 0.7

PM 0 0

PB 0 0

NB NB NB NB NM NS ZO

NB NB NB NM NS Z0 PS

NB NB NM NS Z0 PS PM

NB NM NS Z0 PS PM PB

NM NS Z0 PS PM PB PB

NS Z0 PS PM PB PB PB

Z0 PS PM PB PB PB PB

e

NB NM NS ZO PS PM PB

NB

NM

NS

e ZO

PS

PM

PB

4 active rules (from 49):

IF e is ZO AND e is ZO THEN u is ZO (1)

IF e is ZO AND e is PS THEN u is PS (2)

IF e is PS AND e is ZO THEN u is PS (3)

IF e is PS AND e is PS THEN u is PM (4)

Page 20: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

20

Inference engine on example of fuzzy PI-controller (4):

Before the inference: The crisp values of input variables (e, e) are fuzzificated.

Inference = Evaluation of active rules:

1. Each rule is evaluated independently (there are allways two fuzzy assertions connected by AND in the antecedent, the Mandami implication (min) is used)

2. Partiall results from active rules are aggregated by operation or (i.e. max is used, see slade 12). Fuzzy set is a result.

After the inference: The obtained fuzzy set is defuzzificated to crisp number.

Page 21: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

21

Inference engine on example of fuzzy PI-controller (5):NB NM NS ZO PS PM PB

-0,2 e=0.024 0.2 e

NB NM NS ZO PS PM PB

-0,1 e=0.016 0.1 e

NB NM NS ZO PS PM PB

-5 5 u

IF e is ZO AND e is ZO THEN u is ZO

0.4

0.3

MIN 0.3

NB NM NS ZO PS PM PB

-0,2 e=0.024 0.2 e

NB NM NS ZO PS PM PB

-0,1 e=0.016 0.1 e

NB NM NS ZO PS PM PB

-5 5 u

IF e is ZO AND e is PS THEN u is PS

0.4

0.7

MIN 0.4

Page 22: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

22

Inference engine on example of fuzzy PI-controller (6):NB NM NS ZO PS PM PB

-0,2 e=0.024 0.2 e

NB NM NS ZO PS PM PB

-0,1 e=0.016 0.1 e

NB NM NS ZO PS PM PB

-5 5 u

IF e is PS AND e is ZO THEN u is PS

0.6

0.3

MIN 0.3

NB NM NS ZO PS PM PB

-0,2 e=0.024 0.2 e

NB NM NS ZO PS PM PB

-0,1 e=0.016 0.1 e

NB NM NS ZO PS PM PB

-5 5 u

IF e is PS AND e is PS THEN u is PM

0.6

0.7

MIN 0.6

Page 23: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

23

Inference engine on example of fuzzy PI-controller (7):

NB NM NS ZO PS PM PB

-5 5 u

Resultant fuzzy set:

1

0.70.6

0.40.3

0

Page 24: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

24

Defuzzification:The result of inference is a fuzzy set. The goal of defuzzification is to obtain a crisp value from this fuzzy set.

There are more methods of defuzzification.

Centre of Area (centre of Gravity) - COA (COG):

y

F

y

F

dyy

dyyy

y)(

)(

*

yy*

Page 25: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

25

Defuzzification (2):

Center of Sum (COS), reflects the overlapped areas:

yy*

y

r

kk

y

r

kk

dyy

dyyy

y

1

1

)(

)(

*

Page 26: Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava

26

Defuzzification (3):

FoM, SoM (First of Maximum, Smallest of Maximum):

y* = inf {yY/F(y) = hgt(F)}

y

y*

hgt(F)

LoM (Last of Maximum, Largest of Maximum):

y* = sup {yY/F(y) = hgt(F)}

MoM (Middle of Maxima):

y* = (y1+y2)/2

FoM MoM LoM