440 likes | 824 Views
3. Fuzzy Control. 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 .
E N D
3. Fuzzy Control • The primary goal of control engineering is to distill and applyknowledge about how to control a process so that the resulting control system will reliably and safely achieve high-performance operation. • This section shows how fuzzy logic provides a methodology for representing and implementing our knowledge about how best to control a process.
A Tutorial Introduction • The fuzzy controller is to be designed to automate how a human expert who is successful at this task would control the system. • Human-in-the-loop to control the pendulum
Choosing Procedure • First, the expert tells us (the designer of the fuzzy controller) what information she or he will use as inputs to the decision-making process. • Next, we must identify the controlled variable. You want to make sure that the controllerwill have the proper information available to be able to make good decisions and have proper inputs to be able to steer the system in the directions needed to be able to achieve high-performance operation.
Choosing Procedure (cont.) • Once the fuzzy controller inputs and outputs are chosen, you must determine what the reference inputs are. • For the inverted pendulum: the control variable: the force (u) the reference input: r = 0 • After all the inputs and outputs are defined for the fuzzy controller, we can specify the fuzzy control system.
Putting Control Knowledge into Rule-Bases • The human expert shown in Fig. 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 in Fig. 2.4.
Linguistic Variables • Linguistic variables describe each of the time-varying fuzzy controller inputs and outputs. error: e(t), change-in-error: de(t)/dt, force: u(t) • The choice of the linguistic variables 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.
Linguistic Values • Linguistic values that linguistic variables take on over time change dynamically. neglarge (NL, negative large in size): -2 negsmall(NS): -1, zero (ZR): 0 possmall (PS, positive small in size): +1 poslarge (PL): +2
How to Quantify Knowledge • For the inverted pendulum r = 0 and e = r – y so that e = –y and de/dt = –dy/dt. • “error is poslarge”: the pendulum is at a significant angle to the left of the vertical. • “error is negsmall”: the pendulum is just slightly to the right of the vertical. • “error is zero”: the pendulum is very near the vertical position.
Quantification Statements • The pendulum is moving counterclockwise. • “error is poslargeandchange-in-error is possmall”:the pendulum is at the significant angle to the left of the vertical and, since dy/dt <0, the pendulum is moving away from the upright position. • “error is negsamllandchange-in-error is possmall”:the pendulum is slightly to the right of the vertical and, since dy/dt <0, the pendulum is moving toward the upright position.
Fuzzy Rules (a) If error is neglarge and change-in-error is neglarge Then force is poslarge. (b) If error is zero and change-in-error is possmall Then force is negsmall. (c) If error is poslarge and change-in-error is negsmall Then force is negsmall.
Linguistic Rules • A linguistic rule 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. • Linguistic rules are simply abstract ideas about how to achieve good control that could mean somewhat different things to different people.
Form of Linguistic Rules • General form: IfpremiseThenconsequent • The premises (antecedents) are associated with the fuzzy controllersinputs. • The consequents (actions) are associated with the fuzzy controllersoutputs. • Each premise (or consequent) can be composed of the conjunction (e.g., and, or) of several “terms”.
Rule Bases (Tables) • For the pendulum problem, with two inputs and five linguistic values for each of these, there are at most 52 = 25 possible rules. • Tabular representation of linguistic rules: neglarge: -2 negsmall: -1 zero: 0 possmall: +1 poslarge: +2
Membership Functions for Inputs and Output • For the inputse(t) and de(t)/dt, the outmost membership functions “saturate” at a value of one. • For the outputu, the outmost membership functions cannot be saturated for the fuzzy system to be properly defined.
Fuzzification • Fuzzification process as the act of obtaining a value of an input variable and finding the numerical values of the membership function(s) that are defined for that variable. • The membership function values as an “encoding” of the fuzzy controller numeric input values.
Inference Process • 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. • The conclusions are determined using the rule that have been determined to apply at the current time. The conclusions are characterized with a fuzzy set (or sets) that represents that the input to the plant should take on various values.
Premise Quantification via Fuzzy Logic • “error is zero and change-in-error is possmall”
Certainty of Premise • If error is zero and change-in-error is possmall Then force is negsmall. • Minimum: • Product: • Consider all possible e(t)andde(t)/dt values, we will obtaina multidimensionalmembership function
Determining Which Rules Are On • Determining the applicability of each rule is called “matching.” • A rule is “on at time t ” if its premise membership function • The inference mechanism seeks to determine which rules are on to find out which rules are relevant to the current situation.
Numerical Example • The rules that have thepremise terms “error is zero” “change-in-error is zero” “change-in-error is possmall” are on.
Determining Which Rules Are On • If error is zeroand change-in-error is zeroThen force is zero. • If error is zeroand change-in-error is possmallThen force is negsmall. • We have at mosttwomembership functionsoverlapping, we willnever have more thanfour rules on at onetime.
Inference Step:Determining Conclusions • Rule 1: If error is zeroand change-in-error is zeroThen force is zero. • 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.
Determining Conclusion • The membership function for the conclusion reached by rule (1) is given by min. operation: chop off the top
Recommendation from One Rule • The membership function of the implied fuzzy set for rule (1): • The justification for the use of the minimum (product) operator to represent the implication is that we can be no more certain about our consequent than our premise.
Recommendation from Another Rule • Rule 2: If error is zeroand change-in-error is possmall, Then force is negsmall. • The membership function of the implied fuzzy set for rule (2):
Converting Decisions into Actions • Defuzzification operates on the implied fuzzy sets produced by inference mechanism and combines their effects to provide the “most certain” controller output (plant input). • Defuzzification as “decoding” the fuzzy set information produced by the inference process (i.e., the implied fuzzy sets) into numerical fuzzy controller outputs.
Center of Gravity Defuz. • : the center of the membership function of the consequent of rule (i) • : the area under the membership function
Center-Average Defuz. • Use the product to represent the implication
COG Defuzzification • The area of the implied fuzzy set is generally proportional to since it used to chop the top of (minimum) or scale (product) the triangular output membership function when COG is used for our example.