Fuzzy Logic

  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Fuzzy Logic as PDF for free.

More details

  • Words: 2,444
  • Pages: 12
1. INTRODUCTION What is fuzzy logic FL? Fuzzy logic is a problem solving control system methodology that was invented by Lofti Zadeh a professor at the University of California at Berkley. It has proven to be an excellent choice for many control system applications since it mimics human control logic. It can be built into anything from small hand-held products to large computerized process control systems. It is imprecise but very descriptive language to deal with input data more like human operator. Fuzzy logic (FL) offers several unique features that make it a particularly good choice for many control problems. These include: It is inherently robust since it does not require precise, noise free input, and can be programmed to fail safely if a feedback sensor quits or destroyed. The output control is a smooth control function despite a wide range of input variations. FL controller processes user-defined rules governing the target control system, therefore it can be modified and tweaked easily to improve or drastically alter system performance for the better. FL has no limited inputs feedback and control outputs. It is also not necessary to measure or compute rate of change parameters in order for it to be implemented, any sensor data that provides some indication of a system’s action and reaction is sufficient. This allows the sensor to be inexpensive and imprecise thus keeping the overall cost and complexity low FL control nonlinear systems that would be difficult or impossible to model mathematically. This opens doors for control systems that could normally be deemed unfeasible for automation. 2. FUZZY SETS FL deals with problems that have fuzziness or vagueness , unlike other methods like classical theory which is based on Boolean logic where a particular object or variable is either a member of a given set (logic 1) or not (logic 0). Fuzzy logic problem is an input/output, static, nonlinear mapping problem through a main box as shown in figure 1

Input space

Output space

Main box

Figure 1: Input/Output mapping problem

1

The input information is defined in the input space, it is processed in the main box and the solution appears at the output space. The main box is a fuzzy system or any other method e.g. expert system, neural network or a general mathematical system that can give a desired output. 2.1 Membership function (MF) The MF is a graphical representation of the magnitude of participation of each input. It associates a weighting with each of the inputs that are processed, define, functional overlap between inputs and ultimately determines and output response. The fuzzy variables has values that are expressed by the natural language for instance English. A membership curve defines how the values of fuzzy variable in a certain region are mapped to a membership value μ (or degree of membership) between 0 and1. A stator temperature of a motor for example, as a fuzzy variable can be defined by the qualifying linguistic variables as cold, mild or hot, where they are represented by a triangles or straight line segment membership

Degree of membership Typically 0 - 1

function. Figure 2 shows the features of membership function.

MILD

COLD

1

HOT

0 20

30

40

50

60

70

80

width

Engineering unit

Figure 2 the features of membership function

MF can have different shapes like triangular, trapezoidal, two sided Gaussian, generalised bell, sigmoid-right, sigmoid-left, difference sigmoid, product sigmoid, polynomial-Z, polynomial-Pi and polynomial-S. Triangular and trapezoidal types are the mostly used MF as shown in figure 3, which can be symmetrical or asymmetrical. MF can be represented by mathematical functions, segmented straight lines (for triangular and trapezoidal) and look-up tables.

2

1

1

0.5

0.5

0

0 0

2.5

5

7.5

10

0

2.5

5

7.5

10

(b) trapezoidal

(a) triangular

Figure 3: different types of membership functions

2.2 operations with sets The basic properties of Boolean logic are also valid for FL, figure 4 shows the logical operations of OR, AND, and NOT on the fuzzy set A and B using triangular MFs compares with the corresponding Boolean operations on the right. Let µA(x), µB(x) denote the degree of membership of a given element x n the universe of discourse X (denoted bye x ∈ X). Union: if A and B are two fuzzy sets, defined in the universe of discourse X the union Α∪Bis also a fuzzy set of x with membership function given as: µ AUB(x) ≡ Max [µA(x), µB(x)] ≡ µA(x) v µB(x) Where symbol “v” is a maximum operator equivalent to Boolean OR logic. Intersection: The intersection of two fuzzy sets A and B in the universe of discourse x denoted by A ∩B has the membership function given by µ A∩B(x) ≡ Max [µA(x), µB(x)] ≡ µA(x) ^ µB(x) Where “^” is the minimum operator equivalent to Boolean AND logic. Complementary or Negation: The complement of a given set A in the universe of discourse X denoted bye Ā and has a membership function given by: µĀ (x) ≡ 1- µA (x) Equivalent to the NOT operation in Boolean logic. Product of two fuzzy sets: The product of two fuzzy logic sets A and B defined in the same universe of discourse X is a new fuzzy set A.B with MF that equals the algebraic product of MFs A and B µA.B(x) ≡ µA(x). µB(x) Multiplying fuzzy sets by a crisp number: The MF of fuzzy set A can be multiplied by a crisp number k to obtain a new fuzzy set called product k.A its MFs is 3

µkA(x) ≡ k.µA(x). Power of a fuzzy set: Fuzzy set A can be raised to a power m(positive real number) by raising its MFs to m. the m power of A is a new fuzzy set Am with MF denoted by µAm(x) ≡ µA (x)m

µA(x), µB(x)

B

A

A

B

1 0 2

0

µA U µB(x)

4

6

union OR 1 0 2

0

µA µB (x)

4

6

intersection

AND

1 0

2

0

µA (x)

4

6

Negation (A) NOT (A)

0 2

0

4

6 (b)

(a)

Figure 4: logical operations of (a) fuzzy sets (b) crisp sets

3. FUZZY SYSTEM. 4

Fuzzy system consists of a formulation of the mapping from a given input set to and output using fuzzy logic, which consists of the following five steps. Step 1: Fuzzification of input variables, defining the control objectives and criteria. Step 2: application of fuzzy operators (AND, OR, NOT) in the IF (antecedent) part of the rule. Determine the output and input relationships and choose a minimum number of variables for input to the fuzzy logic engine. Step 3: implication from antecedent to the consequent (THEN part of the rule) for the desired system output response for a given system input conditions. Step 4: aggregation of the consequents across the rules by creating fuzzy logic membership functions that define the meaning (values) of input/output terms used in the rule. Step 5: defuzzification to obtain a crisp result. The following example shows how the above five steps can be implemented in a non technical environment for a restaurant tipping where food and service are the inputs fuzzy variable (0 -10 range) and tip is the output variable (0-25% range). The input variable service is represented by three fuzzy sets poor, good, and excellent which corresponds to curved MFs. While variable food is represented by two fuzzy sets bad and delicious this corresponds to straight-line MFs. The output variable tip is represented by three sets cheap, average, and generous which correspond to triangular MFs. Three rules are developed as shown in figure 5. Fuzzy system

Rule 1

IF the service is poor or food is rancid THEN tip is cheap

Input 1 Service (0-10)

Rule 2

IF the service is good THEN tip is average

Input 2 Food (0-10)

Rule 3

IF the service is excellent or food is delicious THEN tip is generous



Output Tip (0-25%)

Figure 5: fuzzy inference for restaurant tipping

If the quality of service is 3 which implies MF poor gives the output µ=0.3 which is a result of fuzzification (step 1) and if the score for food is 8 which is referred to a MF bad, the 5

result of fuzzification is µ=0. After all the inputs have be fuzzified and each degree of the antecedent if a rule has been satisfied, the OR or max operator is specified and therefore between the two values 0.3 and 0, the result of the operator is 0.3 which is selected in (step 2) this defined as the degree of fulfillment (DOF). The implication stage helps to evaluate the consequent part of a rule. For this rule the output MF cheap is truncated at the value µ=0.3 to give a fuzzy output (step 3). All the rules are evaluated the same manner and their contributions are shown in figure 6

the outputs are combined or aggregated in a cumulative manner to result a final fuzzy

output (step 4). Finally, the fuzzy output (area) is converted into crisp which is defined as defuzzification (step 5)

1.

cheap

Bad DOF

Poor µ=0.3

0.3

10

0

10

0

0%

25%

25%

0%

25%

average

µ-= 0.7

2.

0%

good 10

0

0

10

25%

0%

excellent 3.

delicious

0

10

generous

0

10

Service = 3

Food = 8

Input 1

Input 2

25%

0%

output Tip = 16.7%

Figure 6: information processing in fuzzy system for restaurant tipping

3.1 Implication methods 6

0%

25%

0%

25%

There are three major methods of implication which are; mamdani, lusing lerson and sugeno types but the frequently use is the mamdani because of its simplicity. Given the following rules of a fuzzy system; Rule 1: If X is negative small (NS) and Y is zero ZE THEN Z is positive small (PS) Rule 2: If X is zero (ZE) and Y is zero (ZE) THEN Z is zero (ZE) Rule 3: If X is zero (ZE) and Y is positive small (PS) THEN Z is negative small (NS) Where X and Y are the input variables while Z is the output and NS, ZE, and PS are the fuzzy sets. Figure 7 explains the fuzzy inference system with mamdani method for inputs x=3 and Y= 1.5

The DOF of the rules are; DOF1 = µNS(x) ^ µZE(Y) = 0.8 ^ 0.6 = 0.6 DOF2=µZE(X) ^ µZE(Y) = 0.4 ^ 0.6 = 0.4 DOF3= µZE(X) ^ µPS(Y) = 0.4 ^ 1.0=0.4

The total output is the union (OR) of all the components MFs µout (Z) =µPS’ (Z) v µZE’ (Z) v µNS’ (Z). ZE

NS 1

PS 1

1 DOF1

0

-6

6

-6

ZE

0

PS’

6

ZE

ZE

1

6

0

-6 1

1

ZE’ DOF2

-6

6

0

-6

ZE

1

1

6

0 PS

-6

0

6

NS

1

NS” DOF3

0

-6

X

-6

6

X=-3

0

Y

6

-6

0

Z

6

Y=1.5 µo ut (Z)

-6

0

6 Zo

Figure 7: three-rule fuzzy systemusing mamdani method

4. DEFUZZIFICATION 7

This the final stage in fuzzy system where the fuzzy output needs to be converted to a crisp (non fuzzy) form. A fuzzy rule-based controller for instance, uses such step to generate a crisp control command. There three major types of defuzzification techniques (i)

The Mean Of Maxima (MOM) method. The MOM defuzzification calculates the average of all variables with maximum membership degree. The crisp output is given by the equation; Zo=m=1mZmM

Where Zm = mth element in the universe of discourse, when the output MF is at the maximum value, and M = number of such element. (ii)

Sugeno method From the sugeno implication method where K1,K2,K3,……Kn represent the consequent part of each rule, the output MF in each rule is a singleton spike which, is multiplied by the respective DOF to contribute the fuzzy output of each rule hence the output will be given by the formula; Zo=K1DOF1+K2DOF2+K3DOF3+…KnDOFnDOF1+DOF2+DOF3+…DOFn

(iii)

Center of area (COA) or centroid method This method calculates the weighted average a fuzzy output set. The crisp output of Zo is taken to the geometric center of the output fuzzy value µout (Z) area, where µout (Z) is formed by taking the union of all the contributions of values whose DOF>0 with a discrete universe of discourse as shown by the expression; Zo=i=1nZiµout(Zi)i=1nµout(Zi)

For example: given a two rule fuzzy system output shown in figure 8, the crisp output using COA method will be as shown; 2/3

2/3

2/3

1/3

0

1

2

3

4

1/3

1/3

1/3

5

6

7

Figure 8: defuzzifucatuion output for two rules

Therefore: 8

8

Zo = 1.13+2.23+3.23+4.23+5.13+6.13+7.1313+23+23+23+13+13+13+ = 3.7 FUZZY CONTROL A fuzzy control system embeds the experience an intuition of human plant operator and those of a designer and/or researcher of the plant. It gives robust performance for linear or nonlinear plant with parameters variations and can be applied in a complex process such as cement plant, nuclear reactors etc. 5. APPLICATIONS For the output of a fully control thyristor power converter, the output voltage is determine by the following equation, Vmean =2Vmaxπcos∝. Where Vmean = the average dc output of the inverter ∝= delay angle in degrees

Using a single phase voltage source, a simple fuzzy rule-based system using five simple rules can be used to approximate the output voltage. The universe of discourse for the input variable ∝ will be interval [ 0, 90] in degrees, the input voltage can vary [80-260] line voltage, and the universe of discourse for the output Vmean is the interval [0, 216] volts. The input variable is partition into five membership functions as follows: Very Small VS, Small S, Medium M, Large L, Very Large VL and three for input voltage; Low L, Medium M, and High H while the out is partition into three membership functions; Small S, Medium M, High H. using the fuzzy logic tool box under MATLAB environment the following were obtained.

9

Figure 9: FIS editor for power converter

Figure 10: Rule editor for a power converter 10

Figure 11: Rule Viewer for a power converter

6. REFERENCE: 11

1. John Yen, Reza Langari, Fuzzy logic: intelligence, control, and information. Pearson

Education: patparganji India 2005. 2. Guanrong Chen, Trung Lat Pham: Introduction to fuzzy sets, fuzzy logic and fuzzy

control systems: CRC Press LLC Florida 2001. 3. Marco Russo, Lakhmi C Jain, Fuzzy Learning and application: New York 2001. 4. http://www.prairiedigital.com/PDI_Website/PDI_Model40.htm 5. Fuzzy Logic Toolbox, The MathWorks http://www.mathworks.com/products/fuzzylogic/. 6. Ajith Abraham, Rule-based Expert Systems, pp 909-919, Oklahoma State University,

Stillwater, OK, USA. 7. Nikola K. Kasabov, Foundations of Neural Networks, Fuzzy Systems, and Knowledge Engineering, The MIT Press Cambridge. 1996.

12

Related Documents

Fuzzy Logic
May 2020 18
Fuzzy Logic
June 2020 22
Fuzzy Logic
May 2020 22
Fuzzy Logic
April 2020 18
Fuzzy Logic
November 2019 23
Fuzzy Logic Introduction
November 2019 15