elements 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 achi leve 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 rocess 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 2.2. Here, y denotes the angle that the pendulum makes with the vertical(in radians), I 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) Figure 2.2 Inverted pendulum on a cart 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 Suppose that for the inverted pendulum, the expert (this could be you! says that she or he will use e(t)=r(t)-y(t)and e(n 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 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
elements: 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. 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 2.2. 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). Figure 2.2 Inverted pendulum on a cart 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. Suppose that for the inverted pendulum, the expert (this could be you!) says that she or he will use et rt yt () () () = − and ( ) d e t dt 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. 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 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 倒立摆 Figure 2.3 Human controlling an inverted pendulum on a cart 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 Once the fuzzy controller inputs and outputs are chosen, you must determine what the reference inputs are. For th 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 ↓a模糊控制器 倒立摆 Figure 2. 4 Fuzzy controller for an inverted pendulum on a cart 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 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
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. 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. Figure 2.3 Human controlling an inverted pendulum on a cart 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. 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. Figure 2.4 Fuzzy controller for an inverted pendulum on a cart 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. 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 undamentally important part of the control design 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) 2.2.2 Putting Control Knowledge into Rule-Bases How do we put control knowledge in to 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). We seek to take this"linguistic"description and load it into the fuzzy controller, indicated by the arrow in Figure 2.4 a Linguistic description Linguistic Descriptions 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(t) cribes u(t) Note that we use quotes to emphasize that certain words or phrases are linguistic descriptions, and that we have d added the time index to, for example, e(0), e(t) to 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 However, this can sometimes lead to long descriptions. Others seek to keep the linguistic descriptions as short 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 Just as e(l) takes on a value of, for examples 0 I at /=2(e(2)=0.1), linguistic variables assume"linguistic value 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
be understood that the choice of the controller inputs and outputs is a fundamentally important part of the control design process. 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). 2.2.2 Putting Control Knowledge into Rule-Bases How do we put control knowledge in to 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). 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 Linguistic Descriptions 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, z "error" describes e(t) z "change-in-error" describes ( ) d e t dt z "force" describes u(t) 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), ( ) d e t dt to 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. 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. 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: z "neglarge
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 I"to represent"possmall 2 to represent"poslarge 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 articular 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 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 d Recall that for the inverted pendulum r=0 and e=r-y so thate=-y and- e 0 dt will study how we can quantify certain dynamic behaviors with linguistics. In the next subsection we will study how to quantify knowledge about how to control the pendulum using linguistic descriptions 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 lefn The statement"error is negsmall"can represent the situation where the pendulum is just slightly to the right of the vertical, but not too close to the vertical to justify quantifying it as"zero"and not too far away to justify quantifying it as 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( 0=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) 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 cs is not al ways 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
z "negsmall" z "zero" z "possmall" z "poslarge" 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: z "-2" to represent "neglarge" z "-1" to represent "negsmall" z "0" to represent "zero" z "1" to represent "possmall" . z "2" to represent "poslarge" 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." 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 and e = r - y so thate y = − and d d e y dt dt = − since 0 d r dt = . First, we will study how we can quantify certain dynamic behaviors with linguistics. In the next subsection we will study how to quantify knowledge about how to control the pendulum using linguistic descriptions. 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 to the right of the vertical, but not too close to the vertical to justify quantifying it as ''zero" and not too far away to justify quantifying it as "neglarge." • 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). 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 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(notice that we drop the quotes since the whole rule is linguistic 1. If error is neglarge and change-in-error is neglarge Then force is poslarge 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(to the right) so that we can try to start the pendulum moving in the proper dire Figure 2.5 Inverted m in various positi 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(a guistic quantification of zero does not imply that e(t)=0 exactly) 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(a positive force could result in the pendulum overshooting the desired position) 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 forceto the left) to assist the movement, but not a big one since the pendulum is already moving in the proper direction. Each of the three rules listed above 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 specifying how to control a process The general form of the linguistic rules listed abov If premise Then consequent As you can see from the three rules listed above, 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 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
proper time. 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 (notice that we drop the quotes since the whole rule is linguistic): 1. If error is neglarge and change-in-error is neglarge Then force is poslarge 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 (to the right) so that we can try to start the pendulum moving in the proper direction. (a) (b) (c) Figure 2.5 Inverted pendulum in various positions 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 (a linguistic quantification of zero does not imply that e(t) = 0 exactly) 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 (a positive force could result in the pendulum overshooting the desired position). 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. Each of the three rules listed above 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. The general form of the linguistic rules listed above is If premise Then consequent As you can see from the three rules listed above, 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. 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