第三讲 Fuzzy Control

Download Report

Transcript 第三讲 Fuzzy Control

Chapter 2 Fuzzy Control

1

Fuzzy Control: The Basics

Overview

Fuzzy Control: A Tutorial Introduction

  

General Fuzzy System Simple Design Example: The Inverted Pendulum Simulation of Fuzzy Control System

2

    

Questions

Why do we select fuzzy controllers in many real world systems?

How much of the success can be attributed to the use of the mathematical model and conventional control design approach?

How much should be attributed to the clever heuristic tuning that the control engineer uses upon implementation? If we exploit the use of heuristic information throughout the entire design process, can we obtain higher performance control systems?

How do we design a fuzzy controller?

3

Questions

  

Whether do we need a model in fuzzy control?

What are the performance evaluation of fuzzy control?

What should we pay attention in fuzzy controller design?

4

2.1 Overview

What is the motivation for turning to fuzzy control?

Basically, the difficult task of modeling and simulating complex real world systems for control systems development, especially when implementation issues are considered, is well documented. Even if a relatively accurate model of a dynamic system can be developed, it is often too complex to use in controller development, especially for many conventional control design procedures that require restrictive assumptions for the plant (e.g., linearity).

5

It is for this reason that in practice conventional controllers are often developed via simple models of the plant behavior that satisfy the necessary assumptions, and via the ad hoc(special) tuning of relatively simple linear or nonlinear controllers. Regardless, it is well understood (although sometimes forgotten) that heuristics enter the conventional control design process as long as you are concerned with the actual implementation of the control system. It must be acknowledged, moreover, that conventional control engineering approaches that use appropriate heuristics to tune the design have been relatively successful.

6

You may ask the following questions: How much of the success can be attributed to the use of the mathematical model and conventional control design approach, and how much should be attributed to the clever heuristic tuning that the control engineer uses upon implementation? And if we exploit the use of heuristic information throughout the entire design process, can we obtain higher performance control systems?

Fuzzy control provides a formal methodology for representing, manipulating, and implementing a human's heuristic knowledge about how to control a system.

7

In this section we seek to provide a philosophy of how to approach the design of fuzzy controllers.

The fuzzy controller block diagram is given in Figure 2.1, where we show a fuzzy controller embedded in a closed-loop control system. The plant outputs are denoted by y(t), its inputs are denoted by u (t), and the reference input to the fuzzy controller is denoted by r (t).

8

Reference input r(t) Fuzzy controller Inference mechanism Inputs u(t) Process Outputs y(t) Rule-base Figure 2.1 Fuzzy controller architecture.

9

Basically, you should view the fuzzy controller as an artificial decision maker that operates in a closed-loop system in real time. It gathers plant output data y(t), compares it to the reference input r (t), and then decides what the plant input u(t) should be to ensure that the performance objectives, will be met.

10

The fuzzy controller has four main components : (1) The " rule-base " holds the knowledge, in the form of a set of rules, of how best to control the system. (2) The inference mechanism evaluates which control rules are relevant at the current time and then decides what the input to the plant should be. (3) The fuzzification interface simply modifies the inputs so that they can be interpreted and compared to the rules in the rule-base. (4) the defuzzification interface converts the conclusions reached by the inference mechanism into the inputs to the plant.

11

How do we design a fuzzy controller?

To design the fuzzy controller, the control engineer must gather information on how the artificial decision maker should act in the closed-loop system. Sometimes this information can come from a human decision maker who performs the control task, while at other times the control engineer can come to understand the plant dynamics and write down a set of rules about how to control the system without outside help. These "rules" basically say, "If the plant output and reference input are behaving in a certain manner, then the plant input should be some value." A whole set of such "If-Then" rules is loaded into the rule-base, and an inference strategy is chosen , then the system is ready to be tested to see if the closed-loop specifications are met.

12

This brief description provides a very high level overview of how to design a fuzzy control system. Below we will expand on these basic ideas and provide more details on this procedure and its relationship to the conventional control design procedure.

Modeling Issues and Performance Objectives

 

Fuzzy Controller Design

Performance Evaluation

Application Areas

13

2.1.1

Modeling Issues and Performance Objectives

Whether do we need a model in fuzzy control?

People working in fuzzy control often say that "a model is not needed to develop a fuzzy controller, and this is the main advantage of the approach." However, will a proper understanding of the plant dynamics be obtained without trying to use first principles of physics to develop a mathematical model?

And will a proper understanding of how to control the plant be obtained without simulation-based evaluations that also need a model?

14

We always know roughly what process we are controlling (e.g, we know whether it is a vehicle or a nuclear reactor), and it is often possible to produce at least an approximate model , so why not do this? For a safety-critical application, if you do not use a formal model, then it is not possible to perform mathematical analysis or simulation-based evaluations. Is it wise to ignore these analytical approaches for such applications? Clearly, there will be some applications where you can simply "hack" together a controller (fuzzy or conventional) and go directly to implementation.

15

In such a situation there is no need for a formal model of the process; however, is this type of control problem really so challenging that fuzzy control is even needed? Could a conventional approach (such as PID control) or a "table look-up" scheme work just as well or better, especially considering implementation complexity?

16

Overall, when you carefully consider the possibility of ignoring the information that is frequently available in a mathematical model, it is clear that it will often be unwise to do so. Basically, then, the role of modeling in fuzzy control design is quite similar to its role in conventional control system design. In fuzzy control there is a more significant emphasis on the use of heuristics , but in many control approaches (e.g, PID control for process control) there is a similar emphasis.

17

Basically, in fuzzy control there is a focus on the use of rules to represent how to control the plant rather than ordinary differential equations (ODE) . This approach can offer some advantages in that the representation of knowledge in rules seems more lucid and natural to some people. For others, though, the use of differential equations is more clear and natural. Basically, there is simply a "language difference" between fuzzy and conventional control: ODEs are the language of conventional control, and rules are the language of fuzzy control.

18

The performance objectives and design constraints are the same as the ones for conventional control that we summarized above, since we still want to meet the same types of closed-loop specifications. The fundamental limitations that the plant provides affect our ability to achieve high performance control, and these are still present just as they were for conventional control (e.g, nonminimum phase or unstable behavior still presents challenges for fuzzy control).

19

2.1.2 Fuzzy Controller Design

How do we design a fuzzy controller?

Fuzzy control system design essentially amounts to (1) choosing the fuzzy controller inputs and outputs, (2 ) choosing the preprocessing that is needed for the controller inputs and possibly postprocessing that is needed for the outputs , and (3) designing each of the four components of the fuzzy controller shown in Figure 1.2.

20

As you will see in the next chapter, there are standard choices for the fuzzification and defuzzification interfaces . Moreover, most often the designer settles on an inference mechanism and may use this for many different processes. Hence, the main part of the fuzzy controller that we focus on for design to the rule-base.

21

What is the main task in fuzzy controller design process?

The rule-base is constructed so that it represents a human expert "in-the-loop." Hence, the information that we load into the rules in the rule-base may come from an actual human expert who has spent a long time learning how best to control the process. In other situations there is no such human expert, and the control engineer will simply study the plant dynamics (perhaps using modeling and simulation) and write down a set of control rules that makes sense.

22

It is clear that anyone who has experience driving a car can practice regulating the speed about a desired set-point and load this information into a rule-base. For instance, one rule that a human driver may use is "If the speed is lower than the set-point, then press down further on the accelerator pedal." A rule that would represent even more detailed information about how to regulate the speed would be "If the speed is lower than the set-point AND the speed is approaching the set-point very fast, then release the accelerator pedal by a small amount."

23

This second rule characterizes our knowledge about how to make sure that we do not overshoot our desired goal (the set-point speed). Generally speaking, if we load very detailed expertise into the rule-base, we enhance our chances of obtaining better performance.

24

2.1.3 Performance Evaluation

What are the performance evaluation of fuzzy control?

Each and every idea on performance evaluation for conventional controllers applies here as well. The basic reason for this is that a fuzzy controller is a nonlinear controller—so many conventional modeling, analysis (via mathematics, simulation, or experimentation), and design ideas apply directly.

25

Since fuzzy control is a relatively new technology, it is often quite important to determine what value it has relative to conventional methods. Unfortunately, few have performed detailed comparative analyses between conventional and intelligent control that have taken into account a wide array of available conventional methods (linear, nonlinear, adaptive, etc.); fuzzy control methods (direct, adaptive, supervisory); theoretical, simulation, and experimental analyses; computational issues; and so on.

26

What should we pay attention in fuzzy controller design?

Moreover, most work in fuzzy control to date has focused only on its advantages and has not taken a critical look at what possible

disadvantages

there could be to using it (hence the reader should be cautioned about this when reading the literature). For example, the following questions are cause for concern when you employ a strategy of gathering heuristic control knowledge:

27

• Will the behaviors that are observed by a human expert and used to construct the fuzzy controller include all situations that can occur due to disturbances, noise, or plant parameter variations?

• Can the human expert realistically and reliably foresee problems that could arise from closed loop system instabilities or limit cycles ?

• Will the human expert be able to effectively incorporate stability criteria and performance objectives (e.g., rise-time, overshoot, and tracking specifications) into a rule-base to ensure that reliable operation can be obtained?

28

These questions may seem even more troublesome (1) if the control problem involves a safety-critical environment where the failure of the control system to meet performance objectives could lead to loss of human life or an environmental disaster, or (2) if the human expert's knowledge implemented in the fuzzy controller is somewhat inferior to that of the very experienced specialist we would expect to design the control system ( different designers have different levels of expertise ).

Clearly, then, for some applications there is a need for a methodology to develop, implement, and evaluate fuzzy controllers to ensure that they are reliable in meeting their performance specifications. This is the basic theme and focus of this book.

29

2.1.4 Application Areas

Fuzzy systems have been used in a wide variety of applications in engineering , science , business , medicine , psychology , and other fields. For instance, in engineering some potential application areas include the following: •

Aircraft/spacecraft

: Flight control, engine control, avionic systems, failure diagnosis, navigation, and satellite attitude control.

Automated highway systems

: Automatic steering, braking, and throttle control for vehicles.

Automobiles

: Brakes, transmission, suspension, and engine control.

Autonomous vehicles

: Ground and underwater.

30

Manufacturing systems

: Scheduling and deposition process control.

Power industry

: Motor control, power control/distribution, and load estimation.

• •

Process control

: Temperature, pressure, and level control, failure diagnosis, distillation column control, and desalination processes.

Robotics

: Position control and path planning.

This list is only representative of the range of possible applications for the methods of this book. Others have already been studied, while still others are yet to be identified.

31

The primary goal of control engineering is to distill and apply knowledge about how to control a process so that the resulting control system will reliably and safely achieve high performance operation. In this chapter we show how fuzzy logic provides a methodology for representing and implementing our knowledge about how best to control a process.

32

2.2 Fuzzy Control: A Tutorial Introduction

Questions

How do we choose fuzzy controller inputs and outputs ?

How do we put control knowledge in to rule-bases? How do we quantify the knowledge in fuzzy controller design? Why do that?

33

What are a fuzzy controller composed?

A block diagram of a fuzzy control system is shown in Figure 2.1. The fuzzy controller is composed of the following four elements:

34

参考输入 r(t) 模 糊 化 模糊控制器 推理机 规则库 解 模 糊 输入 u(t) 过程 输出 y(t) Figure 2.2 Fuzzy Control 35

1.

A rule-base

(a set of If-Then rules), which contains a fuzzy logic quantification of the expert's linguistic description of how to achieve good control.

2.

An inference mechanism

(also called an "inference engine" or "fuzzy inference" module), which emulates the expert's decision making in interpreting and applying knowledge about how best to control the plant.

3.

A fuzzification interface

, which converts controller inputs into information that the inference mechanism can easily use to activate and apply rules.

4.

A defuzzification interface

, which converts the conclusions of the inference mechanism into actual inputs for the process.

36

We introduce each of the components of the fuzzy controller for a simple problem of balancing an inverted pendulum on a cart , as shown in Figure 1.3. Here,

y

denotes the angle that the pendulum makes with the vertical (in radians),

l

is the half pendulum length (in meters), and

u

is the force input that moves the cart (in Newtons). We will use

r

to denote the desired angular position of the pendulum. The goal is to balance the pendulum in the upright position (i.e., r = 0) when it initially starts with some nonzero angle off the vertical (i.e., y

0).

37

Figure2.3 Inverted pendulum on a cart 38

This is a very simple and academic nonlinear control problem, and many good techniques already exist for its solution. Indeed, for this standard configuration, a simple PID controller works well even in implementation.

In the remainder of this section, we will use the inverted pendulum as a convenient problem to illustrate the design and basic mechanics of the operation of a fuzzy control system. We will also use this problem in Section 2.4

to discuss much more general issues in fuzzy control system design that the reader will find useful for more challenging applications (e.g., the ones in the next chapter).

39

2.2.1 Choosing Fuzzy Controller Inputs and Outputs

How do we choose fuzzy controller inputs and outputs ?

Consider a human-in-the-loop whose responsibility is to control the pendulum, as shown in Figure 2.3. The fuzzy controller is to be designed to automate how a human expert who is successful at this task would control the system. First, the expert tells us (the designers of the fuzzy controller) what information she or he will use as inputs to the decision-making process.

40

Suppose that for the inverted pendulum, the expert (this could be you!) says that she or he will use

 

And

d dt e

as the variables on which to base decisions. Certainly, there are many other choices (e.g., the integral of the error e could also be used) but this choice makes good intuitive sense .

41

Next, we must identify the controlled variable . For the inverted pendulum, we are allowed to control only the force that moves the cart, so the choice here is simple.

For more complex applications, the choice of the inputs to the controller and outputs of the controller (inputs to the plant) can be more difficult. Essentially, you want to make sure that the controller will have the proper information available to be able to make good decisions and have proper control inputs to be able to steer the system in the directions needed to be able to achieve high-performance operation .

42

Practically speaking, access to information and the ability to effectively control the system often cost money. If the designer believes that proper information is not available for making control decisions, he or she may have to invest in another sensor that can provide a measurement of another system variable. Alternatively, the designer may implement some filtering or other, processing of the plant outputs.

43

r u

倒立摆

y

Figure 2.3 Human controlling an inverted pendulum on a cart 44

In addition, if the designer determines that the current actuators will not allow for the precise control of the process, he or she may need to invest in designing and implementing an actuator that can properly affect the process. Hence, while in some academic problems you may be given the plant inputs and outputs, in many practical situations you may have some flexibility in their choice. These choices affect what information is available for making on-line decisions about the control of a process and hence affect how we design a fuzzy controller.

45

Once the fuzzy controller inputs and outputs are chosen, you must determine what the reference inputs are. For the inverted pendulum, the choice of the reference input r = 0 is clear. In some situations, however, you may want to choose r as some nonzero constant to balance the pendulum in the off vertical position. To do this, the controller must maintain the cart at a constant velocity so that the pendulum will not fall.

46

r +  e

d d t

模糊控制器 u 倒立摆 y Figure 2.4 Fuzzy controller for an inverted pendulum on a cart 47

After all the inputs and outputs are defined for the fuzzy controller, we can specify the fuzzy control system. The fuzzy control system for the inverted pendulum, with our choice of inputs and outputs, is shown in Figure 2.4. Now, within this framework we seek to obtain a description of how to control the process. We see then that the choice of the inputs and outputs of the controller places certain constraints on the remainder of the fuzzy control design process.

48

If the proper information is not provided to the fuzzy controller, there will be little hope for being able to design a good rule-base or inference mechanism . Moreover, even if the proper information is available to make control decisions, this will be of little use if the controller is not able to properly affect the process variables via the process inputs.

It must be understood that the choice of the controller inputs and outputs is a fundamentally important part of the control design process.

49

2.2.2 Putting Control Knowledge into Rule-Bases

How do we put control knowledge into rule-bases?

Suppose that the human expert shown in Figure 2.3 provides a description of how best to control the plant in some natural language (e.g., English or Chineses). We seek to take this "linguistic" description and load it into the fuzzy controller, as indicated by the arrow in

Figure 2.4

.

Linguistic description

 

Rules Rule-bases

50

Linguistic Descriptions

linguistic variables The linguistic description provided by the expert can generally be broken into several parts. There will be " linguistic variables " that describe each of the time-varying fuzzy controller inputs and outputs. For the inverted pendulum, "error" describes e(t)

d

"change-in-error" describes

dt

"force" describes u(t)

51

Note that we use quotes to emphasize that certain words or phrases are linguistic descriptions , and that we have added the time index to, for example, e(t), to

d dt

emphasize that generally e varies with time. There are many possible choices for the linguistic descriptions for variables. Some designers like to choose them so that they are quite descriptive for documentation purposes.

52

However, this can sometimes lead to long descriptions. Others seek to keep the linguistic descriptions as short as possible (e.g., using "e(t)" as the linguistic variable for e(t )), yet accurate enough so that they adequately represent the variables, Regardless, the choice of the linguistic variable has no impact on the way that the fuzzy controller operates; it is simply a notation that helps to facilitate the construction of the fuzzy controller via fuzzy logic.

53

linguistic values Just as e(t) takes on a value of, for examples 0.1 at t = 2 (e(2) = 0.1), linguistic variables assume " linguistic values " . That is, the values that linguistic variables take on overtime change dynamically. Suppose for the pendulum example that "error ," "change-in-error ", and "force" take on the following values: "neglarge" "negsmall" "zero" "possmall" "poslarge"

54

Note that we are using "negsmall" as an abbreviation for "negative small in size" and so on for the other variables. Such abbreviations help keep the linguistic descriptions short yet precise. For an even shorter description we could use integers: "-2" to represent "neglarge" "-1" to represent "negsmall" "0" to represent "zero" "1" to represent "possmall" .

"2" to represent "poslarge"

55

This is a particularly appealing choice for the linguistic values since the descriptions are short and nicely represent that the variable we are concerned with has a numeric quality . We are not, for example, associating "-1" with any particular number of radians of error; the use of the numbers for linguistic descriptions simply quantifies the sign of the error (in the usual way) and indicates the size in relation to the other linguistic values. We shall find the use of this type of linguistic value quite convenient and hence will give it the special name, " linguistic-numeric value ."

56

The linguistic variables and values provide a language for the expert to express her or his ideas about the control decision-making process in the context of the framework established by our choice of fuzzy controller inputs and outputs.

Recall that for the inverted pendulum r = 0

d dt e

 

d dt y

57

d

since

r

 0

. First, we will study how we can

dt

quantify certain dynamic behaviors with linguistics. In the next subsection we will study how to quantify knowledge about how to control the linguistic descriptions.

pendulum using

58

For the inverted pendulum each of the following statements quantifies a different configuration of the pendulum: • The statement "error is poslarge" can represent the situation where the pendulum is at a significant angle to the

left

of the vertical.

• The statement"error is negsmall" can represent the situation where the pendulum is just slightly too close to the right of the vertical, but not to the vertical to justify quantifying it as ''zero" and not too far away quantifying it as "neglarge." to justify

59

• The statement " error is zero " can represent the situation where the pendulum is very near the vertical position ( a linguistic quantification is not precise, hence we are willing to accept any value of the error around e(t) = 0 as being quantified linguistically by "zero" since this can be considered a better quantification than "possmall" or "negsmall“).

• The statement "error is poslarge and change-in-error is possmall" can represent the situation where the pendulum is to the left of the vertical and, since , the pendulum is moving away from the upright position (note that in this case the pendulum is moving counterclockwise).

60

Overall, we see that to quantify the dynamics of the process we need to have a good understanding of the physics of the underlying process we are trying to control. While for the pendulum problem, the task of coming to a good understanding of the dynamics is relatively easy, this is not the case for many physical processes. Quantifying the process dynamics with linguistics is not always easy, and certainly a better understanding of the process dynamics generally leads to a better linguistic quantification . Often, this win naturally lead to a better fuzzy controller

provided

that you can adequately measure the system dynamics so that the fuzzy controller can make the right decisions at the proper time.

61

Rules

Next, we will use the above linguistic quantification to specify a set of rules (a rule-base) that captures the expert's knowledge about how to control the plant. In particular, for the inverted pendulum in the three positions shown in Figure 2.5, we have the following rules: 1.

If

error is neglarge

and

change-in-error is neglarge

Then

force is poslarge 62

Figure 2.5 Inverted pendulum in various positions

63

This rule quantifies the situation in Figure 2.5(a) where the pendulum has a large positive angle and is moving clockwise; hence it is clear that we should apply a strong positive force so that we can try to start the pendulum moving in the proper direction.

2.

If

error is zero

and

change-in-error is possmall

Then

force is negsmall This rule quantifies the situation in Figure 2.5(b) where the pendulum has nearly a zero angle with the vertical and is moving counterclockwise; hence we should apply a small negative force (to the left) to counteract the movement so that it moves toward zero.

64

3.

If

error is poslarge

and

change-in-error is negsmall

Then

force is negsmall This rule quantifies the situation in Figure 2.5(c) where the pendulum is far to the left of the vertical and is moving clockwise; hence we should apply a small negative force (to the left) to assist the movement, but not a big one since the pendulum is already moving in the proper direction. 65

Each of the three rules is a " linguistic rule " since it is formed solely from linguistic variables and values . Since linguistic values are not precise representations of the underlying quantities that they describe, linguistic rules are not precise either. They are simply abstract ideas about how to achieve good control that could mean somewhat different things to different people. They are, however, at a level of abstraction that humans are often comfortable with in terms of specifying how to control a process.

66

The general form of the linguistic rules listed above is

If

premise

Then

consequent The premises (which are sometimes called " antecedents ") are associated with the fuzzy controller inputs and are on the left-hand-side of the rules. The consequents (sometimes called " actions ") are associated with the fuzzy controller outputs and are on the right-hand-side of the rules. 67

Notice that each premise (or consequent) can be composed of the conjunction of several "terms" (e.g., in rule 3 above "error is poslarge

and

change-in-error is negsmall" is a premise that is the conjunction of two terms). The number of fuzzy controller inputs and outputs places an upper limit on the number of elements in the premises and consequents. Note that there does not need to be a premise (consequent) term for each input (output) in each rule, although often there is.

68

Rule-Bases

Using the above approach, we could continue to write down rules for the pendulum problem for all possible cases. Note that since we only specify a finite number of linguistic variables and linguistic values, there is only a finite number of possible rules.

69

For the pendulum problem, with two inputs and five linguistic values for each of these, there are at most

5 2

= 25 possible rules (all possible combinations of premise linguistic values for two inputs).

A convenient way to list all possible rules for the case where there are not too many inputs to the fuzzy controller is to use a tabular representation. A tabular representation of one possible set of rules for the inverted pendulum is shown in Table 2.1. Notice that the body of the table lists the linguistic numeric consequents of the rules , and the left column and top row of the table contain the linguistic-numeric premise terms.

70

Table 2.1 Rule Table for Inverted Pendulum “ “ force”

u

erro r”

e

-2 -1 0 1 2 -2 “ change-in-error”

ė

-1 0 1 2 2 2 2 1 0 2 2 2 1 1 0 0 -1 -1 -2 1 0 0 -1 -1 -2 -2 -2 -2 -2 71

Then, for instance, the (2, -1) position (where the "2" represents the row having "2" for a numeric linguistic value and the "-1" represents the column having "-1" for a numeric-linguistic value) has a -1 ("negsmall") in the body of the table and represents the rule: If

error is poslarge

and

change-in-error is negsmall

Then

force is negsmall

which is rule 3 above. Table 2.1 represents abstract knowledge that the expert has about how to control the pendulum given the error and its derivative as inputs.

72

Notice the diagonal of zeros and viewing the body of the table as a matrix we see that it has a certain symmetry to it. This symmetry that emerges when the rules are tabulated is no accident and is actually a representation of abstract knowledge about how to control the pendulum; it arises due to a symmetry in the system's dynamics . We will actually see later that similar patterns will be found when constructing rule-bases for more challenging applications, and we will show how to exploit this symmetry in implementing fuzzy controllers .

73

2.2.3 Fuzzy Quantification of Knowledge

How do we quantify the knowledge in fuzzy controller design?

Why do that?

Up to this point we have only quantified, in an abstract way, the knowledge that the human expert has about how to control the plant. Next, we will show how to use fuzzy logic to fully quantify the meaning of linguistic descriptions so that we may automate, in the fuzzy controller, the control rules specified by the expert .

Membership functions

Fuzzifiction

74

Membership Functions

First, we quantify the meaning of the linguistic values using "membership functions." Consider, for example, Figure 2.6. This is a plot of a function versus e(t) that takes on special meaning. The function n quantifies the certainty that e(t) can be classified linguistically as "possmall." To understand the way that a membership function works, it is best to perform a case analysis where we show how to interpret it for various values of e(t):

75

If

   2

then certain that

 2   0    2

, indicating that we are is not "possmall." • If

 

8 then

0.5

, indicating that we are halfway certain that is "possmall" (we are only halfway certain

 

8 since it could also be "zero" with some degree of certainty this value is in a "gray area" in terms of linguistic interpretation).

76

If

  4

then

 1.0

, indicating that we are absolutely certain that

  4

is what we mean by "possmall." • If

 

then are certain that

 0  

, indicating that we is not "possmall" .

77

 1.0

0.5

“possmall”

 4  2

e t rad

.

FIGURE 2.6 Membership function for linguistic value "possmall."

78

The membership function quantifies, in a continuous manner, whether values of e(t) belong to the set of values that are "possmall," and hence it quantifies the meaning of the linguistic statement "error is possmall." This is why it is called a membership function. It is important to recognize that the membership function in Figure 2.6 is only one possible definition of the meaning of "error is possmall"; you could use a bell-shaped function, a trapezoid, or many others.

79

1.0

0.5

“possmall”

 4  2

e t rad

.

FIGURE 2.7(a) A few membership function choices for representing "error is possmall."

80

For instance, consider the membership functions shown in Figure 2.7. For some application someone may be able to argue that we are absolutely certain that any value of e(t) near

 4

is still "possmall" and

only when you get sufficiently far from

4

do we lose our confidence that it is "possmall." One way to characterize this understanding of the meaning of "possmall" is via the trapezoid-shaped membership function in Figure 2.7(a).

81

For other applications you may think of membership in the, set of "possmall" values as being dictated by the Gaussian shaped membership function shown in Figure 2.7(b). For still other applications you may not readily accept values far away from

as being "possmall," so you may use the membership function in Figure 2.7(c) to represent this. Finally, while we often think of symmetric characterizations of the meaning of linguistic values, we are not restricted to these symmetric representations.

82

1.0

0.5

“possmall”  4  2

e t rad

.

 FIGURE 2.7 (b) A few membership function choices for representing "error is possmall." 83

 1.0

0.5

“possmall”  4  2

e t rad

.

 FIGURE 2.7(c) A few membership function choices for representing "error is possmall." 84

For instance, in Figure 2.7(d) we represent that we believe that as e(t) moves to the left of

we are very quick to reduce our

4

confidence that it is "possmall," but if we move to the right of

our confidence that

4

e(t) is "possmall," diminishes at a slower rate.

85

 1.0

0.5

“possmall”

 4  2 3  4 FIGURE 2.7(d) A few membership function choices for representing "error is possmall."

rad

.

 86

In summary, we see that depending on the application and the designer (expert), many, different choices of membership functions are possible. It is important to note that for the most part the definition of a membership function is subjective rather than objective. That is, we simply quantify it in a manner that makes sense to us, but others, may quantify it in a different manner.

87

The set of values that is described by as being "positive small" is called a " fuzzy set ." Let A denote this fuzzy set. Notice that from Figure 2.6. we are absolutely certain

that e(t) = is an element of A, but we are

less certain that e(t) = is an element of A. Membership in the set, as specified by the membership function, is fuzzy; hence we use the term "fuzzy set."

88

A "crisp" (as contrasted to "fuzzy") quantification of "possmall" can also be specified, but via the membership function shown in Figure 2.8. This membership function is simply an alternative representation for the interval on the real line

 8   3  8

, and it indicates that this interval of numbers represents "possmall." Clearly,this characterization of crisp sets is simply another way to represent a normal interval (set) of real numbers.

89

 1.0

0.5

 4  2

e t rad

.

 FIGURE 2.8 Membership function for a crisp set.

90

While the vertical axis in Figure 2.6 represents certainty, the horizontal axis is also given a special name. It is called the " universe of discourse " for the input e(t) since it provides the range of values of e(t) that can be quantified with linguistics and fuzzy sets. In conventional terminology, a universe of discourse for an input or output of a fuzzy system is simply the range of values the inputs and outputs can take on.

91

Now that we know how to specify the meaning of a linguistic value via a membership function , we can easily specify the membership functions for all 15 linguistic values (five for each input and five for the output) of our inverted pendulum example. See Figure 2.9 for one choice of membership functions.

92

Notice that we list both the linguistic values and the linguistic-numeric values associated with each membership function. Hence, we see that the membership function in Figure 2.6 for "possmall" is embedded among several others that describe other sizes of values (so that, for instance, the membership function to the right of the one for "possmall" is the one that represents "error is poslarge"). Note that other similarly shaped membership functions make sense (e.g., bell-shaped membership functions).

93

The membership functions at the outer edges in Figure 2.9 deserve special attention. For "the inputs and we see that the outermost membership functions " saturate " at a value of one. This makes intuitive sense as at some point the human expert would just group all large values together in a linguistic description such as "poslarge." The membership functions at the outermost edges appropriately characterize this phenomenon since they characterize "greater than" (for the right side) and "less than" (for the left side).

94

-2 -1 “neglarge” “negsmall” 0 “zero” 1 “possmall” 2 “poslarge”   2   4 -2 “neglarge” -1 0 “negsmall” “zero”  4 1 “possmall”  2

e

2 “poslarge”

r a d

.

   4   8 -2 -1 “neglarge” “negsmall” 0 “zero”  1 6  8 1 “possmall”  4

d d t e

2 “poslarge”

r a d

.

 -30 -20 -10 10 20 30

u

FIGURE 2.9 Membership functions for an inverted pendulum on a cart.

N

 95

For the output u , the membership functions at the outermost edges cannot be saturated for the fuzzy system to be properly defined. The basic reason for this is that in decision making processes of the type we study, we seek to take actions that specify an exact value for the process input. We do not generally indicate to a process actuator, "any value bigger than, say, 10, is acceptable."

96

It is important to have a clear picture in your mind of how the values of the membership functions change as, for example,

e(t)

changes its value over time . For instance, as

e(t)

changes from   2 to  2 we see that various membership functions will take on zero and nonzero values indicating the degree to which the linguistic value appropriately describes the current value of

e(t

). For example, at

e(t)

=   2 we are certain that the error is "neglarge," and as the value of

e(t

) moves toward   4 we become less certain that it is "neglarge" and more certain that it is "negsmall." We see that the membership functions quantify the meaning of linguistic statements that describe time-varying signals.

97

Finally, note that often we will draw all the membership functions for one input or output variable on one graph; hence, we often omit the label for the vertical axis with the understanding that the plotted functions are membership functions describing the meaning of their associated linguistic values. Also, we will use the notation  to represent the membership function

zero

associated with the linguistic value "zero" and a similar notation for the others.

The rule-base of the fuzzy controller holds the linguistic variables, linguistic values, their associated membership functions, and the set of all linguistic rules (shown in Table 2.1), so we have completed the description of the simple inverted pendulum. 98

Fuzzification

It is actually the case that for most fuzzy controllers the fuzzification block in Figure 2.1 can be ignored since this process is so simple. Fuzzification process is regared as the act of obtaining a value of an input variable (e.g.,

e(t))

and finding the numeric values of the membership function(s) that are defined for that variable . 99

For example, if

e(t)

=  4 and

d dt e

  fuzzification process amounts to finding the values of the input membership functions for these. In this case 

possmall

   1 (with all others zero) and 

zero d dt

  16 

possmall d

 0.5

dt

Some think of the membership function values as an "encoding" of the fuzzy controller numeric input values . The encoded information is then used in the fuzzy inference process that starts with " matching ." 100

2.2.4 Matching: Determining Which Rules to Use

How do we decide which rules to use?

The inference process generally involves two steps: 1. The premises of all the rules are compared to the controller inputs to determine which rules apply to the current situation.

This "matching" process involves determining the certainty that each rule applies, and typically we will more strongly take into account the recommendations of rules that we are more certain apply to the current situation.

101

2. The conclusions are determined using the rules that have been determined to apply at the current time . The conclusions are characterized with a fuzzy set (or sets) that represents the certainty that the input to the plant should take on various values .

Premise quantification via fuzzy logic

Determining which rules are on

102

Premise Quantification via Fuzzy Logic

To perform inference we must first quantify each of the rules with fuzzy logic. To do this we first quantify the meaning of the premises of the rules that are composed of several terms,each of which involves a fuzzy controller input. We list two terms from the premise of the rule,

If

error is zero

and Then

change-in-error is possmall force is negsmall 103

“error is zero” quantified with 0 “zero” 

zero

  4  4 and

e t rad

.

 Change-in-error is possmall quantified with 1.0

0.5

 1 6  8 1 “possmall” 

possmall

 4

d d t r a d

/ s e c  FIGURE 2.10 Membership functions of premise terms.

104

Above, we had quantified the meaning of the linguistic terms "

error is zero

" and "

change-in error is possmall

" via the membership functions

shown in Figure 2.9

. Now we seek to quantify the

linguistic premise "

error is zero and change-in error is possmall

." Hence, the main item to focus on is how to quantify the logical " and " operation that combines the meaning of two linguistic terms. While we could use standard Boolean logic to combine these linguistic terms, since we have quantified them more precisely with fuzzy sets (i.e., the membership functions), we can use these.

105

To see how to quantify the "

and

" operation, begin by supposing that

e(t

) =  8 and

d dt

  32 , so that using Figure 2.9 (or Figure 2.10) we see that 

zero

   0.5

And 

possmall d dt

   0.25

What, for these values of

e(t)

and

d

, is the

dt

certainty of the statement "error is zero

and

change-in-error is possmall" that is the premise from the above rule. We will denote this certainty by 

premise

. 106

There are actually several ways to define it: •

Minimum

: Define

premise

= min{0.5,0.25} = 0.25, that is, using the minimum of the two membership values.

Product

: Define

premise

= (0.5)(0.25) = 0.125, that is, using the product of the two membership values.

107

Do these quantifications make sense? Notice that both ways of quantifying the "

and

" operation in the premise indicate that you can be no more certain about the conjunction of two statements than you are about the individual terms that make them up (note that

0  

premise

 1

for either case). If we are not very certain about the truth of one statement, how can we be any more certain about the truth of that statement "

and

" the other statement?

108

While we have simply shown how to quantify the "and" operation for one value of

e(t)

and

d

if we consider all possible

e(t)

and

d , dt

values,

dt

we will obtain a multidimensional membership function and

d

premise

,

d dt

that is a function of

e(t)

for each rule. For our example, if we

dt

choose the minimum operation to represent the "and" in the premise, then we get the multidimensional membership function

d

premise

,

dt

shown in Figure 2.11.

109

premise

  4

d d t

 8  16  4

r a d

/ s e c    4  4

r a d

Figure 2.11 Membership function of the premise for a single rule

110

Notice that if we pick values for

e(t) d

and

,

the

dt

value of the premise certainty 

premise

,

d dt

represents how certain we are that the rule

If

error is zero

and Then

change-in-error is possmall force is negsmall is applicable for specifying the force input to the plant. As

e(t)

and 

premise

,

d dt d

 

dt

e

change, the value of changes according to Figure 2.11, and we become less or more certain of the applicability of this rule.

111

In general we will have a different premise membership function for each of the rules in the rule-base, and each of these will be a function of

d

e(t) and

dt

so that given specific values of e(t) and

d

we obtain a quantification of the

dt

certainty that each rule in the rule-base applies to the current situation. It is important you picture in your mind the situation where e(t) and

d dt

change dynamically over time. When this occurs

d

the values of

premise e

,

e

for each rule

dt

change, and hence the applicability of each rule in the rule-base for specifying the force input to the pendulum, changes with time.

112

Determining Which Rules Are On

Determining the applicability of each rule is called " matching ." We say that a rule is "on at time t" if its premise membership function

premise

,

d dt

   0

. Hence, the inference mechanism seeks to determine which rules are on to find out which rules are relevant to the current situation. In the next step, the inference mechanism will seek to combine the recommendations of all the rules to come up with a single conclusion.

113

Consider, for the inverted pendulum example, how we compute the rules that are on. Suppose that

 0

And

d dt e

  8   32  0.294

114

-2 -1 “neglarge” “negsmall” 0 “zero” 1 “possmall” 2 “poslarge”   2   4 -2 -1 “neglarge” “negsmall” 0 “zero”  4  2

e

1 “possmall” 2 “poslarge”

r a d

.

   4   8  1 6  8  4

d d t r a d

.

 Figure 2.12 Input membership functions with input values 115

Figure 2.12 shows the membership functions for the inputs and indicates with thick black vertical lines the values above for

e(t)

and

d dt e t

  Notice that but that the other

.

membership functions for the

e(t)

input are all " off ' (i.e., their values are zero).

d

the

dt possmall

input we see that (

d

 0.75

zero

(

d

For

dt

and that all the other

dt

membership functions are off. This implies that rules that have the premise terms 116

"error is zero" "change-in-error is zero" "change-in-error is possmall" are on (all other rules have 

premise d

,

dt

   0 .

So, which rules are these? Using Table 2.1, we find that the rules that are on are the following: 1.

If

error is zero and change-in-error is zero

Then

force is zero 2.

If

error is zero and change-in-error is possmall

Then

force is negsmall 117

Note that since for the pendulum example we have at most two membership functions overlappin g, we will never have more than four rules on at one time (this concept generalizes to many inputs). Actually, for this system we will either have one, two, or four rules on at any one time. To get only one rule on choose, for example, e(t) = 0

and

d dt

 8

so that only rule 2 above is on.

118

It is useful to consider pictorially which rules are on. Consider Table 2.2, which is a copy of Table 2.1 with boxes drawn around the consequents of the rules that are on (notice that these are the same two rules listed above). Notice that since e(t) = 0 (e(t) is directly in the middle between the membership functions for "possmall" and "negsmall") both these membership functions are off. If we perturbed e(t) slightly positive (negative), then we would have the two rules below (above) the two highlighted ones on also.

119

TABLE 2.2 Rule Table for the Inverted Pendulum with Rules That Are "On" Highlighted.

“ “ force”

u

erro r”

e

-2 -1 0 1 2 -2 2 2 2 1 0 “ change-in-error”

ė

-1 2 2 1 0 -1 0 2 1 0 -1 -2 1 1 0 -1 -2 -2 2 0 -1 -2 -2 -2 120

With this, you should picture in your mind how a region of rules that are on will dynamically move around in the table as the values of e(t) and

d dt

change. This completes our description of the "matching" phase of the inference mechanism.

121

2.2.5 Inference Step: Determining Conclusions

How do we determine conclusions?

Next, we consider how to determine which conclusions should be reached when the rules that are on are applied to deciding what the force input to the cart carrying the inverted

pendulum should be. To do this, we will

first consider the recommendations

of each rule

independently. Then later we will

combine all the recommendations from all the rules

determine the force input to the cart.

to

122

Recommendation from One Rule

Consider the conclusion reached by the rule

If

error is zero and change-in-error is zero

Then

force is zero which for convenience we will refer to as "rule (1)." Using the minimum to represent the premise, we have (the notation  

premise

  

premise

     0.25

represents for rule (1)) so that we are 0.25 certain that this rule applies to the current situation. The rule indicates that if its premise is true then the action indicated by its consequent should be taken. 123

For rule (1) the consequent is "force is zero" The membership function for this consequent is shown in Figure 2.13(a). The membership function for the conclusion reached by rule (1) , which we denote by  , is shown in Figure 2.13(b) and is given by   

zero

 124

This membership function defines the "

implied fuzzy set

" for rule (1) (i.e., it is the conclusion that is implied by rule (1)).

The justification for the use of the minimum operator to represent the implication is that we can be no more

certain about our consequent than our premise.

We could use the product operation to represent the implication also.

125

Notice that the membership function

is a function of

u and

will generally " that the minimum operation chop off the top" of the

zero

 

membership function to produce

. For

d

different values of e(t) and there will be

dt

different values of the premise certainty

premise

     ,

d dt

  

for rule (1) and hence different functions

obtained (i.e., it will chop off the top at different points).

126

0 “zero” -10 10 0 “zero” -10 10 0.25

FIGU RE 2.13 (a) Consequent membership function and (b) implied fuzzy set with membership function M(i)(«) for rule (1). Recall that the units for

u(t)

are Newtons (N).

127

We see that function

is in general a time-varying that quantifies how certain rule (1) is that the force input u should take on certain values. It is most certain that the force input should lie in a region around zero (see Figure 2.13(b)), and it indicates that it is certain that the force input should not be too large in either the positive or negative direction—this makes sense if you consider the linguistic meaning of the rule. The membership function

 

quantifies the conclusion reached by only rule (1) and only for the current e(t) and

d dt

.

128

Recommendation from Another Rule

Next, consider the conclusion reached by the other rule that is on,

If

error is zero

and

change-in-error is possmall

Then

force is negsmall which for convenience we will refer to as "rule (2)." Using the minimum to represent the premise, we have 

premise

     0.75

so that we are 0.75 certain that this rule applies to the current situation. Notice that we are much more certain that rule (2) applies to the current situation than rule (1). 129

For rule (2) the consequent is "force is negsmall" (this makes sense, for here the pendulum is perfectly balanced but is moving in the counterclockwise direction with a small velocity). The membership function for this consequent is shown in Figure 2.14(a). The membership function for the conclusion reached by rule (2), which we denote by

, is shown in Figure 2.14(b) (the shaded region) and is given by

   

negsmall

 130

This membership function defines the implied fuzzy set for rule (2) (i.e., it is the conclusion that is reached by rule (2)). Once again, for different values of e(t) and

d dt

there will be different values of

premise

  ,

d dt

for rule(2)and hence different function obtained. Rule (2) is quite certain that the control output (process input) should be a small negative value. This makes sense since if the pendulum has some counterclockwise velocity then we would want to apply a negative force (i.e., one to the left). As rule (2) has a premise membership function that has higher certainty than for rule (1), we see that we are more certain of the conclusion reached by rule (2).

131

-1 “negsamll” -20 -10 -1 “negsamll” 0.75

-20 -10 FIGURE 2.14 (a) Consequent membership function and (b) implied fuzzy set with membership function for rule (2).

132

This completes the operations of the inference mechanism in Figure 2.1. While the input to the inference process is the set of rules that are on, its output is the set of implied fuzzy sets that represent the conclusions reached by all the rules that are on.

For our example, there are at most four conclusions reached since there are at most four rules on at any one time. (In fact, you could say that there are always four conclusions reached for our example, but that the implied fuzzy sets for some of the rules may have implied membership functions that are zero for all values.)

133

2.2.6 Converting Decisions into Actions

Next, we consider the defuzzification operation , which is the final component of the fuzzy controller shown in Figure 2.1. Defuzzification operates on the implied fuzzy sets produced by the inference mechanism and combines their effects to provide the "most certain" controller output (plant input).

Some think of defuzzification as "decoding" the fuzzy set information produced by the inference process (i.e., the implied fuzzy sets) into numeric fuzzy controller outputs.

134

To understand defuzzification, it is best to first draw all the implied fuzzy sets on one axis as shown in Figure 2.15. We want to find the one output, which we denote by

u crisp

that best represents the conclusions of the fuzzy controller that are represented with the implied fuzzy sets. There are actually many approaches to defuzzification.

135

Combining Recommendations

Due to its popularity, we will first consider the " center of gravity " (COG) defuzzification method for combining the recommendations represented by the implied fuzzy sets from all the rules. Let

b i

, denote the center of the membership function (i.e., where it reaches its peak for our example) of the consequent of rule (i). For our example we have

b 1 =0.0

136

and

b 2

= -10 as shown in Figure 2.15. Let

 

denote the area under the membership function

The COG method computes to be

u crisp

i b i

  

 

(2.1) This is the classical formula for computing the center of gravity. In this case it is for computing the center of gravity of the implied fuzzy sets . .

137

-1 “negsamll” 0 “zero” -30 -20 -10 10 20 30 FIGURE 2.15 Implied fuzzy sets.

138

Three items about Equation (2.1) are important to note: 1. Practically, we cannot have output membership functions that have infinite area since even though they may be "chopped off' in the minimum operation for the implication (or scaled for the product operation) they can still end up with infinite area.

This is the reason we do not allow infinite area membership functions for the linguistic values for the controller output (e.g., we did not allow the saturated membership functions at the outermost edges as we had for the inputs shown in Figure 2.9). 139

3.

2. You must be careful to define the input and output membership functions so that the sum in the denominator of Equation (2.1) is not equal to zero no matter what,the inputs to the fuzzy controller are.

Essentially, this means that we must have some sort of conclusion for all possible control situations we may encounter .

While at first glance it may not appear so, easy to compute for our example.

is For the case where we have symmetric triangular output membership functions that peak at one and have a base width of w, simple geometry can be used to show that the area under a triangle “chopped off” at a height of h is equal to

  

h

h

2 2   140

Given this, the computations needed to compute are not too significant.

We see that the property of membership functions being symmetric for the output is important since in this case no matter whether the minimum or product is used to represent the implication, it will be the case that the center of the implied fuzzy set will be the same as the center of the consequent fuzzy set from which it is computed. If the output membership functions are not symmetric, then their centers, which are needed in the computation of the COG, will change depending on the membership value of the premise. This will result in the need to recompute the center at each time instant.

141

Using Equation (2.1) with Figure 2.15 we have

u crisp

 4.375

  10  9.375

 4.375

 9.375

  6.81

as the input to the pendulum for the given

e(t)

and

d dt .

Does this value for a force input (i.e., 6.81 Newtons to the left) make sense? Consider Figure 2.16, where we have taken the implied fuzzy sets from Figure 2.15 and simply added an indication of what number COG defuzzification says is the best representation of the conclusions reached by the rules that are on. Notice that the value of

u crisp

is roughly in the middle of where the implied fuzzy sets say they are most certain about the value for the force input. 142

In fact, recall that we had

e{t} = O d

and

dt

  8   32   0.294

 so the pendulum is in the inverted position but is moving counterclockwise with a small velocity; hence it makes sense to pull on the cart, and the fuzzy controller does this.

It is interesting to note that for our example it will be the case that  20 

u crisp

 20 143

To see this, consider Figure 2.17

, where we have drawn the output membership functions. Notice that even though we have extended the membership functions at the outermost edges past -20 and +20 (see the shaded regions), the COG method will never compute a value outside this range.

The reason for this comes directly from the definition of the COG method in Equation (2.1). The center of gravity for these shapes simply cannot extend beyond 20 and +20. Practically speaking, this ability to limit the range of inputs to the plant is useful; it may be the case that applying a force of greater than 20 Newtons is impossible for this plant. Thus we see that in defining the membership functions for the fuzzy controller, we must take into account what method is going to be used for defuzzification.

144

-1 “negsamll” 0 “zero” -30 -20 -10 10 20 30

u crisp

  6.81

FIGURE 2.16 Implied fuzzy sets 145

-2 -1 “neglarge” “negsmall” 0 “zero” 1 “possmall” 2 “poslarge” -30 -20 -10 10 20 30 FIGURE 2.17 Output membership functions.

146

Other Ways to Compute and Combine Recommendations

As another example, it is interesting to consider how to compute, by hand, the operations that the fuzzy controller takes when we use the product to represent the implication or the "center-average" defuzzification method.

First, consider the use of the product. Consider Figure 2.18, where we have drawn the output membership functions for "negsmall" and "zero" as dotted lines.

147

The implied fuzzy set from rule (1) is given by the membership function     0.25

zero

shown in Figure 2.18 as the shaded triangle; and the implied fuzzy set for rule (2) is given by the membership function 

 

 0.75

negsmall

shown in Figure 2.18 as the dark triangle. Notice that 1 computation of the COG is easy since we can use 2 as the area for a triangle with base width

w

and 

h

height

h.

When we use 2.5

  10

u crisp

  7.5

   7.5

2.5

 7.5

product to represent the implication, we obtain which also makes sense.

148

-30 -1 “negsamll” 0 “zero” 0.75

-20 -10 10 0.25

20 30 FIGURE 2.18 Implied fuzzy sets when the product is used to represent the implication.

149

Next, as another example of how to combine recommendations, we will introduce the " center average" method for defuzzification. For this method we let

u crisp

 

i i b i

 

(2.2) where to compute

we use, for example, minimum. We call it the "center-average" method since Equation (2.2) is a weighted average of the center values of the output membership function centers.

Basically, the center-average method replaces the areas of the implied fuzzy sets that are used in COG with the values of

.

150

 This is a valid replacement since the area of the implied fuzzy set is generally proportional to  since is used to chop the top off (minimum) or scale (product) the triangular output membership function when COG is used for our example. For the above example, we have

u crisp

 0.25

  10  0.75

 0.25

 0.75

  7.5

which just happens to be the same value as above. Some like the center-average defuzzification method because the computations needed are simpler than for COG and because the output membership functions are easy to store since the only relevant information they provide is their center values (

b i

just their center value).

) (i.e., their shape does not matter, 151

Notice that while both values computed for the different inference and defuzzification methods provide reasonable command inputs to the plant, it is difficult to say which is best without further investigations (e.g., simulations or implementation). This ambiguity about how to define the fuzzy controller actually extends to the general case and also arises in the specification of all the other fuzzy controller components, as we discuss below. Some would call this " ambiguity " a design flexibility , but unfortunately there are not too many guidelines on how best to choose the inference strategy and defuzzification method, so such flexibility is of questionable value.

152

2.2.7 Graphical Depiction of Fuzzy Decision Making

For convenience, we summarize the procedure that the fuzzy controller uses to compute its outputs given its inputs in

Figure 2.19

. Here, we use the minimum operator to represent the "and" in the premise and the implication and COG defuzzification. Then, repeat the process when center-average defuzzification is used with either minimum or product used for the premise. Also, learn how to picture in your mind how the parameters of this graphical representation of the fuzzy controller operations change as the fuzzy controller inputs change.

153

“zero” “zero” “zero”   4  4

e

  8  16  8

d dt

-10 10

u

If error is zero and chang-in-error is zero Then force is zero 0.25

N

 “zero” “possmall” “negsamll” 0.75

  4  4

e

   16  8  4

d dt

  -20 -10

u

  

N

If error is zero and chang-in-error is possmall Then force is negsamll  “negsamll” “zero” -20 -10

u c ris p

  6 .8 1 10

u N

 FIGURE 2.19 Graphical representation of fuzzy controller operations.

154

This completes the description of the operation of a simple fuzzy controller. You will find that while we will treat the fully general fuzzy controller in the next section, there will be little that is conceptually different from this simple example. We simply show how to handle the case where there are more inputs and outputs and show a fuller range of choices that you can make for the various components of the fuzzy controller.

155

As evidenced by the different values obtained by using the minimum, product, and defuzzification operations, there are many ways to choose the parameters of the fuzzy controller that make sense . This presents a problem since it is almost always difficult to know how to first design a fuzzy controller. Basically, the choice of all the components for the fuzzy controller is somewhat ad hoc.

What are the best membership functions?

How many linguistic values and rules should there be?

Should the minimum or product be used to represent the "and" in the premise—and which should be used to represent the implication?

What defuzzification method should be chosen?

These are all questions that must be addressed if you want to design a fuzzy controller.

156

2.2.8 Visualizing the Fuzzy Controller's Dynamical Operation

The figure on the cover of the book can serve as a nice visual depiction of how a fuzzy system operates dynamically over time. The figure represents a fuzzy system with two inputs, for example, e, and

e

, and one output u. There are triangular membership functions on the two input universes of discourse, and minimum is used to represent the conjunction in the premise. The blue pyramids represent the premise certainties of the rules in a rule-base with 49 rules.

157

Note that for simplicity of the graphic, the outermost membership functions do not saturate in this fuzzy controller; hence if e or

e

goes outside the range it appears that there will be no rules on, so the defuzzification will fail. Actually, the pyramids should be viewed as part of a rule base with many more rules, and only the central ones for the rule-base are shown for simplicity.

158

159

The shading from blue , to progression in

time

red , to yellow , on the pyramids indicates of rules that were (are) on (i.e., the pyramids describing their premises had nonzero certainties) and the two in the middle that are fully shaded in yellow are the two rules that are on now . The pyramids with are ones that were on some blue some time ago . on them , and The ones with red, some red and , some yellow , were on more recently , little less red shading and while more yellow the ones that have a were on even more recently .

The pyramids that are entirely blue , either were never turned on , or they were on a long time ago . Hence, the path of color (blue to red to yellow) could have traveled all over a large landscape of blue pyramids. At this time the path has come very near the

e = 0

,

e

 0 location in the rule-base and this is normally where you want it to be (for a tracking problem where

e= r- y

where want

e = 0

if

y r

is the reference input and is to track

r

).

y

is the plant output we 160

The colored vertical beam holds the four numbers that are the premise certainties for the four rules that are on now. Note that two of the rules that are on, are on with a certainty of zero, so really they are off and this is why they go to the output universe of discourse (top horizontal axis) at the zero level of certainty (see the top figure with the tan-colored output membership functions). The colored vertical beam contains only green and orange since these represent the values of the premise certainties from the two rules that are on. The beam does not have any purple or pink in it as these colors represent the zero values of the premises of the two rules that are off (we have constructed the rule-base so that there are at most four rules on at any time). The green and orange values chop the tops off two triangular output membership functions that then become the implied fuzzy sets (i.e., we use minimum to represent the implication). The defuzzified value is shown as the arrow at the top (it looks like a COG defuzzification).

161

2.3 General Fuzzy Systems

In the previous section we provided an intuitive overview of fuzzy control via a simple example. In this section we will take a step back and examine the more general fuzzy system to show the range of possibilities that can be used in defining a fuzzy system and to solidify your understanding of fuzzy systems. In particular, we will consider the case where there are many fuzzy controller inputs and outputs and where there are more

general membership functions

,

fuzzification procedures

,

inference strategies

, and

defuzzification methods

. Moreover, we introduce a class of "

functional fuzzy systems

" that have been found to be useful in some applications and characterize the general capabilities of fuzzy systems via the " universal approximation property ." 162

2.3.1 Linguistic Variables, Values, and Rules

A fuzzy system is

its inputs and outputs

system). It is assumed that the fuzzy system has inputs where

u i

U ,

a static nonlinear mapping between

where

i = 1,2,..., m, i = 1,2,..., n

as shown in Figure 2.20. The inputs and outputs are " (i.e., it is not a dynamic crisp and outputs

y i

Y i

"—that is, they are real , numbers, not fuzzy sets. The

fuzzification block converts the crisp inputs to fuzzy sets

, the

inference mechanism uses the fuzzy rules in the rule-base to produce fuzzy conclusions

(e.g., the implied fuzzy sets), and

outputs.

the defuzzification block converts these fuzzy conclusions into the crisp

163

Crisp inputs

u

1

u

2 .

.

u

.

n

Fuzzified inputs Fuzzy conclusions Inference mechanism Rule-base

y

1 Crisp outputs

y

2 .

.

.

y m

Figure 2.20 Fuzzy System 164

Universes of Discourse

The ordinary ("crisp") sets

U i

and "

universes of discourse

" for

u i Y i

and are called the

y i ,

respectively (in other words, they are their domains). In practical applications, most often the universes of discourse are simply the set of real numbers or some interval or subset of real numbers. Note that sometimes for convenience we will refer to an " effective" universe of discourse     are the points at which the outermost membership functions saturate for input universes of discourse, or the points beyond which the outputs will not move for the output universe of discourse. 165

For example, for the

e(t)

universe of discourse in Figure 2.12 we have     2 and    2 ; or for the

u(t)

universe of discourse in Figure 2.17, we have    20 and   20 . However, the actual universe of discourse for both the input and output membership functions for the inverted pendulum is the set of all real numbers. When we refer to effective universes of discourse, we will say that the "width" of the universe of discourse is .

166

Linguistic Variables

To specify rules for the rule-base, the expert will use a " linguistic description "; hence, linguistic expressions are needed for the inputs and outputs and the characteristics of the inputs and outputs. We will use " linguistic variables " (constant symbolic descriptions of

~

what are are in general time-varying

i

quantities) to describe fuzzy system inputs and outputs.

167

For our fuzzy system, linguistic variables

~

denoted by

u i

are used to describe the inputs u

i

. Similarly, linguistic variables denoted by

~

y i

are used to describe outputs

y i

. For instance, an input to the fuzzy

~

system may be described as

u

1 ~

="position error" or

u

="velocity error," and an

2

output from the fuzzy system may be

~

y

1

="voltage in."

168

Linguistic Values

Just as

u i

and

y i

take on values over each universe of discourse and

Y i

, respectively, linguistic variables

u

~ and ~

y i

, take on

U i

"

linguistic values

" that are used to describe characteristics of the ~ variables. Let variable ~

u i A i j

denote the , defined over the universe of discourse assume that there exist many linguistic values defined over ~

j th

linguistic value of the linguistic

U i

. If we

U i

, then the linguistic variable

u i

, takes on the elements from the set of linguistic values denoted by ~

A i

 {

A i j

:

j

 1, 2, ,

N i

} (sometimes for convenience we will let the

j

indices take on negative integer values, as in the inverted pendulum example where we used the linguistic-numeric values). 169

Similarly, let ~

B i j

denote the

j th

~ linguistic variable

y i

linguistic value of the defined over the universe of discourse

Y i

, The linguistic variable ~

y i

, takes on elements from the set of linguistic values denoted by ~

B i

 ~

B i p

:

p

 1, 2, ...,

M i

(sometimes for convenience we will let the

p

indices take ~ 2

A

1 on negative integer values). Linguistic values are generally descriptive terms such as "positive large," "zero," and "negative big" (i.e., adjectives). For ~ example, if we assume that

u

1 ~

i

denotes the linguistic variable "speed," then we may assign ~ 1

A

1 = "slow," = "medium," and ~ 3

A

1 = "fast" so that has a value from ~ ~ ~ ~

A

1

A

1 1 ,

A

2 1 ,

A

3 1 170

Linguistic Rules

The mapping of the inputs to the outputs for a fuzzy system is in part characterized by a set of

condition action

rules, or in

modus ponens

(If Then) form,

If

premise

Then

consequent. (2.3) Usually, the

inputs

of the fuzzy system

are associated with the premise

, and

the outputs are associated with the consequent

.

171

These If-Then rules can be represented in many forms. Two standard forms, multi-input multi output (MIMO) and multi-input single-output (MISO), are considered here. The MISO form of a linguistic rule is ~ ~ ~ ~

If u is A and u is A and

1 1

j

2

k

2 , , ~ ~ ~ ~

l and u is A Then y is B n n q q p

(2.4) It is an entire set of linguistic rules of this form that the expert specifies on how to control the system.

172

Note that if ~

u

1 large," then “ ="velocity error" and ~ ~

u

1 is

A

1

j

,

~

A

1

j

="positive a single term in the premise of the rule, means "velocity error is positive large." It can be easily shown that the MIMO form for a rule (i.e., one with consequents that have terms associated with each of the fuzzy controller outputs) can be decomposed into a number of MISO rules using simple rules from logic. 173

For instance, the MIMO rule with

n

inputs and m = 2 outputs ~ ~ ~ ~

If u is A and u is A and

1 1

j

2 2

k

, , ~

n

~

n

~ 1 ~ 1 ~

and u is A Then y is B and y is B

2 ~ 2

s

is linguistically (logically) equivalent to the two rules ~ ~ ~ ~

If u is A and u is A and

1 1

j

2

k

2 , , ~ ~ ~ ~

l and u is A Then y is B n n

1 1

r

~ ~ ~ ~

If u is A and u is A and

1 1

j

2

k

2 , , ~ ~ ~ ~

l and u is A Then y is B n n

2 2

s

This is the case since the logical "and" in the consequent of the MIMO rule is still represented in the two MISO rules since we still assert that both the first "and" second rule are valid. 174

For implementation, we would specify two fuzzy systems, one with output y

1

and the other with output y

2

. The logical "and" in the consequent of the MIMO rule is still represented in the MISO case since by implementing two fuzzy systems we are asserting that 'ones set of rules is true "and" another is true.

We assume that there are a total of R rules in the rule-base numbered 1,2... R, and we naturally assume that the rules in the rule-base are distinct (i.e., there are no two rules with exactly the same premises and consequents); however, this does not in general need to be the case. For simplicity we will use tuples

 , 

i

to denote the MISO rule of the form given in Equation (2.4).

Any of the terms associated with any of the inputs for any MISO rule can be included or omitted.

175

For instance, suppose a fuzzy system has two inputs and ~

y

1 ~

A i

2 ~ one output with

u

1 ~ = "position,"

u

= "velocity," and 2 = "force." Moreover, suppose each input is characterized by two linguistic values ~

A

1

i =

"small" and = 'large" for

i

= 1,2. Suppose further that the output is characterized by two linguistic values ~ and

B

1 2

=

~ 1

B

1 = "negative" "positive." A valid If-Then rule could be

If

position is large

Then

force is positive even though it does not follow the format of a MISO rule given above. In this case, one premise term (linguistic variable) has been omitted from the If-Then rule. We see that we allow for the case where the expert does not use all the linguistic terms (and hence the fuzzy sets that characterize them) to state some rules.

176

Finally,

we note that if all the premise terms are used in every rule and a rule is formed for each possible combination of premise elements, then there are

n

i

 1

N i

N

1

N

2

N n

rules in the rule-base

. For example, if n = 2 inputs and we have

N i =11

membership functions on each universe of discourse, then there are 11 *11 = 121 possible rules. Clearly, in this case the number of rules 177

2.3.2 Fuzzy Sets, Fuzzy Logic, and the Rule-Base

Fuzzy sets and fuzzy logic are used to heuristically quantify the meaning of linguistic variables , linguistic values , and linguistic rules that are specified by the expert . The concept of a fuzzy set is introduced by first defining a " membership function ."

178

Membership Functions

Let

U i

denote a universe of discourse and ~

A i j

 ~

A i

denote a specific linguistic value for the ~ linguistic variable

u i

.

The function

 ~

associated with

A i j

that maps to [0,1] is

i

called a "membership function

." This membership function describes the "certainty" , that an element of

U i

description ~

u i

denoted with a linguistic , may be classified linguistically as ~

A i j .

179

Membership functions are subjectively specified in an ad hoc (heuristic) manner from experience or intuition

.

For instance, if = [-150,150], ~ error," and

A i j

~

u i

="velocity ="positive large," then   

i

may ~

u i

be a bell-shaped curve that peaks at one at ~ = 75 and is near zero when ~

u i

< 50 or

u i

> 100. Then if

u i

absolutely certain that

u i u i

= -25 then  "positive large." = 75,    = 1, so we are is "positive large." If is very near zero, which represents that we are very certain that

u i

, is not 180

Clearly, many other choices for the shape of the membership function are possible (e.g., triangular and trapezoidal shapes), and these will each provide a different meaning for the linguistic values that they quantify. See Figure 2.21 for a graphical illustration of a variety of membership functions and Tables 2.3 and 2.4 for a mathematical characterization of the triangular and Gaussian membership functions (other membership functions can be characterized with mathematics using a similar approach).

181

 Figure 2.21 Some typical membership functions

u i

182

Triangular membership functions Left Centers  

C L

 1     max 0,1 

c L

0.5

w u L

       0.5

w

0.5

w if u

c L otherwise if u

c otherwise

Right 

R

   1  max 0,1  0.5

w R R if u

c R otherwise

TABLE 2.3 Mathematical Characterization of Triangular Membership Functions 183

Left Centers 

L

 Gaussian membership functions   1    exp   2 

u

 

L c L

 2    exp    1 2

u

 

L c

2  

if u

c L otherwise

Right 

R

    exp 1    1 2  

u

 

R c R

 2  

if u

c R otherwise

TABLE 2.4 Mathematical Characterization of Gaussian Membership Functions 184

For practice, you should sketch the membership functions that are described in Tables 2.3 and 2.4. Notice that for Table 2.3

C

" saturation point " and

L L

specifies the specifies the slope Similarly, for

R

. For

C

notice that c is the center of the triangle and w is the base-width. Analogous definitions are used for the parameters in Table 2.4.

185

In Table 2.4, for the "centers" case note that this is the traditional definition for the

Gaussian membership function

. This definition is clearly different from a standard Gaussian probability density function, in both the meaning of

c

and 

,

and in the scaling of the exponential function .

Recall that it is possible that a Gaussian probability density function has a maximum value achieved at a value other than one; the standard Gaussian membership function always has its peak value at one.

186

Fuzzy Sets

Given a linguistic variable ~

u i

with a linguistic value ~

A i j

defined on the universe of discourse

U i ,

and membership function 

A i j

(membership function associated with the fuzzy set

)

that maps with

A i j

A i

 

j u i

is defined as , 

j

 :

A i U i u i

to [0,1], a "fuzzy set" denoted 

U i

 (2.5) ( notice that a fuzzy set is simply a crisp set of pairings of elements of the universe of discourse coupled with their associated membership values ). 187

For example, suppose we assign a linguistic ~ variable

u

1 = "temperature" and the linguistic value ~

A

1 = "hot," then

A

1 1 is a fuzzy set whose membership function describes the degree of certainty that the numeric value of the temperature,

u

1 characterized by 

U A

1 ~ 1 1 , possesses the property .

Additional concepts related to membership functions and fuzzy sets are covered in the following: 188

"

Support of a fuzzy set

":

The set of points on the universe of discourse where the membership function value is greater than zero.

"α-cut":

The set of points on the universe of discourse where the membership function value is greater than

a.

"

Height

" of a fuzzy set or membership function:

The peak value reached by the membership function.

"

Normal

" fuzzy sets:

Ones with membership functions that reach one for at least one point on the universe of discourse.

189

"

Convex fuzzy sets

":

Ones that satisfy a certain type of convexity condition that is given in Equation (2.29) on page 98, •

"

Linguistic hedges

":

Mathematical operations on membership functions of fuzzy sets that can be used to change the meaning of the underlying linguistics.

"

Extension principle

":

If you are given a function that maps some domain into some range and you have membership functions defined on the domain, the extension principle shows how to map the membership functions on the domain to the range.

190

Fuzzy Logic

Next, we specify some set-theoretic and logical operations on fuzzy sets.

191

Fuzzy Subset

Given fuzzy sets

A i

1 and universe of discourse functions 

A i

1  

i A i

2 

i

associated with the  2  , with membership denoted and 

A i

2  

i

, respectively, subset" of for all

i

i A i

2

.

A

1

i

is defined to be a "fuzzy , denoted by

A i

1 

A i

2 , if

A i

1  

A i

2 192

Fuzzy Complement

The complement ("not") of a fuzzy set a membership function 

A i

1  

i

has a membership function given by 1  

A i

1

A i

1 with  

i

.

193

Fuzzy Intersection (AND)

The intersection of fuzzy sets

A i

1 on the universe of discourse by

A i

1 

A i

2 and

U i A i

2 , which are defined , is a fuzzy set denoted , with a membership function defined by either of the following two methods: 1.

Minimum

:

Here, we find the minimum of the membership values as in 

A

1

i

A i

2  min  

A i

1 , 

A i

2 :

u i

U i

 (2.6) 2.

Algebraic Product

:

Here, we find the product of the membership values as in 

A i

1 

A i

2  min  

A i

1

   

A i

2

u i

:

u i

U i

 (2.7) 194

Other methods can be used to represent intersection (and), but the two listed above are the most commonly used. Suppose that we use the notation  min

 

, or at other times we will use it to denote the product 

xy

(* is sometimes called the "

triangular norm

"). Then 

A i

1 * 

A i

2 is a general representation for the intersection of two fuzzy sets.

In fuzzy logic, intersection is used to represent the "and" operation.

195

“blue” “green” color “blue and green”

FIGURE 2.22 A membership function for the "and" of two membership functions.

196

For example, if we use minimum to represent the "and" operation, then the shaded membership function in Figure 2.22 is

A

1

i

A i

2

, which is formed from the two others( ). This

A i

1  

i A i

2  

i

quantification of "and" provides the fundamental justification for our representation of the "and" in the premise of the rule.

197

Fuzzy Union (OR)

The union of fuzzy sets

A i

1 the universe of discourse and

U i

by

A i

1 

A i

2

A i

2 , which are defined on , is a fuzzy set denoted , with a membership function defined by either one of the following methods: 1.

Maximum

:

Here, we find the maximum of the membership values as in 

A i

1 

A i

2  max  

A i

1 , 

A i

2 :

u i

U i

 (2.8) 2.

Algebraic Sum

:

Here, we find the algebraic sum of the membership values as in 

A i

1 

A i

2   

A i

1  

A i

2  

A i

1 

A i

2 :

u i

U i

 (2.9) 198

Other methods can be used to represent union (or), but the two listed above are the most commonly used. Suppose that we use the notation

x

max  

, or at other times we will use it to denote

x

(

is sometimes called the " triangular co-norm is a general representation for the union of two fuzzy sets. In fuzzy logic, union is used to represent the "or" operation . For example, if we use maximum to represent the "or" operation, then the shaded membership function in Figure 2.23, is which is formed from the two others

 1   

This quantification of "or" provides the

i

premise-2 Then consequent-2," or so on).

A

1

i

"). Then fundamental justification for the "or" that

A i

2

and

 

A i

1

A i

2

inherently lies between the rules in the rule-base

,

(note that we interpret the list of rules in the rule base as "If premise-1 Then consequent-1" or "If

 

.

199

A i

2

Note that in the case where we form the "

overall implied fuzzy set

" (to be defined more carefully below) this "or" between the rules is quantified directly with “ " as it is described above. If we use only the implied fuzzy sets (as we did for the inverted pendulum problem in the last section), then the "or" between the rules is actually quantified with the way the defuzzification operation works (consider the way that the COG defuzzification method combines the effects of all the individual implied fuzzy sets).

200

“blue” “green” “blue or green” color FIGURE 2.23 A membership function for the "or" of two membership functions.

201

Fuzzy Cartesian Product

The intersection and union above are both defined for fuzzy sets that lie on the same universe of discourse

.

The fuzzy Cartesian product is used to quantify operations on many universes of discourse

. If

A

1

j

,

A k

2 , ,

A l n

are fuzzy sets defined on the universes of discourse

U U

1 , 2 , ,

U n ,

respectively, their Cartesian product is a fuzzy set (sometimes called a "fuzzy relation"), denoted by function defined by 

j A

1

j

   2

A l n

A n l

1 , , 2 , with a membership

u n

  

A

1

j

  1 * 

A

2

k

  2 * * 

A n l

 

n

202

Why the "*" operation is used here?

Basically, it arises from our interpretation of a standard Cartesian product, which is formed by taking an element from the first element of the product "and" the second element of the product "and" so on. Clearly, in light of this interpretation, the use of "*" and hence "and" makes sense. Note that the "ands" used in the Cartesian product actually represent the "ands" used in the rule premises since normally each of the terms in a premise comes from a different universe of discourse.

203

Fuzzy Quantification of Rules: Fuzzy Implications

Next, we show how to quantify the linguistic elements in the premise and consequent of the linguistic If-Then rule with fuzzy sets. For example, suppose we are given the If-Then rule in MISO form in Equation (2.4). We can define the fuzzy sets as follows:

j A k

2   

u

1 

u

2 , ,  

j A k

2  

u

1

u

2   : :

u

1

u

2 

U

 1

U

  2

A l n p B q

M  

u

 

y n q

, ,  

A l n B p q

u n

y q

  :

u n

:

y q

U

n Y q

  (2.10) 204

These fuzzy sets quantify the terms in the premise and the consequent of the given If-Then rule, to make a " fuzzy implication " (which is a fuzzy relation )

If A

1

j and A k

2 , K ,

l and A Then B n q p

quantification of the linguistic rule).

(2.11) where the fuzzy sets

A

1

j

,

A k

2 , K ,

l n q p

are defined in Equation (2.10). Therefore, the fuzzy set

A

1

j

is associated with, and quantifies the meaning of the linguistic statement “ meaning of

~ which we denote by

~

u is A

~

y is B q q p ."

K ~ 1

j

" and

B q p

quantifies the Each rule in the rule-base,

i

,

i

 1, 2, K is represented with such a fuzzy implication (a fuzzy 205

There are two general properties of fuzzy logic rule-bases that are sometimes studied. These are "

completeness

" (i.e., whether there are conclusions for every possible fuzzy controller input) and "

consistency

" (i.e., whether the conclusions that rules make conflict with other rules' conclusions).

206

2.3.3 Fuzzification

Fuzzy sets are used to quantify the information in the rule base , and the inference mechanism operates on fuzzy sets to produce fuzzy sets ; hence, we must specify how the fuzzy system will convert its numeric inputs

u i

U i

, into fuzzy sets (a process called " fuzzification ") so that they can be used by the fuzzy system.

Let

U i

* denote the set of all possible fuzzy sets that can be defined on transforms

U u i i .

Given

u i

U i ,

fuzzification to a fuzzy set denoted by defined on the universe of discourse

U i i fuz

transformation is produced by the fuzzification operator

F

:

F

defined by

U i

U

*

i .

This where

F

u i

 

i fuz

207

Quite often "

singleton fuzzification

" is used, which produces a fuzzy set

i fuz

U i

*

membership function defined by

A i fuz

  1 0

x

u i otherwise

with a Any fuzzy set with this form for its membership function is called a "singleton." For a picture of a singleton membership function, see the

single vertical line shown in

Figure 2.21

. Note

that the discrete impulse function can be used to represent the singleton membership function.

208

Basically, the reader should simply think of the singleton fuzzy set as a different representation for the number u

i

. Singleton fuzzification is generally used in implementations since, without the presence of noise, we are absolutely certain that , takes on its measured value (and no other value), and since it provides certain savings in the computations needed to implement a fuzzy system (relative to, for example, "Gaussian fuzzification," which would involve forming bell-shaped membership functions about input points, or triangular fuzzification, which would use triangles).

209

Since most practical work in fuzzy control uses singleton fuzzification, we will also use it throughout the remainder of this book. The reasons other fuzzification methods have not been used very much are (1) they add computational complexity to the inference process and (2) the need for them has not been that well justified.

This is partly due to the fact that very good functional capabilities can be achieved with the fuzzy system when only singleton fuzzification is used.

210

2.3.4 The Inference Mechanism

What are the basic tasks of the inference mechanism ?

The inference mechanism has two basic tasks: (1) determining the extent to which each rule is relevant to the current situation as characterized by the inputs

u i

,

= 1,2,..., n

(we call this task " matching "); and (2)

i

drawing conclusions using the current inputs

u i

and the information in the rule-base (we call this task an " inference step "). For matching note that

A

1

j

A k

2  L 

A l n

is the fuzzy set representing the premise of the

i th

 

rule with this premise).

211

Matching

Suppose that at some time we get inputs

u i

,

i = 1,2,..., n

, and fuzzification produces

A

1

fuz

,

A

2

fuz

, K ,

n fuz

the fuzzy sets representing the inputs. There are then two basic steps to matching.

Step 1: Combine Inputs with Rule Premises:

in matching involves finding fuzzy sets membership functions

A

, ,

A

The first step , , , ,

A

with (for all

j,k,..., l)

that combine the fuzzy sets from fuzzification with the fuzzy sets used in each of the terms in the premises of the rules. 212

If singleton fuzzification is used, then each of these fuzzy sets is a singleton that is scaled by the premise membership function (e.g.,

for u

1  

A

1

j

 0

for u

1 

u

1 with singleton fuzzification we have 

).

A i fuz

That is,

 

i

 1 for all

i = 1,2,..., n

for the given

u i

inputs so that 

A j

 

j

 ˆ

k

2

u

1

u

2

 

A k

2

u

1

u

2

l n

u n

M

 

A l n

u n

213

We see that when singleton fuzzification is used, combining the fuzzy sets that were created by the fuzzification process to represent the inputs with the premise membership functions for the rules is particularly simple . It simply reduces to computing the membership values of the input fuzzy sets for the given inputs (as we had

1 , 2 , K

indicated at the end of Section 2.2.3 for the

,

u n

inverted pendulum).

214

Step 2: Determine Which Rules Are On:

In the second step, we form membership values for the

i th

rule's premise (what we called  

i

u u

1 2 K

premise

in

u n

the last section on the inverted pendulum) that represent the certainty that each rule premise 

i

holds for the given inputs. Define

u u

1 , 2 , K ,

u n

 

A

1

j

 

1 *  ˆ 2

k

 

2 * L * 

A l n

 

n

(2-12) which is simply a function of the inputs

u i

. When singleton fuzzification is used (as it is throughout this entire book), we have 

i

1 , , 2 K ,

u n

 

A

1

j

 

1 * 

A

2

k

 

2 * L * 

A l n

 

n

(2.13) 215

We use

i

u u

1 2 K

u n

to represent the certainty that the premise of rule

i

matches the input information when we use singleton fuzzification.

This

i

u u

1 2 K

u n

is simply a multidimensional certainty surface, a generalization of the surface shown in Figure 2.11(P37) for the inverted pendulum example. It represents the certainty of a premise of a rule and thereby represents the degree to which a particular rule holds for a given set of inputs.

216

Finally, we would remark that sometimes an additional "rule certainty" is multiplied by 

i

Such a certainty could represent our a priori confidence in each rule's applicability and

.

would normally be a number between zero and one. If for rule

i

its certainty is 0.1, we are not very confident in the knowledge that it represents; while if for some rule

j

we let its certainty be 0.99, we are quite certain that the knowledge it represents is true. In this book we will not use such rule certainty factors.

This concludes the process of matching input information with the premises of the rules.

217

Inference Step

How many choices to realize the inference step in fuzzy control? What about them?

There are two standard alternatives to performing the inference step , one that involves the use of implied fuzzy sets (as we did for the pendulum earlier) and the other that uses the overall implied fuzzy set.

Alternative 1: Determine Implied Fuzzy

Sets : Next, the inference step is taken by computing, for the

i th

rule  K , 

i ,

the "implied fuzzy set" since 

i

 

i q

 

q

The implied fuzzy set

q

output should be a specific crisp output of discourse

u u

1 , 2 ,

Y q

K  , ,  ˆ

i u n

B i q i

 membership functions 

B

ˆ

i q

with membership function

u u

1 , 2  

q

, K ,

u n

 * 

p q

specifies the certainty level that the

y q

taking into consideration only rule

i.

Note that will vary with time, so will the shape of the for each rule.  

q

(2.14) within the universe 218

Alteniative 2: Determine the Overall Implied Fuzzy Set:

Alternatively, the inference mechanism could, in addition, compute the "overall implied fuzzy set"

q

with membership function 

B q

    ˆ 1

q

    2

q

 L  

B R q

(2.15)

that represents the conclusion reached considering all the rules in the rule-base at the same time (notice that determining can, in general, require significant

q

computational resources). Notice that we did not consider this possibility for the inverted pendulum example for reasons that will become clearer in the next subsection. Instead, our COG or center-average defuzzification method performed the aggregation of the conclusions of all the rules that are represented by the implied fuzzy sets. 219

Discussion: Compositional Rule of Inference

Using the mathematical terminology of fuzzy sets, the computation of  ˆ

q

  is said to be produced by a "sup-star compositional rule of inference," The "sup" in this terminology corresponds to the  operation, and the "star" corresponds to *. "Zadeh's compositional rule of inference" is the special case of the sup-star compositional rule of inference when maximum minimum is used for *.

220

The overall justification for using the above operations to represent the inference step lies in the fact that we can be no more certain about our conclusions than we are about our premises . The operations performed in taking an inference step adhere to this principle. To see this, you should study Equation (2.14) and note that the scaling from

i

 , 2 , ,

u n

that is produced by the premise matching process will

sup

y q

 

B i q

 

q

  

i

u u

1 , 2 , ,

u n

. The fact that we are no more certain of our consequents than our premises is shown graphically in Figure 2.19

where the heights of the implied fuzzy sets are always less than the certainty values for all the premise terms.

221

Up to this point, quantify the fuzzification we have used fuzzy logic to to rules in produce the rule-base , fuzzy sets characterizing the inputs , and the inference mechanism to produce fuzzy sets representing the conclusions that it reaches after considering the current inputs and the information in the rule-base . Next, we look at how to convert this fuzzy set quantification of the conclusions to a numeric value that can be input to the plant.

222

2.3.5 Defuzzification

A number of defuzzification strategies exist, and it is not hard to invent more. Each provides a means to choose a single output (which we denote with

y q crisp

) based on either the implied fuzzy sets or the overall implied fuzzy set (depending on the type of inference strategy chosen, "Alternative 1 or 2," respectively, in the previous section).

223

Defuzzification: Implied Fuzzy Sets

As they are more common, we first specify typical defuzzification techniques for the implied fuzzy

i

sets

q

: • Center of gravity (COG): A crisp output

y crisp q

is chosen using the center of area and area of each implied fuzzy set, and is given by where 

y q R

 ˆ

i q y y crisp q

is the number of rules, of the membership function of implied fuzzy set  

q

dy

q i R

 1

i q i R

b i q y q

y q

  for the

i q i q i y

 

th q q dy b dy q

rule

q q i B q p

 is the center of area associated with the 

i

, and denotes the area under  ˆ

i q

  224

Notice that COG can be easy to compute since it is often easy to find closed-form expressions for 

y q

 ˆ

i q

 

q dy q

,which is the area under a membership function (see the pendulum example in Section 2.2.6 where this amounts to finding the area of a triangle or a triangle with its top chopped off). Notice that the area under each implied fuzzy set must be computable, so the area under each of the output membership functions (that are used in the consequent of a rule) must be finite (this is why we cannot "saturate" the membership functions at the outermost edges of the output universe of discourse). Also, notice that the fuzzy system must be defined so that

i R

   1

y q

i q

 

dy q

 0 for all

u i

or

y crisp q

will not be properly defined. This value will be nonzero if there is a rule that is on for every possible combination of the fuzzy system inputs and the consequent fuzzy sets all have nonzero area.

225

Center-average

: A crisp output

y q crisp

is chosen using the centers of each of the output membership functions and the maximum certainty of each of the conclusions represented with the implied fuzzy sets, and is given by

y crisp q

  

i R

 1

i R b i q

 1 sup sup

y q

y q

   ˆ

i q i q

 

q

  where "sup" denotes the "supremum" (i.e., the least upper bound which can often be thought of as the maximum value). Hence, sup

x

highest value of 

 

can simply be thought of as the (e.g., sup

u

      0.25

for  when product is used to represent the implication, as shown in Figure 2.18). 226

Also,

b i q

associated with the implied fuzzy set rule  is the center of area of the membership function of 

i i

for the

i th q

. Notice that the fuzzy system must be defined so that

i R

 1 sup

y q

 

B i q

  0 for all

u i

. Also, note that since if 

B p q

 

q

 1 sup

y q

  ˆ

i q

  for at least one  is often very easy to compute

y q

(which is the normal way to define consequent membership functions), then for many inference strategies, using Equation (2.14), we have sup  

i q

    

i

u u

1 , 2 , ,

u n

y q

which has already been computed in the matching process.

Moreover, the formula for defuzzification is then given by

y crisp q

 

i

R

 1

i R b i q

 1 

i

i

 

u u

1 , 2

u u

1 , 2 where we must ensure that for all .

, , , ,

u n u n

  227

Also note that this implies that the shape of the membership functions for the output fuzzy sets does not matter; hence, you can simply use singletons centered at the appropriate positions.

228

Defuzzification: The Overall Implied Fuzzy Set

• Next, we present typical defuzzification techniques for the overall implied fuzzy set

B q

:

Max criterion

: A crisp output

y crisp q

is chosen as the point on the output universe of discourse overall implied fuzzy set is,

B q y q

for which the achieves a maximum—that

y crisp q

Here, “ arg sup

x

    

 

 arg sup

y q

ˆ

i q

 

q

    " returns the value of

x

that results in  the supremum of the function being achieved. 229

For example, suppose that 

overall

denotes the membership function for the overall implied fuzzy set that is obtained by taking the maximum of the certainty values of

u

in Figure 2.18 (i.e., 

overall

   max

u

 ,    

and  over all case, arg sup

u

 per 

overall

the max criterion.

 Equation   10 (2.15)).

In this , which is the defuzzified value via Sometimes the supremum can occur at more than one point in

y q

(e.g., consider the use of the max criterion for the case where minimum is used to represent the implication, and triangular membership functions are used on the output universe of discourse, such as in Figure 2.19).

In this case you also need to specify a strategy on how to pick only one point for

y q crisp

(e.g., choosing the smallest value).

Often this defuzzification strategy is avoided due to this ambiguity; however, defuzzification method does offer a way around it.

the next 230

Mean of maximum

: A crisp output

y crisp q

is chosen to represent the mean value of all elements whose membership in ˆ

q

is a maximum. We define supremum of the membership function of

b

ˆ

q

max as the over the universe of discourse set *

q

Y q y q

. Moreover, we define a fuzzy with a membership function defined as  ˆ *

q

  1 0 

B q

b

max

q otherwise

then a crisp output, using the mean of maximum method, is defined as

crisp

 

y

q y q

 ˆ *

q

   

q dy dy q q

y q

(2.17)  ˆ *

q

 

q q

for all

u i

.  0 231

As an example, suppose that for Figure 2.19 the two implied fuzzy sets are used to form an overall implied fuzzy set by taking the maximum of the two certainty values over all of

u

(i.e., 

overall

   max

u

  ,   per Equation (2.15)).

In this case there is an interval of

u

values around -10 where the overall implied fuzzy set is at its maximum value, and hence there is an ambiguity about which is the best defuzzified value.

The mean of the maximum method would pick the value in the middle of the interval as the defuzzified value, so it would choose -10.

232

Note that the integrals in Equation (2.17) must be computed at each time instant since they depend on

B q

, which changes with time.

This can require excessive computational resources for continuous universes of discourse.

For some types of membership functions, simple ideas from geometry can be used to simplify the calculations; however, for some choices of membership functions, there may be many subintervals spread across the universe of discourse where the maximum is achieved. In these cases it can be quite difficult to compute the defuzzified value unless the membership functions are discretized.

Complications such as these often cause designers to choose other defuzzification methods.

233

Center of area (COA):

A crisp output

y q crisp

is chosen as the center of area for the membership function of the overall implied fuzzy set ˆ

q

.

For a continuous output universe of discourse the center of area output is denoted by

y crisp

 

y q y q

y q q

y

q

y q

dy q

dy q q q

The fuzzy system must be defined so that 

y q

B q

 

q q y q

,  0 for all . Note that, similar to the mean of the maximum method,

this defuzzification approach can be computationally expensive.

234

For instance, we compute the area of the overall implied fuzzy set 

overall

 max

u

  ,   for Figure 2.19. Notice that in this case the computation is not as easy as just adding the areas of the two chopped-off triangles that represent the implied fuzzy sets.

Computation of the area of the overall implied fuzzy set does not count the area that the implied fuzzy sets overlap twice; hence, the area of the overall implied fuzzy set can in general be much more difficult to compute in real time.

235

It is important to note that each of the above equations for defuzzification actually provides a mathematical quantification of the operation of the entire fuzzy system provided that each of the terms in the descriptions are fully defined.

Overall, we see that using the overall implied fuzzy set in defuzzification is often undesirable for two reasons : (1) overall implied fuzzy set

B q

the is itself difficult to compute in general , and (2) the defuzzification techniques based on an inference mechanism that provides compute.

B q

are also difficult to It is for this reason that most existing fuzzy controllers (including the ones in this book) use defuzzification techniques based on the implied fuzzy sets, such as center-average or COG.

236

2.3.6 Mathematical Representations of Fuzzy Systems

Notice that each formula for defuzzification in the previous section provides a mathematical description of a fuzzy system. There are many ways to represent the operations of a fuzzy system with mathematical formulas. Next, we clarify how to construct and interpret such mathematical formulas for the case where center-average defuzzification is used for MISO fuzzy systems. Similar ideas apply for some of the other defuzzification strategies, MIMO fuzzy systems, and the Takagi-Sugeno fuzzy systems that we discuss in the next section.

237

Assume that we use center-average defuzzification so that the formula describing how to compute the output is

y

 

R i

  1

R i b i

 1  

i i

(2.18) Notice that we removed the "crisp" superscript and

"q"

subscript from y (compare to Equation (2.16)). Also, we removed the

"q"

superscript from. The

q

index is no longer needed in both cases since we are considering MISO systems, so that while there can be many inputs, there is only one output.

238

To be more explicit in Equation (2.18), we need to first define the premise membership functions , in terms of the individual membership functions that describe each of the premise terms. Suppose that we use product to represent the conjunctions in the premise of each rule. Suppose that we use the triangular membership functions in Table2.3 where we

j

membership function on the j

th

In addition, let function for the j

th

j L

 

j

j C i j

 

j

 

u j

be the i

th

input universe of discourse.

"center" membership input universe of discourse.

In this case, to parameters of the "left" membership function from Table 2.3.

j L

L

In particular, we use and to denote the j

j

th

values of

j C i

 

c i j

 

j

th

j R

 

j

triangle center (triangle base width) on the j

th

input universe of discourse.

239

Suppose that we use all possible combinations of input membership functions to form the rules, and that each premise has a term associated with each and every input universe of discourse. A more detailed description of the fuzzy system in Equation (2.18) is given by 

b

1  

n j

 1  1  

j L

 

j

   

b

2  

C

1 1

C

1   1   1  

n j

n

2

j

  2

L

j L u j

 

j

  L L premise terms all described by the membership functions ,

j = 1,2.....n

. The second term in the

j L

 

b

2  2 1

C

1   1 universes of discourse (i.e.,

j = 2, 3, … n).

240

Continuing in a similar manner, the sum in the numerator (and denominator) extends to include all possible combinations of products of the input membership functions, and this fully defines the μ

i

Equation (2.18).

in Overall, we see that because we need to define rules resulting from all possible combinations of given input membership functions; of which there are three kinds (left, center, right), the explicit mathematical representation of the fuzzy system is somewhat complicated. To avoid some of the complications, we first specify a single function that represents all three types of input membership functions.

241

Suppose that on the

j th

input universe of discourse we number the input membership functions from left to right as

1,2,…,N j

, where

N j

is the number of input membership functions on the

j th

input universe of discourse. A single membership function that represents all three in 

i j

Table 2.3 is           1 max max    0,1    0,1  

c i j

u

0.5

i j j u j

 0.5

c i j i j

   

if u j if u j if u j

 1

c and u j j

i c and u j

j

i c and u j

j

c N j j

 1

c and u j j

 1

c and u j j

c N j j

c N j j

  A similar approach can be used for the Gaussian membership functions in Table 2.4. 242

Recall that we had used

 , K 

i

to denote the i

th

rule. In this notation the indices in (the "tuple") (j, k,...,l) range

N

1

N

2 , ,1

N n

specify which linguistic value is used on each input universe of discourse. Correspondingly, each index in the tuple (j, k,...,l) also specifies the linguistic-numeric value of the input membership function used on each input universe of discourse.

243

Let

b

j

,

k

, ,

l

; 

i

denote the output membership function (a singleton) center for the i

th

rule (of course, q = 1 in our MISO case). Note that we use “i” in the notation

, K ,

i

simply as a label for each rule (i.e., we number the rules in the rule-base, and i is this number).

244

Hence, when we are given

i

, we know the values of

j, k, .... l, p,

and

q.

Because of this, an explicit description of the fuzzy system in

y

Equation (2.18) is given by  

i R

 1

b

 

R

K

i

 1 ,   1

j

i k

2   1

j

L

k

2 

n l

L 

n l

(2.19) 245

This formula clearly shows the use of the product to represent the premise. Notice that since we use all possible combinations of input membership functions to form the rules there are

R

n

j

 1

N j

rules, and hence it takes n  j  1 2

N j

 n  j  1

N j

(2.20) parameters to describe the fuzzy system since there are two parameters for each input membership function and

R

output membership function centers. 246

For some applications, however, all the output membership functions are not distinct. For example, consider the pendulum example where five output membership function centers are defined, and there are

R

= 25 rules. that they take on only a fixed number of given values, that is less than

R,

one approach is to specify them as a function of the indices of the input membership functions. What is this function for the pendulum example? 247

A different approach to avoiding some of the complications encountered in specifying a fuzzy system mathematically is to use a different notation, and hence a different definition for the fuzzy system. For this alternative approach, for the sake of variety, we will use Gaussian input membership functions. In particular, for simplicity, suppose that for the input universes of discourse we only use membership functions of the "center" Gaussian form shown in Table 2.4.

248

For the i

th

rule, suppose that the input membership function is

exp      1 2  

u j

 

i j c i j

  2    

for the j

th

input universe of discourse. Hence, even though we use the same notation for the membership function, these centers are different from those used above, both because we are using Gaussian membership

c i

functions here, and because the "i" in is the index for the rules, not the membership function on the j

th

input universe of discourse.

249

i

Similar comments can be made about the ,

i = 1,2, ...,R , j = 1,2, ...,n

. If we let

b i

denote the center of the

i th

,

i = 1,2,.... R,

output membership function for the rule, use center-average defuzzification, and product to represent the conjunctions in the premise, then

y

 

R i

 1

b i i

j n n j

 1  1 exp exp           1 2 1 2    

u u j j

  

i j

i j c i j c i j

    2 2         (2.21) is an explicit representation of a fuzzy system. 250

Note that we do not use the "left" and "right" versions of the Gaussian membership functions in Table 2.4 as this complicates the notation. There are nR input membership function centers, nR input membership function spreads, and R output membership function centers. Hence, we need a total of

R(2n+1)

parameters to describe this fuzzy system.

251

Now, while the fuzzy systems in Equations (2.19) and (2.21) are in general different, it is interesting to compare the number of parameters needed to describe a fuzzy system using each approach. In practical situations, we often have for

j

each j = 1,2,..., n, and sometimes the number of membership functions on each input universe of discourse can be quite large. From Equation (2.20) we can clearly see that large values of n will result in a fuzzy system with many parameters (there is an exponential increase in the number of rules). On the other hand, using the fuzzy system in Equation (2.21) the user specifies the number of rules and this, coupled with the number of inputs n, specifies the total number of parameters.

There is not an exponential growth in the number of parameters in Equation (2.21) in the same way as there is in the fuzzy system in Equation (2.19) so you may be tempted to view the definition in Equation (2.21) as a better one.

Such a conclusion, can, however be erroneous for several reasons.

252

First

, the type of fuzzy system defined by Equation (2.19)is sometimes more natural in control design when you use triangular membership functions since you often need to make sure that there will be no point on any input universe of discourse where there is no membership function with a nonzero value . Of course, if you are careful, you can avoid this problem with the fuzzy system represented by Equation (2.21) also.

Second

, suppose that the number of rules for Equation (2.21) is the same as that for Equation (2.19). In this case, the number of parameters needed to describe the fuzzy system in Equation (2.21) is    n  j  1

N j

    2

n

 1  253

Now, comparing this to Equation (2.20) you see that for many values of

N i

,

j = 1,2,..., n

, and number of inputs

n,

it is possible that the fuzzy system in Equation (2.21) will require many more parameters to specify it than the fuzzy system in Equation (2.19).

Hence, the inefficiency in the representation in Equation (2.19) lies in having all possible combinations of output membership function centers, which results in exponential growth in the number of parameters needed to specify the fuzzy system.

The inefficiency in the representation in Equation (2.21) lies in the fact that, in a sense, membership functions on the input universes of discourse are not reused by each rule. There are new input membership functions for every rule.

254

Generally, it is difficult to know which is the best fuzzy system for a particular problem . In this book, we will sometimes (e.g., in Chapter 5) use the mathematical representation in Equation (2.21) because it is somewhat simpler, and possesses some properties that we will exploit. At other times we will be implicitly using the representation in Equation (2.19) because it will lend to the development of certain techniques (e.g., in Chapter 6). In every case, however, that we use Equation (2.21) (Equation (2.19)) you may want to consider how the concepts, approaches, and results change (or do not change) if the form of the fuzzy system in Equation (2.19) (Equation (2.21)) is used.

255

Finally, we would like to recommend that you practice creating mathematical representations of fuzzy systems. For instance, it is good practice to create a mathematical representation of the fuzzy controller for the inverted pendulum of the form of Equation (2.19), then also use Equation (2.21) to specify the same fuzzy system. Comparing these two approaches, and resolving the issues in specifying the output centers for the Equation (2.19) case, will help clarify the issues discussed in this section.

256

2.3.7 Takagi-Sugeno Fuzzy Systems

The fuzzy system defined in the previous sections will be referred to as a " standard fuzzy system ." In this section we will define a " functional fuzzy system " of which the Takagi-Sugeno fuzzy system is a special case .

For the functional fuzzy system, we use singleton fuzzification, and the MISO rule has the form

If

% 1 % 1

j

and

% 2 % 2

k

%

n

%

l n

then

b

i

where "•" simply represents the argument of the function and the are not output membership function centers.

b i

g

i

257

The premise of this rule is defined the same as it is for the MISO rule for the standard fuzzy system in Equation (2.4). The consequents of the rules are different , however. Instead of a linguistic term with an associated membership function, in the consequent we use

a function b i =g i (.)

(hence the name "functional fuzzy system") that does not have an associated membership function. Notice that often the argument of

g i

contains the terms

u i

,

i = 1,2,...,n

, but other variables may also be used.

The choice of the function depends on the application being considered. Below, we will discuss linear and affine functions but many others are possible. 258

For instance, you may want to choose

b i

g i a i

,0 

a i

,1 2

a

2

or b i

g i

exp  

a i

,1 sin   1

a

sin  

n

 

Virtually any function can be used

(e.g., a neural network mapping or another fuzzy system),

which makes the functional fuzzy system very general.

259

For the functional fuzzy system we can use an appropriate operation for representing the premise (e.g., minimum or product), and defuzzification may be obtained using

y

 

R i

  1

R i b i

 

i i

 1 (2.22) where is defined in

i

Equation (2.13).

It is assumed that the functional fuzzy system is defined so that no 

i R

1 

i

One way to view the functional fuzzy system is as a nonlinear interpolator between the mappings that are defined by the functions in the consequents of the rules.

260

An Interpolator Between Linear Mappings

In the case where

b i

g i a i

,0 

a u i

,1 1  L 

a u n

(where the are real numbers)

i

, j system is referred to as a “Takagi-Sugeno fuzzy system".

i

,0

a

i

,0 0  0 the functional fuzzy

g i

  "affine." Often, however, as is standard, we will refer to the afflne mapping as a linear mapping for convenience.

Overall, we see that the Takagi-Sugeno fuzzy system essentially performs a nonlinear interpolation between linear mappings.

261

As an example, suppose that

n

=1,

R

= 2, and that we have rules if % 1 % 1 if % 1 % 1 then then

b

1

b

2  2 

u

1  1 

u

1 with the universe of discourse for

u 1

Figure 2.24 so that represents given in % 1 and  2 represents

.

We have 

y

b

1

A

 2 1 1  1 

b

2  2  2 

b

1  1 

b

2  2 262

 1 1  2 -1 1

u

1 Figure 2.24 Membership functions for Takagi-Sugeno fuzzy system example.

263

  1, 1,   1  0

,

which is a  

u

1 which is a different line. In between , the output

y

is an interpolation between the two lines. Plot

y

versus

u 1

achieved. to show how this interpolation is Finally, it is interesting to note that if we pick g i 

a i

, 0 (i.e.,

a i,j =0

for

j >

0), then the Takagi-Sugeno fuzzy system is equivalent to a standard fuzzy system that uses center-average defuzzification with singleton output membership functions at

a i.0

. It is in this sense that the Takagi-Sugeno fuzzy system—or, more generally, the functional fuzzy system—is sometimes referred to as a "general fuzzy system." 264

An Interpolator Between Linear Systems

It is important to note that a Takagi-Sugeno fuzzy system may have any linear mapping (affine mapping) as its output function, which also contributes to its generality.

One mapping that has proven to be particularly useful is to have a linear dynamic system as the output function so that the

i th

rule has the form % 1 1

j

% 2 % 2

k

K %

p

%

l p

  

i

  

Bu i

1 265

1     2 K

n

   

T

state (now

n

is not necessarily the number of K

u m

dimensional model input;

A i 1,2,...,R

and

B i

,

i =

are the state and input matrices of appropriate dimension; and

z t

1

z t

2 , K ,

z p

T

is the p-dimensional input to the fuzzy system. 266

This fuzzy system can be thought of as a nonlinear interpolator between

R

linear systems.

It takes the input

z(t)

and has an

x

output  

R i

 1 

or x where

  

i R

  1

A i

i

   

R i

 1  

i

    

T

    

i

    

i R

  1

B i

i

    1 , K , 

R

    1 

R i

 1 

i

    1 , K , 

R

    267

If

R = 1

, we get a standard linear system. Generally, for

R > 1

and a given value of

z(t),

only certain rules will turn on and contribute to the output. Many choices are possible for

z(t)

. For instance, we often choose

z(t

) =

x(t),

or sometimes

z(t)=[x T (t),u T (t)] T .

As an example, suppose that

z(t) = x(t), p = n = m =1,

and

R = 2

with rules % 1 &  

x

1  2

u

1 % 1 % 1 Suppose that we use μ

1

and μ

2

  2

x

1 

u

1 from Figure 2.24 as the membership functions for 1 2 1

,

respectively (i.e., we relabel the horizontal axis of Figure 2.24 with

x 1

). 268

In this case Equation (2.23) becomes & 1

  

 1 2  2

   

1 2  1  2

2 1

 

If

x 1 (t)>1

, then μ

1 =0

and μ

2 =1

, so the behavior of the nonlinear system is governed by & 1     2

x

1   

u

1   which is the linear system specified by the second rule above. However, if

x 1 (t) <-1

, then μ

1 =1

and μ

2 =0,

so the behavior of the nonlinear system is governed by & 1  

 

x

1  

2

u

1   which is the linear system specified by the first rule above. 269

  interpolates between the two linear systems. We see that for changing values of different amounts.

x 1 (t)

, the two linear systems that are in the consequents of the rules contribute We think of one linear system being valid on a region of the state space that is quantified via

μ 1

and another on the region quantified by

μ 2

(with a "fuzzy boundary" in between). For the higher-dimensional case, we have premise membership functions for each rule quantify whether the linear system in the consequent is valid for a specific region on the state space. As the state evolves, different rules turn on, indicating that other combinations of linear models should be used. Overall, we find that the Takagi-Sugeno fuzzy system provides a very intuitive representation of a nonlinear system as a nonlinear interpolation between

R

linear models.

270

2.3.8 Fuzzy Systems Are Universal Approximators

Fuzzy systems have very strong functional capabilities. That is, if properly constructed, they can perform very complex operations (e.g., much more complex than those performed by a linear mapping). Actually, many fuzzy systems are known to satisfy the "universal approximation property".

271

For example, suppose that we use center-average defuzzification, product for the premise and implication, and Gaussian membership functions. Name this fuzzy system

f(u).

Then, for any real  fuzzy system

f(u)

such that sup

f

   

u

Note, however, that all this "universal approximation property" does is guarantee that there exists a way to define the fuzzy system

f(u)

(e.g., by picking the membership function parameters). It does

not

say how to find the fuzzy system, which can, in general, be very difficult.

Furthermore, for arbitrary accuracy you may need an arbitrarily large number of rules .

272

The value of the universal approximation property for fuzzy systems is simply that it shows that if you work hard enough at tuning, you should be able to make the fuzzy system do what you are trying to get done.

For control, practically speaking, it means that there is great flexibility in tuning the nonlinear function implemented by the fuzzy controller . Generally, however, there are no guarantees that you will be able to meet your stability and performance specifications by properly tuning a given fuzzy controller.

You also have to choose the appropriate controller inputs and outputs, and there will be fundamental limitations imposed by the plant that may prohibit achieving certain control objectives no matter how you tune the fuzzy controller (e.g., a nonminimum phase system may provide certain limits on the quality of the performance that can be achieved).

273

Charpter 2

END

274