Fuzzy PID Controllers

Fuzzy PID Controllers
Dr.NaveenBansal Profile Pic
Published Date:25-10-2017
Your Website URL(Optional)
CHAPTER 5 Fuzzy PID Controllers Conventional (classical) proportional-integral-derivative (PID) controllers are perhaps the most well-known and most widely used controllers in modern industries: statistics has shown that more than 90% controllers used in industries todays are PID or PID-type of controllers. Generally speaking, PID controllers have the merits of being simple, reliable, and effective: they consume lower cost but are very easy to operate. Besides, for lower-order linear systems (plants, processes), PID controllers have remarkable set-point tracking performance and guaranteed stability. Therefore, PID controllers are very popular in real-world applications. In this chapter, we first give a brief review on the conventional PID controllers, and then introduce the design and stability analysis of a new type of fuzzy PID controller. We will also compare these two classes of PID controllers and discuss their advantages as well as limitations. It will be seen that the fuzzy PID controllers are generally superior to the conventional ones, particularly for higher-order, time-delayed, and nonlinear systems, and for those systems that have only vague mathematical models which the conventional PID controllers are difficult, if not impossible, to handle. For lower-order linear systems, it will be seen that both conventional and fuzzy PID controllers work equally well, so in these simple cases conventional PID controllers are recommended due to their simple structures. The price to pay for the success of the fuzzy PID controllers is that their design methods are slightly more advanced and their resulting formulas are somewhat more complicated (e.g., containing variable control gains in contrast to the conventional PID controllers where the control gains are constant). It will be seen that although the fuzzy PID controllers are designed by fuzzy mathematics, their final form as controllers are conventional controllers. As such, they can be used to directly replace the conventional ones in applications. Moreover, their variable control gains are self-tuned formulas that have adaptive capability to handle time-delay effects, nonlinearities, and uncertainties of the given system. This chapter will make these points clear. I. CONVENTIONAL PID CONTROLLERS In this section, we provide a brief review on several basic types of conventional PID controllers: their configuration, design methods, and stability analysis, which will be needed in introducing the fuzzy PID controller later, where the fuzzy PID controllers are natural extensions of the conventional ones: they have the same structure but are defined based on fuzzy mathematics and fuzzy control strategies. Individually, the conventional proportional (P), integral (I), and derivative (D) controllers for controlling a given system (plant, process) have the184 Fuzzy PID Controllers •• 5 + re u y system K P – (a) Proportional controller t + re u y system K I ∫ – 0 (b) Integral controller + d re u y system K D dt – (c) Derivative controller Figure 5.1. Proportional-integral-derivative controllers. structures shown in Figure 5.1(a), (b), and (c), respectively, where r = r(t) is the reference input (set-point), y = y(t) is the controlled system’s output, e = : e(t) = r(t)– y(t) is the set-point tracking error, and u = u(t) is the control action (output of the controller) which is used as the input to the system. In the time domain, they have the following solutions: (i) The P-controller u(t) = K e(t); P t (ii) The I-controller u(t) = K e(τ) dτ; I ∫ 0 d (iii) The D-controller u(t) = K e(t). D dt Here, the three control gains, K , K, and K , are constants to be P I D determined in the design for the set-point tracking performance and stability consideration. To increase their control capabilities, they are usually used in combinations, which will be further discussed below. In the frequency domain, we have the following corresponding relations for the individual P, I, and D controllers: (i) The P-controller U(s) = K E(s); P K I (ii) The I-controller U(s) = E(s); s (iii) The D-controller U(s) = K sE(s). D Here and throughout the chapter, we use capital letters for the Laplace transform L⋅ of a continuous-time signal, or the z-transform Z⋅ of a discrete-time signal. Thus,5•• Fuzzy PID Controllers 185 U(s) = L u(t) and E(s) = L e(t) , with zero initial conditions. The following are some basic, typical combinations of P, I, and D controllers (see Figure 5.2 for their configurations): In the time domain: t (iv) The PI-controller u(t) = K e(t) + K e(τ) dτ; P I ∫ 0 d (v) The PD-controller u(t) = K e(t) + K e(t); P D dt t d (vi) The PID-controller u(t) = K e(t) + K e(τ) dτ + K e(t); P I D ∫ dt 0 t d (vii) The PI+D-controller u(t) = K e(t) + K e(τ) dτ – K y(t). P I D ∫ dt 0 Correspondingly, in the frequency domain: K I (iv) The PI-controller U(s) = K E(s) + E(s); P s (v) The PD-controller U(s) = K E(s) + K sE(s); P D K I (vi) The PID-controller U(s) = K E(s) + E(s) + K sE(s); P D s K I (vii) The PI+D-controller U(s) = K E(s) + E(s)– K sY(s). P D s In the above, Y(s) = L y(t) = L r(t)– e(t) = R(s)– E(s). We note that the PID controller shown in Figure 5.2(c) is not a good combination of the three controllers in practice, since if the error signal e(t) has discontinuities then the D-controller will produce very bad (even unbounded) responses. This combination is good only for illustration since it has a neat formulation, and hence is called a “textbook PID controller.” A practical combination of the three controllers is the PI+D controller shown in Figure 5.2(d), where the system output signal y(t) is usually smoother than the error signal (through the I-controller and the system). More importantly, this structure of closed-loop control systems has been validated to be efficient by many practical examples and case studies. To show how a PID-type of controller works and how to design such a controller to perform set-point tracking with guaranteed stability, we study two simple examples below. Example 5.1. Consider the PI-control system shown in the frequency domain by Figure 5.3, where the given linear system has a first-order transfer function, 1/(as + b), with known constants a 0 and b. The reference r is a given constant (set-point). The design of the PI controller is to determine the186 Fuzzy PID Controllers •• 5 t K I ∫ 0 re + +u y system − + K P (a) PI controller d K D dt re + +u y system + − K P (b) PD controller K P re + +u y t + system K I ∫ 0 + − d K D dt (c) PID controller t K I ∫ 0 re + + +u y system + − − K P d K D dt (d) PI+D controller Figure 5.2 Some typical combinations of P, I, and D controllers. two constant control gains, K and K, such that the system output y(t) can P I track the reference: y(t)→ r as t→∞, while the entire feedback control system is stable even if the given transfer function 1/(as + b) is unstable. We first observe from Figure 5.3 that K I U(s) = K E(s) + E(s), P s5•• Fuzzy PID Controllers 187 K I s 1 R(s)+ E(s) + U(s) Y(s) as+ b + − K P Figure 5.3 A PI control system. E(s) = R(s)– Y(s), 1 Y(s) = U(s). as+ b By combining these relations together, we can obtain the following overall system input-output relation: K s+ K P I Y(s) = H(s) R(s) = R(s), (5.1) as+ b where H(s) is the transfer function of the overall feedback control system. It is easy to see that this transfer function has two poles: 2 − (b+ K )± (b+ K ) − 4aK P P I s = . (5.2) 1,2 2a Thus, in our design, if we choose (note: a 0) K –b, (5.3) P then we can guarantee that these two poles have negative real parts, so that the overall controlled system is stable. What we want for set-point tracking is lim e(t) = 0. (5.4) t→∞ It follows from the Terminal-Value Theorem of Laplace transforms that lim e(t)= lim sE(s) t→∞ s→0 = lim s R(s)– Y(s) s→0 = lim s 1 – H(s) R(s) s→0 2 as + bs r = lim s⋅ ⋅ 2 s→0 s as + (b+ K )s+ K P I =0. It may appear that the set-point tracking task can always be done no matter how we choose the control gain K , provided that the other control gain, K , I P satisfies the condition (5.3), and this is true for any given constants a and b in the given system (plant). This observation is correct for this example. However, in so doing it often happens that the system output y(t) tracks the set-point r with higher-frequency oscillations caused by the pure imaginary parts of the two poles given in (5.2). Hence, to eliminate such undesirable oscillations so as to obtain better tracking performance, we can select the188 Fuzzy PID Controllers •• 5 overshoot set point 0 t Figure 5.4 A typical tracking performance of the PI controller. control gain K to zero out the pure imaginary parts of the poles s and s . I 1 2 Namely, we can force 2 (b + K ) – 4 aK = 0, P I which yields 2 (b+ K ) P K = , I 4a where K has been determined by (5.3). Thus we complete the design of the PI P controller for the given plant 1/(as + b), which can be originally unstable (i.e., b 0). We thus obtain an overall stable feedback control system whose output can track the set-point without oscillations, at least in theory. Its output y(t) generally has the shape as shown in Figure 5.4. As seen, a PI controller so designed can completely eliminate both the steady-state tracking error and the transient oscillations, but may not be able to reduce the maximum overshoot in the output. On the contrary, a PD controller can generally improve the tracking performance by reducing the maximum overshoot of the output, but may not be able to eliminate the steady-state tracking error, as can be seen from the next example. Example 5.2. Consider the PD-control system shown in the frequency domain by Figure 5.5, where the given linear system has a second-order 2 transfer function, 1/(as + bs + c), with known constants a 0, b, and c. The design of the PD controller is again to determine the two constant control gains, K and K , such that the system output can track the set-point while the P D entire feedback control system is stable even if the given transfer function 2 1/(as + bs + c) is unstable. It follows from Figure 5.5 that U(s) = K E(s) + K sE(s), P D E(s) = R(s)– Y(s), 1 Y(s) = U(s), 2 as + bs+ c so that5•• Fuzzy PID Controllers 189 K s D 1 R(s)+ E(s) + U(s) Y(s) 2 as + b+ c + − K P Figure 5.5 A PD control system. K + K s P D Y(s) = H(s) R(s) = R(s). 2 as + (b+ K )s+ (c+ K ) D P The transfer function H(s) of the overall feedback control system has two poles: 2 − (b+ K )± (b+ K ) − 4a(c+ K ) D D P s = , (5.5) 1,2 2a and so the selection (note a 0) K –b (5.6) D and 2 (b+ K ) D K = – c (5.7) P 4a can guarantee the controlled system be stable and have no oscillations on the output trajectory during the set-point tracking process. However, the asymptotic tracking error for this PD controlled system is lim e(t) = lim s E(s) t→∞ s→0 = lim sI − H (s)R(s) s→0 2 as + bs+ c r = lim s⋅ ⋅ 2 s→0 s as + (b+ K )s+ (c+ K ) D P cr = , c+ K P which will not be zero if c ≠ 0 and r ≠ 0. This implies that the PD controller generally cannot eliminate the steady-state error in set-point tracking. The PD controller, as compared to the PI controller, has its advantages: it can produce smaller maximum overshoot and is more sensitive (easier to tune) in general. A typical set-point tracking performance of the PD control is similar to that of the PI controller shown in Figure 5.4. To implement a PI or PD controller on a computer, we need the digital version of the analog one discussed above. To digitize an analog controller, the following three discretization formulas can be used: z−1 (i) The forward divided difference: s = ; T190 Fuzzy PID Controllers •• 5 e(nT) 1 K I T + + 1 ∆ u(nT) + u(nT) − z T − + + −1 z v(nT) 1 u(nT−T) K P T Figure 5.6 The digital PI controller. −1 1− z (ii) The backward divided difference: s = ; T 2 z−1 (iii) The trapezoidal formula: s = , T z+1 where T 0 is the sampling period. These formulas transform the analog controller and the controlled system from the continuous-time frequency domain (in the Laplace-transform s-variable) to the discrete-time frequency domain (in the z-transform z-variable). In particular, the last formula maps the entire left-half (right-half) s-plane into the entire inner (outer) unit circle in the z-plane in such a way that the mapping is one-to-one and the entire imaginary axis corresponds to the entire unit circle. Hence, this formula preserves all basic properties, particularly the stability, of the original controller and controlled system, and hence is the one used most frequently. This trapezoidal formula is also known as the bilinear transform in engineering and the conformal mapping in mathematics. Using the bilinear transform 2 z−1 s = (5.8) T z+1 in the continuous-time PI controller, we obtain (see Figure 5.3): −1 K K T z−1 K T 2− (1− z ) K T K T I I I I I → = = + , −1 −1 s 2 z+1 2 2 1− z 1− z K K T K T I I I U(s) = (K + ) E(s)→ U(z) = (K – + ) E(z) . P P −1 s 2 1− z Let K I K = K + and K = K T. (5.9) P I P I s Then we have –1 –1 (1 – z )U(z) = K (1 – z ) E(z) + K E(z) . P I It then follows from the inverse z-transform that5•• Fuzzy PID Controllers 191 d(nT) 1 K P + T + −1 z + e(nT) u(nT) + u(nT) ∆ T + −1 − z −1 z + u(nT−T) − v(nT) 1 K D T Figure 5.7 The digital PD controller. u(nT)– u(nT–T) = K e(nT)– e(nT–T) + K e(nT), P I so that − − − − u(nT) u(nT T ) e(nT ) e(nT T ) K I = K + e(nT). P T T T Let, furthermore, u(nT)− u(nT − T ) ∆ u(nT) = (5.10) T be the incremental control and e(nT )− e(nT − T ) v(nT) = . (5.11) T We arrive at u(nT) = u(nT–T) + T∆ u(nT) (5.12) K I ∆ u(nT) = K v(nT) + e(nT), (5.13) P T which can be implemented as shown in Figure 5.6. Similarly, using the bilinear transform (5.8) in the continuous-time PD controller (see Figure 5.5), we obtain −1 2 z−1 2 1− z sK → K = K , D D D −1 T z+1 T 1+ z −1 2 1− z U(s) = (K + sK ) E(s)→ U(z) = (K + K ) E(z) . P D P D −1 T 1+ z Let 2 K = K and K = K . (5.14) P D P D T Then we have –1 –1 –1 (1 + z )U(z) = (1 + z ) K E(z) + K (1 + z ) E(z) , P D so that the inverse z-transform gives192 Fuzzy PID Controllers •• 5 ∆ u(nT) = K d(nT) + K v(nT), (5.15) P D where e(nT )+ e(nT − T ) d(nT) = , T e(nT )− e(nT − T ) v(nT) = . T This digital PD controller, described by (5.15), can be implemented as shown in Figure 5.7. We remark that formula (5.15) can be rewritten as u(nT) = –u(nT–T) + K e(nT) + e(nT–T) + K e(nT)– e(nT–T), P D so that u(nT–T)= –u(nT–2T) + K e(nT–T) + e(nT–2T) P + K e(nT–T)– e(nT–2T). D Thus, by substituting u(nT–T) into u(nT), we obtain u(nT)= u(nT–2T) + K e(nT)– e(nT–2T) P + K e(nT)– 2e(nT–T) + e(nT–2T) D e(nT )− e(nT − 2T ) = u(nT–2T) + K T P T e(nT )− 2e(nT − T )+ e(nT − 2T ) 2 + K T , D 2 T where the two finite divided differences are the discretization of e&(t) and && e(t) , respectively, of the continuous-time error signal e(t), under the bilinear transform. This formula shows clearly that the digital PD controller implicitly & && uses the discretization of both e(t) and e(t) , as is known in conventional control theory. Since this formula is equivalent to, but more complicated than, formula (5.15), we will not use it in the following. The fuzzy PI, PD, and PI+D controllers to be introduced below employ the digital PI controller (5.12) and the digital PD controller (5.15), whose implementations are shown in Figures 5.6 and 5.7, respectively. II. FUZZY PID CONTROLLERS We are now in a position to introduce the fuzzy PID controllers: their design methods, performance evaluation, and stability analysis. We first study the fuzzy PD controller design in detail, in which all the basic ideas, design principles, and step-by-step derivation and calculations are discussed. The fuzzy PI controller design will be discussed briefly next, followed by the fuzzy PI+D controller design. Having this background, many other types of fuzzy PID controllers can be designed by following similar procedures. The stability analysis of these fuzzy PID controllers will be investigated in the last section of the chapter.5•• Fuzzy PID Controllers 193 Although it is possible to design a fuzzy logic type of PID controller by a simple modification of the conventional ones, via inserting some meaningful fuzzy logic IF-THEN rules into the control system (e.g., to self-tune the PID control gains with the help of a “look-up” table), these approaches in general complicate the overall design and do not come up with new fuzzy PID controllers that capture the essential characteristics and nature of the conventional PID controllers. Besides, they generally do not have analytic formulas to use for control specification and stability analysis. The fuzzy PD, PI, and PI+D controllers to be introduced below are natural extensions of their conventional versions, which preserve the linear structures of the PID controllers, with simple and conventional analytical formulas as the final results of the design. Thus, they can directly replace the conventional PID controllers in any operating control systems (plants, processes). The main difference is that these fuzzy PID controllers are designed by employing fuzzy logic control principles and techniques, which have been studied in the last few chapters, to obtain new controllers that possess analytical formulas very similar to the conventional digital PID controllers. After the design is completed, all the fuzzy logic IF-THEN rules, membership functions, defuzzification formulas, etc. will not be needed any more in applications: what one can see is a conventional controller with a few simple formulas similar to the familiar PID controllers. Thus, in operations the controllers do not use any “look-up” table at any step, and so can be operated in real time. A control engineer who doesn’t have any knowledge about fuzzy logic and/or fuzzy control systems can use them just like the conventional ones, particularly for higher-order, time-delayed, and nonlinear systems, and for those systems that have only vague mathematical models or contain significant uncertainties. The key reason, which is the price to pay, for such success is that these fuzzy PID controllers are slightly more complicated than the conventional ones, in the sense that they have variable control gains in their linear structures. These variable gains are nonlinear functions of the errors and changing rates of the error signals. The main contribution of these variable gains in improving the control performance is that they are self-tuned gains and can adapt to the rapid changes of the errors and the (changing) rates of the error signals caused by the time-delayed effects, nonlinearities, and uncertainties of the underlying system (plant, process). A. Fuzzy PD Controller The overall fuzzy PD set-point tracking control system is shown in Figure 5.8, where the process under control is a discrete-time system (or a discretized continuous-time system), and r(nT) is the reference signal which can be a constant (set-point). The fuzzy PD controller inside the dashed box differs from the conventional digital PD controller (shown in Figure 5.7) in that there is an extra “fuzzy controller” in the path of the incremental control signal ∆ u(nT). Moreover, a constant multiplication block has been changed from the sampling period T to an adjustable constant control gain K in order to enable u the new controller one more degree of freedom in the control process (but this 194 Fuzzy PID Controllers •• 5 d(nT) 1 K P T + ∆ u(nT) + u(nT) fuzzy + K u controller −1 − z r(nT) e(nT) −1 z + −1 − z + system − v(nT) 1 K d T Figure 5.8 The fuzzy PD controller. is not necessary). In this fuzzy PD controller, the “fuzzy controller” block is the key that improves the conventional digital PD controller’s capabilities and performance. To simplify the notation, we have let the adjustable control gains be K = K and K = K p d P D in Figure 5.8 (compared to Figure 5.7), and similarly let K = K when the i I fuzzy PI controller is discussed later. To illustrate how the “fuzzy controller” block works, we first introduce a constant parameter (an adjustable scalar) L 0, and decompose the plane by L as twenty input-combination regions (IC1-IC20) as shown in Figure 5.9, where the horizontal axis is the input signal K d(nT), and the vertical axis the p input signal K v(nT), to the “fuzzy controller.” Then, according to which d region the input signals (K d(nT), K v(nT)) belong, the “fuzzy controller” p d block produces the following incremental outputs: LK d(nT )− K v(nT ) p d ∆ u(nT)= , in IC1, IC2, IC5, IC6, (5.16) 2(2L− K d(nT ) ) p LK d(nT )− K v(nT ) p d = , in IC3, IC4, IC7, IC8, (5.17) 2(2L− K v(nT ) ) d 1 = L – K v(nT) , in IC9, IC10, (5.18) d 2 1 = –L + K d(nT) , in IC11, IC12, (5.19) p 2 1 = –L – K v(nT) , in IC13, IC14, (5.20) d 25•• Fuzzy PID Controllers 195 K v(nT) d IC18 IC12 IC11 IC17 L IC4 IC3 IC13 IC10 IC5 IC2 K d(nT) P −L L IC6 IC1 IC14 IC9 IC7 IC8 −L IC19 IC15 IC16 IC20 Figure 5.9 Regions of the “fuzzy controller” input-combination values. 1 = L + K d(nT) , in IC15, IC16, (5.21) p 2 = 0, in IC17, IC19, (5.22) =–L, in IC18, (5.23) = L, in IC20. (5.24) Here, if the input signals (K d(nT), K v(nT)) belong to a boundary line, then p d either of the two neighboring regions can be used, since they will be the same (namely, all these control functions are continuous on the boundaries). This completes the description for implementation of the fuzzy PD controller in a set-point tracking system, regardless of any knowledge about the system (plant, process) under control. The initial conditions for this control system are the following nature ones: y(0) = 0, ∆ u(0) = 0, e(0) = r, v(0) = 0. (5.25) Before we discuss how to derive these formulas for the “fuzzy controller” block and in what sense this design is good, a few remarks on the above formulas are in order. First, we note that the above nine pieces of formulas are all conventional (crisp) analytical formulas, from which one does not see any fuzzy contents (membership functions, fuzzy logic IF-THEN rules, etc.). Therefore, the “fuzzy controller” block, as well as the entire fuzzy PD controller shown in Figure 5.8, are conventional controllers: the overall control system works in the conventional manner despite the name “fuzzy.” As a result, this fuzzy PD controller can be used to replace the conventional PD controller anywhere, and a control engineer can operate this fuzzy PD controller in a way completely analogous to the conventional one: what he needs to do is to tune the control gains and parameters, K , K , K , and L, without the need of p d u knowledge of the fuzzy mathematics, fuzzy logic, and fuzzy control theory. Second, the above nine pieces of formulas are continuously connected as a whole (on the boundaries between different regions shown in Figure 5.9). This can be verified by direct calculation of any two adjacent formulas on a196 Fuzzy PID Controllers •• 5 boundary. Therefore, the control formula switching process does not have any jumps. Third, since as usual all the control gains (K , K , and K ) are positive real p d u numbers, the above nine formulas can be computed from the two inputs K d(nT) and K v(nT), where we have p d K d(nT) = K v(nT) and K v(nT) = K v(nT) . p p d d Finally, but most importantly, we should point out that the first formula (5.16) preserves the linear structure of the conventional PD controller (see formula (5.15)): ⎡ LK ⎤ p ∆ u(nT)= d(nT) + ⎢ ⎥ 2(2L− K d(nT ) ) p ⎢ ⎥ ⎣ ⎦ ⎡ ⎤ − LK d v(nT), ⎢ ⎥ 2(2L− K d(nT) ) p ⎢ ⎥ ⎣ ⎦ except that the two control gains here are variable gains: they are nonlinear 1 functions of the signal d(nT) = e(nT) + e(nT–T). Similarly, the second T formula, (5.17), has the same linear structure but with two variable gains that 1 are nonlinear functions of the signal v(nT) = e(nT)– e(nT–T). It is very T important to note that it is exactly these variable control gains that improve the performance of the controller: when the error signal e(nT) increases, for instance, the signal d(nT) increases, so that the control gain L/2(2L–K d(nT)) p also increases automatically. This means that the controller takes larger actions accordingly and, hence, has certain self-tuning and adaptive capabilities in the control process. Here, it is also important to note that K d(nT) will not exceed the constant L in the denominator of the control gain p according to the definition of the input-combination (IC) regions shown in Figure 5.9; otherwise, the formula will switch to another one of the nine formulas. We next discuss the design principle of the fuzzy PD controller described above, and give detailed derivations to the resulting formulas (5.16)-(5.24). We first recall that in a standard procedure, a fuzzy controller design consists of three components: (i) fuzzification, (ii) rule base establishment, and (iii) defuzzification. Our design of the fuzzy PD controller follows this procedure. In the fuzzification step, we employ two inputs: the error signal e(nT) and the rate of change of the error signal v(nT), with only one control output u(nT) (to be fed to the system under control). The input to the fuzzy PD controller, namely, the “error” and the “rate” signals, have to be fuzzified before being fed into the controller. The membership functions for the two inputs (error and rate) and the output of the controller that is used in our design are shown in Figure 5.10, which are likely the simplest possible functions to use for this purpose. Both the error and the rate have two membership values: positive and negative, while the output has three (singleton functions): positive, negative,5•• Fuzzy PID Controllers 197 µ µ µ e(nT) v(nT) u(nT) error error error error negative positive negative positive 1 1 1 0.5 0.5 0 L 0 L 0 L −L −L −L Figure 5.10 The membership functions of e(nT), v(nT), and u(nT). and zero. The constant L 0 used in the definition of the membership functions is chosen by the designer according to the value ranges of the error, rate, and output, which is used as a tunable parameter but can also be fixed after being determined. Note that the constant L used in these three membership functions can be different in general (according to the physical meaning of the signals in the application), but we let them be the same here in order to simplify the design. Based on these membership functions, the fuzzy control rules that we used are the following: (1) R IF error = ep AND rate = vp THEN output = oz. (2) R IF error = ep AND rate = vn THEN output = op. (3) R IF error = en AND rate = vp THEN output = on. (4) R IF error = en AND rate = vn THEN output = oz. Here, “output” is the fuzzy control action ∆ u(nT), “ep” means “error positive,” “oz” means “output zero,” etc. The “AND” is the logical AND defined by µ AND µ = min µ ,µ A B A B for any two membership values µ and µ on the fuzzy subsets A and B, A B respectively. The reason for establishing the rules in such formulation can be understood in the same way as that described in Chapter 4, Section II, which is briefly repeated here for clarity. First, it is important to observe that since the error signal is defined to be e = r – y, where r is the reference (set-point) and y is the system output (see Figure 5.4 for the general situation in the continuous-time & & & & setting), we have e = r – y = – y in the case that the set-point r is constant. (1) For Rule 1 (R ): condition ep (the error is positive, e 0) implies that r & y (the system output is below the set-point) and condition vp ( e 0) implies & that y 0 (the system output is decreasing). In this case, the controller at the previous step is driving the system output, y, to move downward. Hence, the controller should turn around and drive the system output to move upward. It is very important to observe, however, that in our control law (see formula (5.12) and Figure 5.8): u(nT) = –u(nT–T) + K ∆ u(nT), (5.26) u198 Fuzzy PID Controllers •• 5 there is a minus sign in front of u(nT–T), which will automatically perform the expected task. For this reason, we set “output = oz” for the incremental control as the first rule, which means ∆ u(nT) = 0 at this step. (2) For Rule 2 (R ): condition ep (e 0) implies that r u and condition vn ( e& 0) implies that y& 0. In this case, u is below r and the controller at the previous step is driving the system output, y, to move upward. Hence, the controller needs not to take any action. But, in control law (5.26), there is a minus sign with u(nT–T) which will turn the control action to the opposite. To compensate for this, we should let ∆ u be positive, i.e., “output = op.” (3) For Rule 3 (R ): condition en (e 0) implies that r y and condition vp ( e& 0) implies that y& 0. In this case, y is over r and the controller at the previous step is driving the system output to move downward. Therefore, the controller needs not to take any action. Similar to Rule 2, to compensate the minus sign in (5.26), we let ∆ u be negative, i.e., “output = on.” (4) For Rule 4 (R ): condition en (e 0) implies that r y and condition vn ( e& 0) implies that y& 0. In this case, y is over r and the controller at the previous step is driving the system output to move upward. Hence, the controller should turn its output around to drive the system output to move downward. Because of the minus sign in (5.26), similar to Rule 1, the controller needs not to take any action: “output = oz.” Here, we remark that one may try to let the controller take some action to speed up the system output in cases of Rules 1 and 4, but this will somewhat complicate the design of the controller. In the defuzzification step, we use the same logical AND as mentioned above, and the membership functions shown in Figure 5.10 for the error e(nT), the rate v(nT), and the output ∆ u(nT) of the “fuzzy controller” block. Because we have two (positive and negative) membership values for the error and rate, the commonly used weighted average formula is used for defuzzification, leading to (membership value of input× corresponding value of output) ∑ ∆ u(nT) = (membership value of input) ∑ (5.27) The defuzzification procedure and its corresponding results are now analyzed and summarized in the following. First, we observe from (5.16)-(5.24) that, instead of the error signal e(nT), we will actually use the average error signal d(nT). We will simply call K d(nT) and K r(nT) the “error signal” and the “rate signal,” respectively. p d Note that using the average error will not alter the above reasoning for the (1) (4) control rules (R )-(R ), at least in principle. Second, observe that the membership functions of the average error and rate signals decompose their value ranges into twenty adjacent input- combination (IC) regions, as shown in Figure 5.9. This figure is understood as follows.5•• Fuzzy PID Controllers 199 We put the membership function of the error signal (given by the first picture of Figure 5.10) over the horizontal K d(nT)-axis in Figure 5.9, and put p the membership function of the rate of change of the error signal (given by the second picture of Figure 5.10) over the vertical K r(nT)-axis in Figure 5.9. d These two membership functions then overlap and form the third-dimensional picture (which is not shown in Figure 5.9) over the 2-D regions shown in Figure 5.9. When we look at region IC1, for example, if we look upward to the K d(nT)-axis, we see the domain 0,L and the membership function (in the p third dimension) over 0,L of the error signal; if we look leftward to the K r(nT)-axis, we see the domain –L,0 and the membership function (in the d third dimension) over –L,0 of the rate of change of the error signal. Then, we consider the locations of the error K d(nT) and the rate K r(nT) p d in the region IC1 and IC2 (see Figure 5.9). Let us look at region IC1, for example, where we have ep 0.5 vp (see the first two pictures in Figure (1) 5.10). Hence, the logical AND used in (R ) leads to “error = ep AND rate = vp” = min ep, vp = vp, (1) so that Rule 1 (R ) yields the selected input membership value is vp; ⎧ (1) R : ⎨ the corresponding output value is oz. ⎩ (2) (4) Similarly, in region IC1, Rules 2-4, (R )-(R ), and the logical AND used in (2) (4) (R )-(R ) together yield the selected input membership value is vn; ⎧ (2) R : ⎨ the corresponding output value is op. ⎩ the selected input membership value is en; ⎧ (3) R : ⎨ the corresponding output value is on. ⎩ the selected input membership value is en; ⎧ (4) R : ⎨ the corresponding output value is oz. ⎩ It can be verified that the above are true for the two regions IC1 and IC2. Thus, in regions IC1 and IC2, it follows from the defuzzification formula (5.27) that vp⋅ oz+ vn ⋅ op+ en⋅ on+ en⋅ oz ∆ u(nT) = . vp+ vn+ en+ en It is very important to note that if one follows the above procedure to work through the two cases, then it is found that both the last two cases give the same result of en (i.e., the two en in the above formula are not the misprint of en and ep). To this end, by applying op = L, on = –L, oz = 0 (obtained from Figure 5.10), and the following straight line formulas from the geometry of the membership functions associated with Figure 5.9: K d(nT )+ L −K d(nT )+ L p p ep = , en = , 2L 2L200 Fuzzy PID Controllers •• 5 K v(nT )+ L −K v(nT )+ L d d vp = , vn = , 2L 2L we obtain L ∆ u(nT) = K d(nT)– K v(nT). p d 22L− K d(nT ) p Here, we note that d(nT)≥ 0 in regions IC1 and IC2. In the same way, one can verify that in regions IC5 and IC6, L ∆ u(nT) = K d(nT)– K v(nT), p d 22L− K d(nT ) p where it should be noted that d(nT)≤ 0 in regions IC5 and IC6. Therefore, by combining the above two formulas, we arrive at the following result for the four regions IC1, IC2, IC5, and IC6: L ∆ u(nT) = K d(nT)– K v(nT), p d 22L− K d(nT ) p which is (5.16). Similarly, if K d(nT) and K v(nT) are located in the regions p d IC3, IC4, IC7, and IC8, we have K d(nT) ≤ K v(nT) ≤ L, p d and, in this case, L ∆ u(nT) = K d(nT)– K v(nT), p d 22L− K d(nT) d which is (5.17). Finally, in the regions IC9-IC20, we have the corresponding formulas shown as in (5.18)-(5.24). To this end, we have determined all the control rules and formulas for the fuzzy PID controller, with the control law (5.26) and the fuzzy control action ∆ u(nT) calculated by (5.16)-(5.24) according to the different locations in Figure 5.9 of the error signal K d(nT) and the rate of the change of the error p signal K v(nT). The initial conditions for the overall control system are the d following natural values: for the fuzzy control action ∆ u(0) = 0, for the system output, y(0)= 0, for the original error and rate signals, e(0) = r (the set-point) and v(0) = 0, respectively, as shown in (5.25). Finally, we remark that in the steady-state situation, e(nT) = 0, so that v(nT) = d(nT) = 0 in the denominators of the coefficients of ∆ u(nT). Thus, we obtain the steady-state relations between the conventional PD control gains c c K and K and the fuzzy PD control gain K and K as follows: p d d p K K K K c c u p u d K = and K = . (5.28) d p 4 4 Example 5.3. In order to compare the fuzzy PD controller with the conventional one, we first consider a first-order linear system with transfer function 1 H(s) = , s+15•• Fuzzy PID Controllers 201 and the reference (set-point) r = 10.0. For this sytem, the fuzzy controller parameters are: T = 0.1, K = 0.5, K = 0.5, K = 1.0, and L = 361.0. The d p u control performance is shown in Figure 5.11. We then consider a second-order linear system with transfer function 1 H(s) = , 2 s + 4s+ 3 and the reference (set-point) r = 10.0. The system response, controlled by the fuzzy PD controller, is shown in Figure 5.12. The controller parameters are T = 0.1, K = 0.51, K = 0.02, K = 0.232, and L = 1000.0. p d u In the above two cases, both conventional and fuzzy PD controllers work equally well. To show one more case of the second-order linear system, consider one with the transfer function 1 H(s) = , s(s+100) which is only marginally stable. This time, let’s make it more difficult by setting the reference as a ramp signal, r(t) = t. The controller parameters used are T = 0.01, K = 25.0, K = –50.0, K = 0.5, and L = 3000.0, and the tracking p d u tolerance is 5% of the steady-state error. For this example, it is easy to verify that the steady-state error for the conventional PD controller is given analytically by 100 e (t) = . ss c K p c c Therefore, we have to use a high gain of K = 2000.0 (along with K = p d 10.0) to obtain specified performance (of 5% steady-state tracking error). The fuzzy control result is shown in Figure 5.13, where the solid curve is the set- point while the dashed curve is the system output. This result demonstrates the advantage of the fuzzy PD controller over the conventional one (the former uses very small control gains) even for a second-order linear process. Next, consider a lower-order linear system with time-delay, with transfer function 1 –3s H(s) = e . 2 (100s+1) The comparison is shown in Figure 5.14. The conventional PD controller, c c with K = 66.0, K = 25.0, and T = 0.1, produces the solid curve. On the p d contrary, the fuzzy PD controller, with T = 0.1, K = 49.3, K = 5.3, K = 0.8, p d u and L = 19.0, yields the dashed curve in the same figure. Finally, the conventional and fuzzy PD controllers are compared using two nonlinear systems. The first one has the simple nonlinear model & y(t) = 0.0001 y(t) + u(t). We used two different references: the constant set-point r = 1.0 and the ramp signal r(t) = t. For the constant set-point case, the fuzzy PD controller has the 202 Fuzzy PID Controllers •• 5 parameters T = 0.1, K = 19.5, K = 0.5, K = 0.1, and L = 20.0. The result is p d u shown in Figure 5.15(a). The conventional PD controller, on the other hand, cannot handle this nonlinear system no matter how one changes its two c constant gains. One control performance is shown in Figure 5.15(b), with K p c = 3.0, K = 0.1, and T = 0.1. For the ramp signal reference case, the fuzzy PD d controller produces a good tracking result with very small transient oscillation, shown in Figure 5.15(c), where K = 19.0, K = 0.5, K = 0.1, L = 40.0, and T p d u = 0.1. However, although the conventional PD controller also performs well after a long transient period, as shown in Figure 5.15(d), its transient behavior is poorer (see Figure 5.15(e)), as compared to the fuzzy controller (Figure 5.15(c)). The second nonlinear example is shown in Figure 5.16, where the system is described by 2 & y(t) = –y(t) + 0.5y (t) + u(t) with the constant set-point r = 2.0. The fuzzy controller is designed with K = p 41.9, K = 15.4, K = 0.1, L = 239.0, and T = 0.1, which produces the tracking d u response shown in Figure 5.16. However, no matter how one adjusts the two constant gains of the conventional PD controller, it does not show any reasonable tracking results. 10 7.5 5 2.5 0 0 100 200 300 400 500 Figure 5.11 Output of a first-order linear fuzzy PD control system.

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