EarthWeb   
HomeAccount InfoLoginSearchMy ITKnowledgeFAQSitemapContact Us
     

   
  All ITKnowledge
  Source Code

  Search Tips
  Advanced Search
   
  

  

[an error occurred while processing this directive]
Previous Table of Contents Next


The third step in the design of an FLC is to select linguistic terms to represent each of the condition and action variables. Realize at the outset that there is not a definite method of doing this; the number and definition of the linguistic terms is always problem specific, and their definitions should be consistent with the normal meaning of the terms. For this application, four linguistic terms were used to describe the error associated with the position of the cart, Ex. Three linguistic terms are adequate to represent the variables, ΔEx, Eθ, and ΔEθ. The manipulated variable, F, required seven linguistic terms for adequate representation. The specific linguistic terms which describe the condition and action variables follow:

Ex Negative Big (NB), Negative Small (NS), Positive Small (PS) and Positive Big (PB);
ΔEx Negative (N), Near Zero (NZ), and Positive (P);
Eθ Negative (N), Near Zero (NZ), and Positive (P);
ΔEθ Negative (N), Near Zero (NZ), and Positive (P);
F Negative Big (NB), Negative Medium (NM), Negative Small (NS), Zero (Z), Positive Small (PS), Positive Medium (PM) and Positive Big (PB).

(These linguistic terms are later “defined” with the membership functions shown in Figure 3.3.)

The fourth step in the design of a FLC is to develop a rule set. The rule set in a FLC must include a rule for every possible combination of the variables of the chosen linguistic terms. Thus, 108 rules are required for the cart-pole balancing FLC. There are 4 * 3 * 3 * 3 = 108 possible combinations of the fuzzy linguistic terms describing the variables Ex, Eθ, ΔEx, and ΔEθ. Many of the actions needed for the 108 possible condition combinations are readily apparent.

For instance, when the position of the cart is NEGATIVE BIG (well to the left of center), the velocity of the cart is NEGATIVE (the cart is moving further still to the left of center), the position of the pole is POSITIVE (the pole is leaning back to the right), and the angular velocity of the pole is POSITIVE (the pole is moving further to the right), the best action is to apply a positive big force to the cart, i.e., to hit the cart hard on its left side. Such a force will tend to move the pole back to a vertical position while simultaneously moving the cart toward the center of the track. However, because the system is coupled (the pole is sensitive to actions taken on the cart), there are some conditions for which the appropriate action is not readily apparent. In fact, there are some conditions for which the selection of an appropriate action seems inappropriate.

For example, what is the appropriate action when the position of the cart is PS, the velocity of the cart is P, the position of the pole is NZ, and the angular velocity of the pole is P? The cart is to the right of the centerline and moving further away from the setpoint. Thus, if one considers only the cart, the appropriate action is to apply a small force in the negative direction. However, obviously the cart cannot be considered independently of the pole. The state of the pole requires a small force in the positive direction. The traditional way to resolve these conflicts and to select an appropriate action has been to experiment with different selections of the action variables. (As will be presented in several later chapters, an alternative to the trial-and-error approach is to allow a search algorithm like a genetic algorithm to select an effective rule set). However, at this juncture, the method of choice is the old fashioned trial-and-error approach directed by experience with controlling the system.

The complete rule set used for the cart-pole balancing system appears in Figure 3.2. To help ensure that the reader understands this figure, the bold action in the figure is the appropriate action for the condition: Ex is PS, ΔEx is NZ, Eθ is P, and ΔEθ is N. Note that the linguistic terms for Eθ are read as N, NZ, and P from left to right, and the linguistic terms for ΔEθ are read as N, NZ, and P from top to bottom. Thus, the complete rule is:

IF {Ex IS PS AND ΔEx IS NZ AND Eθ IS P AND ΔEθ IS N} THEN {F IS NM}.


Figure 3.2  The complete rule set for the cart-pole balancer includes 108 rules.

Now that the fuzzy rules are established, the exact criteria for determining which rules apply at any given time must be determined. In other words, the fuzzy terms must be “defined” through the membership functions for both the condition and action variables. As with the initial requirement of selecting the necessary linguistic terms, there are no definite guidelines for constructing the membership functions; the terms are defined to represent as closely as possible the ordinary linguistic meaning of the terms. Membership functions can have many forms. Triangles and trapezoids are two commonly used membership function forms (and the two forms that will be used in the applications presented in this chapter). A restriction generally applied to the membership functions is that they have a maximum value of 1 and a minimum value of 0. When a membership function value is 1, there is complete confidence in the premise that the crisp value of the condition variable is accurately described by the particular linguistic term. When a membership function value is 0, there is complete confidence in the premise that the crisp value of the condition variable is not described by the particular linguistic term. The membership functions developed by the authors for the cart-pole balancer appear in Figure 3.3.


Figure 3.3  Fuzzy membership functions used in the cart-pole balancer FLC.

Now that both the condition and action variables have been chosen and described with linguistic terms, and a rule set has been written that prescribes an appropriate action for every possible set of conditions, it is left to determine a single crisp value of the force to be applied to the cart at a particular time step. This is a concern because more than one of the 108 possible rules can be applicable for a given state of the cart-pole system.


Previous Table of Contents Next

Copyright © CRC Press LLC

HomeAccount InfoSubscribeLoginSearchMy ITKnowledgeFAQSitemapContact Us
Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.