Fuzzy control is an old control paradigm that has received a lot of attention recently. In this section we will give a brief description of the key ideas. We will start with fuzzy logic, which has inspired the development. Fuzzy Logic Ordinary Boolean logic deals with quantities that are either true or false. Fuzzy logic is an attempt to develop a method for logic reasoning that is less sharp. This is achieved by introducing linguistic variables and associating them with membership functions, which take values between 0 and 1. In fuzzy control the logical operations and, or, and not are operations on linguistic variables. These operations can be expressed in terms of operations on the membership functions of the linguistic variables. Consider two linguistic variables with the membership functions fA(x) and fB(x). The logical operations are defined by the following operations on the membership functions.  A linguistic variable, where the membership function is zero everywhere except for one particular value, is called a crisp variable. Assume for example that we want to reason about temperature. For this purpose we introduce the linguistic variables cold, moderate,  Figure 7.23 Illustration of fuzzy logic. The upper diagram shows the membership functions of cold, moderate, and hot. The middle diagram shows the membership functions for cold and moderate the lower diagram shows the membership functions for cold or moderate.
and hot, and we associate them with the membership functions shown in Figure 7.23. The membership function for the linguistic variables cold and moderate and cold or moderate are also shown in the figure.
7.7.2 A Fuzzy Controller A block diagram of a fuzzy PD controller is shown in Figure 7.24. The control error, which is a continuous signal, is fed to a linear system that generates the derivative of the error. The error and its derivative are converted to so-called "linguistic variables" in a process called "fuzzification." This procedure converts continuous variables to a collection of linguistic variables. The number of linguistic variables is typically quite small, for example: negative large (NL), negative medium (NM), negative small (NS), zero (Z), positive small (PS), positive medium (PM), and positive large (PL). The control strategy is expressed in terms of a function that maps linguistic variables to linguistic variables. This function is defined in terms of a set of rules expressed in fuzzy logic. As an illustration we give the rules for a PD controller where the error and its derivative are each characterized by three linguistic variables (N, Z, P) and the control variable is 
Figure 7.24 A fuzzy PD controller. characterized by five linguistic variables (NL, NM, Z, PM, and PL). Rule 1: If e is N and de/dt is P then u is Z
Rule 2: If e is N and de/dt is Z then u is NM
Rule 3: If e is N and de/dt is N then u is NL
Rule 4: If e is Z and de/dt is P then u is PM
Rule 5: If e is Z and de/dt is Z then u is Z
Rule 6: If e is Z and de/dt is N then u is NM
Rule 7: If e is P and de/dt is P then u is PL
Rule 8: If e is P and de/dt is Z then u is PM
Rule 9: If e is P and de/dt is N then u is Z These rules can also be expressed in table form, see Table 7.1. The membership functions representing the linguistic variables normally overlap (see Figure 7.23). Due to this, several rules contribute to the control signal. The linguistic variable representing the control signal is calculated as a weighted sum of the linguistic variables of the control signal. The linguistic variable representing the control signal is then mapped into a real number by an operation called "defuzzification." More details are given in the following.
7.7.3 Fuzzy Inference Many different shapes of membership functions can be used. In fuzzy control it is common practice to use overlapping triangular shapes like the ones shown in Figure 7.23 for both inputs and control variables. Typically only a few membership functions are used for the measured variables. Fuzzy logic is only used to a moderate extent in fuzzy control. A key issue is to interprete logic expressions of the type that appears in the description of the fuzzy controller. Some special methods are used in fuzzy control. To describe these we assume that fA, fB, and fC are the membership functions associated with the linguistic variables A, B, and C. Furthermore let x and y represent measurements. If the values x0 and y0 are measured, they are considered as crisp values. Table 7.1 Representation of the fuzzy PD controller as a table.  The fuzzy statement  is then interpreted as the crisp variable  where and is equivalent to minimization of the membership functions. The linguistic variable u defined by  is interpreted as a linguistic variable with the membership function  If there are several rules, as in the description of the PD controller, each rule is evaluated individually. The results obtained for each rule are combined using the or operator. This corresponds to taking the maximum of the membership functions obtained for each individual rule. Figure 7.25 is a graphical illustration for the case of the first two rules of the PD controller. The figure shows how the linguistic variable corresponding to each rule is constructed and how the control signal is obtained by taking the maximum of the membership functions obtained from all rules. The inference procedure described is called "product-max." This refers to the operations on the membership functions. Other inference procedures are also used in fuzzy control. The and operation is sometimes represented by taking the product of two membership functions and the or operator by taking a saturated sum. Combinations of the schemes are also used. In this way it is possible to obtain "product-max" and "min-sum" inference.
7.7.4 Defuzzification Fuzzy inference results in a control variable expressed as a linguistic variable and defined by its membership function. To apply a  Figure 7.25 Illustration of fuzzy inference with two rules using the min-max rule. control signal we must have a real variable. Thus, the linguistic variable defining the control signal must be converted to a real number through the operation of "defuzzification." This can be done in several different ways. Consider a linguistic variable A with the membership function fA(x). Defuzzification by mean values gives the value  Defuzzification by the centroid gives a real variable x0 that satisfies 
7.7.5 Nonlinear Control Having gone through the details, we return to the fuzzy PD controller in Figure 7.24. We first notice that the operations fuzzification, fuzzy logic, and defuzzification can be described in a very simple way. Stripping away the vocabulary and considering the final result, a fuzzy controller is nothing but a nonlinear controller. The system in Figure 7.24  Figure 7.26 Graphic illustration of the nonlinearity of the fuzzy controller showing control signal u as function of control error e and its derivative.
can in fact be expressed as  where F is a nonlinear function of two variables. Thus, the fuzzy PD controller is a controller where the output is a nonlinear function of the error e and its derivative de/dt! In Figure 7.26 we give a graphic illustration of the nonlinearity defined by given rules for the PD controller with standard triangular membership functions and product fuzzification. The figure shows that the function is close to linear. In this particular case the fuzzy controller will behave similarly to an ordinary linear PD controller. Fuzzy control may be considered as a way to represent a nonlinear function. Notice that it is still necessary to deal with generation of derivatives or integrals, integral windup, and all the other matters in the same way as for ordinary PID controllers. We may also inquire as to when it is useful to introduce the nonlinearities and what shape they should have. Representation of a nonlinearity by fuzzification, fuzzy logic, and defuzzification is not very different from representation of a nonlinear function as a table with an interpolation procedure. Roughly speaking, the function values correspond to the rules; the membership functions and the fuzzification and defuzzification procedures correspond to the interpolation mechanism. To illustrate this we consider a function of two variables. Such a function can be visualized as a surface in two dimensions. A linear function is simply a tilted plane. This function can be described completely by three points on a plane, i.e., three rules. More complex surfaces or functions are obtained by using more function values. The smoothness of the surface is expressed by the interpolation procedures. From the point of view of control, the key question is understanding when nonlinearities are useful and what shape they should have. These are matters where much research remains to be done. There are cases where the nonlinearities can be very beneficial but also cases where the nonlinearities cause problems. It is also a nontrivial task to explore what happens. A few simulations of the behavior is not enough because the response of a nonlinear system is strongly amplitude dependent. Let us also point out that the properties of the controller in Figure 7.24 are strongly influenced by the linear filter used. It is thus necessary to limit the high-frequency gain of the approximation of the derivative. It is also useful to take derivatives of the process output instead of the error, as was discussed in Section 3.4. Other filters can also be used; by adding an integrator to the output of the system in Figure 7.24, we obtain a fuzzy PI controller. Applications The representation of the control law as a collection of rules for linguistic variables has a strong intuitive appeal. It is easy to explain heuristically how the control system works. This is useful in communicating control strategies to persons with little formal training. It is one reason why fuzzy control is a good tool for automation of tasks that are normally done by humans. In this approach it is attempted to model the behavior of an operator in terms of linguistic rules. Fuzzy control has been used in a number of simple control tasks for appliances. It has also been used in controllers for processes that are complicated and poorly known. Control of a cement kiln is one example of this type of application. Fuzzy control has also been used for controller tuning. |