Sei sulla pagina 1di 12

CHAPTER 4.

DESIGN ASPECTS OF FUZZY SYSTEMS

This chapter deliberates on various methods of design aspects of a fuzzy logic


based system. These include membership function construction, rule base design etc.

4.1 A few suggestions on fuzzy system design


For a beginner, it is preferred to follow certain guidelines, while designing a fuzzy
logic system.

 Use uniform fuzzy sets i.e., employ same membership function to describe a
single variable.
 Use fuzzy sets, which can be expressed in simple mathematical terms. Triangular
fuzzy sets are more preferred in this regard.
 Employ symmetrical fuzzy sets.

The domain of a fuzzy set can be divided into left width and right width as
indicated in figure 4.1. A fuzzy set is said to be symmetric, if its left width is equal to the
right width. This property enables the defuzzified output, u* to fall in the middle of the
clipped fuzzy set; thereby satisfying plausibility.

μ(x)

1 1-

0-
x

Left Right Width


Width
Figure 4.1
 The fuzzy sets should overlap. This necessity is illustrated in figure 4.2. Here
there are two fuzzy sets namely LARGE and HIGH. As they do not overlap, there
is a domain of variable which does not fall in either LARGE or HIGH.

1
μ(x)
LARGE HIGH
1

0-
x

Uncovered domain

Figure 4.2

Thus when a fuzzy singleton falls in this domain, no proposition will be activated
resulting in no change in control action. This can cause poor response or instability even.

Figure 4.3 shows a special case where the two fuzzy sets just overlap. Here too,
the variable x1 does not belong to either LARGE or HIGH. Thus if fuzzy singleton is x1,
situation will be same as in the previous case. Thus cases in figures 4.2 and 4.3 suggest
that overlapping is compulsory for effective fuzzy logic control.
μ(x)

- LARGE HIGH
1

0-
x
x1

Figure 4.3

 Quantum of overlap: Ideally 50% overlap is generally advised. However, in case


it does not work out and the fuzzy sets are non-symmetric, the following rule is
applied:
The right width of a fuzzy set should be equal to the left width of the next
adjacent fuzzy set and both should be equal to the interval between the peak
values of the two fuzzy sets. This is illustrated in figure 4.4.

2
μ(x)

A B
1 b
x B
B

0-
x
Left Right
Width Width
Figure 4.4
 Number of fuzzy sets: This is purely a problem dependent one. Lesser the fuzzy
sets, lesser the memory requirement for storing FAM; but this can reduce the
quality of system response. An increased number of fuzzy sets increases the
precision in the output and will lead to good dynamic response. However,
increased number of fuzzy sets will require more memory space. Thus the
number of fuzzy sets should be judicially chosen.

4.2 Extracting information from knowledge engineer


In this section, we will discuss about developing fuzzy sets by interacting with
people, who are exposed to the problem under consideration for a long time. Such
individuals are called ‘experts’ or ‘knowledge engineers’ in this regard. The fuzzy set
designer can ask suitable questions to the expert to arrive at the following:
 Labels to be used
The appropriate semantic titles can be derived from the concerned expert. The
labels should be consumer friendly and suitable to the application. In automatic washing
machines, it is preferable to put “mild”, “hard”, “normal” etc. This is similar to labeling
“wool”, “cotton” etc. in an automatic iron box.
 Domain of a fuzzy set
Once the Universe of Discourse of the concerned variable is known, it can be
divided into various fuzzy sets. The domain of each fuzzy set can be obtained by posing
questions like
“Is 250c belong to “HOT”?” in the case of an air conditioning system.
“Is 100 rpm suitable for “HARD”?” etc. for a washing machine.
 Determination of approximate membership grade
Once the approximate domain is located, the expert can be consulted further for
ascertaining the membership grade of each variable. This can be done either
consulting a single person or multiple persons. With a single expert, he can be asked
to allocate grades for each variable by posing questions like:
“What can be the membership grade of 200c in “WARM”?”
or
“What is the possible membership grade of 50 rpm in “NORMAL WASH”?” etc.

Once the membership grades are obtained, the scattered pattern can be viewed to
find a suitable standard fuzzy set to represent it. Then the membership grades are used to
construct the proper fuzzy set by using curve fitting methods.
3
This procedure of face to face interaction with a single expert works well; but
however, the drawback is that the questions are directly thrown and as a result, the
answers can be non-crisp and vary from the individual experts’ perception about the
linguistic term. Hence, it is better to request the expert to compare the grades of a set of
variable in a given fuzzy set. This is illustrated below:
Let x1, x2,…,xp, xq, …,xn be the variables falling in a fuzzy set S1. Instead of asking
the expert directly to assign the membership grades, the expert can be asked to compare
the relative value of

 S 1  x1   S 1  x3  ,  S 1 xP 
, ……… ………etc.
 S 1  x2   S 1  x4   S 1 xq 

This pair-wise comparison gives more idea about the ‘actual’ membership grade and can
be considered to be more efficient than the previous method.
In a situation where numerous knowledge engineers are available, then it is possible
to consolidate the views put together by all. Here, each expert is asked to give
membership grades of x1, x2, ..., xn falling in the domain of a fuzzy set S1. If there are m
experts, then each variable has m different membership grades. Then actual value can be
taken as the average of all.

4.3 Curve fitting


Once the membership grades are arrived at, now the task is to employ curve fitting
techniques to suit a particular fuzzy set. After observing the distribution of membership
values, the designer can choose an appropriate fuzzy set. The parameters of this fuzzy set
are then identified using error minimization techniques.
Consider figure 4.5 where encircled points represent the membership grades
assigned by the expert(s). The pattern suggests for a trapezoidal fuzzy set and hence the
solid line is drawn to approximate the trapezoidal shape. α, β, γ, and δ are the parameters
of the trapezoidal fuzzy set to be identified so as to include the encircled points. The
curve fitting follows an error minimization algorithm and is described below:

µ(x)

1.2
1

0-
α β γ δ x

Figure 4.5. Curve fitting


Step1:- Make a suitable initial guess for α, β, γ, and δ. Let us denote initial values as α0,
β0, γ0 and δ0.

4
Step2:- Let x1, x2, …, xi,…, xn be the values of the variables within the domain of the
proposed fuzzy set.

Step3:- Compute the error function, E given by


n
E    f  xi ;0 ,0 , 0 ,0 *( xi ) 2
i 1 ----------- (4.1)

Where μ*(xi) is the membership grade of xi given by the expert. The task is to find
suitable values of parameters of the fuzzy set such that E is made as minimum as
possible. Once E reaches an acceptable value, then

μ(xi)=Max{0, Min(1,f(xi ; α0, β0, γ0 and δ0))} -----------------(4.2)

4.4 Iterative algorithm


This method is applicable to systems whose desired output is already known.
Estimation process is a typical example falling in this category. For simplicity, consider
a two input – single output system. Let the input pairs be represented by
(x1,y1),(x2,y2),…(xi,yi)…(xn,yn) and the desired outputs are given as u1,u2,…,ui,…un
respectively. In other words, following mapping is known:

(x1,y1) u1
(x2,y2) u2
………………………...
(xi,yi) ui
………………………..
(xn,yn) un

The task is to identify the fuzzy sets to represent this problem. Assume that it is desired
to construct a triangular fuzzy set as shown in figure 4.6.

μ(x)

0-
α β γ x
Figure 4.6

5
Assume an initial set as α0 , β0 and γ0 and using the expression for defuzzification method
employed, compute the output emerging from the fuzzy system as ui*. Repeat the process
for all available information. Now the error function, E is written as

n
E   (u i u i ) 2
*

i 1

where n represents the number of data available. The value of E depends on the initial
guess. If E is large, fine tuning can be performed by employing the Newton Raphson
method. With this iterative method, new values of parameters are computed as
 (1)  0 
 (1)   0 
 (1)  0 
where
   J 1.E ( 0, 0, 0)
and J is the Jacobian matrix.
Thus, the parameters are updated till E reaches the lowest acceptable value.

4.5 Adaptive fuzzy control


Fuzzy logic system is quite adaptive to plants which exhibit parameter variation
and non-linearity. However, if plant coefficients vary largely, a simple fuzzy control may
not be effective. In such cases, it is possible to develop adaptive fuzzy control methods.
Generally the fuzzy sets in a fuzzy logic system have fixed domain. It is possible
to alter the domain of all fuzzy sets by employing a scaling factor. This is illustrated in
figure 4.7. Here, the input variable is multiplied by a factor, K prior to fuzzification. As
shown in the figure, for K=1, the universe of discourse is from -100 to +100 whereas it

μ(x)

NL NB NM NS ZERO PS PM PB PL

Input i
variable K x
-100 -50 0 50 100
Figure 4.7 Use of scaling factor.

changes from -50 to +50 for K=0.5 and from -0.1 to +0.1 with K=0.1. Variation of K
results in the classification of the input variable. For example, when the input variable
value is 70, for K=1, the variable belongs to the fuzzy sets PM to PB. The same variable
belongs to PS and PM fuzzy sets with K=0.5 whereas it falls to the domain of ZERO and
PS for K=0.1. Thus altering the value of scaling factor leads to activation of different

6
fuzzy propositions for the same input value. Thus, if the plant parameters vary largely,
then suitable variation can be adopted for K leading to adaptive fuzzy control.

4.6 Rule base design using dynamic response analysis


Assume that a system is non-linear with parameter variation at different operating
points. It is possible to obtain a linearized model of the plant at a typical operating point
and thereby design a conventional controller. The intuition and experience derived from
the dynamic response curve of controlled system can be well utilized to design an
effective fuzzy control system. The transient response of the system is first segmented
and then characterised. This leads to an initial support base for the rule base design. In
the subsequent stages, rule base can be modified to achieve best dynamic response at all
operating points. This is illustrated through an example below.
Consider a closed loop system given in figure 3.1 (in chapter 3). Let the transfer
function is given as
wr s  s
 2
wr s  Js  ( F  K a K p  K w ) s  K a K I
*

where ∆ denotes small incremental change,


J, F – invariant system parameters,
KP, KI – proportional and integral constants, and
Ka , Kw – variable parameters of the system.
The values of Ka and Kw at different operating points are shown in table-1.

Table 1
Operating point Ka Kw

Point-1 0.666 -2.500

Point-2 0.667 -0.667

Point-3 0.500 -0.800

Point-4 0.303 -0.667

For a typical operating point, where Ka=0.03717 and Kw=-0.6331, KP and KI are
computed as 0.48 and 5 respectively. The response of the system for a step disturbance
with these controller gains at different operating points is shown in figure 4.8

7
Figure 4.8. System response with fixed gain controller.

It is evident that as operating point changes, response becomes poorer with fixed gain
controller. Thus, Kp, KI are to be varied in accordance with drift in the Ka and Kw, so as
to achieve best dynamic response. On-line variation of controller gains is strenuous and
infeasible too, in practice.
For convenience of incorporating the intuition and experience into the fuzzy
control algorithms, the behavior of the dynamic response is first investigated. The error
and error change of the system are defined as

e(k ) =  r* (k )   r (k )
-------- (4.3)
e(k )  e(k )  e(k  1)

where  r* (k ) is the reference value, e(k ) is the speed error and e(k ) is the error change
in the k-th sampling interval. The change in control variable is denoted as  (k ) .
.

The step response waveform of the system with PI controller together with step
command is obtained and is drawn in figure 4.9.

8
1.5-
System Response p1

p3
c1 c2 c3 c4
1--
p2
s1 s2 s3 s4
0.5-
|

| | | | | |
0 1 2 4 6 8 10
Time (sec)
Change of control variable

1- αc2
--- 0.5 αc3
0- - αp3
- --- αp2
-1 - α αp1
c1

-2 -
Ti
me| | | | | |
0
Time(
(se 2 4 6 8 10
Tim
sec) Time (sec)
c)
e(se
Time(
c) 1 Figure 4.9 Dynamic response characteristics.
sec)
Referring figure 4.9, according to the magnitude of e and the sign of e , the
response plane is roughly divided into four segments. These segments are defined as
0.5
S1: e > 0 and e < 0; S2 : e < 0 and e <0 --------------- (4.4)

S3: e < 0 and e > 0; S4 : e > 0 and e > 0.

c1, c2, ……… are named as crossover points. At these points,


c1: ( e >0 and e < 0), e <<< 0;
c2: ( e < 0 and e > 0), e << 0;
c3: ( e >0 and e < 0), e < 0; ----------------- (4.5)

c4: ( e <0 and e > 0), e > 0;


c5: ( e < 0 and e > 0), e >> 0;
c6: ( e < 0 and e > 0), e >>> 0.

9
Also, the magnitude index for representing the extent of overshoot and undershoot such a
p1, p2 etc is defined as

p1: e  0 and e <<< 0


p2: e  0 and e << 0
p3: e  0 and e < 0 --------------------- (4.6)

p4: e  0 and e > 0


p5: e  0 and e >> 0
p6: e  0 and e >>> 0.

Further, when e = 0 and e = 0,  = 0. --------------------- (4.7)

Figure 4.10 Membership functions of inputs and output.

10
Seven fuzzy sets are then defined to fall in line with equations (4.4) to (4.7) and are
shown in figure 4.10, where N denotes negative, P is positive, B is big, M is medium, S is
small and ZR is zero.
Having defined the membership functions, the linguistic control rules are then obtained
following the definitions in equations (4.4) to (4.7). This is shown in table 2.
The rule base listed in table 2 serves as a better guideline for forming the fuzzy
associative memory (FAM). The exact rules in the “gray” regions in table 2 such as
 S1 are obtained through trial and error so as to achieve best dynamic response. The rule
base thus obtained is shown in table 3.

Table 2

e/e NB NM NS ZR PS PM PB

NB  C1

NM  S 2  C 2 S1A3  A3

NS  C 3

ZR  P 6  P 5  P 4 ZR  P 3  P 2  P1

PS  C 4

PM  S 3  C 5  S 4

PB  C 6

Table 3

e\e NB NM NS ZR PS PM PB
PB ZR PS PM PB PB PB PB
PM NS ZR PS PM PB PB PB
PS NM NS ZR PS PM PB PB
ZR NB NM NS ZR PS PM PB
NS NB NB NM NS ZR PS PM
NM NB NB NB NM NS ZR PS
NB NB NB NB NB NM NS ZR

11
4.6.1 Simulation Results
In order to validate the fuzzy logic approach, extensive simulation is carried out
on the system model with fuzzy controller and the results are shown in figure 4.11, where
system response with unit reference command and disturbance is plotted. It is seen that
the overshoot and settling time are drastically decreased yielding excellent response at all
operating points with fuzzy controller. The reason for superior performance of fuzzy
controlled system is that basically it is adaptive in nature and the controller is able to
develop different control laws for each input state of e and e ; on the other hand,
conventional PI controller is sensitive to model change that occurs with parameter
variation. This figure also shows system response with PI-controller. The dynamic
response curves in figure 4.11 show that fuzzy controller rejects internal and external
disturbances and nullifies the effect of parameter variation.

Figure 4.11 Comparison of system response with PI and fuzzy controller.

4.7 Conclusion
A few fuzzy system design aspects are explained in this chapter. These
methodologies help a beginner to develop fuzzy logic systems.

12

Potrebbero piacerti anche