functions describing the meaning of their associated linguistic values. Also, we will use the notation Azero to represent the membership function 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. Next we describe the fuzzification process 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. In Section 2.3.3 we will explain the exact operations of the fuzzification process and also explain why it can be simplified and under certain conditions virtually ignored For now, the reader should simply think of the fuzzification process as the act of obtaining a value of an input variable(e.g, e(b)) and finding the numeric values of the membership function(s )that are defined for that variable For example, ife(t)=and e(0)=T/16, the fuzzification process amounts to finding the values of the input membership functions for these. In this case P passa(e(1 )=1(with all others zero) and ero Ap e(t=0.5.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 2.2.4 Matching: Determining Which Rules to Use How do we decide which rules to use? Next, we seek to explain how the inference mechanism in Figure 2. 1 operates. The inference process generally involves 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 2. The conclusions(what control actions to take) 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 or 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. Consider Figure 2. 10, where we list two terms from the premise of the rule If error is zero and change-in-error is possmall Then force is negsmall Above, we had quantified the meaning of the linguistic terms"error is zero"and"change-in-error is po the membership functions shown in Figure 2.9. Now we seek to quantify the linguistic premise "error is sero 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 PDF文件使用" pdffactory Pro"试用版本创建ww. fineprint,com,cn
functions describing the meaning of their associated linguistic values. Also, we will use the notationmzero to represent the membership function 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. Next we describe the fuzzification process. 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. In Section 2.3.3 we will explain the exact operations of the fuzzification process and also explain why it can be simplified and under certain conditions virtually ignored. For now, the reader should simply think of the fuzzification process 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. For example, if ( ) 4 e t p = and ( ) 16 d e t dt = p ,the fuzzification process amounts to finding the values of the input membership functions for these. In this case ( ( )) 1 possmall m e t = (with all others zero) and ( ) ( ) 0.5 zero possmall d d e t e t dt dt m m æ ö æ ö ç ÷ = = ç ÷ è ø è ø .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." 2.2.4 Matching: Determining Which Rules to Use How do we decide which rules to use? Next, we seek to explain how the inference mechanism in Figure 2.1 operates. 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. 2. The conclusions (what control actions to take) 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. n Premise quantification via fuzzy logic n Determining which rules are on 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. Consider Figure 2.10, where we list two terms from the premise of the rule, If error is zero and change-in-error is possmall Then force is negsmall 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 PDF 文件使用 "pdfFactory Pro" 试用版本创建 www.fineprint.com.cn
terms, since we have quantified them more precisely with fuzzy sets (i.e, the membership functions), we can use these To see how to quantify the"and"operation, begin by supposing that e(0=r/ 8 and e(t=t/32,so that m()2-(2)-03h alues of e(t) ande(t), is the 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 d Chanae inert is noNsmall quantified with quantified wit LO 5 t). (radi sec) Figure 2. 10 Membership functions of premise terms There are actually several ways to define it: Minimum: Define Apremise-min(0.50.25)=0. 25, that is, using the minimum of the two membership values Product: Define A premise=(0.5)(0.25)=0. 125, that is, using the product of the two membership values 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 thato sPpremise s l 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? It is important that you convince yourself that the above quantifications make sense. To do so, we recommend that you consider other examples of"anding" linguistic terms that have associated membership functions While we have simply shown how to quantify the"and"operation for one value of e(y) t all possible e(1) and (t) values, we will obtain a multidimensional membership d function Premise e ( ), e(t) that is a function of ef@) and e(t)for each rule. For our example, if we choose PDF文件使用" pdffactory Pro"试用版本创建ww. fineprint,com,cn
terms, since we have quantified them more precisely with fuzzy sets (i.e., the membership functions), we can use these. To see how to quantify the "and" operation, begin by supposing that e(t) =p 8and ( ) 32 d e t dt = p , so that using Figure 2.9 (or Figure 3.10) we see that ( ( )) 0.5 zero m e t = and ( ) 0.25 possmall d e t dt m æ ö ç ÷ = è ø .What, for these values of e(t) and ( ) d e t dt , is the 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 bympremise . Figure 2.10 Membership functions of premise terms. There are actually several ways to define it: • Minimum: Define mpremise = min{0.5,0.25} = 0.25, that is, using the minimum of the two membership values. • Product: Define mpremise = (0.5)(0.25) = 0.125, that is, using the product of the two membership values. 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 1 £ £ mpremise 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? It is important that you convince yourself that the above quantifications make sense. To do so, we recommend that you consider other examples of "anding" linguistic terms that have associated membership functions. While we have simply shown how to quantify the "and" operation for one value of e(t) and ( ) d e t dt , if we consider all possible e(t) and ( ) d e t dt values, we will obtain a multidimensional membership function premise ( ), ( ) d e t e t dt m æ ö ç ÷ è øthat is a function of e(t) and ( ) d e t dt for each rule. For our example, if we choose PDF 文件使用 "pdfFactory Pro" 试用版本创建 www.fineprint.com.cn
the minimum operation to represent the " and"in the premise, then we get the multidimensional membership function A premise[e(), e() shown in Figure 2.1 t】.(rd t】.[rad!g) Figure 2. 11 Membership function of the premise for a single rule d Notice that if we pick values for e() and A premise e(), e(1). the value of the premise certainty represents how specifying the force input to the plant. As efv and e(t change, the value of premise ()? py certain we are that the rule: If error is zero and change-in-error is possmall Then force is negsmall is applicable for dt e() changes according to Figure 2. 11, and we become less or more certain of the applicability of this rule 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 e(D) and e(t)so that given specific values of e0) and e(t) we obtain a quantification dt of the certainty that each rule in the rule-base applies to the current situation. It is important you picture in your mind the d situation where e() and e(t)change dynamically over time. When this occurs the values of premise e(),te(1) for each rule change, and hence the applicability of each rule in the rule-base for fying the force input to the pendulum, changes with time 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 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. Consider, for the inverted pendulum example, how we compute the rules that are on. Suppose PDF文件使用" pdffactory Pro"试用版本创建ww, fineprint,com,cn
the minimum operation to represent the "and" in the premise, then we get the multidimensional membership function premise ( ), ( ) d e t e t dt m æ ö ç ÷ è ø shown in Figure 2.11. Figure 2.11 Membership function of the premise for a single rule Notice that if we pick values for e(t) and premise ( ), ( ) d e t e t dt m æ ö ç ÷ è ø, the value of the premise certainty represents how certain we are that the rule : If error is zero and change-in-error is possmall Then force is negsmall is applicable for specifying the force input to the plant. As e(t) and ( ) d e t dt change, the value of premise ( ), ( ) d e t e t dt m æ ö ç ÷ è ø changes according to Figure 2.11, and we become less or more certain of the applicability of this rule. 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 e(t) and ( ) d e t dt so that given specific values of e(t) and ( ) d e t dt we obtain a quantification of the 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 e t dt change dynamically over time. When this occurs the values of premise ( ), ( ) d e t e t dt m æ ö ç ÷ è øfor each rule change, and hence the applicability of each rule in the rule-base for specifying the force input to the pendulum, changes with time. 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 ( ), 0 ( ) d e t e t dt m æ ö ç ÷ > è ø . 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. Consider, for the inverted pendulum example, how we compute the rules that are on. Suppose PDF 文件使用 "pdfFactory Pro" 试用版本创建 www.fineprint.com.cn
()=0m0(=x 0.294 [t】,[P.〕 Figure 2. 12 Input membership functions with input values Figure 2. 12 shows the membership functions for the inputs and indicates with thick black vertical lines the values above for e0) and e(t). Notice that u ero(e(n)=1 but that the other membership functions for the e(0) input are all"off zero).For see that Hero (.e(t))=0.25 and p possmal (.e(())=0.75 and that all the other membership functions are off. This implies that rules that have the premise terms error is zero "change-in-error is zero" change-in-error is possmall are on(all other rules have premise e (0), e(0=0). So, which rules are these? Using Table 2.1, we find that the rules that are on are the following 1. Iferror is zero and change-in-error is zero then force is zero 2. Iferror is zero and change-in-error is possmall Then force is negsmall Note that since for the pendulum example we have at most two membership functions overlapping, 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( 0=0 and e(t)=o so that only rule 2 above is on 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(0=0(e/y 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 PDF文件使用" pdffactory Pro"试用版本创建ww. fineprint,com,cn
that e t( ) = 0 and ( ) 0.294 8 32 d e t dt p p = - = . Figure 2.12 Input membership functions with input values 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 e t dt . Notice that ( ( )) 1 zero m e t = but that the other membership functions for the e(t) input are all "off' (i.e., their values are zero).For the ( ) d e t dt input we see that ( ( )) 0.25 zero d e t dt m = and ( ( )) 0.75 possmall d e t dt m = and that all the other membership functions are off. This implies that rules that have the premise terms "error is zero" "change-in-error is zero" "change-in-error is possmall" are on (all other rules have premise ( ), 0 ( ) d e t e t dt m æ ö ç ÷ = è ø ). 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 Note that since for the pendulum example we have at most two membership functions overlapping, 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 ( ) 8 d e t dt p = so that only rule 2 above is on. 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 PDF 文件使用 "pdfFactory Pro" 试用版本创建 www.fineprint.com.cn
(above) the two highlighted ones on also With this, you should picture in your mind how a region of rules that are on( that involves no more than four cells in the body of Table 2.2 due to how we define the input membership functions) will dynamically move around in the table d as the values of e(6) and e(t)change. This completes our description of the"matching"phase of the inference mechanism Table 2.2 Rule Table for the Inverted Pendulum with rules That Are"On" Highlighted “ force hange-in- error” 0 e 0 2210 0210 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 to determine the force input to the cart 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 =min 0.25, 1=0. 25(the notation P premise( presents 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 For rule(1)the consequent is"force is zero"(this makes sense, for here the pendulum is balanced, so we should not apply any force since this would tend to move the pendulum away from the vertical ). 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 Ho, is shown in Figure 2. 13(6) and is given by o=min (0.25, Zero(u)) This membership function defines the "implied fuccy ser"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 Notice that the membership function Hm(u)is a function of u and that the minimum operation will generally PDF文件使用" pdffactory Pro"试用版本创建ww. fineprint,com,cn
(above) the two highlighted ones on also. With this, you should picture in your mind how a region of rules that are on (that involves no more than four cells in the body of Table 2.2 due to how we define the input membership functions) will dynamically move around in the table as the values of e(f) and ( ) d e t dt change. This completes our description of the "matching" phase of the inference mechanism. Table 2.2 Rule Table for the Inverted Pendulum with Rules That Are "On" Highlighted. “change-in-error” e “force” u -2 -1 0 1 2 -2 2 2 2 1 0 -1 2 2 1 0 -1 0 2 1 0 -1 -2 1 1 0 -1 -1 -2 “error” e 2 0 -1 -2 -2 -2 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 to determine the force input to the cart. 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 ( ) 1 min{0.25,1} 0.25 premise m = = (the notation premise( ) 1 m 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. For rule (1) the consequent is "force is zero" (this makes sense, for here the pendulum is balanced, so we should not apply any force since this would tend to move the pendulum away from the vertical). 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 ( ) 1 m , is shown in Figure 2.13(b) and is given by ( ) m m 1 = min{0.25, zero (u)}. 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. Notice that the membership function ( ) ( ) 1 m u is a function of u and that the minimum operation will generally PDF 文件使用 "pdfFactory Pro" 试用版本创建 www.fineprint.com.cn