15
DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi Malaysia Karung Berkunci 791, 8130 UTM Skudai, Johor Darul Ta’zim, Malaysia Phone. (607) 5533333 Ext. 34788 Fax. (607) – 5566159 Abstract The fuzzy logic control system is expected to be able to reproduce the behavior of the target system. The target system may be human operator in change of a processing plant. Fuzzy logic control can be pursued in the following stages : select relevant input and output variables, determine the number of linguistic terms associated with each input and output variables, choose appropriate family of membership functions, interview human expert who familiar with the target systems to determine the collection of fuzzy If -Then rules and membership functions, and refine the membership functions and rules. Keywords : Fuzzy control, Design Method, Membership function, Temperature control. 1. Introduction Fuzzy logic was introduced by Professor Lotfi Zadeh in 1965. Not it the least degree trying to undermine his achievements, this theory has its roots in the previous history of science, particularly in logic science. Although logic as a branch of Western science had been developing as binary logic, there were some famous paradoxes that could not be solved by binary logic. When the concepts of fuzzy logic were first published in the U.S., they faced a lot of critics. One example from Zadeh’s colleagues : “ …. I would like to comment briefly on Prof. Zadeh’s presentation. His proposals could be severely, ferociously, even brutally criticized from a technical point of view. This would be out of place here. But a blunt question remains : Is Zadeh presenting important ideas or is he indulging in wishful thinking ? The most serious objection of “Fuzzification” of system analysis is that lack of methods of system analysis is not the principal scientific problem in the ‘system’ field. That problem is one of developing basic concepts and deep insight into the nature of ‘system’, perhaps trying to find something akin to the ‘laws’ of Newton. In my opinion, Zadeh’s suggestion have no chance to contribute to the solution of this problem ….” (R.E. Kalman, 1972). Even today, where hundreds of successful fuzzy logic application have proved the value of this technology, some scientists still condemn the concept, as this more recent example shows : “… Fuzzy logic is based on fuzzy thinking. It fails to distinguish between the issues specifically addressed by the traditional methods of logic, definition and statistical decision making …” (Jon Konieki in AI Expert, 1991) Toshiro Terano (1994) pointed out that three conditions necessary for a new theory : A societal need, new methodology (both ideas and techniques), and An attractiveness to researchers. After 1991 fuzzy technology came out of scientific laboratories and became an industrial tool (Reznik, 1997 ; Altrock, 1995 ; Zilouchian & Jamshidi, 2001 ; Marzuki, 1996). 1

DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

  • Upload
    others

  • View
    14

  • Download
    0

Embed Size (px)

Citation preview

Page 1: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL

Henry Nasution

Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi Malaysia Karung Berkunci 791, 8130 UTM Skudai, Johor Darul Ta’zim, Malaysia

Phone. (607) 5533333 Ext. 34788 Fax. (607) – 5566159

Abstract

The fuzzy logic control system is expected to be able to reproduce the behavior of the target system. The target system may be human operator in change of a processing plant. Fuzzy logic control can be pursued in the following stages : select relevant input and output variables, determine the number of linguistic terms associated with each input and output variables, choose appropriate family of membership functions, interview human expert who familiar with the target systems to determine the collection of fuzzy If -Then rules and membership functions, and refine the membership functions and rules. Keywords : Fuzzy control, Design Method, Membership function, Temperature control. 1. Introduction

Fuzzy logic was introduced by Professor Lotfi Zadeh in 1965. Not it the least degree trying to undermine his achievements, this theory has its roots in the previous history of science, particularly in logic science. Although logic as a branch of Western science had been developing as binary logic, there were some famous paradoxes that could not be solved by binary logic.

When the concepts of fuzzy logic were first published in the U.S., they faced a lot of critics. One example from Zadeh’s colleagues :

“ …. I would like to comment briefly on Prof. Zadeh’s presentation. His proposals could be severely, ferociously, even brutally criticized from a technical point of view. This would be out of place here. But a blunt question remains : Is Zadeh presenting important ideas or is he indulging in wishful thinking ? The most serious objection of “Fuzzification” of system analysis is that lack of methods of system analysis is not the principal scientific problem in the ‘system’ field. That problem is one of developing basic concepts and deep insight into the nature of ‘system’, perhaps trying to find something akin to the ‘laws’ of Newton. In my opinion, Zadeh’s suggestion have no chance to contribute to the solution of this problem ….” (R.E. Kalman, 1972).

Even today, where hundreds of successful fuzzy logic application have proved the value of this

technology, some scientists still condemn the concept, as this more recent example shows : “… Fuzzy logic is based on fuzzy thinking. It fails to distinguish between the issues specifically addressed by the traditional methods of logic, definition and statistical decision making …” (Jon Konieki in AI Expert, 1991)

Toshiro Terano (1994) pointed out that three conditions necessary for a new theory : A societal need, new methodology (both ideas and techniques), and An attractiveness to researchers. After 1991 fuzzy technology came out of scientific laboratories and became an industrial tool (Reznik, 1997 ; Altrock, 1995 ; Zilouchian & Jamshidi, 2001 ; Marzuki, 1996).

1

Page 2: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

In the last two decades, the fuzzy sets theory has established itself as a new methodology for dealing with any sort of ambiguity and uncertainty. An underlying philosophy of the theory is a mathematical framework where imprecise conceptual phenomena in modeling and decision making may be precisely and rigorously studied. It lets mathematical models describe rather un modeled situation and finds solution of unsolvable problems. The theory includes a new mathematical apparatus and computer realizable models.

Fuzzy logic is an innovative technology that enhances conventional system design with engineering expertise. Using fuzzy logic, you will circumvent the need for rigorous mathematical modeling. Fudge factors in your control system will be replaced by a self explanatory linguistic description of the control strategy (Altrock, 1995). 2. What and Why Fuzzy Logic

One of the major development of fuzzy set theory, fuzzy logic was primarily designed to represent and reason with some particular form of knowledge. It was assumed that the knowledge would be expressed in a linguistic or verbal form, conventional control system divide the world into yes and no (1,0), but by using fuzzy logic, the true value are expressed by the world of natural language, e.g. true, more or less true, rather false etc (1, 0.7, 0.5, 0.1, 0). Fuzzy logic put a scale between yes by the side of no. Fuzzy logic translates qualitative strategy derived from human experience to a formulation acceptable to a computer.

Fuzzy logic is powerful problem solving methodology with a myriad of applications in embedded control and information processing. Fuzzy provides a remarkably simple way to draw definite conclusions from vague, ambiguous or imprecise information. In a sense, fuzzy logic resembles human decision making with its ability to work from approximate data and find precise solutions.

Unlike classical logic which requires a deep understanding of a system, exact equations, and precise numeric values, fuzzy logic incorporates an alternative way of thinking, which allows modeling complex systems using a higher level of abstraction originating from our knowledge and experience. Fuzzy logic allows expressing this knowledge with subjective concepts such as very hot, bright red, and a long time which are mapped into exact numeric ranges.

Fuzzy logic can (Marzuki, 1996) : represent vague language naturally, enrich not replace crisp sets, allow flexible engineering design, improve model performance, are simple to implement, and best of all they often work.

Reznik (1997) reported, why fuzzy logic : ability to translate imprecise/vague knowledge of human experts, simple, easy to implement technology, software design and hardware implementation support, results are easy to transfer from product to product, smooth controller behavior, robust controller behavior, and ability to control unstable systems.

Fuzzy logic is a paradigm for an alternative design methodology which can be applied in developing both linear and non-linear systems for embedded control. By using fuzzy logic, designer can realize lower development costs, superior, features, and better end product performance.

With fuzzy logic the first step is to understand and characterize the system behavior by using our knowledge and experience. The second step is to directly design the control algorithm using fuzzy rules, which describe the principles of the controllers regulation in terms of the relationship between its input and outputs. The last step is to simulate and debug the design. If the performance is not satisfactory we only need to modify some fuzzy rules and re-try. 3. Fuzzy Sets and Fuzzy Relation 3.1 Definition of fuzzy sets In classical sets, or crisp sets, the transition between membership and non-membership in a give set for an element in the universe is abrupt and well defined (said to be “crisp”). For an element in a universe which contains fuzzy sets this transition can be gradual. This transition among various

2

Page 3: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

degrees of membership can be thought of as conforming to the fact that the boundaries of the fuzzy sets are vague and ambiguous. Hence, membership of an element from the universe in this set is measured by a function which attempts to describe vagueness and ambiguity. A fuzzy set then is a set containing elements which have varying degrees of membership in the set. This idea is contrasted with classical, or crisp, sets because complete in that set (i.e., their membership is assigned a value of 1). Elements in a fuzzy set, because their membership can be a value other than complete, can also be members of other fuzzy sets on the same universe. Elements of a fuzzy set are mapped to a universe of “membership values” using a function theoretic form. Fuzzy sets are denoted by a set symbol with a tilde understrike, so for example, A would be the “fuzzy set” A. This function maps elements of a fuzzy set A to real numbered value on the interval 0 to 1. If an element in the universe, say x is a member of fuzzy set A then this mapping is given as, µ A (x) ∈ [0,1] [1]

A = (x, µ A (x) | x ∈ X [2]

A notation convention for fuzzy sets that is popular in the literature when the universe of discourse, X, is discrete and finite, is given below for a fuzzy set A by,

A = ∑=++i i

iAA

xx

xx

xx )(

..........)()(

2

2

1

1A µµµ [3]

These mapping are show in Figure 1. membership function for crisp and fuzzy sets, respectively.

(a) Crisp set A (b) Fuzzy set A

A

x 0

A 1

0 x

1

Figure 1. Membership function for crisp and fuzzy set and, when the universe, X, is continuous and infinite, the fuzzy set A is denoted by,

A = ∫ xxA )(µ

[4]

In both notations, the horizontal bar is not quotient, but rather a delimiter. In both notations, the numerator in each individual expression is the membership value in set A associated with the element of the universe indicated in the denominator of each expression. In the first notation, the summation symbol is not for algebraic summation, but rather is denoting a fuzzy union, hence the “+” signs in the first notation are not algebraic “add”, but rather function theoretic union. In the second notation the integral sign is not an algebraic integral, but rather a set union notation for continuous variables. 3.2 Fuzzy set operation The use of fuzzy sets provides a basis for the systematic manipulation of vague and imprecise concepts using fuzzy set operations performed by manipulating the membership functions. Let A and B be two point valued fuzzy sets in X with membership functions µA and µB. For a given element x of the universe, the following function theoretic operations for the set theoretic operation of equality, union, intersection, and complement are defined,

3

Page 4: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

• Equality : A = B iff µA (x) = µB (x) ∀ x ∈ X [5]

• Union : µA∪B (x) = max { µA (x) , µB (x)} ∀ x ∈ X [6]

• Intersection : µA∩B (x) = max { µA (x) , µB (x)} ∀ x ∈ X [7]

• Complement : µA’ (x) = 1 - µA (x) ∀ x ∈ X [8]

• Subset : A ⊆ B iff µA (x) ≤ µB (x) ∀ x ∈ X [9]

Some notes on the 5 fuzzy operations (Marzuki, 1996) :

• The above definitions of union, intersection and complement work equally well for ordinary ‘crisp’ sets.

• Note that in the fuzzy case, if A and A’ complements, their intersection need not be the empty set.

• The closer the sets are to being crisp, the closer their intersection will be to being empty. • Note also that if A and A’ are complements, their union is not necessarily equal to the universe. • The closer they are to being crisp, the closer their union will be to being the universe.

3.3 Properties of fuzzy sets Fuzzy sets follow the same properties as do crisp sets. Because of this and because the membership values of a crisp set are a subset of the interval [0,1], classical sets can be though of as a special case of fuzzy sets. Frequently used properties of fuzzy sets are listed below.

• Commutativity : A ∪ B = B ∪ A

A ∩ B = B ∩ A [10]

• Associativity : A ∪ ( B ∪ C ) = ( A ∪ B ) ∪ C

A ∩ ( B ∩ C ) = ( A ∩ B ) ∩ C [11]

• Distibutivity : A ∪ ( B ∩ C ) = ( A ∪ B ) ∩ ( A ∪ C )

A ∩ ( B ∪ C ) = ( A ∩ B ) ∪ ( A ∩ B ) [12]

• Idempotency : A ∪ A = A and A ∩ A = A [13]

• Identity : A ∪ ∅ = A and A ∩ X = A and A ∩ ∅ = ∅

and A ∪ X = X [14]

• Transitivity : If A ⊆ B ⊆ C, then A ⊆ C [15]

• Involution : Ā = A [16]

4. Design Methodology The primary goal of control engineering is to distill and apply knowledge about how to control a process so that the resulting control system will reliably and safely achieve high performance operation. In this section we show how fuzzy logic provides a methodology for representing and implementing our knowledge about best to control process. Why fuzzy logic control (Marzuki, 1996) :

• During the past decade, fuzzy logic control has emerged as one of the most active and fruitful research areas in the application of fuzzy set theory, fuzzy logic and fuzzy reasoning.

• The idea was first proposed by Mamdani and Assilian around 1972.

4

Page 5: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

• Many industrial and consumer product using fuzzy logic technology have been built, especially in Japan.

• In contrast to conventional control techniques, fuzzy logic control is best utilized in complex ill-defined processes that can be controlled by a skilled human operator without much knowledge of their underlying dynamics.

• The basic idea behind fuzzy logic control is to incorporated the expert experience of human operator in the design of a controller in controlling a process whose input-output relationship is described by a collection of fuzzy control rules involving linguistic variables.

• This utilization of linguistic variables, fuzzy control rules, and approximate reasoning provides a means to incorporate human expert experience in designing the controller.

A block diagram of fuzzy control system is shown in Figure 2. Basically in fuzzy control system, there are four major stages to accomplish the control process : Choosing fuzzy controller inputs and outputs, Fuzzification, Inference mechanism, and Defuzzification. Fuzzy Controller

Reference Input Process Input Output

Inference Mechanism

Rule-base Def

uzzi

ficat

ion

Fuzz

ifica

tion

Figure 2. Fuzzy control system 4.1 Choosing fuzzy controller inputs and outputs The objective of the first stage is to study the system where we want to place our control system. From that, we have to identify and establish the architectural characteristics of the systems. What is the fuzzy input and output variable to our control system. For more complex application, the choice of the inputs to controller and output of the controller (inputs to the plant) can be more difficult. Essentially, you want to make sure that the controller will have the proper information available to be able to make good decisions and have proper control inputs to be able to steer the system in the direction needed to be able to achieve high performance operation. Practically speaking, access to information and the ability to effectively control the system often cost money. In some academic problems you may be given the plant inputs and outputs, in many practical situations you may have some flexibility in their choice. These choice affect what information is available for making on-line decisions about the control of a process and hence affect how we design a fuzzy controller. Once the fuzzy controller inputs and outputs are chosen, you must determine what the reference inputs are. After all the inputs and outputs are defined for the fuzzy controller, we can specify the fuzzy control system. 4.2 Fuzzification Fuzzy sets are used to quantify the information in the rule base, and the inference mechanism operators on fuzzy sets to produce fuzzy sets, hence, we must specify how the fuzzy system will

5

Page 6: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

convert its numeric inputs ui ∈ Ui into fuzzy sets (a process called fuzzification) so that they can be used by the fuzzy system. Each input and output variable in the fuzzy model which are given unique names called labels (Table 1.), within the domain of the variable. Table 1. Fuzzy set and labels

Fuzzy Variable Fuzzy Set Linguistic Term Labels Input e Very Hot VH Hot HT Less Hot LH Normal NR Cool CL Cold CD Very Cold VC ∆e Positive Large PL Positive Medium PM Positive Small PS Neutral NU Negative Small NS Negative Medium NM Negative Large NL Output ∆Z Very Fast VF Fast FT Less Fast LF Normal NO Less Slow LS Slow SL Very Slow VS

Source : An Introduction to Fuzzy Logic Control (Henry Nasution, 2002) Membership function need to be assigned ( m = Z → [0,1] ) to each fuzzy subset. The membership functions for fuzzy sets can have many different shapes, depending on definition. Some of the possible membership functions are shown :

• S – membership function :

0.5

1

x

µA

[17]

>≤≤−−−≤≤−−

<

=

c for x 1 c x bfor )]/()[(21

b x afor )]/()[(2a for x 0

),,;(accx

acaxcbaxS

a b c

• Phi – membership function :

c-b/2 c+b/2 c-b c+ b

cx

0.5

1

b

µA

[18]

≥++−≤−−

=c for x ,2/,;(1c for x ),2/,;(

),;(bcbccxS

cbcbcxScbxπ

6

Page 7: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

• Triangular membership function :

µA [19]

>≤≤≤≤

<

=

c for x 0c x bfor b)-x)/(c-(cb x afor a)-a)/(b-(x

a for x 0

),,;( cbaxT

b a c

1

x

• Trapezoidal membership function :

[20]

>≤≤≤≤

≤≤<

δδγγδδγβ

βααβαα

δγβα

for x 0 x for )-x)/(-( x for 1

x for )-)/(-(x for x 0

),,,;(x

δ γ βα

1

x

µA

Figure 3., assists in this description of fuzzy membership function : Core

a a Support

0

1

µ(x)

x

a : Boundary

Figure 3. Description of fuzzy membership function

The core of a membership function for some fuzzy set A is defined as that region of the universe that is characterized by complete and full membership in the set A. That is, the core comprises those elements x of the universe such that µA (x) = 1. The support of a membership function for some fuzzy set A is defined as that region of the universe that is characterized by nonzero membership in the set A. That is, the support comprises those elements x of the universe such that µA (x) > 0. The boundaries of a membership function for some fuzzy set A are defined as that region of the universe containing elements that have a nonzero membership but not complete membership. That is, the boundaries comprise those elements x of the universe such that 0 < µA (x) < 1. These elements of the universe are those with some degree of fuzziness, or only partial membership in the fuzzy set A. Reznik (1997) reported that, Triangular or Trapezoidal functions have proved to be more popular with fuzzy logic theoretic and practitioners rather than higher order based functions such as Gaussian, etc. A possible reason for this is simplicity of this function often allowing for the prediction and calculation of an output of the fuzzy system. Another reason is that the extra smoothness introduced by higher order fuzzy sets and demanding higher computational consumption is not strongly reflected in the output quality of a fuzzy model. However, the problem of the membership function choice has not yet been solved theoretically. Different researchers choose numerous shapes in various application problems.

7

Page 8: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

Let say the labels for input variables e and ∆e is {VC, CD, CL, NR, LH, HT, VH} and {NL, NM, NS, NU, PS, PM, PL} respectively while the labels for output variable ∆Z is {VS, SL, LS, NO, LF, FT, VF}. Then the membership functions may be presented as in Figure 4.

-50 - 35 - 20 - 10 0 10 20 35 50

-2 -1.5 -1 - 0.5 0 0.5 1 1.5 2

-2 -1.5 -1 - 0.5 0 0.5 1 1.5 2

1

1

1

µ∆e

µe

µ∆Z

VS SL LS NO LF FT VF

NL NM NS NU PS PM PL

VC CD CL NR LH HT VH

e

∆e

∆Z

Figure 4. Triangular membership functions for e, ∆e and ∆Z

There are some rules of thumb which are helpful in defining fuzzy set (Lim, 1998 ; Ong, 1999) : • The number of labels (unique names of fuzzy subset) with variable should generally be an odd

number between 5 and 9. And the amount is very much depends on the complexity on the control system.

• Each should overlap somewhat with its neighbors. The overlap should be between 10 % and 50 % of the neighbors space. And the sum of the vertical points of the overlap should always be less than 1 as shown in Figure 5.

1

X Y

X + Y < 1

Figure 5. Rule of membership function

• The density of the fuzzy sets should be highest around the optimal control point of the system and should thin out as the distance from that point increases. This rule brings about a condition where the labels are bunched together in the middle of the domain but are more widely spaced toward the edges.

8

Page 9: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

4.3 Inference mechanism An inference mechanism also called an inference engine or fuzzy inference module, which emulates the expert’s decision making in interpreting and applying knowledge about how best to control the plant (Passino, 1998). In the inference mechanism, rules If-Then need to be developed to control the process. Expert’s knowledge and experience should take place home to develop the appropriate rule in order to perform an ideal control system. The rules that have been developed by the expert can be simply by constructing the fuzzy associative memories (FAM), which associate fuzzy set of output fuzzy variable ∆Z with fuzzy sets of input variables e and ∆e. For example, by implementing example of Figure 4., a FAM with 7 times 7-bank matrix has been construct as in Table 2. Table 2. Fuzzy associative memories (FAM)

e ∆e

VC CD CL NR LH HT VH

NL VS VS SL LS FT VF VF

NM SL SL SL LS LF FT FT

NS SL LS LS LS NO LF LF

NU LS LS NO NO NO LF LF

PS LS LS NO NO LF FT FT

PM SL SL LS LF LF FT FT PL VS VS SL LS FT VF VF

Source : An Introduction to Fuzzy Logic Control (Henry Nasution, 2002) After developing the FAM, the next stop is the inference engine, the objective of the inference engine is to make a choice when there are an output variable fuzzy set with different values. Normally, we can use the Correlation Minimum Encoding technique to do the inferencing (Ong, 1999). The procedure or the correlation minimum encoding technique is to choose the minimum value among all the values in a single input variable fuzzy set, to insert the minimum value to the output variable fuzzy set as shown in Figure 6. The figure shows that when the membership function value of the input variable “e” and “∆e” is 0.7 at membership function “CL” and 0.4 at membership function “NU” respectively, the membership value of the output variable “∆Z” will be 0.4 at membership function “NO”. Input Fuzzy Variable Output Fuzzy Variable µe ∆Z = NO at 0.4 ∆e = NU at 0.4 e = CL at 0.7

∆e e

µ∆Z µ∆e

∆Z

Figure 6. Correlation minimum inference

9

Page 10: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

4.4 Defuzzyfication As mentioned in the introduction, there may by situations where the output of a fuzzy process needs to be a single scalar quantity as opposed to a fuzzy set. Defuzzification is the conversion of a fuzzy quantity to a precise quantity, just as fuzzification is the conversion of a precise quantity to a fuzzy quantity. The output of a fuzzy process can be the logical union of two or more fuzzy membership function defined on the universe of discourse of the output variable. At least seven methods in the literature, among the many that have been proposed by investigators in recent year, are popular for defuzzifying fuzzy output functions (membership functions).

o Max membership principle, Also known as the height method, this scheme is limited to peaked output function. This method is given by the algebraic expression :

µx (z*) ≥ µx (z) for all z ∈ Z [21] z

1

µ

z*

o Centroid method, This procedure (also called center of area, center of gravity) is the most prevalent and physically appealing of all the defuzzification methods, it is given by the algebraic expression

∫∫=

dzz

zdzzz

x

x

)(

).(*

µ

µ [22]

z

1

µ

z*

where ∫ denotes an algebraic integration.

o Weighted average method, This method is only valid for symmetrical output membership function. It is given by the algebraic expression :

∑∑=

)().(*

zzz

zx

x

µ

µ [23]

a b

µ 1

0.9

0.5

z

where Σ denotes an algebraic sum. The weighted average method is formed by weighting each membership function in the output by its respective maximum membership value. Since the method is limited to symmetrical membership functions, the values “a” and “b” are the means of their respective shapes.

o Mean-max membership, This method (also called middle-of-maxima) is closely related to the first method, excerpt that the locations of the maximum membership can be non unique (i.e., the maximum membership can be a plateau rather than a single point). This method is given by the expression :

10

Page 11: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

2

* baz += [24]

o Center of sums, This faster than many defuzzification methods that are presently in

use. This process involves the algebraic sum of individual output fuzzy sets, say C1 and C2, instead of their union. One drawback to this method is that the intersecting areas are added twice. The defuzzified value z* is given by the following equation :

∫∑∫ ∑

=

=

z

n

k C

n

k C

dzz

dzzz

k

k

1

1*

)(

)(

µ

µ= zz [25]

This method is similar to the weighted average method, except in the center of sums method the weights are the areas of the respective membership functions whereas in the weighted average method the weights are individual membership values.

o Center of largest area, If the output fuzzy set has at least two convex sub-regions, then the center of gravity (i.e., is calculated using the centroid method) of the convex fuzzy sub-region with the largest area is used to obtain the defuzified value z* of the output.

∫∫=

dzz

dzzzz

m

m

x

x

)(

.)(*

µ

µ [26]

where xm is the convex sub-region that has the largest area making up xk. This condition applies in the case when the overall output xk is non convex, and in the case when xk is convex, z* is the same quantity as determined by the centroid method or the center of largest area method (because then there is only one convex region).

µ

z*

1

1

z*

C2 C1

µ

z*

a

µ 1

z b

z

z

o First (or last) of maxima, This method uses the overall output or union of all individual

output fuzzy sets xk to determine the smallest value of the domain with maximized membership degree xk. The equation of for z* are as follow. First, the largest height in the union [denoted hgt(xk)] is determined, hgt(xk) = sup [27] )(

Zz

zkXµ

Then the first of the maxima is found,

11

Page 12: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

}{ )hgt()(inf*kxZz

xzZzzk

=∈=∈

µ [28]

An alternative to this method is called the last of maxima, and it is given by,

}{ )hgt()(sup*kx

ZzxzZzz

k=∈=

∈µ [29]

sup : supremum (is the least upper bound), inf : infimum (is the greatest lower bound).

z* Figure 7. shows procedure for centroid de satisfies both membership function CL and Nvariable ∆e only satisfies membership functioencoding technique to do inferencing, the mmembership function NO and 0.3 at membership

Input fuzzy variables

µ∆e µe

0.3

NUNR

e

0.7

NUCL

e

µ∆e µe

Figure 7. Procedure

z

µ

1

efuzzification. The figure shows that the input variable R at value 0.7 and 0.3 respectively. Whereas, input

n NU at value 0.4. After using correlation minimum embership value of output variable ∆Z are 0.4 at function LF.

Output fuzzy variable

NO

Centroid

µ∆Z LF NO

0.3 0.4

0.3 0.4

LF

∆Z ∆e

µ∆Z

0.4 0.4

∆Z ∆e

µ∆Z

∆Z

of centroid defuzzification

12

Page 13: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

The following example shows how fuzzy logic technology can be developed for an air conditioner temperature control system of the process block diagram of the control system is shown in Figure 1.

Fuzzy Controller

Error (e) Change of Motor Speed (∆Z)

Derivative of error (∆e)

Figure 8. Configuration of the fuzzy controller

There are two inputs and one output to the fuzzy controller as shown in Figure 8. Suppose the inputs i.e., error (e) and derivative of error (∆e) ranges from –2 to 2 OC respectively while the output, i.e., change of compressor motor speed (∆Z) ranges from – 50 to 50 rpm. The performance measurement is as follows : e(k) = set point(k) – y(k) [30]

∆e(k) = e(k) – e(k – 1) [31]

Z(k) = Z(k – 1) + ∆Z(k) [32]

where y(k) is the actual speed at time k, and Z(k) is the manipulated output variable at time k. For the fuzzification of fuzzy controller, each input and output in the fuzzy model is quantized into fuzzy subsets. Table 1., shows how fuzzy variable being quantized into fuzzy subsets and labeled. Then, membership functions need to be developed. For computational simplicity, we use triangular membership function as shown in Figure 4. The next step is to develop fuzzy If – Then form to control the process. For example, If error in temperature is about VC (very cold) and derivative of error is about NL (negative large) Then the change of compressor motor speed is about VS (very small), i.e. :

If (e = VC And ∆e = NL) Then ∆Z = VS A 49 bank matrix as shown in Table 2., is used for simplicity to observe the developed fuzzy

rules. Therefore, if given : e = -1.3 oC and ∆e = -1.2 oC. Value of e = -1.3 oC satisfies two membership functions i.e. VC and CD with the value of membership as shown in Figure 9. Whereas, value of ∆e = -1.2 oC satisfies two membership functions i.e. NL and NM with the value of membership as shown in Figure 10.

76.0)5.1(1

)5.1(12.1)()( 4.0

)5.1(1)5.1(3.1

)()(

24.0)5.1(1)12.1(1

)()( 6.0

)5.1(1)3.1(1

)()(

=−−−

−−−=

−−

==−−−−−−

=−−

=

=−−−

−−−=

−−

==−−−−−−

=−−

=

abax

abax

bcxc

bcxc

NMCD

NLVC

µµ

µµ

0.4

0.5

0.6

-2 -1.5 -1 - 0.5 0 0.5 1 1.5 2

1

µe

VC CD CL NR LH HT VH

e

Figure 9. Value of membership which satisfied by e = -1.3 oC

13

Page 14: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

Figure 10. Value of membership which satisfied by ∆e = -1.2 oC

After developing the fuzzy rules, correction minimum encoding technique is used to do inferencing. The results are summarized as below :

1. If e = VC µVC (0.6) And ∆e = NL µNL (0.24) Then ∆Z = VS µVS (0.24) 2. If e = VC µVC (0.6) And ∆e = NM µNM (0.76) Then ∆Z = SL µSL (0.6) 3. If e = CD µCD (0.4) And ∆e = NL µNL (0.24) Then ∆Z = VS µVS (0.24) 4. If e = CD µCD (0.4) And ∆e = NM µNM (0.76) Then ∆Z = SL µSL (0.4)

where, ∆Z = VS µVS (0.24) and ∆Z = SL µSL (0.6)

Finally, the output fuzzy set is converted into a numerical solution variable using Centroid defuzzification. Figure 11., shows the function of the output satisfied by the given e and ∆e value. Therefore, the centroid is obtained as :

Rpm 29.246.024.0

6.0*)20(24.0*)35(−=

+−+−

=Z∆

That means compressor motor should decreases its speed to 24.29 rpm.

∆Z 0.24

0.4

0.6 0.5

-50 - 35 - 20 - 10 0 10 20 35 50

1

µ∆Z

VS SL LS NO LF FT VF

0.24

0.76 0.5

-2 -1.5 -1 - 0.5 0 0.5 1 1.5 2 ∆e

1

µ∆e NL NM NS NU PS PM PL

Centre of Gravity

Figure 11. Output of compressor motor 5. Concluding Remarks

Our mathematical characterization served to show how the fuzzy logic control can handle more inputs and outputs, the range of possibilities for the definition on universes of discourse, the membership functions, the rules, the inference mechanism, and defuzzification methods. The design example for the air conditioner temperature control system problem is meant to be an introduction to basic design methods for fuzzy logic control. The section on coding is meant to help the reader bridge the gap between theory and application so that you can quickly get a fuzzy logic control implemented.

14

Page 15: DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL€¦ · DESIGN METHODOLOGY OF FUZZY LOGIC CONTROL Henry Nasution Ph.D Student at Faculty of Mechanical Engineering, Universiti Teknologi

6. Acknowledgements The author acknowledge support provided by Bung Hatta University and Universiti Teknolgi Malaysia for this research. We have to thank Prof. Madya Dr. Hishamuddin Jamaluddin, Fluid and Thermal Laboratory of Faculty Mechanical Engineering and to all members of Associate Student of Indonesia in Malaysia. 7. References

[1] Henry Nasution (2002). Fuzzy Logic for Air Conditioner, of a Report by the Faculty of Mechanical Engineering Universiti Teknologi Malaysia.

[2] __________________ (2002). “An Introduction to Fuzzy Logic Control.” Bung Hatta University. [3] __________________ (2003). Overview of Fuzzy Logic Control, of a Report by the Faculty of

Mechanical Engineering Universiti Teknologi Malaysia. [4] Altrock, Constantin Von (1995). “Fuzzy Logic & NeuroFuzzy Applications Explained.” New

Jersey : Prentice Hall. [5] Bojadziev, George and Bojadziev, Maria (1998). “Fuzzy Sets, Fuzzy Logic, Applications.”

Singapore : World Scientific. [6] Carvajal, J., Chen, Guanrong and Ogmen, Haluk (2000). “ Fuzzy PID Controller : Design

Performance Evaluation, and Stability Analysis.” Information Sciences. 123. 249-270. [7] Huang, S. and Nelson, R. M. (1991). “ A PID Law Combining Fuzzy Controller for HVAC

Applications.” ASHRAE Transactions 97. 2. 768-774. [8] _________________ (1994). “ Rule Development and Adjustment Strategies of A Fuzzy Logic

Controller for an HVAC System : Part One – Analysis.” ASHRAE Transactions 100. 1. 841-850.

[9] _________________ (1994). “ Rule Development and Adjustment Strategies of A Fuzzy Logic Controller for an HVAC System : Part Two – Experiment.” ASHRAE Transactions 100. 1. 851-856.

[10] Jamshidi, Mohammad, Vadiee, Nader and Ross, Timothy J. (1993). “Fuzzy Logic and Control.” New Jersey : Prentice Hall.

[11] Klir, George J., and Bo, Yuan (1996). “ Fuzzy Sets, Fuzzy Logic, And Fuzzy Systems.” Singapore : World Scientific.

[12] Lim, Huey Yi (1998). “ On-Line Fuzzy Control for Motor Control.” Universiti Teknologi Malaysia : Degree Thesis.

[13] Li-Xin, Wang (1997). “ A Course in Fuzzy Systems and Control.” United State of America : Prentice Hall.

[14] Masjuki Khalid (1996). “ A Hand On Fuzzy Logic.” Universiti Teknologi Malaysia. [15] Ong, Song Ping (1999). “On Line Fuzzy Logic Control.” Universiti Teknologi Malaysia : Degree

Thesis. [16] Passino, Kevin M., and Yurkovich, Stephen (1998). “Fuzzy Control.” California : Addison

Wesley. [17] Reznik, Leonid (1997). “Fuzzy Controller.” Oxford : Newnes. [18] Ross, Timothy J. (1997). “ Fuzzy Logic With Engineering Applications.” Singapore : McGraw

Hill. [19] The Math Works (2001). “Fuzzy Logic Toolbox for Use With Matlab.” [20] Tsoukalas, Lefteri H., and Uhrig, Robert E. (1997). “Fuzzy and Neural Approach In

Engineering.” United States of America : John Wiley & Sons. [21] Yen, John., Langari, Reza., and Zadeh, Lotfi A. (1995). “ Industrial Applications of Fuzzy Logic

and Intelligent Systems.” In. Mohammad Jamshidi. “ On Fuzzy Control of Nonchlorofluorocarbon Air Conditioning Systems.” New York : IEEE Press.

[22] Zilouchian, Ali and Mo Jamshidi (Ed.) (2001).” Intelligent Control Systems Using Soft Computing Methodologies.” In . Talebi – Daryani, Reza. “ Application of Fuzzy Logic for Control of Heating, Chilling, and Air Conditioning Systems.” Boca Raton, Florida : CRC Press.

15