Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Banks W.Fuzzy logic in embedded microcomputers and control systems.2002.pdf
Скачиваний:
38
Добавлен:
23.08.2013
Размер:
1.45 Mб
Скачать

Fuzzy Logic Presentation Slides

These slides accompanied the presentation adapted for the first part of this book, Fuzzy logic implementation on embedded microcomputers. The quality of some slides reflects their origin as transparencies.

Byte Craft Limited

35

Fuzzy Logic in Embedded Microcomputers and Control Systems

Linguistic

 

 

 

 

 

 

 

Variables

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ix

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

pM

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

u

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

o

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

;

 

 

 

 

 

 

 

 

 

 

S

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

an

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ep

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

uc

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

s:

 

 

 

 

 

 

 

 

 

 

to

sa

 

r.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

nts

in

 

 

 

 

 

 

 

 

tly.

 

 

 

 

tion

 

 

 

 

 

 

 

 

 

 

 

 

 

ate

 

 

 

 

 

ec

 

 

 

 

 

 

 

 

 

te

 

 

 

 

 

 

 

ld

w

 

 

 

 

an

ir

 

 

 

 

 

 

 

 

 

 

on

 

 

 

 

 

 

 

 

 

 

 

 

 

 

st

 

D

 

 

 

 

 

 

 

 

 

 

c

 

 

 

 

 

 

)

co

 

 

 

 

 

on

 

 

 

 

 

 

 

 

 

ty

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

g

c

 

 

 

 

 

 

 

 

 

 

p

 

 

 

 

 

 

 

(1

L

 

 

 

 

 

 

 

 

 

 

 

 

 

.

Em

 

 

 

 

 

 

ps

 

 

 

 

 

 

 

 

rin

 

 

 

r

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ir

 

 

 

 

 

 

1

 

 

 

 

 

 

 

 

 

 

u

 

 

 

 

 

 

l,

st

 

 

 

 

 

 

ve

 

 

 

 

 

 

 

 

½

c

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

o

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

oi

 

 

 

 

 

 

 

 

ly

c

 

 

 

 

 

 

d

4

 

 

 

 

 

 

 

 

b

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d

 

 

 

 

 

 

 

 

 

to

a

 

 

 

 

 

 

 

 

tia

 

 

 

 

 

 

 

a

 

 

 

 

 

 

 

 

g

 

 

 

 

 

 

 

 

 

r

 

 

 

 

s,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

t;

pa

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

in

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

te

 

 

 

 

 

 

 

 

 

 

r

 

 

 

 

 

 

 

 

 

a

 

 

 

 

 

 

 

 

 

u

 

 

 

 

 

 

 

.B

 

 

 

 

 

 

e

he

 

 

 

 

 

 

 

 

 

in

 

 

 

 

 

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

m

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

uc

 

 

 

 

 

 

 

15

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ed

 

 

 

 

 

 

 

 

 

r

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

.

R

 

 

 

 

 

 

 

 

r

fo

 

 

 

 

 

 

y.

 

 

 

 

 

 

 

3

 

 

 

 

 

 

 

 

 

 

e

 

 

 

 

 

 

 

 

ll

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

m

 

 

 

 

 

 

 

 

 

a

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

im

 

 

 

 

 

 

 

 

n

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

nd

s

 

 

 

 

 

 

 

 

sio

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ca

 

 

 

 

 

 

 

 

 

 

 

 

 

L)

 

 

 

a

 

 

 

 

 

 

 

g

oc

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(1

 

 

 

 

 

 

 

 

 

 

 

in

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

s

 

 

 

 

 

 

 

 

 

 

 

r

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

p

 

 

 

 

 

 

 

 

 

 

ir

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

u

 

 

 

 

 

 

 

 

 

st

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

½c

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

s,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

g

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

in

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

rv

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

se

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4

to

6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

36

Byte Craft Limited

Fuzzy Logic in Embedded Microcomputers and Control Systems

Linguistic Variables

Degree of Membership

COOL WARM HOT 1

0

0

37

75

112

150

Temperature

CRISP

Temperature = 75

Given a crisp temperature of 75:

#Degree of Membership(COOL) = 0.0

#Degree of Membership(WARM) = 0.7

#Degree of Membership(HOT) = 0.23

Byte Craft Limited

37

Fuzzy Logic in Embedded Microcomputers and Control Systems

Linguistic Variables

Degree of Membership

HOT 1

0

0

37

75

112

150

Temperature

Linguistic Variable HOT

38

Byte Craft Limited

Fuzzy Logic in Embedded Microcomputers and Control Systems

Linguistic Variables

Degree of Membership

 

 

90

HOT

150

1

 

 

 

 

 

73

 

 

 

 

150

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

37

75

112

150

 

Temperature

Linguistic Variable HOT

LINGUISTIC Temperature TYPE unsigned int MIN 0 MAX 150

{

MEMBER HOT {73, 90, 150, 150}

}

Byte Craft Limited

39

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy Operators

Degree of Membership

F_NOT operator

1

F_NOT A

A

0

0 10 20 30 40 50 60 70 80 90 100

(Crisp)

Degree of Membership

F_OR operator

1

F_OR (A,B)

A B

0

0 10 20 30 40 50 60 70 80 90 100

(Crisp)

Degree of Membership

F_AND operator

1

F_AND (A,B)

 

 

A B

0

0 10 20 30 40 50 60 70 80 90 100

(Crisp)

40

Byte Craft Limited

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Proportional

Contoller

Set Point

Manipulated

Variable

Process

Process Error

Byte Craft Limited

41

Fuzzy Logic in Embedded Microcomputers and Control Systems

Process

Proportional

Band

#Range of error to give full-scale proportional output

 

10

 

Variable

8

5 volt band

6

2 volt band

4

1 volt band

2

 

Manipulated

0

 

-2

-10 -5 -4 -3 -2 -1 0 1 2 3 4 5 10

-4

 

-6

 

-8

 

 

Process Error

 

-10

 

 

42

Byte Craft Limited

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Proportional

Controller

DOM

Proportional

Band

1

Negative Zero Positive

0

Process Error

1

0

M Z P

Manipulated Variable

Byte Craft Limited

43

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Proportional

Controller

1

0

Process Error

1

0

M Z P

Rules:

#if pe is POSITIVE THEN mv IS M

#if pe is NEGATIVE THEN mv IS P

#if pe is ZERO THEN mv is Z

44

Byte Craft Limited

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Proportional

Controller # Transfer Function

 

10

 

Variable

8

 

6

 

4

 

2

 

Manipulated

0

 

-2

-10 -5 -4 -3 -2 -1 0 1 2 3 4 5 10

-4

 

-6

 

-8

 

 

Process Error

 

-10

 

 

Byte Craft Limited

45

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Proportional

Controller

Performance

46

Byte Craft Limited

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Proportional

Controller

Performance

Byte Craft Limited

47

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Proportional

Controller

1

DOM Negative Zero Positive

0

Process Error

1

0

M Z P

48

Byte Craft Limited

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Proportional

Controller # Transfer Function

 

10

 

Variable

8

 

6

 

4

 

2

 

Manipulated

0

 

-2

-10 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 10

-4

 

-6

 

-8

 

 

Process Error

 

-10

 

 

Byte Craft Limited

49

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Proportional

Controller

1

DOM Negative

Positive

0

Process Error

1

0

M Z P

Manipulated Variable

50

Byte Craft Limited

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Proportional

Controller # Transfer Function

 

10

 

Variable

8

 

6

 

4

 

2

 

Manipulated

0

 

-2

-10 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 10

-4

 

-6

 

-8

 

 

Process Error

 

-10

 

 

Byte Craft Limited

51

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Proportional

Controller

# Computationally less intensive

1

 

 

 

 

 

 

 

 

 

DOM Negative

 

Positive

0

Process Error

1

0

M Z P

Manipulated Variable

52

Byte Craft Limited

Fuzzy Logic in Embedded Microcomputers and Control Systems

Bang Bang

Controller

Process

1

0

Setpoint

1

0

M P

Manipulated Variable

IF (process < setpoint)

THEN mv is P

ELSE mv is M

Byte Craft Limited

53

Fuzzy Logic in Embedded Microcomputers and Control Systems

Bang Bang

Controller

# Transfer Function

 

10

 

Variable

8

 

6

 

4

 

2

 

Manipulated

0

 

-2

-10 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 10

-4

 

-6

 

-8

 

 

Process Error

 

-10

 

 

54

Byte Craft Limited

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Bang Bang

Process

1

0 NOTNORMAL

pe

1

0

M P

RULES:

IF pe IS NOTNORMAL THEN mv is P ELSE mv is M

Byte Craft Limited

55

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Bang Bang # Transfer Function

 

10

 

Variable

8

 

6

 

4

 

2

 

Manipulated

0

 

-2

-10 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 10

-4

 

-6

 

-8

 

 

Process Error

 

-10

 

 

56

Byte Craft Limited

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

PID

Controller

Set Point

Manipulated

Variable

Process

Process Error

Derivative

Integral

Byte Craft Limited

57

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

PID

Controller

#Classical PID

#Manipulated variable is the sum of three terms:

mv = (pe × K1) + d pe × K2 + ($%pe × K3) d t

Fuzzy

PID

Controller

SP-

Error

#Break problem into separate control zones.

#Solve each part of the problem individually.

Process

Time

58

Byte Craft Limited

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

# Separate rules for

PID

#

Error term

Controller

#

Derivative Term

#

Integral Term

 

 

 

Byte Craft Limited

59

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Irrigation

Controller

60

Byte Craft Limited

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Irrigation

# Making the rules

Controller

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Rotation

straight

1

DOM acute

 

 

 

obtuse

0

 

 

 

 

 

 

0

178

180

182

360

Byte Craft Limited

61

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Irrigation

Controller

#Each node has its own rules

IF angle IS straight THEN speed IS same

IF angle IS acute

THEN speed IS slowdown IF angle IS obtuse

THEN speed IS speedup

Fuzzy

Irrigation

Controller

#Differential Control

#speedup

#slowdown

#CONSEQUENCE functions may be non-linear

62

Byte Craft Limited

Fuzzy Logic in Embedded Microcomputers and Control Systems

Fuzzy

Irrigation

Controller

#Normalized control values

#Degree of membership range is two degrees

 

 

 

straight

 

1

 

 

 

 

 

 

DOM

acute

 

 

 

obtuse

0

 

 

 

 

 

 

 

0

178

180

182

360

The

Fuzzy

Advantage

#Normalized number system

#Natural smooth transition between different strategies

#Focus on problem solution, not problem analysis

#Works well on conventional embedded microprocessors

#Can easily be combined with conventional software

Byte Craft Limited

63

Соседние файлы в предмете Электротехника