Chapter 10 Fuzzy Control and Fuzzy Expert Systems

Download Report

Transcript Chapter 10 Fuzzy Control and Fuzzy Expert Systems

Chapter 10 Fuzzy Control and Fuzzy Expert Systems

10.1 Fuzzy logic controller

10.1.1 Advantage of fuzzy logic controller   Useful cases (1) The control processes are too complex to analyze by conventional quantitative techniques.

(2) The available sources of information are interpreted qualitatively, inexactly, or uncertainly.

Advantage of FLC (1) Parallel or distributed control  multiple fuzzy rules – complex nonlinear system (2) Linguistic control  linguistic terms - human knowledge (3) Robust control  more than 1 control rules – a error of a rule is not fatal

10.1.2 Configuration of fuzzy logic controller

Fig 10.1 Configuration of FLC Knowledge base Input Fuzzification interface Defuzzification interface Output Inference State variable Control output Controlled system (process) Control variable Control input

10.1.2 Configuration of fuzzy logic controller

Four main components (1) The fuzzification interface : transforms input crisp values into fuzzy values (2) The knowledge base : contains a knowledge of the application domain and the control goals. (3) The decision-making logic :performs inference for fuzzy control actions (4) The defuzzification interface

10.1.3 Choice of state variables and control variables

State variables  input variables of the fuzzy control system  state, state error, state error deviation, and state error integral are often used Control variables  output variables of the fuzzy control system Selection of the variables  depends on expert knowledge on the process

10.2 Fuzzification interface component

(1)  Scale mapping of input data convert the range of values of input variables into corresponding universe of discourse.

(2)   Strategy for noise When observed data were disturbed by random noise, a fuzzification operator should convert the probabilistic data into fuzzy numbers. a fuzzy singleton   assume that the observed data do not contain vagueness a precise value and no fuzziness

10.2 Fuzzification interface component

(3) Selection of fuzzification function   

x

= fuzzifier (

x 0

)

x 0 x

is a observed crisp value is a fuzzy set fuzzifier represents a fuzzification operator

10.2 Fuzzification interface component

 F ( x ) 1 fuzzification functions  F ( x ) 1 x 0 x Fig 10.1 Fuzzification function for fuzzy singleton x 0 base Fig 10.2 Fuzzification function for fuzzy triangular number x

10.3 Knowledge base component

10.3.1 Data base  Principal design parameters for an FLC  discretization and normalization of universe of discourse  fuzzy partition of input and output spaces  membership function of primary fuzzy set

10.3.1 Data base

(1) Discretization of a universe of discourse     quantization The quantization discretizes a universe into a certain number of segments. Each segment is labeled as a generic element and forms a discrete universe.   A fuzzy set is then defined on the discrete universe of discourse. The number of quantization levels affects an important influence on the control performance, discretization   A scale mapping serves to transform measured variables into values in the discretized universe.

The mapping can be uniform (linear), non-uniform (nonlinear), or both.

Discretization and normalization of universe of discourse

Table 10.1 An example of discretization  a universe of discourse is discretized into 13 levels (-6, -5, -4, … , 0, 1, … , 5, 6).

Range x   2.4

 2.4  x   2.0

 1.6  x   0.8

 0.8  x   0.4

 0.4  x   0.2

 0.2  x   0.1

 0.1  x  +0.1

 0.1  x   0.2

 0.2  x   0.4

 0.4  x   0.8

 0.8  x   1.1

 1.1  x   1.4

 1.4  x Level No.

 6  5  4  3  2  1 0 1 2 3 4 5 6

Discretization and normalization of universe of discourse

(2) Normalization of a universe of discourse  a discretization into a normalized universe.

 The normalized universe consists of finite number of segments.

 The scale mapping can be uniform, nonuniform, or both.

Discretization and normalization of universe of discourse

Table 10.2 shows an example  the universe of discourse [-6.9, +4.5] is transformed into the normalized closed interval [-1, 1].

Range [  6.9,  4.1] [  4.1,  2.2] [  2.2,  0.0] [  0.0,  1.0] [  1.0,  2.5] [  2.5,  4.5] Normalized segments [  1.0,  0.5] [  0.5,  0.3] [  0.3, 0.0] [0.0,  0.2] [  0.2,  0.6] [  0.6,  1.0] Normalized universe [  1.0,  1.0]

10.3.1 Data base

(3) Fuzzy partition of input and output spaces   linguistic variable    in the antecedent of a rule forms a fuzzy input space, in the consequent of the rule forms a fuzzy output space.

In general, associated with a term set. fuzzy partition of the space  determines how many terms should exist in a term set.  to find the number of primary fuzzy sets(linguistic terms)

10.3.1 Data base

Fig 10.3 Example of fuzzy partition with linguistic terms Z N P  1 0  1 N: negative, Z: zero, P: positive NB NM NS ZE PS PM PB 7 linguistic terms are often used  NB: negative big  NM: negative medium  NS: negative small  ZE: zero  PS: positive small  PM: positive medium  PB: positive big  1 0 NB, NM, NS, ZE, PS, PM, PB  1

10.3.1 Data base

Fuzzy partition of input and output spaces 2 x x 2 PS ZO NS NB NB NS ZO PS x 1 PB Fig 10.4 A fuzzy partition in 2-dimension input space the maximum number of control rules = 20 (5x4) big small small big Fig 10.5 A fuzzy partition having three rules x 1

10.3.1 Data base

(4) Membership function of primary fuzzy set Table 10.3 Definition of triangular membership function Level No.

 6  5  4  3  2  1 0 1 2 3 4 5 6 NB 1.0

0.7

0.3

0.0

0.0

0.0

0.0

0.0

0.0

0.0

0.0

0.0

0.0

NM 0.3

0.7

1.0

0.7

0.3

0.0

0.0

0.0

0.0

0.0

0.0

0.0

0.0

NS 0.0

0.0

0.3

0.7

1.0

0.7

0.3

0.0

0.0

0.0

0.0

0.0

0.0

ZE 0.0

0.0

0.0

0.0

0.3

0.7

1.0

0.7

0.3

0.0

0.0

0.0

0.0

PS 0.0

0.0

0.0

0.0

0.0

0.0

0.3

0.7

1.0

0.7

0.3

0.0

0.0

PM 0.0

0.0

0.0

0.0

0.0

0.0

0.0

0.0

0.3

0.7

1.0

0.7

0.3

PB 0.0

0.0

0.0

0.0

0.0

0.0

0.0

0.0

0.0

0.0

0.3

0.7

1.0

Term NM

 NM (  6) = 0.3

 NM (  5) = 0.7

 NM (  4) = 1.0

 NM (  3) = 0.7

 NM (  2) = 0.3

10.3.1 Data base

 bell shaped membership function 

f

(

x

)  exp{  (

x

 2 

f m f

2 ) 2 } ; mean

m f

and standard deviation  Table 10.4 Definition of bell-shaped membership function Normalized universe [  1.0,  1.0] Normalized segments [  1.0,  0.5] [  0.5,  0.3] [  0.3,  0.0] [  0.0,  0.2] [  0.2,  0.6] [  0.6,  0.8] [+0.8, +1.0] m f  1.0

 0.5

 0.2

0.0

0.2

0.5

1.0

f

0.4

0.2

0.2

0.2

0.2

0.2

0.4

Fuzzy sets NB NM NM ZE PS PM PB

10.3.1 Data base

Fig 10.6 Example of bell-shaped membership function NB NM NS ZE PS PM PB  1  1 0

10.3.2 Rule base

1) Source of fuzzy control rules   derivation of fuzzy control rules a heuristic method   rules are formed by analyzing the behavior of a controlled process.

The derivation relies on the qualitative knowledge of process behavior. a deterministic method  can systematically determine the linguistic structure of rules.

10.3.2 Rule base

4 modes of derivation of fuzzy control rules  Expert experience and control engineering knowledge:    operating manual and questionnaire Based on operators ’ control actions : observation of human controller ’ s actions in terms of input-output operating data Based on the fuzzy model of a process : linguistic description of the dynamic characteristics of a process Based on learning : ability to modify control rules such as self-organizing controller

10.3.2 Rule base

2) Types of fuzzy control rules (1) State evaluation fuzzy control rules:  a collection of rules of the form(MISO version) R 1 : if x is A 1 , … and y is B 1 R 2 : if x is A 2 , … and y is B 2 … then z is C then z is C 1 2 R n : if x is A n , … and y is B n then z is C n where x, … y and z are linguistic variables representing the process state variable and the control variable. Ai, … Bi and Ci are linguistic values of the variables x, … y and z in the universe of discourse U, … V and W, respectively i = 1, 2, … , n. That is,

x

 U, A i  U, …,

y

 V, B i  V,

z

 W, C i  W

10.3.2 Rule base

 general version, : the consequent part is represented as a function of the state variable x , … y .

R i : if

x

is A i , … and

y

is B i then

z

=

f i

(

x

, …

y

) The state evaluation rules evaluate the process state (e.g.

state, state error, change of error) at time t and compute a fuzzy control action at time t .

In the input variable space, the combination of input linguistic term may give a fuzzy rule.

a set of fuzzy rules R i : if

x

is A i , and

y

is B i then

z

is C i, i = 1, 2, … , n

10.3.2 Rule base

Fig 10.7 Fuzzy rules represented by a rule table y B n … B 2 B 1 C 1 A 1 C n C 3 C 2 A 2 C 5 C 4 … … C 6 C 5 C 4 C 7 A n x

2) Types of fuzzy control rules(Con ’ t) (2) Object evaluation fuzzy control rules : predict present and future control actions, and evaluate control objectives (predictive fuzzy control)  Typical rules R 1 : if (

z

… is C 1  (

x

R n : if (

z

is C n  (

x

is A 1 and is A n and

y y

is B 1 )) then

z

is B n )) then

z

is C 1 .

is C n .

 A control action is determined by an objective evaluation that satisfies the desired states and objectives.   

x

and

y

are performance indices for the evaluation and command.

z

is control A i and B i are fuzzy values such as NM and PS. The most likely control rule is selected through predicting the results (

x

,

y

) corresponding to every control command C i , i = 1, 2, … , n.

10.4 Inference (Decision making logic)

10.4.1 Mandani method   minimum operator for a fuzzy implication max-min operator for the composition R i : if

x

x

is A U, A i  i and U,

y y

 is B i V, B then i 

z

V, is C i , i = 1, 2, … , n

z

 W, C i  W 1) When input data are singleton such as

x

the matching degree of rule R i : 

i

 

A i

(

x

0 )  =

x

0 

B i

and (

y

0 )

y

the result of rule R i : 

C i

 (

z

)  

i

 

C i

(

z

) =

y

0 the aggregated result : 

C

 (

z

) 

n i

V  1 [ 

i

 

C i

(

z

)]

C

 

n i U

 1

C i

10.4 Inference (Decision making logic)

2) When input data are fuzzy sets, A  and B 

i

i

C i

  min[ (

z

)   max

x i

 (  

C i A

 (

x

) (

z

)  1 , 2 ,  ,

n

 

A

(

x

)), max

v

( 

B

 (

y

)  

B

(

y

))] the aggregated result : 

C

 (

z

) 

n i

V  1 [ 

i

 

C i

(

z

)]

C

 

n i U

 1

C i

10.4 Inference (Decision making logic)

10.4.2 Larsen method  product operator( • ) for a fuzzy implication  max-product operator for the composition 1) When input data are singleton such as

x

=

x

0 and

y

=

y

0 the matching degree of rule R i : the result of rule R i : 

i

 

A i

(

x

0 )  

B i

(

y

0 ) 

C i

 (

z

)  

i

 

C i

(

z

) the aggregated result : 

C

 (

z

) 

n i

V [  1 

i

 

C i

(

z

)]

C

 

n i U

 1

C i

10.4 Inference (Decision making logic)

2) When input data are fuzzy sets, A  and B  the matching degree of rule R i : 

i

 min[ max

x

( 

A

 (

x

)  

A

(

x

)), max

v

( 

B

 (

y

)  

B

(

y

))] the result of rule R i : the aggregated result : 

C i

 (

z

)  

i

 

C i

(

z

) 

C

 (

z

) 

n i

V [  1 

i

 

C i

(

z

)]

C

 

n i U

 1

C i

10.4 Inference (Decision making logic) 10.4.3 Tsukamoto method

 the consequent part : fuzzy set with a monotonic membership function 

C i

(

z

) the result of rule R i :

z i

  

C i

1 ( 

i

) the aggregated result :

z

   1 

z

1 1     2 2

z

2

10.4 Inference (Decision making logic)

Fig 10.8 Example of Tsukamoto control rules 1  = z 2 R 1 : 5 7 1 3 7 9  z =( z  1) 2 R 2 : 5 7 1 0 1 3 7 9 z R 3 : 8 1 0 3 5 z R 4 : 8 1 0 5 7 z

10.4 Inference (Decision making logic) 10.4.4 TSK method

 the consequent part is given as a function of input variables.

R i : if

x

is A i and

y

is B i then

z

is f i (

x

,

y

) ,where

z

= f(x, y) is a crisp function of input variables

x

and

y

. When input data are singleton

x 0

R i is f i (

x 0

,

y 0

). and

y 0

, then the inferred result of rule the aggregated result : weighted average using the matching degree  i

z

   1

f

1 (

x

0 ,

y

0  1 )     2 2

f

2 (

x

0 ,

y

0 )

10.5 Defuzzification

Defuzzification  In many practical applications, a control command is given as a crisp value.  a process to get a non-fuzzy control action that best represents the possibility distribution of an inferred fuzzy control action.  no systematic procedure for choosing a good defuzzification strategy,  select one in considering the properties of application case

10.5.1 Mean of maximum method (MOM) The MOM strategy generates a control action which represents the mean value of all control actions, whose membership functions reach the maximum.

z

0 

j k

  1

z j k z j

: control action whose membership functions reach the maximum.

k

: number of such control actions.

 (z) z 0 z

10.5.2 Center of area method (COA) The widely used COA strategy generates the center of gravity of the possibility distribution of a fuzzy set C .

z

0 

j n

  1 

C

(

z j

) 

z j j n

  1 

C

(

z j

)

n

: the number of quantization levels of the output

C

: a fuzzy set defined on the output dimension (

z

)  ( z ) z 0 z

10.5.3 Bisector of area (BOA)

The BOA generates the action (z0) which partitions the area into two regions with the same area .

 

z

0 

C

(

z

)

dz

 

z

 0 

C

(

z

)

dz

  = min{

z

= max{

z

|

z

|

z

  W} W}

10.5.4 Lookup table

Lookup Table   Due to the problem of time complexity, it takes much time to compute the fuzzy inference and defuzzification. simply shows relationships between input variables and control output actions.   can be constructed after making the FLC and identifying the relationships between the input and output variables. In general, it is extremely difficult to get an acceptable lookup table of a nonlinear control system without constructing a corresponding FLC.

10.5.4 Lookup table

Example 10.1 the two input variables error (e) and change of error (ce), and control variable ( v ). when e =  1.0 and ce =  0.5, we can obtain v =  0.5

ce e  1.0

 0.5

0 0.5

1.0

 1.0

 1.0

 1.0

 1.0

0.5

0.5

 0.5

 0.5

 1.0

 1.0

0.5

0.5

0  0.5

0.5

0.5

1.0

0.5

0.5

 0.5

 0.5

 0.5

1.0

1.0

1.0

 0.5

 0.5

 0.5

1.0

1.0

10.6 Design procedure of fuzzy logic controller

1) Determination of state variables and control variables 2) Determination of inference method 3) Determination of fuzzification method 4) Discretization and normalization of state variable space 5) Partition of variable space.

6) Determination of the shapes of fuzzy sets 7) Construction of fuzzy rule base 8) Determination of defuzzification strategy 9) Test and tuning 10) Construction of lookup table

10.7 Application example of FLC design

The control problem of Servomotors  Servomotors are used in many automatic system including drivers for printers, floppy disks, tape recorders, and robot manipulations.  The servomotor process shows nonlinear properties  We apply the fuzzy logic control to the motor control.  The task of the control is to rotate the shaft of the motor to a set point without overshoot.

10.7 Application example of FLC design

Design procedure for servomotor control 1) Determination of state variables and control variable (1) State variables (input variable of FLC): Error : the set point minus the process output (e).

Change of error (ce) : the error from the process output minus the error from the last process output.

(2) Control variable(output variable of FLC): Control input (v) : the voltage applied to the process.

2) Determination of inference method  The Mandani inference method is selected 3) Determination of fuzzification method  fuzzy singleton uncertainty : measure the state variables without

10.7 Application example of FLC design

4)      Discretization and normalization The shaft encoder of the motor has a resolution of 1000. The universes of discourse are as follows:  1000  e  1000  100  ce  100 The servo amplifier has an output range of 30 V and thus the control variables (v) are in the range  30  v  30 We discretize and normalize the input variables in the range [  1,  1] as shown in Table 10.6(next page). The control variable v is normalized in the range [  1,  1] with the equation

v

  1 30

v

10.7 Application example of FLC design

4) Discretization and normalization(con ’ t) Table 10.6 Discretization and normalization error (e)  1000  e   800  800  e   600  600  e   400  400  e   200  200  e   100  100  e  100 100  e  200 200  e  400 400  e  600 600  e  800 800  e  1000 error change (ce)  100  ce   80  80  ce   60  60  ce   40  40  ce   20  20  ce   10  10  ce  10 10  ce  20 20  ce  40 40  ce  60 60  ce  80 80  ce  100 quantized level  1.0

 0.8

 0.6

 0.4

 0.2

0 0.2

0.4

0.6

0.8

1.0

10.7 Application example of FLC design

5) Partition of input space and output space    We partition space of each input and output variable into seven regions, Each region is associated with linguistic term as shown in Fig 10.13. the maximum number of possible fuzzy rules is 49.

 1 NB NM NS ZE PS 0 Fig 10.13 Partition of space PM PB  1 e ce v

10.7 Application example of FLC design

6) Determination of the shapes of fuzzy sets  We normalized the input and output variables on the same interval [-1, +1] and partitioned the region into seven subregions Level  1  0.8

 0.6

 0.4

 0.2

0 0.2

0.4

0.6

0.8

1.0

NB 1 0 0 0 0 0 0 0 0 0 0 NM 0.5

1 0.5

0 0 0 0 0 0 0 0 NS 0 0 0.5

1 0.5

0 0 0 0 0 0 ZE 0 0 0 0 0.5

1 0.5

0 0 0 0 Table 10.7 Definition of primary fuzzy sets PS 0 0 0 0 0 0 0.5

1 0.5

0 0 PM 0 0 0 0 0 0 0 0 0.5

1 0.5

PB 0 0 0 0 0 0 0 0 0 0 1

10.7 Application example of FLC design

Fig 10.14 Graphical representation of primary fuzzy sets NB NM NS ZE PS PM PB 1 0.5

 1  0.8

 0.6

 0.4

 0.2

0 0.2

0.4

0.6

0.8

1.0

10.7 Application example of FLC design

7) Construction of fuzzy rules  We interviewed with an expert of the servomotor control, and we collect knowledge such as: “If the error is zero and the error change is positive small, then the control input is negative small” (1) (2) (3) (4) If e is PB and ce is any, then

v

is PB.

If e is PM and ce is NB, NM, or NS, then

v

is PS.

If e is ZE and ce is ZE, PS, or PM, then

v

is ZE.

If e is PS and ce is NS, ZE, or PS, then

v

is ZE.

(5) If e is NS and ce is NS, ZE, PS, or PM, then (6) If e is NS or ZE and ce is PB, then

v

is PS.

v

is NS.

10.7 Application example of FLC design

Construction of fuzzy rules(Con ’ t) e c e NB NM NS ZE PS PM PB NB NM NS NM PS NS PB ZE NS ZE PS NB PM PM PB PS Fig 10.15 Fuzzy rule table

10.7 Application example of FLC design

8) Determination of defuzzification strategy  We take the COA (center of area) method because it is most commonly used.

9) Test and tuning  We checked the performance of the developed controller and refined some fuzzy rules.

10) Construction of lookup table  For example,  for c = -0.2 and ce = 0, v is -0.4

for c = -0.4 and ce = 0.4, v is 0.2

this lookup table can be used in order to save the inference time and defuzzification time

10.8 Fuzzy expert systems

Configuration of fuzzy expert system Knowledge base User input Fuzzification interface Scheduler Linguistic approximation Output Inference engine

10.8 Fuzzy expert systems

10.8.1 fuzzification interface   The fuzzy expert system receive linguistic terms, this module has to have an ability to handle such fuzzy information. Each rule can have its certainty factor. This certainty factor is used in the aggregation of the results from each rule.

10.8.2 Inference engine   The fuzzy expert systems can use the inference methods of the fuzzy logic controller. it is difficult to have a fuzzy set with monotonic membership function in the consequent part of a rule. (Therefore especially, Mamdani method and Larsen method are often used.)

10.8 Fuzzy expert systems

10.8.3 Linguistic approximation  Instead of the defuzzification module, a linguistic approximation module is needed.

  finds a linguistic term which is closest to the obtained fuzzy set. use a measuring technique of distance between fuzzy sets.

10.8.4 Scheduler    controls all the processes in the fuzzy expert system. determines the rules to be executed and sequence of their executions. also provides an explanation function for the result.