DEPARTMENT OF ELECq'RICAL & COMPUTER

2 downloads 0 Views 3MB Size Report
Jan 1, 1993 - system design using fuzzy logic controllers, and to design and ..... Characteristics . ..... along with experimental data to test the robustness of the controllers. Chapter ...... is used to construct the change of error sequence Ae(kT) = e(kT) - e((k-1)T), which ... r(kt) defines a range for y(kT) and y(t) at steady-state.
DEPARTMENT COIJ.EGE

OF OF

ENGINEERING

DOMINION

OLD

NORFOLK,

DESIGN

ELECq'RICAL

& TECHNOLOGY

23529

IMPLEMENTATION

OF FUZZY

By Osama

A. Abihana,

Principal

Final For

Graduate

Investigator:

Research

Oscar

Assistant

R. Gonzalez

Report the

period

Prepared

January

Aeronautics

Langley

1, 1993

for

National

Research

Hampton,

and

Space

Administration

Center

VA

23681-0001

Under P.O. Capt. U.S.

#L20278D Gregory

W. Walker,

of Contact

by the

Old Dominion P.O. Box 6369 Norfolk,

O July

Point

Army

Submitted

1993

Virginia

ENGINEERING

UNIVERSITY

VIRGINIA

AND

& COMPUTER

University

Research

23508-0369

Foundation

LOGIC

CONTROLLERS

ACKNOWLEDGEMENTS This is a thesis entitled

"Design

1992 to January Center

being submitted

and Implementation 1, 1993.

through purchase

U.S. Army,

NASA

Langley

in lieu of a final report of Fuzzy Logic

for the research

Controllers"

This work was supported

by the NASA

order

of contact

no. L20278D,

Research

point

Center,

Mail Stop 286.

ii

for the period Langley

project July 27,

Research

Capt. Gregory

W. Walker,

ABSTRACT The main overview

of fuzzy

system fuzzy

objectives

design

sets and fuzzy

using

logic

controller

fundamental

concepts

fuzzy operations to understand

design

of fuzzy

the concepts

a four-step

and robustness procedure

our

design

actuator Research

methods,

fuzzy

based

and

logic

variables,

control

control

systems.

implementation

Fuzzy

of a fuzzy

logic

Research

Third, Finally,

controller

of the Free Center.

Second,

we The

the capabilities

This is followed experience.

term sets,

procedure.

showing

the

it is important

values,

design

a

sets and basic

methods.

analysis.

Langley

and implement

systems,

for stability

the direction

for control

we first present

linguistic

system

from our design

techniques

at NASA

for control

via four examples,

to be used to control Vehicle

logic.

and defuzzification

logic

is illustrated of fuzzy

In this thesis

In addition,

a self-contained

a methodology

and to design

sets and fuzzy

of linguistic

that we developed

two Lyapunov

develop

for a real system.

are defined.

procedure

logic,

are to present

fuzzy logic controllers,

fuzzy rule base, inference introduce

of our research

Flight

by a tuning we present we present for

a linear

Rotorcraft

TABLE

OF CONTENTS

LIST OF TABLES

..............................................................................................

vi

LIST OF FIGURES

...........................................................................................

vii

INTRODUCTION 1.1 Introduction

............................................................................................ ................................................................................................

1 1

1.2 1.3

Overview of Fuzzy Controls .................................................................... Thesis Structure ........................................................................................

2 3

FUZZY

SETS AND FUZZY LOGIC IN CONTROL SYSTEMS ................... 2.1 Introduction .....................................................................................

6 6

2.2

Sets ........................................................................................ Definition of Fuzzy Sets ...................................................... Fuzzy Set Operations ......................................................... Linguistic Variables ......................................................... Logic ................................................................................... Fuzzy Rule Base ................................................................. InferenceMethods ..............................................................

8 8 11 20 23 23 25

Fuzzy Systems in Control Systems .............................................. 2.4.1 Defuzzification .................................................................... 2.4.2 Defuzzification Method .....................................................

29 29 31

2.4.3 Center of Gravity Method .................................................. Example ......................................................................................... Conclusions ....................................................................................

32 35 41

LOGIC CONTROLLERS (FLCs) ....................................................... 3.1 Introduction ....................................................................................

42 42

2.3

2.4

2.5 2.6 FUZZY

3.2

Fuzzy 2.2.1 2.2.2 2.2.3 Fuzzy 2.3.1 2.3.2

Fuzzy Logic Control System Design ........................................... 44 3.2.1 Step One. Acquire Plant Information ................................ 47 3.2.2 Step Two. Select Term Sets For the Linguistic Variable.48 3.2.2.1 Example ................................................................. 52 iv

3.3 3.4 3.5 3.6 3.7

3.2.3 Step Three. Form the Fuzzy Rule Base ........................... 3.2.4 Step Four. Tune the Fuzzy Controller ............................... Design Example One ..................................................................... Design Example Two .................................................................... Design Example Three .................................... _............................ Design Example Four ................................................................... Conclusions ...................................................................................

Appendices

3A, 3B, 3C ...........................................................................

56 59 60 76 87 91 93 94

OVERVIEW OF STABILITY ANALYSIS OF FLC's ................................. 4.1 Introduction .................................................................................

109 109

4.2

Stability Analysis Using Lyapunov's Direct Method ............... 4.2.1 Example ............................................................................. 4.2.2 Conclusions .....................................................................

110 115 120

4.3

Another Approach Using Lyapunov's Direct Method .............. 4.3.1 StabilityCriterion ............................................................. 4.3.2 Example ............................................................................ 4.3.3 Conclusions ....................................................................

120 121 123 126

Appendix

128

ACTUATOR RESEARCH 5.1

4A ................................................................................

DESIGN FOR THE FREE FLIGHT ROTORCRAFT VEHICLE ................................................................................... 131 Introduction ............................................................................... 131

5.2

System 5.2.1 5.2.2 5.2.3

5.3 5.4 5.5

Design Procedure ....................................................................... Testing Results ........................................................................... Conclusions .................................................................................

Appendix

Description and Specifications ..................................... Physical Characteristics ................................................... Mechanical Characteristics .............................................. Electrical Characteristics ..................................................

................................................................................................

CONCLUSIONS AND SUGGESTIONS FOR FURTHER RESEARCH 6.1 Conclusions ................................................................................. 6.2

Suggestions

For Further

Research .............................................

BIBLIOGRAPHY ........................................................................................ APPENDIX A .................................................................................................

V

133 133 134 134 135 138 142 148 .... 154 156 158 158 162

LIST

OF TABLES

Table 2.1.

Sample

Table

Range of signals ............................................................................

48

Table 3.2.

Example

57

Table

3.3.

Rule base for the example ...........................................................

63

Table

3.4.

Results

of varying

the command

74

Table

3.5.

Results

of varying

the pole locations

Table

3.6.

Results

of varying

the dc gain by 20% .......................................

75

Table

3.7.

Results

of varying

the command

86

Table

3.8.

Results

of varying

the pole locations

Table

3.9.

Results

of varying

the dc gain by 20% .......................................

Table

4.1.

Partitioned

3.1.

look up table ....................................................................

of a rule base .................................................................

input ........................................ by 20% ............................

input ........................................ by 20% ............................

state space .................................................................

vi

37

74

86 87 124

LIST OF FIGURES

Figure

2.1.

The membership

Figure

2.2.

Membership

functions

for two valued

Figure

2.3.

Membership

functions

Figure

2.4.

Membership

functions

Figure

2.5.

Membership functions for the complement of WARM HOT ................................................................................................

Figure

2.6.

Membership

functions

for WARM

union NOT WARM ........... 21

Figure

2.7.

Membership

functions

for WARM

intersection

Figure

2.8.

Max-min

inference

method ..........................................................

28

Figure

2.9.

Max-dot

inference

method ..........................................................

29

Figure 2.10.

Graphical

functions

representation

Figure

2.11.

Figure

3.1.

A basic block diagram

Figure

3.2.

Block diagram

Figure

3.3.

Example

Figure

3.4.

Graphical

WARM

and HOT ............................ logic ...............................

12

for WARM

union HOT ..........................

14

for WARM

intersection

15

of control

HOT .................

rules ...................................

for fuzzy controlled

of the filter in Figure

representation

functions

system ....................

3.1 .....................................

..............................................

of two rules with overlapping vii

and 16

NOT WARM...22

Determination of the control input by means of center gravity method ..............................................................................

of membership

10

39 of 40 45 46 51

sets ..... 53

Figure

Figure

3.5.

3.6.

Graphical representation of two roles with non sets ............................................................................................. Membership

functions

of fuzzy

sets error,

control input ....................................................

w

change

overlapping 54 of error, and

._............................

65

Figure

3.7.

Stages of fuzzy logic controllers

.................................................

68

Figure

3.8.

Step response before tuning the controUer, control included .....................................................................................

input 69

Figure

3.9.

Step response

after the first tuning,

Figure

3.10.

Step response

after the second

Figure

3.11.

Step response

to different

Figure

3.12.

Step response

to variation

in pole locations

..............................

72

Figure

3.13.

Step response

to variation

in dc gain ....... . .................................

73

Figure

3.14.

Step response

before tuning,

Figure

3.15.

Step response

to different

Figure

3.16.

Step response

to variation

in pole locations

Figure

3.17.

Step response

to variation

in dc gain .........................................

Figure

3.18.

Ramp response .............................................................................

82

Figure

3.19.

Step response

to disturbance

at the input ...................................

83

Figure

3.20.

Step response

to disturbance

at the output .................................

84

Figure

3.21.

Step response

to disturbance

at the input and output ................

85

Figure

3.22.

Step response

to variation

control

tuning,

command

control

command

control

oo_

....... 70

input included.71

inputs ...............................

input included

.................

inputs ...............................

in pole locations

VIII

input included

..............................

................................

71

78 79 80 81

89

Figure

3.23.

Step response

to variation

Figure

3.24.

Step response

of unstable

Figure

3.25.

Fuzzy sets for example

one, before tuning...._ ...........................

96

Figure

3.26.

Fuzzy

one, after first tuning ...........................

97

Figure

3.27.

Fuzzy sets for example

one, after second

98

Figure

3.28.

Fuzzy sets for example

two ......................................................

101

Figure

3.29.

Fuzzy

four .....................................................

102

Figure

4.1

No P-region .................................................................................

117

Figure

4.2

CriticalP-region

..........................................................................

118

Figure

4.3

P-region

appears .........................................................................

19

Figure

4.4

Step response

Figure

5.1.

Closed loop step response

before tuning ...................................

140

Figure

5.2.

Closed loop step response

after tuning ......................................

143

Figure

5.3.

Closed

due to horizontal

144

Figure

5.4.

Closed loop step response

due to vertical

Figure

5.5.

Closed loop step response

of different

controllers

Figure

5.6.

Closed loop step response

of different

controllers

Figure

5.7.

Fuzzy

sets for the linear actuator

before tuning ........................

150

Figure

5.8.

Fuzzy

sets for the linear actuator

after first tuning ..................

151

sets for example

sets for example

in dc gain ......................................... plant ..................................................

tuning ......................

of example ...........................................................

loop step response

ix

loading ................

loading .................... ....................

90 92

127

145 146

under load. 147

Figure

5.9.

Fuzzy

sets for the linear actuator after second

X

tuning ............ 152

CHAPTER

ONE

INTRODUCTION

1.1 Introduction Fuzzy logic processes

operator

FLCs

are fuzzy

of a process. variables.

and fuzzy

are used

in control

logic.

Fuzzy

linguistic

variables,

linguistic

methods,

and defuzzification logic

control

illustrated via four examples control

controllers.

systems. Third,

values, methods. design

showing

completeness

operations

to understand

Second,

we

are defined.

In

the concepts

rule bases,

present

four

procedure

is

of fuzzy

to tune fuzzy

two

of

inference

a basic

and robustness

by a procedure

of the sets

The design

the capabilities

the human

of fuzzy

we introduce

procedure.

for

the data is

description

concepts

term sets, fuzzy

This is followed for

fuzzy

design

can model

on a linguistic

it is important

system

that

system

or where

the fundamental

sets and basic

systems,

model

systems

are based

We first present

for control

step fuzzy

expert

They

addition,

logic

(FLCs)

that do not admit a mathematical

imprecise.

process

controllers

logic

Lyapunov-based

2 techniques

for

stability

analysis.

research,

since these techniques

designs.

Finally,

controller

we

1.2 Overview Since

of Fuzzy

fuzzy

laboratory

speed

engine

setting

area

be applied

and implementation

in NASA

of fuzzy

for

Langley

future

to our control of a fuzzy logic

the direction

set theory

was developed (Mamdani, steam

of the Free

Research

Center.

by Lofti

for control

applications.

by Mamdani

1974).

Zadeh

to control

The purpose

by using

heat

on the engine.

Because

of the successes

conducted

by Mamdani

logic

was generated.

Since

many others have been developed

(Zadeh, In 1974 a small

was to regulate

pressure

experiments control

currently

that it is well suited

and boiler

and the throttle

important

Controls

controller

steam

is an

to be used to control

Vehicle

the development

it was found

the first

engine

Research

cannot

the design

for a linear actuator

Flight Rotorcraft

1965),

present

This

applied

to the boiler

and co-workers,

an interest

that first application

of fuzzy

and tested to prove the worthiness

of these in fuzzy set theory of those

controllers. Fuzzy control to processes

where

generated other

a lot of enthusiasm

control

techniques

were

because

it can be applied

not efficiem

or simply

3 failed

to do the

mathematical

job.

model

Moreover,

but rather

fuzzy

a linguistic

logic

controllers

description

require

of the process.

no The

Q

control

task

IF..THEN

is achieved

rules that capture

a control

process

would,

One drawback fine

tune

the

difficult

procedure

to achieve

The tuning

1.3 Thesis

sets

and

Those

rules

when

includes

results.

consuming.

This

In this

response reshaping

when

of

applied

to

input to the process.

is the lack of systematic best

the desired

control

a series

techniques

to

process

is

introduce

a

tuning

thesis

tuning

we fuzzy

of the membership

controllers. functions

to

response.

Structure

The theory

of the chapters

of fuzzy sets and fuzzy logic

comparison understand

of fuzzy

expertise.

to attain

and time

The organization

of fuzzy

human

of fuzzy control

procedure

the desired

the use

in turn, give the desired

controller

sometimes

achieve

through

controllers

between

and appreciate

relate to fuzzy

control

logic as it directly

is presented

two-valued

logic

the theory

are defined

in the thesis follows.

in Chapter and

fuzzy

of fuzzy

Two. logic

sets.

and illustrated

relates to the design This

includes

a

to help

the reader

Moreover,

terms that

graphically.

An example

4 is presented to help in understanding

the application

of fuzzy

sets and fuzzy

logic. t

Chapter

Three

is an

controllers.

In this

chapter,

controllers

is presented

logic

control

invariant,

system

controller

techniques

with experimental Chapter controllers. briefly.

In this chapter, However,

problems.

these

This implies

analyzing

the stability

A real-world in Chapter

Five.

fuzzy

logic

of fuzzy

logic

single-output,

Second-order

type 0 and

phase

plant.

The

and the way to approach

them

fuzzy

controllers

data to test the robustness is an

of

In the examples,

for single-input,

for tuning

Four

design

the design

by examples.

plants.

examples

the

for

as a non-minimum

for these

Moreover,

actuator

is designed

as well

to

a procedure

followed

and continuous

considered,

introduction

overview

of

two approaches approaches

are also

linear,

problem The design

time

1 systems

are

design

of a

is explained.

presented

along

of the controllers. the

stability

to stability

are all aimed

analysis analysis

of

fuzzy

are discussed

at specific

that until now there has been no general of fuzzy

a fuzzy

classes method

of for

logic controllers.

is solved

and its controller

of a fuzzy

logic

to be used on the Free Flight Rotorcraft

controller Research

design

is presented

to control Vehicle

a linear (FFRRV)

5 is included with the specifications by testing

the controller

The presented

conclusion in Chapter

Fuzzy Chapters

requirements.

under various

load conditions

of the

and

thesis

topics

This is followed

to show its robusmess. for

further

research

are

Six.

sets and the rule base used

Two,

Three,

with the C code listings loop systems

and system

in the design

and Five are included that were written

in appendices

before

of the controllers

and after tuning

for the simulation

at the end of each chapter.

in

along

of the closed-

CHAPTER FUZZY

SETS

AND

TWO

FUZZY

LOGIC

IN CONTROL

SYSTEMS

2.1 Introduction The theory University

of

generalization solution

of fuzzy sets was developed California

of real-world

applicability,

mathematics chapter, control

system

concepts

the objects

making

Prade,

it more fuzzy

with uncertain

data.

of fuzzy

Kandel

applicable

In addition

a

in the logic

to its real

area of research

and Lee,

sets and fuzzy

represents

sets and fuzzy

is now an important

1980;

It

of the

logic

1979).

in

In this

that are used

in

are presented.

to introduce

sets which

1965).

In particular,

set theory

and

design

In order

theory,

decisions

fuzzy

(Zadeh,

set theory,

problems.

(Dubois

the main

conventional

Berkeley

of conventional

may be used to make world

at

in 1965 by Lofii Zadeh

and

appreciate

fuzzy

are based on two-valued

of the universal

set belong 6

sets,

logic.

consider

first

In conventional

to or do not belong

the set

to specific

7 sets. This is due to the fact that two-valued we assign

an object

odd-even,

black-white,

performed

on processes

the classification categories etc.

etc.

This

that are precise

of numbers

for example,

might

consider

by another

A historical sophism

tall,

or dictates

can

and well def'med. However,

warm,

another

be

many

are all relative.

warm by an individual

easily

Such a process

might

near,

tall,

For instance

consider

could

is

engineering

hot, fast, turbulent,

person

that

0-1, good-bad,

of classification

as odd or even.

or what is considered

very warm

type

imposes

for example,

that the terms in the above example

what one person height

to one of two categories,

are ill-defined,

Notice

logic

medium

be classified

as

individual.

example

of fuzzy notation

and can best illustrate

comes

the classification

from an ancient

dilemma

(Pedrycz,

Greek 1989),

"...one seed does not constitute a pile nor two nor three .. from the other side everybody agrees that a 100 million seeds constitute a pile. What therefore is the appropriate limit? Can we say that 325,647 constitute a pile but 325,648 do?" From the above discussion to a set.

seeds don't

we see the need to assign

degree

of belonging

The concept

Zadeh

did just that and is introduced

of a fuzzy

in the next

section.

to an object set formulated

some by

8 2.2 Fuzzy 2.2.1

Sets

Definition Fuzzy

grade

set theory

of belonging

complete certain

object

generalizes

(1).

by A.

in degrees

set warm

with

degrees

belongs

example,

the

universe

of discourse

real interval

defining

to the

of 1.0 while

with

a grade

set warm

X.

The

In this example temperature

by a membership

the value

For example,

set of all possible

Formally,

from

a fuzzy function

of a set to allow the

full exclusion

with

a grade

temperatures universe

of warm belongs

of 70 degrees

and the temperature of 0.0.

the closed

to

From

a universal

of 50

the

above

set or a

can be discrete interval

or

on the real

Fahrenheit.

set A on a universe RA(X) which

notion

of 80 degrees

of discourse

X=[40 °, 100°], in degrees

the fuzzy

forms

of a

the link of x to the

the temperature

of 0.50,

(0) up to

of the membership

set A, R^(x), the stronger

a grade

to the set warm

line, denoting

varies

concept

we can say that a temperature

belongs

continuous.

the original

The higher

x to the fuzzy

described

expressed

Sets

to the set, which

membership

category

the

of Fuzzy

of discourse

X is characterized

elements

of X into the closed

maps

[0,1] as follows: PA: X --_ [0, 1],

9 where

pA(X) expresses

simplicity simply

if there

the degree that x belongs

is no confusion,

denoted by A.

to some

the membership

category

function

A fuzzy set A can be represented

A.

For

pA will be

by an ordered pair

A = {(x,IaA(X))l x e X}. Hence, a fuzzy setcan be viewed by plottingx vcrsus laA(X). In addition,for discrete X, a tablecan alsobe used to representa fuzzy set.In conventional set theory,there is also a membership function called the characteristic function which can only take two values 0 or I, dcnoting exclusion or inclusion, respectively, of an objectin a set. For cxarnplc,considerthe universeof discourseX of temperaturesin [40°,100°].Wc can definetwo fuzzy setsWARM

and HOT

on X which are

characterized by theirrespectivemembership functions.Figure 2.1 shows the membership functionsfor WARM functionsare leftout,such as VERY

and HOT. HOT.

Additionalmembership

Given thatx=65 ° wc determine

the degree x belongs to cach fuzzy set by findingthe point at which x intersects thc membership function,thatis,findingthe value of WARM(x) and HOT(x). WARM

In thiscase a temperatureof 65° belongs to the fuzzy set

with a dcgrcc of 0.75 and to HOT

with a degree of 0.25. In

conventionalsets,the characteristic functionleadsto sharpboundaries as

I0

Warm

Hot

10

85

Figure

2.1.

The

membership

functions

WARM

and

HOT.

11 seen in Figure used.

2.2.

Triangular

In this example

and trapezoidal

a triangular

membership

membership

functions

function

are commonly

was used

ql,

in fuzzy control membership

Other membership

applications.

functions

and

monotonically

functions

include

increasing

and

gaussian decreasing

functions.

2.2.2 Fuzzy

Set Operations

All conventional

set operations

In fact, when

a fuzzy

set operation

conventional

set result

is obtained

In this

section

we present

three

have been is performed (Zadeh,

basic

generalized

to fuzzy

on a conventional

1965;

operations

Kandel including

sets.

set, the

and Lee,

1979).

some

of their

properties. In set theory the operations denoted

by Ac'_B, AuB

defined

as follows:

of union,

, and NOT

A, respectively.

AUB = {xeXlxeA

AQB

= {x6X

intersection,

IxeA

and complement The

operations

are are

oz xeB},

(2.1)

and

(2.2)

x6B},

12

_)

Figure

2.2.

_)

Membership

_)

function

1_)

for

two

valued

logic.

13 and

-- {x6Xl

Operations

in fuzzy

functions above

(Zadeh,

operations

sets are defined

1965).

in terms

In particular,

in (2.1),

(2.2),

(2.3)

xfA}.

of their

for fuzzy

sets

fuzzy

membership

A and B on X the

and (2.3) become

(AUB)

(x)

= max(A(x),B(x))

(AnB)

(x)

--min(A(x),B

(x))

xeX,

(2.4)

xeX,

(2.5)

and

A(x)

where operator

the union

operator

corresponds

corresponds set operations

= 1 - A(x)

corresponds

to the AND

to the NOT

function.

to the OR function,

function, Notice

in (2.4) - (2.6) is a new fuzzy

in (2.4) - (2.6) are illustrated

in Figures

(2.6)

xeX,

and

the complement

that the result set.

the intersection operator

of the three

The three fuzzy

2.3 - 2.5 for the fuzzy

fuzzy

operations

sets WARM

14

i

10

0S

40

Figure

2.3.

The

60

membership

80

function

I00

of

WARM

union

HOT.

15

10 / /

05 / /

\ /

40

Figure

2.4.

The membership intersection

function HOT.

of

WARM

16

10

05

411

Figure

2.5.

60

I_

The membership functions of WARM and HOT.

II_

of

the

complements

17 and HOT

defined

2.3 - 2.5 consider

in Section

2.2.1.

the following

To aid in the interpretations

subset

of Figures

of temperatures

T = {60 °, 65 °, 70 °, 75 °, 80°}. The

degrees

WARM

of the membership

of these

temperatures

to the fuzzy

sets

and HOT are given by WARM

(T) = {I,0.75,0.5,0.25,0}

and HOT

(T) = { 0, 0.25,0.5,0.75,I}.

The fuzzy operationsin (2.4)- (2.6)must be satisfied for allx _ X.

In

particular, they must be satisfied for x _ T. The degree of membership of temperaturesin T to the fuzzy setsthatresultfrom (2.4)- (2.6)isgiven by (WARM

u HOT)(T) =

{max(l,0),max(0.75,0.25),max(0.5,0.5), max(0.25,0.75),max(0, I)} = { 1, 0.75, (WARM

n HOT)(T)

{min(1,0), = { 0, 0.25, (NOT and

0.5, 0.75,

1 }; -

min(0.75,0.25), 0.5, 0.25,

WARM)(T)

min(0.5,0.5),

min(0.25,

0};

= {0, 0.25,

0.5, 0.75,

1 };

0.75),

min(0,

1)}

18 (NOT HOT) (T) --- {1, 0.75, 0.5, 0.25, 0}. For completeness, are stated (1989).

below. First,

functions

some fuzzy

For further

two

are identical

fuzzy

set properties

information

sets are equal

for all x _ X.

in the form

see Zadeh, if and

(1965)

only

De Morgan's

if their

Laws

of theorems or Pedrycz, membership

are given

(ANa) (x) = _(x)U _(x)

by

(2.7)

and

(AUB)

De Morgan's (2.6).

(x)

laws can be easily

A(X)

proven

using

(2.8)

.

the basic

operations

in (2.4)-

The first, becomes 1 - Max{A(x),

In order to verify

B(x)}

the equality,

< B(x) need to be tested.

= Min{ 1 - A(x),

the two possible

1 - A(x);

if A(x) < B(x) we have, 1 - B(x) = 1 - B(x). The distributive

cases:

If A(x) > B(x) we have, 1 - A(x)--

while

NB(x)

laws are given by

1 - B(x)}. A(x) > B(x) and A(x)

19

A _

(BUC)

=

(A/_B) U

(2.9)

(AnC)

and

°

A U

The properties

(B_C)

of absorption

= (AUB)

n

(AUC)

and idempotency

(2.10)

.

also hold:

(AnB)

U A : A,

(2.11)

(AUB)

n A = A,

(2.12)

AUA

= A,

(2.13)

A.

(2.14)

and

AnA:

However,

the following

laws are not satisfied,

AUX,

X

(2.15)

¢' O.

(2.16)

and

ANA

This is expected of two values.

since fuzzy To illustrate

sets do not impose

that an object

why the laws are not satisfied

take on one

consider

the fuzzy

20 set WARM. WARM fuzzy

The membership functions of WARM

n NOT

WARM

are given

set to be universal,

membership

function

that is, be equal

to define

the concept

logic

2.2.3

Linguistic

function

of linguistic

and

In order

for a

of discourse,

its

a fuzzy set is empty

is zero on X. of the above statements

variables

which

we need

is the comer

stone

of

Variables variable

rather than with

is a variable

numbers.

variables

are considered

statement

such as the temperature

variable

WARM

control.

A linguistic words

to its universe

we move on to the application

fuzzy

2.6 and 2.7.

should be unity on X. In addition,

if and only if its membership Before

in Figures

u NOT

temperature

linguistic

variable

linguistic

values.

with

variables.

values

Since each linguistic

may

is referred

in a

that the linguistic

The linguistic

X

with

the measured

For example,

of temperatures.

of discourse

The set of linguistic variable.

is represented

applications,

value hot.

of discourse

universe

value

is hot, we are saying

has the linguistic

set in the universe

of the linguistic

In control

to be linguistic

is a fuzzy

whose

value hot

In general, take

on

a

several

to as the term set

value is a fuzzy set on X, the

21

1.J J

/

/

/

05

Figure

2.6.

The membership intersection

NOT

function WARM.

for

WARM

22

10

05

Figure

2.7.

The membership WARM.

function

for

WARM

union

NOT

23 term

set

represents

a fuzzy

functions

of the linguistic

linguistic

values

values

are made

of X,

where

to overlap.

the

membership

An example

of some

are:

PB: positive

big,

PS: positive

small,

Z:

partitioning

zero,

NS: negative

small,

NB: negative

big.

and

A finer

granularity

2.3 Fuzzy 2.3.1

can be obtained

expert

Fuzzy

Rule

rule base

Lee (1990) rule base

linguistic

values.

Base sets, a fuzzy

can be provided

or learned

to derive

more

Logic

In order to apply fuzzy This

by considering

a fuzzy

by an artificial

to the system, neural

rule base for control

and Kosko

(1992).

are of the form

rule base needs

for example,

network. system

The fuzzy

(Hill, Horstkotte,

to be specified. by a human

Some of the methods applications

control

are presented

or production

and Teichrow,

1990):

used in

rules in the

24 IF premise where

the premise

THEN consequence,

is a set of conditions

(2.17)

to be specified

and the consequence Q

is a set of actions to be taken.

The premise

relations

represented

example,

let L1, L2, and L 3 be three linguistic

x3, respectively. respectively, addition,

by linguistic

Let

where

variables

x 1, x 2, and

B,2}, and {C1,..., Cn3}, respectively. Ri: IF L I is A i AND Additional easily

linguistic

taken into account.

the cartesian represented

x 3 be

variables

variables

defined

samples

of

are fuzzy values.

For

on Xl, x2, and

L l, L 2, and

and x 3 is to be determined.

L3, In

and L3 be given by {A1,..., A_I}, {BI,..., Then the i th fuzzy L2 is B i THEN in the premise

The premise

of _

rule is of the form

L3 is Ci

(2.18)

and consequence

is a fuzzy relation

product XI×X 2. This fuzzy relation

can be

defined

on

is a fuzzy set and it can be

by Premise

where

and their linguistic

x I and x 2 are known,

let the term sets for L1, _,

and the consequence

= {((xl,x2),

Premise(xl,x2))

[ (xl,x2)e

X1xX2},

(2.19)

we can take Premise(x

In this case, conjunctively

it is assumed with

the

1, x2) = min (Ai(xl), that the fuzzy

AND

operation.

Bi(x2)).

sets in the premise It is also

possible

(2.20) are combined to use,

for

25 example, the OR operation to combine the fuzzy sets. depends

on the inference

method

chosen.

This

The

is discussed

operation

further

in the

III

next section. An example

of a rule to control

a linear actuator

is

R1: IF E is PB AND AE is PS THEN Here E, AE, and control PB linguistic

values

2.3.2 Inference

be taken taken

input

input are the linguistic

of applying

rule premise

from the premise.

the

degree

to the rule's

is called performing

and PB, PS, and

variable.

of membership

conclusion

an inference.

In the example to be a fuzzy

computed

to determine

One is inferring in the previous

for a

the action the action

section,

to

to be

each fuzzy

implication

Ai. xBi---_C

is a fuzzy set. This fuzzy implication

membership

variables

in the term sets of each linguistic

rule R can be considered

which

is PB.

Methods

The process production

control

(2.21)

k,

is a fuzzy set in X_xX2xX 3 with

function R(x l, x 2, x 1) = Ll(xl)*L2(x2)*La(x3),

(2.22)

26 where the most commonly

used operations

for * are product

and union (Lee,

1990). I,

The two main are the max-min Horstkotte, methods

are

inference

methods

inference

method

and Teichrow,

1990).

referred

and the max-dot In Kosko

respectively.

the value

to be assigned

to the output

(max-min)

to the degree

of membership

In either

to form the final output

inference

membership

very similar

results.

However,

the max-dot

method

is preferred

method.

is either

the output

can be computed

and observing

to which

and we can find the degree or the OR (max)

methods

of fulfillment

operations.

inference

concept

is that

or clipped or

together

both methods

faster

give

implementation computationally

are illustrated

in Figures

In Figures

2.8 and 2.9

1990).

Temperature

From the appropriate

and Pressure rules will fire

of each rule by applying

The output

(Hill,

All the clipped

to computer

the samples

sets they belong.

two

are then combined

it is much

and Teichrow,

method

(max-dot)

In reality,

it comes

because

by taking

the basic

scaled

fuzzy logic

correlation-product

for the premise.

function.

when

these

and

method,

Both inference

2.8 and 2.9 (Hill, Horstkotte,

(min)

(1992)

sets for all the rules that set this output

than the max-min

inference

to as correlation-minimum

encoding,

scaled

that are used in applying

fuzzy

the AND

set is then scaled

or

27 Figures

clipped by the result of the min or max operation. both

the

AND

(min)

the

and

OR

(max)

operations

2.8 and 2.9 show on both

inference

Q

methods. The following membership

function

comments

apply to the max-dot

of the i th fuzzy

implication

Ri.(xl,x2,x3) = rain(Ai(xl),

is given

function

of the consequence

W i = min(Ai(xl),

If there

are

sets _.

A method is needed

base which

will be called

n fuzzy

to determine

the output fuzzy

o = R1.UR2U...

A better

approach

(Kosko,

1992)

method.

rules,

(2.23)

a combined set.

scaled then

The

by

Bi(x2))xC i,

which is the membership Bi(x2)).

inference

by the weight

there

fuzzy

are

n fuzzy

set for the rule

One approach

is to let

URn.

(2.24)

is to add the membership

functions

as

follows

n

"o -- _

wxci"

(2.25)

t-1.

The latter

approach

in the rule base fuzzy

set is X 3.

is preferred,

grows.

Note

in particular, that the universe

as the number of discourse

of fuzzy

rules

of the output

28

rule : if Temperatureis Low or PressureIs Low then throttleis I_edlum

Throttle

P is Low

T is Low

ls I_1

rule ' if Tenl)erature is Low and Pressureis Low then throttmeis radium

Throttle

P is Low Figure

2.8.

Max-Min

Inference

is l_d

Method.

29

rule : if Temperatureis Low or PressureIs Low then throttleis Medium

T i5 Low

P is Low

rule : if Te_erature is Lowand PressureIs Low then throttleis medlum

,/xx T is Low Figure

P is Low 2.9.

Max-Dot

Throttleis Med Inference

Method.

30 2.4 Fuzzy 2.4.1

Systems

in Control

Defuzzification The previous

systems. engine. linguistic one

A fuzzy

system

The fuzzy

system

values,

method

consists

system

variable

applications, first.

process variable

an inference

represented

fuzzy

(MISO)

section,

with

variables

considering

with an appropriate the degree

fuzzy

set.

of measured by

by

can be handled

we may

each

term set.

of membership

sets in the corresponding

of the previous

of fuzzy

rules fire and together

the output

in f'lnding

inputs,

single-output

which

variable

and

inputs

is accomplished

to the fuzzy

with the example

More

the crisp vector

This

consists

set of fuzzy set O.

determine

components

rule base

multi-input,

to be a linguistic

The fuzzification

Continuing

fuzzy

several

the main

of a fuzzy

maps a given

chosen,

to be fuzzified

measured

described

logic is used to determine

In control

measured

has

into an output

Fuzzy

the inference

each

section

at a time by forming

systems.

needs

Systems

term

of sets.

find that

x_ is A_, x_ is A2, X2 is B5, and x 2 is B 6. The fuzzy

sets for which

the degree

inputs

to the fuzzy

system.

which

corresponds,

for example,

of membership

The output

of the fuzzy

to the degree

is non-zero system

of membership

are used as is a fuzzy

set

of the control

31 inputs.

In control

converted

applications,

into a crisp munerical

and it is described logic

systems

controllers

value.

This process

in the next section. is given

2.4.2 Defuzzification

the output fuzzy

described

requires

a nonfuzzy

stage.

above

is a fuzzy

value.

that best

methods

for performing

procedure membership

This

method

performance

function

establishes

defuzzification. method

used (Hill,

and

is discussed

than

the latter

because

using

one of the inference

set of controls.

However,

a method function.

is needed There

the max-procedure below. method

It yields, (Lee,

to pick

are several that are used

defuzzification in general, 1990).

not consider

and Teichrow,

a process

for a defuzzification

Two of the methods

it does

Horstkotte,

the need

value,

the membership

of gravity

is hardly

obtained

at a crisp output

represents

The former

steady-state

of fuzzy

Method

a value

method.

description

in the next chapter.

In order to arrive

are the center

to be

is called defuzzification

A more detailed

The output of the fuzzy controller methods

set needs

the

1990).

better

The maxshape

of the

32 2.4.3

Center

Of Gravity

Method

The center of gravity method picks the output value corresponding

to

el,

the center of gravity of the output membership an output.

In other words,

of the summed the IF_THEN

area, which

in this method is contributed

the action is given by the center by the inputs

(the premise

system

is the control

input

u.

set is denoted by O then the control input u, determined

the centroid control

input,

part of

rule).

The output of the fuzzy fuzzy

function as the crisp value for

to the axis corresponding

to the universe

If the output by projecting

of discourse

of the

is given by

44J

f

xO(z)dz

--

,

fo(_)

(2 26)

dx

whenever

foc

_r) d'r ,

0,

(2.27)

33 These

integrals

membership numerical more

function

than

output fuzzy

in our applications

of the integrals

makes

the max method.

the integrals

As described

defined

since

is non zero only over a f'lnite range

evaluation

complex

evaluate

are well

the center

Fommately,

the output fuzzy of values.

of gravity

The

method

it is not necessary

to

at all. in the previous

section,

the membership

function

of the

set is given by

n

n

(2.28)

where

C corresponds

of the

control

sections). directly using

to one of the fuzzy values

input

It is possible related

(Kosko,

linguistic

variable

in the term set {C1,

(denoted

to show that the centroid

to the centroids

of C i.

The control

by

...,

Cn3

I_,3 in the previous

of the output input

fuzzy

set is

can be evaluated

1992)

n

E

u--

w:t c:t I i

i--I n

}

(2.29)

34 where rule

n is the number that

has

corresponding

of fuzzy

fired,

wi =

to the centroid

min(Ai(xl),

with respect

is simply

the value

of the control

is easily

computed.

In addition,

then

Therefore,

I = _ for the control

all

fired, and for the ith fuzzy

Bi(x2)),

ci is the

of C, and _ is the area under

sets are symmetric

same

rules that have

to a vertical

line passing

control

C i. If the fuzzy

through

input on the axis of symmetry. if the area under

i and

it can

input is simply

be

each fuzzy

canceled

input

from

it, then ci This value

set Ci is the the

equation.

given by

wl Ci

u -

(2.30)

n

If the fuzzy sets Ci are unimodal in triangular fuzzy

or trapezoidal

set is the same,

with peak belief values

membership

then the control

functions)

over its centroid

and the area under

input is also given

(as each

by

n

ciO (c±) u = i=I rl

_. O(c±)

(2.31)

35 2.5 Example Suppose

we have a system

inputs

are error and derror

input

of the plant.

normalized

(the change-of-error)

The fuzzy

with the universe

for inputs

and output

of discourse

-1 and a change-of-error are the following

control

R 3 :

IF error THEN

and the output

In addition,

are all

the term sets

a crisp output,

In addition,

suppose

consider

an error of

that the rules that get

control

derror

derror

is PS

change

is Z

input is Z;

is NS AND control

change

input is NS;

R 2 : IF error is Z AND THEN

[-6, 6].

is the control

ones:

R 1 : IF error is Z AND THEN

inputs

two

in this case.

how to obtain of 1.75.

The

and one output.

and the output

sets for both

are identical

In order to illustrate

fired

with two inputs

input

derror

change

is NS

change

is Z

is PS;

and R4 : IF error is NS AND derror THEN Figures

control

input is PB.

2.10 and 2.11 illustrate

the fuzzification

of the controller

inputs,

the

36 max-dot inference method, and the center of gravity Figure

defuzzification

method.

2.10 show the fuzzy sets Z and NS for error, PS, Z, and NS for error t

change,

and the fuzzy

additional

lines

inference

method.

illustrate

0.5, w 2 = 0.25, resulting

(2.25).

solved

membership

given

Equation

the

respectively.

function

output

used

input.

in the

Figure

contributed can

by

for the control membership

input

by w_ =

2.11 shows the

be obtained

the

rules.

using

The

Equation

corresponds

function.

The

max-dot

for the four rules are given

functions

value

scaling

to the

It can be easily

(2.30):.

[0.5x(-2)+O.25xO+OxO+O.25x4] (0.5+0.25+0+0.25)

the centroids

(2.32)

=0.0,

of the NS, Z, PS, and PB membership

functions

are

by ci = -2, c2 = 0, c3 = 2, and c4 = 4, respectively. These

calculation, input.

crisp

of the combined

I=

where

factors

membership

The resulting

using

to fred

The scaling

output

centroid

how

w 3 -- 0, and w4 = 0.25,

scaled

combined

sets NS, Z, PS, and PB for the control

These

calculations each

can be implemented

error and error

results

such a way that given

change

can then be stored an error and error

on a computer.

will give

a corresponding

in the form change

After

of a look-up

we can then

each

control table

in

look up the

37 control input.

An example of a look up-table is given in Table 2.1.

Error

Error change -4 I -3

-2 ]-1

]

0 ]

1

2 I

3 I

4

-4

5

4

4

3

3

2

1

1

-1

-3

5

4

3

2

2

1

0

0

-2

-2

4

3

3

2

1

1

0

-1

-3

-I

4

3

2

1

1

0

1

-2

-3

0

3

3

2

1

0

-1

-2

-3

-3

1

3

2

1

0

-1

-1

-2

-3

-4

2

3

1

0

-1

-1

-2

-3

-4

-4

3

2

0

0

-1

-2

-2

-3

-4

-5

4

1

-1

-1

-1

-2

-3

-4

-4

-5

Table 2.1. Sample look-up table. The following

procedure shows how a control input is determined from the

look up table. • Suppose

the set point

= 1.

• Output

of system

at t_ = 4.

• Output

of system

at t2 = 2.

• Erroratt_=4• Erroratt

2=2-1

1=3. = 1.

38 • Error change = 1 - 3 -- -2. From

the look-up

table we can find the control

t2 to be 1. For errors and error changes interpolation

will be necessary

the simplicity use

of determining

of a computer

implement

makes

in real time.

input to the process

that do not appear

to find the control the control the

in the table, linear

input. This example

input to a process.

calculation

process

at time

simple

shows

Moreover, and

easy

the to

39

tm

\ |

O Rule one

2

2

4

-2

,/

\ 0

-2

-4

-2

2

-!

I

-2

I

-4

2

-2

0

-2

2.10.

1

Graphical

2

0

_lt

!

_

7',,

-1

Figure

2

I

I

I Iide

1

-4

2\ 1

I

-4

0

f_,r

representation

of

control

rules.

4O

I_oership

function

1.0 Contributed

by rule 1

_.75 Corrtr ibuted by rule 2 0.50

/

-4

-2

0

Cor_ibut_ byrole4

2

4

6

Universe of discourse

Figure

2.11.

Determination of the control input means of center of gravity method.

by

41 2.6 Conclusions In this chapter,

we presented

an overview

of fuzzy sets and fuzzy logic Q

as they

apply

operations

to control

on fuzzy

introduced defuzzification

and

the

logic

It is expected researchers

design.

analytically

concepts

of

Moreover,

and a rule

we

graphically. base,

inference

illustrated

Fuzzy

logic

methods,

the was and

were illustrated.

In conclusion, fuzzy

sets

systems

this chapter

served

and how they can be applied to be a useful new to the field.

research

as an introduction to design

guide, together

fuzzy

to fuzzy logic

sets,

controllers.

with the references,

to

CHAPTER FUZZY

LOGIC

3

CONTROLLERS

3.1 Introduction A

fuzzy

logic

controller

is

generalization

of the expert systems

applications.

The main difference

expert

systems

system,

is in the way

uncertainty

expert

system

linguistic

variables

logic controller knowledge

engine

Initially

fuzzy

fuzzy

expert

a probabilistic

which

systems

is embedded approximate

approach.

interpretation

operator

is a (AI)

and AI

In an AI expert A fuzzy

in the way humans

In fact, one

a human

operator

system

uncertainty.

uncertainty

and the defuzzifier

to a given

handle

sets.

is that it models

of the human

inference operator

and fuzzy

between

using

to handle

expert

widely used in artificial intelligence

they

is handled

attempts

a fuzzy

of a control in the fuzzy the response

do, using of a fuzzy

process.

The

rule base.

The

of the human

set of inputs. logic

applications

characterized

mathematical

models

controllers by

slow

of the process,

were time

applied constants

but reasonably

42

in

process

and

controlled

control

lacking

the

by a human

43 operator. More recently, fuzzy logic controllers have been applied to more typical

electrical

engineering

control

problems

such as motor

control

(Li and

Q

Lau,

1989),

aircraft

(Chiu

mentioned faster

these

offered

and proportional proportional

(MRAC)

or in many The

includes

goal

new

cases better

guidelines

of fuzzy

up with

logic

model techniques

1992).

for the tuning

controllers.

single-output to multivariable

Furthermore,

fuzzy

logic

integral

reference

all of

controllers

derivative adaptive

to prove

control

is to present

examples

All of the

to single-input,

between

of

can be used with

have been applied

than classical

roll control

applications.

(PI), proportional

control

1992),

controllers

(Heisemer,

(PD),

of this chapter

will be followed

robustness

integral

classical

general

logic

comparisons

derivative

and other

more

In addition

such as a turbo fan engine

(FLCs),

This

systems.

(Kosko,

and many

fuzzy logic controllers

applications

(PID),

1989)

problem

show that fuzzy

constant

processes,

problems

pendulum

and Chand,

applications

time

(SISO)

good

the inverted

control

that FLCs

are as

techniques.

our design of fuzzy

to illustrate

procedure logic

which

controllers.

the capabilities

and

44 3.2 Fuzzy

Logic

Control

System

A basic block diagram

Design

for fuzzy logic

control

is given in Figure 3.1 Q

where

r(kT) is a sequence

sequence output

of tracking of the plant.

control

systems

of command

errors,

that is useful

The controller

to construct

the change

is a rough diagram

consists

implementation (Langari

of four blocks

signal,

Ae(kT)

= e(kT)

in Figure

1992). The fuzzy

is a

and y(t) is the of fuzzy

to other

control

First, a filter is used

of the rate of change

in Figure

- y(kT)

implementation

and comparison

of the filter is shown

illustrated

= r(kT)

of two main blocks.

of error sequence

and Berenji,

e(kT) input

sampled-data

for analysis

first order approximation

also possible consists

u(t) is the control

This is a typical

techniques.

requests,

- e((k-1)T), of error.

3.2.

A block

Other filters

logic controller

3.7; their

which

design

are

(FLC)

is described

next.

A Design

Procedure

Suppose an appropriate typically

that the control sampling

used to design

period fuzzy

configuration

in Figure

T is chosen. logic

controllers.

3.1 is chosen

The following

main

and that steps

are

45

= 5) derror=5; if (derror -0.

X(k)---0 for the system

if there exists a Lyapunov

function

is negative

- V(x) < 0 with AV(x) = 0 only if x = 0.

4. V(x) approaches

stable

- V(x)

positive

is asymptotically

definite

matrix

stable

in the large

P such that

ATi P Ai -P