Chapter 5: PID and Fuzzy Logic Air/Fuel Ratio Control
5.5 Fuzzy Controller Design
5.5.2 Fuzzy Inference System Design
In a control system the actual range of error e and the rate of error change rate (ec) is called basic universe, denoted asοΌ» π₯π, π₯ποΌ½ and οΌ» π₯ππ, π₯πποΌ½. Assume that the set of the error (e) or its change rate has the following universe (Sivanandam, Sumathi & Deepa, 2010):
π₯ = [| π| | π + 1| β― |0| β― |π 1| |π|] (5 )
where x is crisp value for the error e or error change ec, and n is set to either 6 or 7. The universe transformation can be done through the so-called quantisation factors. For example, the quantisation factor for ππ is defined as (Ming, Jun & Hao, 2004):
ππ = π π₯β (5 5) π
For a fuzzy control rule the IF linguistic variables constitute a fuzzy input space, and the THEN linguistic variables form a fuzzy output space. Each linguistic variable has a set of fuzzy language values, which consists of a set of linguistic names. Each linguistic name corresponds to a fuzzy set, values having the same universe. The linguistic names usually have some meanings, for example, N (negative), Z (zero) and P (Positive). The universe can be set to [-1, 1].
The following experiment is carried out to test a discretisation method for continuous variables. These continuous values are accurate and the range is assumed to be within [- 3, 3]. This range is further divided into seven levels, with each corresponding an integer. Note that each discretised level has a fuzzy set. This treatment is simple, otherwise, each crisp value would have to be mapped to a fuzzy subset, resulting in infinite fuzzy sets and complicating the fuzzification process. Then, a relationship can be established between the discretised crisp values in the range of [-3, 3] and the fuzzy variables. In fact, once such a relationship is ready, any crisp values within the range can be mapped to the fuzzy variable, denoted as Y. For example, any values around -3 can be viewed as big negative, denoted as the name NB, near -2 referred to as medium negative, or by a linguistic name of NM, NB, NM, NS, ZO, PS, PM, PB ( Here, Negative Big, Negative Medium, Negative Small, Zero, Positive Small, Positive Medium, Positive Big are
127
shorten by the acronyms, respectively.). Input variables error e and error change ec are all continuous variables, and the approach through which continuous values are first discretised into a finite number of integer values and then fuzzification is very convenient for designing a fuzzy inference system.
A fuzzy subset can be determined by the curve shape of membership functions. The curve can then be discretised to obtain a finite number of points. Each of these points has its own degree of membership, and they constitute a fuzzy set. Theoretical studies reveal that within a number of membership function curves, fuzzy variables having normal distributions are the best for describing humanβs vague concept of control activities. However, in practice, calculations of fuzzy variables with normal distributions are very complex and slow, and hence a triangular fuzzy variable distribution is more efficient in terms of the computation speed and simplicity. Therefore, many control systems commonly adopt triangular distributions to achieve rapid control effect by relatively simple calculation. However, in order to maintain control smoothness the Z-shaped membership function is used at the beginning whereas the S-shaped membership function is applied at the end. Curves of these discussed membership functions are shown in Figure 5.18.
128 Fuzzy control rule table
As discussed previously different deviation e and their change speed ec have different requirements for PID controller parameters, kp, ki, & kd. The error curve of a typical second-order system for the unit impulse response are analysed as follows Fig 5.19.
Figure 5.19: Typical Second-Order System Error Curve
It can be seen from the response error curve that:
(1) When error e is large and in order to accelerate the response speed of the system larger value of Kp should be taken. However, saturation of the differential function caused by large shocks in the deviation e at the beginning can lead to the system control exceeding its permitted range and hence should be avoided. For this purpose the value of Kd should be set smaller. In the meantime, the value of Ki is set to 0 to restrict the integral function. This step is necessary to prevent the system response producing big overshoots, resulting in the problem of integral saturation.
(2) When the size of the deviation e is moderate Kp should be set small whist the value of Ki should be appropriate, which can ensure the systemβs response to have smaller overshoot. In this case, the value of Kd has significant impact on the system, and hence it must be set appropriate to maintain a reasonable response speed given by the system.
(3) When the deviation e is smaller closing to the pre-set value the values of Kp and Ki should be increased so that the system can have good stability feature. Meanwhile, whist avoiding oscillations around the pre-set value the system should be enhanced to vicinity of the settings of the system should have better tolerance to disturbance, and this can be achieved by increasing (decreasing) Kd when ec is small (big).
t 0
129
The fuzzy control table can be generally obtained in two ways. The first method is to use an off-line algorithm, which is based on fuzzy mathematical synthetic reasoning. By sampling error e and error change speed ec the corresponding amount of changes in the parameters can then be calculated. The other one is to form a fuzzy control set from the experience of operators. However, it is obvious that the summarised fuzzy control table by this method is very rough due to the human subjective consciousness, which may not be in line with actual situations. Therefore, it is necessary to run an online control correction process for the fuzzy control table. According to the experience in engineering design, a typical set of fuzzy partition values for both e and ec have seven fuzzy values, denoting as NB, NM, NS, O, PS, PM, PB. Similarly, the same seven fuzzy values can be set for the output linguistic descriptive parameters, e.g. β³kp, β³kd and β³ki. Accordingly, the fuzzy rule table comprises a total of 49 combinations as shown in the following table.
Table 5.2: Fuzzy Rule Table
β³kp /β³ki /β³kd EC NB NM NS O PS PM PB E NB PB/PB/PB PB/PB/PB PB/PB/PB PB/PB/NB PS/NS/NB O/NM/NM O/NB/NS NM PB/PB/PB PB/PB/OB PM/PM/PM PM/PM/NM O/NM/O O/NB/PS NM/NB/PM NS PB/PB/PB PM/PM/PM PM/PS/PM PS/PS/NS O/NB/PM NM/NB/PB NB/NB/PB O PS/O/O PS/O/O O/O/O O/O/O O/O/O NS/O/O NS/O/O PS NB/NB/PB NM/NB/PB O/NB/PM PS/PS/NS PM/PS/PM PM/PM/PM PB/PB/PB PM NM/NB/PM O/NB/PS O/NM/O PM/PM/NM PB/PM/PM PB/PB/PB PB/PB/PB PB O/NB/NS O/NM/NM PS/NS/NB PB/PB/NB PB/PB/PB PB/PB/PB PB/PB/PB