Fuzzy Control Systems

Fuzzy Control Systems
Dr.NaveenBansal Profile Pic
Published Date:25-10-2017
Your Website URL(Optional)
CHAPTER 4 Fuzzy Control Systems Control systems theory, or what is called modern control systems theory today, can be traced back to the age of World War II, or even earlier, when the design, analysis, and synthesis of servomechanisms were essential in the manufacturing of electromechanical systems. The development of control systems theory has since gone through an evolutionary process, starting from some basic, simplistic, frequency-domain analysis for single-input single- output (SISO) linear control systems, and generalized to a mathematically sophisticated modern theory of multi-input multi-output (MIMO) linear or nonlinear systems described by differential and/or difference equations. It is believed that the advances of space technology in the 1950s completely changed the spirit and orientation of the classical control systems theory: the challenges posed by the high accuracy and extreme complexity of the space systems, such as space vehicles and structures, stimulated and promoted the existing control theory very strongly, developing it to such a high mathematical level that can use many new concepts like state-space and optimal controls. The theory is still rapidly growing today; it employs many advanced mathematics such as differential geometry, operation theory, and functional analysis, and connects to many theoretical and applied sciences like artificial intelligence, computer science, and various types of engineering. This modern control systems theory, referred to as conventional or classical control systems theory, has been extensively developed. The theory is now relatively complete for linear control systems, and has taken the lead in modern technology and industrial applications where control and automation are fundamental. The theory has its solid foundation built on contemporary mathematical sciences and electrical engineering, as was just mentioned. As a result, it can provide rigorous analysis and often perfect solutions when a system is defined in precise mathematical terms. In addition to these advances, adaptive and robust as well as nonlinear systems control theories have also seen very rapid development in the last two decades, which have significantly extended the potential power and applicable range of the linear control systems theory in practice. Conventional mathematics and control theory exclude vagueness and contradictory conditions. As a consequence, conventional control systems theory does not attempt to study any formulation, analysis, and control of what has been called fuzzy systems, which may be vague, incomplete, linguistically described, or even inconsistent. Fuzzy set theory and fuzzy logic, studied in some detail in Chapters 1 and 2, play a central role in the investigation of controlling such systems. The main contribution of fuzzy control theory, a new alternative and branch of control systems theory that uses fuzzy logic, is its ability to handle many practical problems that cannot140 Fuzzy Control Systems •• 4 be adequately managed by conventional control techniques. At the same time, the results of fuzzy control theory are consistent with the existing classical ones when the system under control reduces from fuzzy to nonfuzzy. In other words, many well-known classical results can be extended in some natural way to the fuzzy setting. In the last three chapters, we have seen many such examples: the interval arithmetic is consistent with the classical arithmetic when an interval becomes a point; the fuzzy logic is consistent with the classical logic when the multi-valued inference becomes two-valued; and the fuzzy Lyapunov stability and fuzzy controllability (and observability) become the classical ones when the fuzzy control systems become nonfuzzy. Basically, the aim of fuzzy control systems theory is to extend the existing successful conventional control systems techniques and methods as much as possible, and to develop many new and special-purposed ones, for a much larger class of complex, complicated, and ill-modeled systems – fuzzy systems. This theory is developed for solving real-world problems. The fuzzy modeling techniques, fuzzy logic inference and decision-making, and fuzzy control methods to be studied in the following chapters, should all work for real-world problems – if they are developed correctly and appropriately. The real-world problems exist in the first place. Fuzzy logic, fuzzy set theory, fuzzy modeling, fuzzy control methods, etc. are all man-made and subjectively introduced to the scene. If this fuzzy interpretation is correct and if the fuzzy theory works, then one should be able to solve the real-world problems after the fuzzy operations have been completed in the fuzzy environment and then the entire process is finally returned to the original real- world setting. This is what is called the “fuzzification – fuzzy operation – defuzzification” routine in the fuzzy control systems theory. We will study this routine in detail for various control systems design and applications in this chapter. Although fuzzy control systems theory is used for handling vague systems, this theory itself is not vague. On the contrary, it is rigorous: as has been seen from Chapters 1 and 2, fuzzy logic is a logic, and fuzzy mathematics is mathematics. It will be seen in this chapter that fuzzy logic control is an effective logical control technique using some simple fuzzy logic, in a way comparable to the well-known programmable logic control (PLC) using classical two-valued logic. To motivate, the PLC theory is first reviewed in the next section as an introduction to the general fuzzy logic control (FLC) theory and methodology. I. CLASSICAL PROGRAMMABLE LOGIC CONTROL A programmable logic controller (PLC) is a simple microprocessor-based, specialized computer that carries out logical control functions of many types, with the general structure shown in Figure 4.1. A PLC usually operates on ordinary house current but may control circuits of large amperage and voltage of 440V and higher. A PLC typically has a4•• Fuzzy Control Systems 141 110V ac source Power User Supply Interface Memory console Back-up Microprocessor battery CPU I/O Interface ... ... Outputs to Process Inputs from Process Figure 4.1 A programmable logic controller (PLC). detachable programmer module, used to construct a new program or modify an existing one, which can be taken easily from one PLC to another. The program instructions are typed into the memory by the user via a keyboard. The central processing unit (CPU) is the heart of the PLC, which has three parts: the processor, memory, and power supply. In the input-output (I/O) modules, the input module has terminals into which the user enters outside process electrical signals and the output module has another set of terminals that send action signals to the processor. A remote electronic system for connecting the I/O modules to long-distance locations can be added, so that the actual operating process under the PLC control can be some miles away from the CPU and its I/O modules. Optional units include racks, chassis, printer, program recorder/player, etc. To see how a PLC works, let us consider an example of a simple pick-and- place robot arm working in an automatic cycle under the control of a PLC. This simple robot arms is shown in Figure 4.2, which has three joints: one rotational type and two sliding types, as indicated by the arrows; and has a gripper that can close (to grasp an object) and open (to release the object). To control this robot arm, according to the structure shown in Figure 4.2, we need eight actions created by the PLC, called outputs of the PLC, as follows: A0: rotate the base counterclockwise (CCW), A1: rotate the base clockwise (CW), A2: lift the arm,142 Fuzzy Control Systems •• 4 rotate CCW rotate CW retract the arm lift the arm lower extend the arm the arm Figure 4.2 A pick-and-place robot arm controlled by a PLC. A3: lower the arm, A4: extend the arm, A5: retract the arm, A6: close the gripper, A7: open the gripper. Suppose that in each cycle of the control process, the entire job performance is completed in 12 steps sequentially within 40 seconds, as shown in Figure 4.3. Step Outputs Time Duration in Activities 1 A4 (extend arm) 4 2 A3 (lower arm) 2 3 A6 (close gripper) 1 4 A2 (lift arm) 2 5 A5 (retract arm) 4 6 A0 (rotate base CCW) 7 7 A4 (extend arm) 4 8 A3 (lower arm) 2 9 A7 (open gripper) 1 10 A2 (lift arm) 2 11 A5 (retract arm) 4 12 A1 (rotate base CW) 7 0 5 10 15 20 25 30 35 40 time (seconds) Figure 4.3 Time duration of activities of the robot arm.4•• Fuzzy Control Systems 143 Table 4.1 PLC Drum-Timer Array for the Robot Arm Step Counts Outputs (count/sec) A0 A1 A2 A3 A4 A5 A6 A7 1 4 0000100 0 2 2 0001000 0 3 1 0000001 0 4 2 0010000 0 5 4 0000010 0 6 7 1000000 0 7 4 0000100 0 8 2 0001000 0 9 1 0000000 1 10 2 0010000 0 11 4 0000010 0 12 7 0100000 0 In Figure 4.3, it is shown that the PLC is needed to first operate the “extend arm” action for 4 seconds (from the beginning), and then stop this action. To this end, the PLC operates the “lower arm” action for 2 seconds and then stops, and so on. For simplicity, we assume that the transitions between any two consecutive steps are continuous and smooth, so that no time is needed for any of these transitions. To set up the PLC timer, called the drum-timer, so as to accomplish these sequential activities of the robot arm, we need to select the time frequency for the PLC. Since the smallest step time in Figure 4.3 is the 1-second gripper operation, we select a count frequency of 1 count per second. The entire PLC drum-timer array is shown in Table 4.1, where 1 means ON and 0 means OFF, as usual. The above-described sequential control process is by nature an open-loop control procedure. Now, if we use sensors to provide feedback information at each step of the arm’s motion, then we can also perform a closed-loop logic control. For this purpose, mechanical limit switches (or proximity switches) can be used to sense the point of completion of each arm motion and, hence, provide inputs to the PLC. The PLC can then be programmed not to begin the next step until the previous step has been completed, regardless of how much time this might take. We will use, by industrial convention, the number symbol 00 to represent the input from the limit switch that signals completion of the previous output A0 (“rotating the base counterclockwise”), the number symbol 01 to represent the input from the limit switch that signals completion of the previous output A1 (“rotating the base clockwise”), and, finally, 07 for the input that signals144 Fuzzy Control Systems •• 4 Table 4.2 Robot Arm Control Scheme Arm Motion PLC Outputs PLC Inputs Necessary Prior Conditions extend arm A4 04 01, 07 lower arm A3 03 01, 04, 07 close gripper A6 06 01, 03 lift arm A2 02 01, 06 retract arm A5 05 01, 02, 06 rotate base CCW A0 00 05, 06 extend arm A4 04 00, 06 lower arm A3 03 00, 04, 06 open gripper A7 07 00, 03 lift arm A2 02 00, 07 retract arm A5 05 00, 02, 07 rotate base CW A1 01 05, 07 completion of A7. The entire scheme, together with necessary prior inputs for each arm motion, is shown in Table 4.2. Note that in this diagram, usually two previous steps are sufficient as prerequisite, but one more is needed in case two are not enough for distinction of different actions. It is also important to remark that if we do not consider the necessary prior conditions, then when the PLC applies the logic control to the robot arm, it may make mistakes. For example, the second step in Table 4.2 is “lower arm,” for which the completion is represented by 03. If 03 were to be used as the logic input to trigger the next step in the sequential operations, the “close gripper” action, the robot arm would always close its gripper after it executes the action “lower arm.” However, the eighth step of the program is also “lower arm,” but it is followed by “open gripper” instead. Hence, it is necessary to provide other prior conditions to the eighth step to ensure that it would not repeat the second step here. Figure 4.4 shows the ladder logic diagram corresponding to Table 4.2, in which the standard symbols listed in Table 4.3 are used, and the input contact P0 is used to represent a power-ON switch. Here, the input contacts include switches, relays, photoelectric sensors, limit switches, and other ON-OFF signals from the logical system; the output loads include motors, valves, alarms, bells, lights, actuators, or other electrical loads to be driven by the logical system. We should not confuse the input contact symbol with the familiar circuit symbol for capacitors. Also, we should note that output loads can become input contacts in the following steps, depending on the actual system structure. In a routine yet somewhat tedious procedure, one can verify that the PLC ladder logic diagram shown in Figure 4.4 performs the automatic control4•• Fuzzy Control Systems 145 Table 4.3 Ladder Diagram Symbols Input contacts Output loads A Logical NOT A AB Logical AND A∧ B A Logical OR A∨ B B process summarized in Table 4.2. Under the indicated necessary prior conditions for each step during the entire process, this PLC works for the designed “pick-and-place” motion-control of the robot arm described by Figure 4.3. The design procedure is time-consuming. However, once a design has been completed, the PLC can be automatically programmed over and over again, to control the robot arm to repeat the same “pick-and-place” motion for the production line. When the job assignment is changed, the PLC has the flexibility to be reprogrammed to perform a new logic control process. II. FUZZY LOGIC CONTROL (I): A GENERAL MODEL-FREE APPROACH The programmable logic controllers (PLCs) discussed in the last section, which have been widely used in industries, can only perform classical two- valued logic in programming some relatively simple but very precise automatic control processes. To carry out fuzzy logic-based control programming, a new type of programmable fuzzy logic controllers is needed.146 Fuzzy Control Systems •• 4 A0 05 06 00 P0 A0 A1 05 00 07 01 P0 A1 A2 06 01 02 P0 A2 07 00 04 A3 04 01 07 03 P0 A3 00 06 A4 01 07 04 P0 A4 00 06 A5 05 06 01 02 P0 A5 00 07 A6 03 01 06 P0 A6 A7 03 00 07 P0 A7 Figure 4.4 PLC ladder logic diagram for the robot arm.4•• Fuzzy Control Systems 147 r + e u y Controller Plant Σ Σ (reference (error (control (output signal) − signal) signal) signal) Figure 4.5 A typical closed-loop set-point tracking system. The majority of fuzzy logic control systems are knowledge-based systems in that either their fuzzy models or their fuzzy logic controllers are described by fuzzy IF-THEN rules, which have to be established based on experts’ knowledge about the systems, controllers, performance, etc. Moreover, the introduction of input-output intervals and membership functions is more or less subjective, depending on the designer’s experience and the available information. However, we emphasize once again that after the determination of the fuzzy sets, all mathematics to follow are rigorous. Also, the purpose of designing and applying fuzzy logic control systems is, above all, to tackle those vague, ill-described, and complex plants and processes that can hardly be handled by classical systems theory, classical control techniques, and classical two-valued logic. This is the first type of fuzzy logic control system: the fuzzy logic controller directly performs the control actions and thus completely replaces a conventional control algorithm. Yet, there is another type of fuzzy logic control system: the fuzzy logic controller is involved in a conventional control system and thus becomes part of the mixed control algorithm, so far as to enhance or improve the performance of the overall control system. We will study these two types of fuzzy logic control systems, often alternatively, in the rest of this book. In this section, we first discuss a general approach of fuzzy logic control for a conventional (crisp) system (plant or process) of the feedback (closed- loop) type. A. A Closed-Loop Set-Point Tracking System To facilitate our presentation and discussion, we consider the typical continuous-time, closed-loop, set-point tracking system shown in Figure 4.5. In this figure, we assume that the plant is a conventional (crisp) one, which is given but its mathematical model may not be known, and that all the signals (r, e, and y) are crisp. The closed-loop set-point tracking control problem is to design the controller such that the output signal of the controlled plant, y, can track the given reference signal r (need not be a constant): e(t) : r(t)− y(t)→ 0(t→∞). = Instead of designing a conventional controller, in the following we study how to design a fuzzy logic controller for the same purpose. Recall that in148 Fuzzy Control Systems •• 4 e u Fuzzification Fuzzy Rule Base Defuzzification controller controller input output Fuzzy Logic Controller (FLC) Figure 4.6 General structure of a fuzzy logic controller. designing a conventional controller, a precise mathematical model (formulation) of the plant is usually necessary. A typical example is the conventional proportional-integral-derivative (PID) controller design, where the first- or second-order linear plant transfer function has to be first given. We will review and discuss these conventional PID controllers in Chapter 5. Here, to design a fuzzy logic controller, not necessarily of PID-type, for set- point tracking, we suppose that the mathematical formulation of the plant is completely unknown. If the mathematical formula of the plant is unknown, for instance we don’t even know if it is linear or nonlinear (and, if it is linear, we don’t know what order it has; if it is nonlinear, we don’t know what kind of nonlinearity it has), how can we design a controller to perform the required set-point tracking? One may think of designing a conventional controller and try to answer this question at this point, to appreciate the ease of fuzzy logic controller design to be studied below. Before we discuss how fuzzy logic can help in completing such a design for a “black box” system, we need to clarify some basic concepts and to introduce some new terminology. First, the general structure of a fuzzy logic controller (FLC), or fuzzy controller (FC) for short, consists of three basic portions: the fuzzification unit at the input terminal, the inference engine built on the fuzzy logic control rule base in the core, and the defuzzification unit at the output terminal, as shown in Figure 4.6. The fuzzification module transforms the physical values of the current process signal, the error signal in Figure 4.5 which is input to the fuzzy logic controller, into a normalized fuzzy subset consisting of a subset (interval) for the range of the input values and an associate membership function describing the degrees of the confidence of the input belonging to this range. The purpose of this fuzzification step is to make the input physical signal compatible with the fuzzy control rule base in the core of the controller. Here, between the physical input signal and the fuzzy subset within the fuzzification unit, a pre-processing unit mapping the physical signal to some pointwise and crisp real values (that the fuzzy subset can accept) may be needed, depending on the nature of the underlying process. Generally speaking, a universal fuzzy 4•• Fuzzy Control Systems 149 logic controller for the closed-loop set-point tracking system shown in Figure 4.5 is unlikely possible. Hence, the fuzzy subset, both the subset and the membership function, has to be selected by the designer according to the particular application at hand. In other words, depending on the nature and characteristics of the given plant and reference signal, the FLC has to be designed to fit to the need, so as to make the closed-loop fuzzy control system work for that particular application. This situation is just like the design of a conventional controller for a specifically given system, where there is no universal controller in practical design. The role of the inference engine in the FLC is key to make the controller work − and work effectively. The job of the “engine” is to create the control actions, in fuzzy terms, according to the information provided by the fuzzification module and the set-point tracking requirement (and perhaps other control performance requirements as well). A typical fuzzy logic IF-THEN rule base performing the inference is in the general form that was studied in detail in Sections II-VI of Chapter 2. More specifically, the rule base is a set of IF-THEN rules of the form 1 R : IF controller input e is E AND ... AND 1 11 controller input e is E n 1n THEN controller output u is U . 1 1 M m R : IF controller input e is E AND ... AND 1 m1 controller input e is E n mn THEN controller output u is U . m m Here, as discussed in Sections II-VI of Chapter 2, the fuzzy subsets E , ..., 11 E share the same subset E and the same membership function µ defined m1 1 E 1 on E , and fuzzy subsets E , ..., E share the same subset E and the same 1 1n mn n membership function µ defined on E . In general, m rules produce m E n n controller outputs, u , ..., u , belonging to m fuzzy subsets, U , ..., U , in 1 m 1 m which, of course, some of them may overlap. The establishment of this rule base depends heavily on the designer’s work experience, knowledge about the physical plant, analysis and design skills, etc., and is, hence, more or less subjective. Thus, a good design can make the controller work; a better design can make it work more effectively. This situation is just like conventional design: any specific design is not unique in general. Yet, there are some general criteria and some routine steps for the designer to follow in a real design, which will be discussed in more detail later. Here, basically, what have to be determined are the choices of the controller’s input and output variables and the IF-THEN rules. The defuzzification module is the connection between the control rule base and the physical plant to be controlled, which plays the role of a transformer mapping the controller outputs (generated by the control rule base in fuzzy terms) back to the crisp values that the plant can accept. Hence, in a sense the defuzzification module is the inverse of the fuzzification module. The150 Fuzzy Control Systems •• 4 controller outputs u , ..., u , generated by the rule base above, are fuzzy 1 m signals belonging to the fuzzy subsets U , ..., U , respectively. The job of the 1 m defuzzification module is to convert these fuzzy controller outputs to a pointwise and crisp real signal, u, and then send it to the physical plant as a control action for tracking. Between the defuzzification step and the physical plant, a post-processing unit mapping the pointwise signal u to a physical signal (that the plant can accept) may be needed, depending again on the nature of the underlying process. What has to be determined in this stage is essentially a defuzzification formula. There are several commonly used, logically meaningful, and practically effective defuzzification formulas available, which are by nature weighted average formulas in various forms. This tree-step design routine, the “fuzzification – rule base establishment – defuzzification” procedure, is further discussed in detail next. B. Design Principle of Fuzzy Logic Controllers Now, we are in a position to discuss some design principles of a fuzzy logic controller, using the typical structure shown in Figure 4.6, for the set- point tracking system depicted in Figure 4.5. We only consider a continuous-time single-input/single-output (SISO) system in this study for simplicity of notation. Discrete-time and multi- input/multi-output (MIMO) cases can be similarly discussed. Suppose that a scalar-valued reference signal r, the set-point, is given, which needs not be a constant in general. For ease of explanation, we fix it to be constant in the following discussion. A plant is also assumed to be given, whose mathematical formulation is assumed to be unavailable. The aim is to design a fuzzy logic controller, to be put into the controller block of Figure 4.5, to derive the plant output y(t) to track the constant set-point r as t→∞, or, in other words, to force the error signal e(t) : r− y(t)→ 0(t→∞). = The following is a general approach for the design of the fuzzy logic controller. (1) The Fuzzification Module. The fuzzification module performs the following functions: (1.1) It transforms the physical values (position, voltage, degree, etc.) of the process signal, the error signal shown in Figure 4.6 which is an input to the fuzzy logic controller, into a normalized fuzzy subset consisting of a subset (interval) for the range of the input values and a normalized membership function describing the degree of confidence of the input belonging to this range. For example, suppose that the physical error signal, the input to the fuzzy logic controller shown in Figure 4.6, is the degree of temperature. Suppose also that the distribution of this temperature error signal is within the range4•• Fuzzy Control Systems 151 NL PL NL PL 1 1 o o o o o o −25 −104 1 5 −1 0 1 Figure 4.7 Selection examples of membership functions for error signals. −25°,45° in an application in which the fuzzy logic controller needs to be designed to reduce this error to 0°±0.01°. In this case, the scale of 1° is too large to use in the measurement of the control effect within ±0.01°. Hence, we may first try to rescale the range to be −2500,4500 in the unit of 0.01°. But this is not convenient in the calculation of fuzzy membership functions either. To have a compromise, a better choice can be a combination of two different scales (see Figure 4.7): Use −25°,45° when error 1; Use −100,100 when error ≤ 1, with 1° = 100. (1.2) It selects reasonable and good, ideally optimal, membership functions under certain convenient criteria meaningful to the application. In the above-described temperature control example, one may use the membership functions shown in Figure 4.7 to describe “the error is positive large (PL),” or “the error is negative large (NL),” etc., in which one figure is in the 1° scale and the other is in the 1 = 0.01° scale. A designer may have other choices, of course, but this example should provide some idea about how the selection can be done in general. In the fuzzification module, the input is a crisp physical signal (e.g., temperature) of the real process and the output is a fuzzy subset consisting of intervals and membership functions. This output will be the input to the next module, the fuzzy logic IF-THEN rule base for the control, which requires fuzzy-subset inputs in order to be compatible with the fuzzy logic rules. (2) The Fuzzy Logic Rule Base. Designing a good fuzzy logic rule base is key to obtaining a satisfactory controller for a particular application. Classical analysis and control strategies should be incorporated in the establishment of a rule base. A general procedure in designing a fuzzy logic rule base includes the following: (2.1) Determining the process states and control variables.152 Fuzzy Control Systems •• 4 temperature bc y t ( ) o r = 45 d e t ( ) a 0 t Figure 4.8 Temperature set-point tracking example. In the set-point tracking example discussed above in Figures 4.5 and 4.6, let us suppose that the physical process is a temperature control. Thus, the set-point r is a target temperature to be reached, say r = 45°. In this application, the process state is the overall controlled system output, y(t), which is also temperature. Finally, the error signal e(t) = r− y(t), (4.1) as shown in Figure 4.8, is used to create the control variable u (see Figure 4.5) through the controller. (2.2) Determining input variables to the controller. As mentioned above, the tracking error signal e(t) is an input variable to the controller (see Figures 4.5 and 4.6). Oftentimes, we need more auxiliary input variables in order to establish a complete and effective rule base. In this temperature control example, it can be easily seen that only the error signal e(t) is not enough to write an IF-THEN control rule. Indeed, let us say e 0 at a moment. Then we know e = r− y 0or r y, namely, at that moment the system output y is below the set-point. This indicates that the output y is either at position a or position d in Figure 4.8. However, this information is not sufficient for determining a control strategy that can bring the trajectory of y to approach the set-point thereafter: if the output y is at position a then the controller should take action to keep the trajectory going up; if y is at position d then the controller should turn the trajectory to the opposite moving direction (from pointing down to pointing up). Namely, in the first case the controller should maintain the previous action but in the last case it should switch its previous action to the opposite. Therefore, one more input variable that can distinguish these two situations is necessary. Recall from Calculus that if a curve is moving up its derivative is positive and if it is moving down its derivative is negative. Hence, the change of the & error signal, denoted e or ∆ e, can help distinguish the two situations at points 4•• Fuzzy Control Systems 153 a and d, as well as that at points b and c, shown in Figure 4.8. Hence, we introduce the change of error as the second input variable for this temperature set-point tracking example. More input variables can be introduced such as && the second derivative e or the sum (integral) Σe of the errors, to make the controller work more effectively. However, this will also complicate the design, and so there is a trade-off for the design engineer. In order to simplify the design and for simplicity of discussion, in this example we only use two & input variables, e and e , for the controller. (2.3) Establishing a fuzzy logic IF-THEN rule base. The input variables determined in the previous step will be used in the design of the rule base for control. As mentioned above, successful classical analysis and control strategies should also be incorporated in the design. To obtain some ideas and insights about the rule base design, we consider again the above temperature control example. In Figure 4.8, it is clear that essentially we have four situations to consider: when the temperature output y(t) is at the situations represented by the points a, b, c, and d. We thus need at least four rules for this set-point tracking application in order to make it work and work effectively. In principle, also intuitively, we can set up the following four control rules, where u is the output (control action) of the controller: 1 R:IF e 0 AND e& 0 THEN u(t+) = u(t); 2 & R:IF e 0 AND e 0 THEN u(t+) = −u(t); 3 R:IF e 0 AND e& 0 THEN u(t+) = u(t); 4 R:IF e 0 AND e& 0 THEN u(t+) = −u(t). & Otherwise (e.g., e = 0 or e = 0), u(t+) = u(t), until the next step. In Figure 4.8, it is very important to observe that e& (t) = r& − y& (t) = − y& (t). (4.2) 1 2 3 4 Hence, the rules R , R , R , and R correspond to the situations indicated by points a, b, c, and d, respectively, in Figure 4.8. In these rules, the notation u(t+) = u(t) means that, conceptually, the controller retains its previous action unchanged, while u(t+) = −u(t) means that the controller turns its previous action to the opposite (e.g., from a positive action to a negative action, or vice versa). Quantitative implementation of these actions will be further discussed below. To this end, it can be easily realized that by following the above four rules, the controller is able to drive the temperature output y(t) to track the set-point & & r, at least in principle. For example, if e 0 and e 0 then r y and y 0, 1 which means that the curve y is at position a of Figure 4.8. In this case, rule R implies that the controller should maintain its current action (to keep pushing the system in the same way). The other three rules can be similarly analyzed. However, some technical issues remain. Let us again look at the situation 1 at point a in Figure 4.8, which has the control rule R . One problem with this rule is that if the previous control action u were small, this rule would let the154 Fuzzy Control Systems •• 4 µ µ PL NL 1 µ µ 1 PS NS . . 0H ee , −H 0 ee , (a) (b) & Figure 4.9 Four membership functions for both e and e . controller keep driving the output temperature up toward the set-point, but very slowly; so it may need a long time to complete the task. Another problem with this rule, on the other side of the issue, is that if the previous control action u were large, this rule would lead the controller to drive the output temperature overshooting the set-point. As a result of such rules and actions, the output temperature oscillates up and down around the set-point, which may not eventually settle at the set-point, or take a very long time to do so. Hence, these four rules have to be further improved to be practical. Recall that we have fuzzified the error signal e in the fuzzification module. & If we also fuzzify the change of error, e , in the fuzzification module, then we & have two fuzzified input variables, e and e , for the controller, and they have corresponding membership functions to describe their properties of “positive large,” “negative small,” etc. These properties can be used to improve the above rules. Again, let us consider the situation at point a in Figure 4.8 and its 1 corresponding control rule R . It is clear that if the error e 0 is small then the controller can take a smaller action, and if the error e 0 is large then the controller can take a larger action. In doing so, the output trajectory y(t) will be directed to the set-point correctly and more efficiently. Therefore, we should incorporate the membership values of the two input variables e and e& in the four control rules. To further simplify the notation and discussion below, we only use the simple membership functions shown in Figure 4.9, rather than those shown in & Figure 4.7, for both e and e . In a real application, of course, a designer can (and likely should) employ more membership functions. Using these membership functions as weights for the control u(t), we can accomplish the following task: if y is far away from r then the control action is large, but if y is close to r then the control action is small. The improved control rule base is obtained as follows: 1 + . R:IF e = PL AND e& 0 THEN u(t ) = µ (e) u(t); PL 2 + . R:IF e = PS AND e& 0 THEN u(t ) = (1−µ (e)) u(t); PS 3 + . R:IF e = NL AND e& 0 THEN u(t ) = −µ (e) u(t); NL 4 + . R:IF e = NS AND e& 0 THEN u(t ) = −(1−µ (e)) u(t); NS 5 + . R:IF e = NL AND e& 0 THEN u(t ) = µ (e) u(t); NL 6 + . R:IF e = NS AND e& 0 THEN u(t ) = (1−µ (e)) u(t); NS 7 + . R:IF e = PL AND e& 0 THEN u(t ) = −µ (e) u(t); PL4•• Fuzzy Control Systems 155 8 . R:IF e = PS AND e& 0 THEN u(t+1) = −(1−µ (e)) u(t). PS Here and below, “= PL” means “is PL,” etc. These rules can be easily verified by taking into account the temperature & & output curve y(t) shown in Figure 4.8, the relation y (t) = − e (t), and the four & membership functions for e (and the same four membership functions for e ) . shown in Figure 4.9. Note that “ ” in the formulas of u(t+1) above are algebraic multiplications. To implement these rules on a digital computer, we actually use their discrete-time version of the form u(t) = u(kT) and u(t+) = u((k+1)T), (4.3) where T is the sampling time and u(kT) is the value of the new change of the ... control action: ∆ u(t) at t = kT, k = 0, 1, 2, . Thus, the actual executive rules on a computer program become 1 & R:IF e(kT) = PL AND e (kT) 0 . THEN u((k+1)T ) = µ (e(kT)) u(kT); PL 2 & R:IF e(kT) = PS AND e (kT) 0 . THEN u((k+1)T) = (1−µ (e(kT))) u(kT); PS 3 R:IF e(kT) = NL AND e& (kT) 0 . THEN u((k+1)T ) = −µ (e(kT)) u(kT); NL 4 & R:IF e(kT) = NS AND e (kT) 0 . THEN u((k+1)T ) = −(1−µ (e(kT))) u(kT); NS 5 R:IF e(kT) = NL AND e& (kT) 0 . THEN u((k+1)T ) = µ (e(kT)) u(kT); NL 6 & R:IF e(kT) = NS AND e (kT) 0 . THEN u((k+1)T ) = (1−µ (e(kT))) u(kT); NS 7 & R:IF e(kT) = PL AND e (kT) 0 . THEN u((k+1)T ) = −µ (e(kT)) u(kT); PL 8 & R:IF e(kT) = PS AND e (kT) 0 . THEN u((k+1)T) = −(1−µ (e(kT))) u(kT), PS 1 ... & for all k = 0, 1, 2, , where e (kT) ≈ e(kT) − e((k−1)T), with the initial T 1 & conditions y(0) = 0, e(−T) = e(0) = r− y(0), e (0) = e(0)− e(−T) = 0. T We finally remark that another commonly used alternative for determining the weight of the control u(t) is to give it a value of PL, PS, NL, or NS. More specifically, we put the above rule base in a tabular form as shown in Table 4.4. Table 4.4 is sometimes called a “look-up table,” which can be made more & accurate by dividing both e and e into more subcases. Table 4.5 gives an example of a more subtle rule-base table for fuzzy logic controller whose control action is proportional to both e and e& , namely, & u((k+1)T) = ae(kT) + be (kT)156 Fuzzy Control Systems •• 4 Table 4.4 A Rule Base in the Tabular Form for ∆ u . e 0 0 e PL PL NL PS PS NS NS NS PS NL NL PL & Table 4.5 A Rule Base Table for u = ae + be . ee NL NM NS ZO PS PM PL NL NL NL NL NL NM ZO PS NM NL NL NL NM ZO PS PM NS NL NL NM ZO PS PM PL ZO NL NM ZO PS PM PL PL PS NM ZO PS PM PL PL PL PM ZO PS PM PL PL PL PL PL PS PM PL PL PL PL PL for some constants a 0 and b 0, where NM and ZO mean “negative medium” and “zero,” respectively, and the other abbreviations are similarly understood. Finally, we need to select membership functions for the different control 1 8 outputs, given either by the formulas shown in the rule base R - R above, or by the linguistic terms PL, PS, NS, and NL shown in Table 4.4. Figure 4.10 is a simple, yet typical choice for the membership functions of u, where P, N, and ZO indicate positive, negative, and zero, respectively, and H is a real number. (2.4) Establishing a fuzzy logic inference engine. In order to complete the fuzzy logic inference embedded in the control rule base, the general fuzzy IF-THEN rule given in Definition 2.1 of Chapter 2 has to be applied to each rule in the rule base. Take the first rule as an example: 1 R:IF e(kT) = PL AND e& (kT) 0 . THEN u((k+1)T) = µ (e(kT)) u(kT). PL4•• Fuzzy Control Systems 157 µ µ µ N ZO P 1 ∆ u –H 0 H Figure 4.10 Typical membership functions for ∆ u. In this rule, e(kT) = PL has a membership function µ (e(kT)) shown in Figure PL 4.9 (a), e& (kT) 0 is nonfuzzy and so has membership values µ ( e& (kT)) = 1, N and u((k+1)T) has three membership functions as shown in Figure 4.10. Thus, the fuzzy logic inference µ (e(kT))∧µ ( e& (kT))⇒µ(u((k+1)T)) PL N yields the logical inference membership function (see Sections II, VI, Chapter 2 for more detail): & µ(u((k+1)T)) = min µ (e(kT)) , µ ( e (kT)) = µ (e(kT)) PL N PL without using the membership functions shown in Figure 4.10. Another approach is to use the output membership functions shown in Figure 4.10, along with the weighted average formula (3.12), Chapter 3, as shown in formula (4.5) below. This approach is quite common in practice. Once this logical inference has a fuzzy logic membership function, it is completed as a logical formula. A fuzzy logic control rule base with all complete logical inference membership functions is called a fuzzy logic inference engine: it activates the rules with fuzzy logic. We remark, however, that the logical inference membership functions are usually not used in the design of a digital fuzzy logic controller in many control engineering applications today, where only the control rule base discussed in the last part, part (2.3), is essential. We will follow this common practice to use the rule base rather than the inference engine in the rest of the book. Remember, this is a design of a controller, for which the design engineer has a choice of what approach to take. It is just like a classical controller design for which the designer usually has different options. (3) The Defuzzification Module. The defuzzification module is in a sense the reverse of the fuzzification module: it converts all the fuzzy terms created by the rule base of the controller to crisp terms (numerical values) and then sends them to the physical system (plant, process), so as to execute the control of the system. The defuzzification module performs the following functions:158 Fuzzy Control Systems •• 4 (3.1) It creates a crisp, overall control signal, u, by combining all possible control outputs from the rule base into a weighted average formula, such as N ∑α u (kT ) i i N i=1 u((k+1)T) = ,(α ≥ 0, ∑α 0). (4.4) i i N i=1 α ∑ i i=1 1 8 In the control rule base R - R , established above, we obtained eight different control outputs, u, which we now denote by u (kT), i = 1, ..., 8. i Suppose that we have a fuzzy logic control rule base i & R:IF e(kT) is E AND e (kT) is F THEN u ((k+1)T) is U , i i i i where i = 1, ..., N; E , F , and U are fuzzy subsets consisting of some bounded i i i intervals with their associated membership functions µ (⋅), µ (⋅), and µ (⋅), E F U i i i respectively. Note that this control rule base may also be given in a tabular form like the one shown in Table 4.5. There are several commonly used defuzzification formulas: (i) The “center-of-gravity” formula: N µ (u (kT ))⋅u (kT ) ∑ U i i i i=1 u((k+1)T) = , (4.5) N ∑µ (u (kT )) U i i i=1 which is by nature the same as the formula (3.12) introduced in Chapter 3. The continuous-time version of this formula is µ (u )⋅u du ∫ U U u(t) = , (4.6) µ (u )du ∫ U U where U is the value range (interval) of the control u in the rule base (the continuous-time version): R:IF e(t) is E AND e& (t) is F THEN u(t+) is U. In applications, namely, in a practical engineering design employing digital computers, the continuous-time formulation is seldom used. However, the continuous-time formula (4.6) best explains the name of the formula: if µ U represents the density function over a rigid body of volume U and u is a coordinate variable, say the horizontal x-coordinate (in a three-dimensional x-y-z Cartesian space), then formula (4.6) gives the x-coordinate of the center of mass (gravity) of the body (at time t), as is well known in Calculus and Mechanics. (ii) The “center-of-sums” formula:

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.