functions will take on zero and nonzero values indicating the degree to which s to we see that various membership example, e(t) changes its value over time. For instance, as e(t) changes from he linguistic value appropriately describes the current value of e(0). For example, at e(t)=-- we are certain that the error is"neglarge, "and as the value of e(n) moves toward-- 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 Finally, note that often we will draw all the membership functions for one input or output variable on one graph ence, we often omit the label for the vertical axis with the understanding that the plotted functions are membershi functions describing the meaning of their associated linguistic values. Also, we will use the notation /=ero to represent the membership function associated with the linguistic value"zero" and a similar notation for the ot The rule-base of the fuzzy controller holds the linguistic variables, linguistic values, their associated membershi ctions,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(t=7/16, the fuzzification process amounts to finding the values of the input membership functions for these. In this case f posmal(e())=1(with others zero d and H=sol dt e(b)=p rosman dt et 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 involve two step 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
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. 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μ zero 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 π = and ( ) 16 d e t dt = π ,the fuzzification process amounts to finding the values of the input membership functions for these. In this case ( ( )) 1 possmall μ e t = (with all others zero) and ( ) ( ) 0.5 zero possmall d d e t e t dt 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." 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
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 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 mines 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 To see how to quantify the"and"operation, begin by supposing that e()=r 8 and e(t)=T/32,so that using Figure 29(or Figure 3.10) we see that zero(e()=0.5 and Aposmaim[re()=0.25. What, for these values of e(0 and e(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 19 Change-inzerror quantified with quantified with 0 1.0 possum1L” zero 从。 0.5 e().(a 1684a().(ad/e) Figure 2. 10 Membership functions of premise terms There are actually several ways to define it Minimum: Define Apremise-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 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
Premise quantification via fuzzy logic 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 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) =π 8and ( ) 32 d e t dt = π , so that using Figure 2.9 (or Figure 3.10) we see that ( ( )) 0.5 zero μ e t = and ( ) 0.25 possmall d e t dt μ ⎛ ⎞ ⎜ ⎟ = ⎝ ⎠ .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 byμ premise . Figure 2.10 Membership functions of premise terms. 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. 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 premise sl 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 example 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) ande(t), if we consider all possible e() and e(t values, we will obtain a multidimensional membership function(I/premise e (),e()) that is a function of ef() and e(t)for each rule. For our example, if we choose the minimum operation to represent the and"in the premise, then we get the multidimensional membership function//premise e (),e() shown in Figure 2.11 e《)nd e()(rad isec) Figure 2. 11 Membership function of the premise for a single rule 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() and e(0) change, the value of premise e d (1)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() and e(t so that given specific values of e() and e(t) 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
that make them up (note that0 premise ≤ μ ≤1for 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 et et dt μ ⎛ ⎞ ⎜ ⎝ ⎠⎟that is a function of e(t) and ( ) d e t dt for each rule. For our example, if we choose the minimum operation to represent the "and" in the premise, then we get the multidimensional membership function premise ( ), ( ) d et et dt μ ⎛ ⎞ ⎜ ⎝ ⎠⎟ 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 et et dt μ ⎛ ⎞ ⎜ ⎝ ⎠⎟, 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 et et dt μ ⎛ ⎞ ⎜ ⎟ ⎝ ⎠ 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
d situation where e(t and -e(t)change dynamically over time. When this occurs the values 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 I"if its premise membership function premise e( ), e(t))>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 Consider, for the inverted pendulum example, how we compute the rules that are on. Sup d 如e()0m0()=7-72 32=0.294 neglarge"“ nessa11 zero postal1” pos lar z 0 nessa mall 8 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 H ero(e()=1 but that the other membership functions for the ef0) input are all"off zero).For n((0)=025m1-0(2e()=075 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
situation where e(t) and ( ) d e t dt change dynamically over time. When this occurs the values of premise ( ), ( ) d et et dt μ ⎛ ⎞ ⎜ ⎝ ⎠⎟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 ( ), ( ) d et et 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. Consider, for the inverted pendulum example, how we compute the rules that are on. Suppose thate t( ) = 0 and ( ) 0.294 8 32 d e t dt =− = π π . 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 μ 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 μ = and ( ( )) 0.75 possmall d e t dt μ = 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 u premise e().d e(t=0). So, which rules are these? Using Table 2. 1, we find that dt 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(0=0 a()= d 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()=0(e( 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 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 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 “ change-in-erpr”e 2 2 2 0 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
are on (all other rules have premise ( ), ( ) d et et 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 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 π = 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 (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 i “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