32
.......................................................................... Collection Technique Cahier technique no 191 Fuzzy logic F. Chevrie F. Guély

191 Fuzzy Logic

Embed Size (px)

Citation preview

..........................................................................Collection Technique

Cahier technique no 191

Fuzzy logic

F. ChevrieF. Guély

Cahiers Techniques are a collection of documents intended for engineersand technicians, people in the industry who are looking for information ingreater depth in order to complement that given in display productcatalogues.

These Cahiers Techniques go beyond this stage and constitute practicaltraining tools.They contain data allowing to design and implement electrical equipement,industrial electronics and electrical transmission and distribution.Each Cahier Technique provides an in-depth study of a precise subject inthe fields of electrical networks, protection devices, monitoring and controland industrial automation systems.

The latest publications can be downloaded on Internet from theSchneider server.Code: http://www.schneider-electric.comSection: Mastering electricity

Please contact your Schneider representative if you want either a CahierTechnique or the list of available titles.

The “Cahiers Techniques” collection is part of the Groupe Schneider’s“Technical series”.

ForewordThe author disclaims all responsibility further to incorrect use of informationor diagrams reproduced in this document, and cannot be held responsiblefor any errors or oversights, or for the consequences of using informationand diagrams contained in this document.

Reproduction of all or part of a Cahier Technique is authorised with the priorconsent of the Scientific and Technical Division. The statement “Extractedfrom Schneider Cahier Technique no..... (please specify)” is compulsory.

Cahier Technique Schneider no 191 / pp.1

no 191Fuzzy logic

ECT 191 first issued, december 1998

François CHEVRIE

After joining Telemecanique in 1987, he joint the AdvancedAutomation Laboratory of the Research Division in 1993. A CNAMIndustrial Automation engineering graduate, his dissertation wasbased on the integration of fuzzy logic in Schneider programmablecontrollers.He played an active part in the preparation of the fuzzy logic productoffer for the Micro/Premium PC range, and helped implement thistechnique, particularly in the car and food industries.

François GUELY

After graduating from the Ecole Centrale de Paris in 1988, he joinedTelemecanique in Japan in 1990 and was awarded his PhD in fuzzylogic based automatic control in 1994. He has been in charge ofSchneider’s Advanced Automatic Department since 1995 where hehas helped prepare the extension to fuzzy logic of the IEC languagestandard for programmable controllers.

Cahier Technique Schneider no 191 / pp.2

Lexicon

Activation:See degree of truth.

Conclusion:A rule conclusion is a statement combining alinguistic variable and a linguistic term writtenafter the then of the rule. A conclusion can bemade up of a combination of several statements.

Condition:See predicate.

Data merge:Data merge consists of extracting, from severalpieces of data, one or more items of informationwhich may be different kinds.For example: from variables R, V and B givingthe colour of a biscuit, the cooking state of thebiscuit can be deduced. The term “Sensormerge” is also used.

Defuzzification:Conversion, after inference, of a fuzzy set of alinguistic output variable into a numerical value.

Degree of activation:See degree of truth.

Degree of membership:An element x belongs to a fuzzy set A with adegree of membership between 0 and 1, givenby the membership function µA (x).

Degree of truth:The degree of truth, or degree of activation, of arule is a value y between 0 and 1 deduced fromthe degrees of membership of the rulepredicates. It directly affects the value of theconclusions of this rule. The rule is also said tobe active at y.

Fuzzification:Conversion of a numerical value into a fuzzydegree of membership by evaluating amembership function.

Fuzzy set:In the classical set theory, the characteristicfunction defines the set: this function only takes

the two discrete values 0 (the element does notbelong...) or 1 (...belongs to the set). A fuzzy setis defined by a membership function which cantake any real values between 0 and 1.

Inference:Calculation of the degrees of activation of all therules in the base as well as of all the fuzzy setsof the linguistic variables contained in theconclusions of these rules.

Knowledge base:Set of membership functions and rules of a fuzzysystem containing expertise, knowledge of theoperator, expert, etc.

Linguistic term:Term associated with a membership functioncharacterising a linguistic variable.

Linguistic variable:Numerical variable with a name (pressure,temperature… to which are associated inguisticterms.

Membership function:Function µA (x) associating to any input value xits degree of membership to the set A. Thisgradual value belongs to the [0; 1] interval.

Predicate:Also known as premise or condition, a rulepredicate is a statement combining a linguisticvariable and a linguistic term written betweenthe if and the then of the rule. A predicate canbe made up of a combination of severalstatements linked by AND, OR, NOT operators.

Premise:See Predicate.

Sensor merge:See Data merge.

Singleton:Membership function µA (x), equals to zero for allx, except at a singular point x0.

Cahier Technique Schneider no 191 / pp.3

Fuzzy logic

Contents

1 Introduction 1.1 Fuzzy logic today pp. 4

1.2 The history of fuzzy logic pp. 4

1.3 Value and use of fuzzy logic for control pp. 5

2 Theory of fuzzy sets 2.1 Notion of partial membership pp. 6

2.2 Membership functions pp. 6

2.3 Fuzzy logic operators pp. 8

2.4 Fuzzy rules pp. 9

3 A teaching application example 3.1 Introduction pp. 14

3.2 Presentation of the example pp. 14

3.3 Linguistic variables and terms pp. 15

3.4 Rules and outputs pp. 15

4 Implementation 4.1 when can fuzzy rule bases be used? pp. 16

4.2 Designing an application pp. 16

4.3 Using an application pp. 17

4.4 Choosing the implementation technology pp. 17

4.5 Standards pp. 18

5 Fuzzy application 5.1 Application types pp. 19

5.2 Examples of industrial achievements pp. 20

6 Conclusion pp. 24

Appendix pp. 26

Bibliography pp. 28

Initially a theory, today fuzzy logic has become an operational technique.Used alongside other advanced control techniques, it is making a discretebut appreciated appearance in industrial control automation systems.

Fuzzy logic does not necessarily replace conventional control systems.Rather it completes such systems. Its advantages stem from its ability to:

c formalise and simulate the expertise of an operator or designer inprocess control and tuning,c provide a simple answer for processes which are difficult to model,c continually take into account cases or exceptions of different kinds, andprogressively incorporate them into the expertise,c take into account several variables and perform “weighted merging” ofinfluencing into variables.

How does this technique contribute to industrial process control?What is the effect on product quality and manufacturing cost?

Following a few basic theoretical notions, this Cahier Technique answersthe questions asked by automatic control engineers and potential users bymeans of industrial examples, in terms of implementation and competitiveadvantages.

Cahier Technique Schneider no 191 / pp.4

1 Introduction

1.1 Fuzzy logic today

In the majority of present-day applications, fuzzylogic allows many kinds of designer and operatorqualitative knowledge in system automation tobe taken into account.

Fuzzy logic began to interest the media at thebeginning of the nineties. The numerousapplications in electrical and electronichousehold appliances, particularly in Japan,were mainly responsible for such interest.Washing machines not requiring adjustment,camcorders with Steadyshot (TM) imagestabilization and many other innovations broughtthe term “fuzzy logic” to the attention of a widepublic.

In the car industry, automatic gear changes,injection and anti-rattle controls and airconditioning can be optimized thanks to fuzzylogic.

In continuous and batch production processes,as well as in automation systems (which is thesubject of this Cahier Technique), applicationshave also increased. Fuzzy logic has developedin this area as it is an essentially pragmatic,effective and generic approach. It allowssystematisation of empirical knowledge andwhich is thus hard to control. The theory of fuzzysets offers a suitable method that is easy toimplement in real time applications, and enablesknowledge of designers and operators to betranscribed into dynamic control systems.

This makes fuzzy logic able to tackle automationof procedures such as startup and setting ofparameters, for which few approaches werepreviously available.

This Cahier Technique describes fuzzy logic andits application to production processes.

1.2 The history of fuzzy logic

Appearance of fuzzy logic

The term “fuzzy set” first appeared in 1965 whenprofessor Lotfi A. Zadeh from the university ofBerkeley, USA, published a paper entitled“Fuzzy sets”. Since then he has achieved manymajor theoretical breakthroughs in this field andhas been quickly joined by numerous researchworkers developing theoretical works.

Initial applications

At the same time, some researchers turned theirattention to the resolution by fuzzy logic ofproblems considered to be difficult. In 1975professor Mamdani from London developed astrategy for process control and published theencouraging results he had obtained for thecontrol of a steam motor. In 1978 the Danishcompany, F.L. Smidth, achieved the control of acement kiln. This was the first genuine industrialapplication of fuzzy logic.

Boom

Fuzzy logic experienced a veritable boom inJapan where research was not only theoreticalbut also highly application oriented. At the end ofthe eighties fuzzy logic had taken off in a bigway, and consumer products such as washingmachines, cameras and camcorders with themention “fuzzy logic” were too numerous to becounted. Industrial applications such astreatment of water, harbour container cranes,undergrounds and ventilation/air conditioningsystems began to use fuzzy logic too. Finally,applications developed in such other fields suchas finance and medical diagnosis.From 1990 onwards, many applications began toemerge in large numbers in Germany, as wellas, to a lesser extent, in the USA.

Cahier Technique Schneider no 191 / pp.5

1.3 Value and use of fuzzy logic for control

ValueFuzzy logic stems from several observations,namely:c The knowledge that a human being has of anysituation is generally imperfect,v it can be uncertain (he doubts its validity),v or imprecise.c Human beings often solve complex problemswith approximate data: accuracy of data is oftenuseless; for example, in order to choose anapartment he may take into account surfacearea, proximity of shops, distance from theworkplace and rent without, however, needing avery precise value for each piece of information.c In industry and technology, operatorsfrequently solve complex problems in a relativelysimple manner without needing to model thesystem. Likewise, it is common knowledge that amathematical model is not required to drive acar, and yet a car is a highly complex system.c The more complex a system, the more difficultit is to make precise assertions on its behaviour.

The following are naturally deduced from theseobservations:c rather than modelling the system, it is oftenmore useful to model the behaviour of a humanoperator used to control the system;c rather than using equations, operation can bedescribed by qualitatively with an appropriatequantitative translation.

Use for control purposesFuzzy logic is well known by automatic controlengineers for its applications in process controland monitoring, then commonly referred to as“fuzzy control”. Just like a conventionalcontroller, the fuzzy controller is incorporated inthe control loop and computes the control to beapplied to the process according to one or moresetpoints and one or more measurements takenon the process.

Fuzzy rule bases are advantageous in control asthey allow:c consideration of existing qualitative expertise,c consideration of variables the effect of whichwould be difficult to model with traditional means,but is known in a qualitive way,c improvement of conventional controlleroperation by:v self-tuning of controller gains off line or on line,v modification of their output (feed forward)according to events that cannot be taken intoaccount using a conventional technique.

Using knowhow to its best advantage

A vital condition for the use of fuzzy rules is theexistence of human expertise and knowhow.Fuzzy rule bases cannot provide a solution whenno-one knows how the system operates orpeople are unable to manually control it.When such knowhow exists and can betranscribed in the form of fuzzy rules, fuzzy logicsimplifies its implementation, and operation isthen easily understood by the user.Fuzzy logic also enables maximum benefit to bederived from practical knowhow, often sought forin order to prevent loss of knowhow or to sharethis knowhow with other people in the company.When collecting expertise, unconscious omissionof information, the difficulty to explain and thefear to disclose knowhow are obstacles that arefrequently encountered. This stage musttherefore be prepared and conducted with care,taking into account the human factor.

If human expertise exists, then fuzzy rules canbe used, particularly when system knowledge istainted by imperfections, when the system iscomplex and hard to model and when themethod used requires a global view of some ofits aspects. Fuzzy rules do not replaceconventional automatic control methods, ratherthey complete these methods.

Cahier Technique Schneider no 191 / pp.6

2 Theory of fuzzy sets

2.1 Notion of partial membership

In the sets theory, an element either belongs ordoes not belong to a set. The notion of a set isused in many mathematical theories. Thisessential notion, however, does not take intoaccount situations which are yet both simple andcommon. Speaking of fruits, it is easy to definethe set of apples. However, it is harder to definethe set of ripe apples. We understand that anapple ripens progressively... the notion of a ripeapple is thus a gradual one.

Fig. 1 : comparison of a conventional set and a fuzzy set.

“Fuzzy” or “gradual”outline

“Crisp” outline x belongs neither to A nor By belongs completely to Az belongs completely to Bt belongs partially to BA: conventional set B: fuzzy set

x

y

zt

A B

The notion of a fuzzy set was created in order totake situations of this kind into account. Thetheory of fuzzy sets is based on the notion ofpartial membership: each element belongspartially or gradually to the fuzzy sets that havebeen defined. The outlines of each fuzzy set(see fig.1 ) are not “crisp”, but “fuzzy” or“gradual”.

2.2 Membership functions

A fuzzy set is defined by its “membershipfunction” which corresponds to the notion of a“characteristic function” in classical logic.

Let us assume that we want to define the set ofpeople of “medium height”. In classical logic, wewould agree for example that people of mediumheight are those between 1.60 m and 1.80 mtall. The characteristic function of the set(see fig. 2 ) gives “0” for heights outside the

1

0

Degree of membership µ

Variable: height

Characteristic function “medium height”

1m60 1m80

Fig. 2 : characteristic function.

range [1.60 m; 1.80 m] and “1” for heights in thatrange. The fuzzy set of people of “mediumheight” will be defined by a “membershipfunction” which differs from a characteristicfunction in that it can assume any value in therange [0;1].Each possible height will be assigned a “degreeof membership” to the fuzzy set of “mediumheights” (see fig. 3 ) between 0 and 1.

1

0

Degree of membership µ

Variable: height

Characteristic function “medium height”

1m72

Fig. 3 : membership function.

Cahier Technique Schneider no 191 / pp.7

c they are simple,

c they contain points allowing definition of areaswhere the notion is true and areas where it isfalse, thereby simplifying the gathering ofexpertise.

We have chosen to use membership functions ofthis kind in the rest of this document.

In some cases, membership functions may beequal to 1 for a single value of the variable, andequal to 0 elsewhere. They are then known as“singleton membership functions”. A fuzzysingleton (see fig. 6 ) defined on a real variable(height) is the expression in the fuzzy field of aspecific value (Paul’s height) of this variable(see appendix).

1

0.7

0.3

0Height (m)

Small Medium Tall

1.801.60 2

µ

Fig. 4 : membership function, variable and linguistic term.

A number of fuzzy sets can be defined on thesame variable, for example the sets “smallheight”, “medium height” and “tall height”, eachnotion being explained by a membership function(see fig. 4 ).

Height

Small Medium

“Totally”medium height

Small “not at all” medium

Tall “not at all” medium

Tall

µ

Fig. 5 : piece-wise linear membership functions.

This example shows the graduality that enablesfuzzy logic to be introduced. A 1.80 m tall personbelongs to the “tall” set with a degree of 0.3, andto the set “medium height” with a degree of 0.7.In classical logic, the change from average to tallwould be sudden. A 1.80 m person would thenbe of medium height, whereas a 1.81 m personwould be tall, an assertion which shocksintuition. The variable (for example: height) aswell as the terms (for example: medium, tall)defined by the membership functions, are knownas linguistic variable and linguistic termrespectively.

As we shall see further on, both linguisticvariables and terms can be used directly in rules.

Membership functions can assume any shape.However they are often defined by straightsegments and said to be “piece-wise linear”(see fig. 5 ).

“Piece-wise linear” membership functions arefrequently used as:

1

0Paul's height1.78 m

µ

Fig. 6 : singleton membership function.

1

0.4

0Input2

Low

µ

Fig. 7 : fuzzification.

Fuzzification - Degree of membership

Fuzzification enables a real value to beconverted into a fuzzy one.

It consists of determining the degree ofmembership of a value (measured by example)to a fuzzy set. For example (see fig. 7 ), if thecurrent value of the “input” variable is 2, thedegree of membership to the “low input”membership function is equal to 0.4 which is theresult of the fuzzification.

We can also say that the “low input” proposal istrue at 0.4. We then talk of degree of truth of theproposal. Degree of membership and degree oftruth are therefore similar notions.

Cahier Technique Schneider no 191 / pp.8

2.3. Fuzzy logic operators

These operators are used to write logiccombinations between fuzzy notions, i.e. toperform computations on degrees of truth. Justas for classical logic, AND, OR and NOToperators can be defined.

For example: Interesting Apartment =Reasonable Rent AND Sufficient Surface Area.

Choice of operatorsThese operators have many variants (seeappendix). However the most common are the“Zadeh” operators described below.

The degree of truth of a proposal A will benoted µ(A).

IntersectionThe logic operator corresponding to theintersection of sets is AND. The degree of truthof the proposal “A AND B” is the minimum valueof the degrees of truth of A and B:

µ(A AND B) = MIN(µ(A),µ(B))

For example:“Low Temperature” is true at 0.7“Low Pressure” is true at 0.5“Low Temperature AND Low Pressure” istherefore true at 0.5 = MIN(0.7; 0.5).

NB: this fuzzy AND is compatible with classicallogic 0 and 1, yelds 0.

Union

The logic operator corresponding to the union ofsets is OR. The degree of truth of the proposal“A OR B” is the maximum value of the degreesof truth of A and B:

µ(A OR B) = MAX(µ(A),µ(B))

For example:“Low Temperature” is true at 0.7“Low Pressure” is true at 0.5“Low Temperature OR Low Pressure” istherefore true at 0.7.

NB: this fuzzy OR is compatible with classicallogic: 0 OR 1 yields 1.

Complement

The logic operator corresponding to thecomplement of a set is the negation.

µ(NOT A) = 1 - µ(A)

For example:“Low Temperature” is true at 0.7“NOT Low Temperature” that we will normallywrite as “Temperature NOT Low” is thereforetrue at 0.3.

NB: the negation operator is compatible withclassical logic: NOT(0) yields 1 and NOT(1)yields 0.

Fuzzy ladderLadder language or contact language iscommonly used by automatic control engineersto write logic combinations, as it enables theirgraphic representation. Schneider hasintroduced the use of ladder representation todescribe fuzzy logic combinations.

Below is an example dealing with the comfort ofambient air:

hot, damp air is uncomfortable (excessiveperspiration); likewise breathing is difficult in airthat is cold and too dry. The most comfortablethermal situations are those in which air is hotand dry, or cold and damp. This can betranscribed by the fuzzy ladder in figure 8corresponding to the following combination:

Good comfort = (Low Temperature AND HighHumidity) OR (High Temperature AND LowHumidity).

It represents a possible definition of thesensation of comfort felt by a person in a thermalenvironment in which air does not move.

Temperature

10 20 30 °C

Low High

Humidity

50 100 %

Low High

Lowtemperature

Highhumidity

Hightemperature

Lowhumidity

Goodcomfort

µ µ

Fig. 8 : fuzzy ladder.

Cahier Technique Schneider no 191 / pp.9

Fuzzy classification

Classification normally consists of two steps:

c preparation: determining the classes to beconsidered,c on line: assigning the elements to classes.

The notions of class and set are identicaltheoretically.There are three types of assignment methodsaccording to the result produced:

c boolean: the elements either belong or do notbelong to the classes,c probabilistic: the elements have a probability ofbelonging to boolean classes, such as for examplethe probability that a patient has measles giventhe symptoms that he shows (diagnosis),c gradual: the elements have a degree ofmembership to the sets; for example a lettuce

belongs to a varying degree to the class of “freshlettuces”.

Classification methods, whether they produce agradual, boolean or probabilistic result, can bedeveloped from:

c an experiment (case of “fuzzy ladder”mentioned above),c examples used for learning purposes (e.g. forneuron network classifiers),c mathematical or physical knowledge of aproblem (for example, the comfort of a thermalsituation can be evaluated from thermal balanceequations).

Gradual (or fuzzy) classification methods can beused in control loops. This is the case of theindustrial cooking example for biscuits describedlater on.

2.4. Fuzzy rules

Fuzzy logic and artificial intelligence

The purpose of fuzzy rule bases is to formaliseand implement a human being’s method ofreasoning. As such it can be classed in the fieldof artifical intelligence.The tool most commonly used in fuzzy logicapplications is the fuzzy rule base. A fuzzy rulebase is made of rules which are normally used inparallel but which can also be concatenated insome applications.

A rule is of the type:

IF “predicate” THEN “conclusion”.For example: IF “high temperature and highpressure” THEN “strong ventilation and wideopen valve”.

Fuzzy rule bases, just like conventional expertsystems, rely on a knowledge base derived fromhuman expertise. Nevertheless, there are majordifferences in the characteristics and processingof this knowledge (see fig. 9 ).

A fuzzy rule comprises three unctional partssummarised in figure 10 .

Fuz-zification

Inputs Outputs

Fuzzyarea

Numericalvalues

Numericalvalues

InferencesDefuz-zification

Fig. 9 : fuzzy rule base and conventional rule base.

Fig. 10 : fuzzy processing.

Predicate

A predicate (also known as a premise orcondition) is a combination of proposals by AND,OR, NOT operators.

The “high temperature” and “high pressure”proposals in the previous example are combinedby the AND operator to form the predicate of therule.

Fuzzy rule base Conventional rule base (expert system)

Few rules Many rulesGradual processing Boolean processingConcatenation possible but scarcely used Concatenated rules A OR B ⇒ C,

C ⇒ D,D AND A ⇒ E

Rules processed in parallel Rules used one by one, sequentiallyInterpolation between rules that No interpolation, no contradictionmay contradict one another

Cahier Technique Schneider no 191 / pp.10

Inference

The most commonly used inference mechanismis the “Mamdani” one. It represents asimplification of the more general mechanismbased on “fuzzy implication” and the“generalised modus ponens”. These conceptsare explained in the appendix. Only the“Mamdani” rule bases are used below.

Conclusion

The conclusion of a fuzzy rule is a combination ofproposals linked by AND operators. In theprevious example, “strong ventilation” and “wideopen valve” are the conclusion of the rule.

“OR” clauses are not used in conclusions as theywould introduce an uncertainty into theknowledge (the expertise would not make itpossible to determine which decision should bemade). This uncertainty is not taken into accountby the Mamdani inference mechanism whichonly manages imprecisions. Therefore the“Mamdani” fuzzy rules are not in theory suitablefor a diagnosis of the “medical” kind for which

Pressure

High

IF “high pressure” AND “high temp.” THEN “valve wide open”

IF “average pressure” AND “high temp.” THEN “average valve opening”

High Wide

Temperature Valve opening

Pressure

Average High Average

Temperature Valve opening

µ µ µ

µ µ µ

conclusions are uncertain. The theory ofpossibilities, invented by Lotfi Zadeh, offers anappropriate methodology in such cases.

Likewise, negation is not used in conclusions forMamdani rules. This is because if a rule were tohave the conclusion “Then ventilation notaverage”, it would be impossible to say whetherthis means “weak ventilation” or “strongventilation”. This would be yet another case ofuncertainty.

Mamdani inference mechanism

c Principle

A Mamdani fuzzy rule base therefore containslinguistic rules using membership functions todescribe the concepts used (see fig. 11 ).

The inference mechanism is made up of thefollowing steps:c Fuzzification

Fuzzification consists of evaluating themembership functions used in rule predicates, asis illustrated in figure 12 :

Fig. 11 : implication.

Cahier Technique Schneider no 191 / pp.11

Pressure

High0.50.3

2.5 bar 17°C

High Wide

Temperature Valve opening

µ µ µIF “high pressure” AND “high temp.” THEN “valve wide open”

Pressure

0.5Min= 0.3

0.3

2.5 bar 17°C

High

Temperature Valve opening

µ µ µIF “high pressure” AND “high temp.” THEN “valve wide open”

}

Pressure

Min= 0.3

2.5 bar 17°C

Wide

Temperature Valve opening

µ µ µIF “high pressure” AND “high temp.” THEN “valve wide open”

0.50.3 }

c Degree of activation

The degree of activation of a rule is theevaluation of the predicate of each rule by logiccombination of the predicate proposals

c Implication

The degree of activation of the rule is used todetermine the conclusion of the rule: thisoperation is called the implication. There areseveral implication operators (see appendix), butthe most common is the “minimum” operator.

(see section 2.3.), as shown in figure 13 . The“AND” is performed by realising the minimumbetween the degrees of truth of the proposals.

The conclusion fuzzy set is built by realising theminimum between the degree of activation andthe membership function, a sort of “clipping”of the conclusion membership function(see fig. 14 ).

Fig. 12 : fuzzification.

Fig. 13 : activation.

Fig. 14 : implication.

Cahier Technique Schneider no 191 / pp.12

c AggregationThe output global fuzzy set is built byaggregation of the fuzzy sets obtained by eachrule concerning this output. The example belowshows the case when two rules act on an

output. The rules are considered to be linked bya logic “OR”, and we therefore calculate themaximum value between the resultingmembership functions for each rule (see fig. 15 ).

Pressure

0.3

2.5 bar 17°C

2.5 bar 17°C

IF “high pressure” AND “high temp.” THEN “valve wide open”

WideHighHigh

Temperature Valve opening

Pressure

IF “average pressure” AND “high temp.” THEN “valve wide open”

Average

Aggregation: MAXIMUM

HighAverage

Temperature Valve opening

Valve opening

µ µ µ

µ µ µ

µ

Fig. 15 : aggregation of rules.

DefuzzificationAt the end of inference, the output fuzzy set isdetermined, but cannot be directly used toprovide the operator with precise information orcontrol an actuator. We need to move from the“fuzzy world” to the “real world”: this is known asdefuzzification.

A number of methods can be used, the mostcommon of which is calculation of the “centre ofgravity” of the fuzzy set (see fig. 16 ).

µ

35.6° Valve opening

∫∫xµ(x)dx

µ(x)dx

“Free” and “able” rulesFuzzy rule bases, in their general case, usemembership functions on system variables, andrules that can be written textually. Each rule usesits own inputs and outputs, as shown by theexample below:

R1: IF “high temperature”THEN “high output”

R2: IF “average temperature”AND “low pressure”THEN “average output”

R3: IF “average temperature”AND “high pressure”THEN “low output”

R4: IF “low temperature”AND “high pressure”THEN “very low output”

Fig. 16 : defuzzification by centre of gravity.

Cahier Technique Schneider no 191 / pp.13

In diagram form, the “areas of action” of the rulesand their overlapping can be represented in thetable in figure 17 .

Temp.

Pressure

High

Low

Low Average High

Verylow

output

Lowoutput

Averageoutput

Highoutput

Fig. 17 : implication represented in a table.

We can make the following observations:

c not all the space is necessarily covered: thecombination “low temperature and low pressure”is not taken into account in this case. Theexplanation is for example that this combinationis not physically possible for this machine or that

it does not interest us. It is best to verify it as thismay be an omission;c the first rule only takes temperature intoaccount: this situation is normal in that it reflectsthe existing expertise.However, many applications define rule “tables”.In this context, the space is “gridded” and each“box” in the grid is assigned a rule. Thisapproach has the advantage of beingsystematic, but:c it does not always allow simple expression (ina minimum number of rules) of the existingexpertise,c it can be applied only for two or three inputs,whereas ”free” rule bases can be built with alarge number of variables.

Remarks

c The behaviour of a fuzzy rule base is staticand non-linear with respect to its inputs.c Fuzzy rule bases are not themselves dynamic,although they often use as inputs variablesexpressing system dynamics (derivatives,integrals, etc. ) or time.c The main advantage of the “fuzzy PID”controller, often presented as a teachingexample to give an idea of fuzzy logic, is to makea non-linear PID, which rarely justifies its use inthe place of a conventional PID. Moreover itwould be hard to incorporate an existingexpertise in this case.

Cahier Technique Schneider no 191 / pp.14

3 A teaching application example

3.1 Introduction

Most fuzzy logic achievements require preliminaryspecialist knowledge of the application area. Inorder to be easily understood by the reader, the

following example is based on a fictitiousapplication and is designed to illustrate theprocedure for creating a fuzzy rule base.

3.2 Presentation of the example

The example concerns a process for washinglettuce for the production of prepacked lettuce inthe “fresh produce” counters of supermarkets.The lettuce is cut, washed and packed. Thepurpose of washing is to remove earth from thelettuce as well as any micro-organisms whichcould proliferate during product shelf-life. Themanufacturer wishes to automate the washingprocess.

Washing is a continuous process. The lettuceleaves are placed in “drums” which movethrough a “tunnel” fitted with nozzles sprayingchlorinated water. The water removes the earth,whereas the chlorine kills the micro-organisms(see fig. 18 ).

The following priorities were formulated by themarketing department and listed in the order oftheir importance:

c With respect to the customerv Guarantee quality- “Very clean” lettuce (appearance)- No taste of chlorine.v Guarantee safety- Acceptable level of micro-organisms

c With respect to profitabilityv Maximise production

Drum

Belt speed Turbidity measurementWaste water after washing

Measurement off line of:- chlorine ratio- micro-organism ratio

Water flow Chlorine flow

Tunnel

v Save waterv Save chlorine.

The operators manually controlling the processusually inspect the dirty water at the end of thetunnel washing. If the water is clear, they deduceby experience that the lettuce will have a“clean” appearance. The decision is thus madeto install an optic “turbidity” sensor designed todetermine the degree of transparency of thewater.

Moreover, operators use once an hour a reportbased on analysis conducted in the factory whichgives the ratio of micro-organisms and residualchlorine found in washed and prewashed lettuceat the end of the line.

The aim is therefore to use the aboveinformation to improve control of:c lettuce conveyor belt speed (in order toincrease production output),c the amount of chlorine sprayed,c the amount of water sprayed.

Limits are imposed:c on conveyor belt speed, by the mechanism,c on water flow to prevent damaging the lettuceleaves.

Fig. 18 : lettuce washing process.

Cahier Technique Schneider no 191 / pp.15

3.3. Linguistic variables and terms

The following variables will therefore bechosen:

c inputs:

v micro-organism ratio: Micro_ratiov residual chlorine ratio: Cl_ratiov turbidity of water: Turbidityv conveyor belt speed: Speedv water flow: Water_f

Cl_ratio

Acceptable High

µ

Water_f_var

Negative Positive Positive big

µ

Turbidity

Low High

µ

CI_f_var

Negative Positive Positive big

µ

TMicro_ratio

Low

Acceptable

High

µ

Water_f

Not high High

µ

Speed

Not high High

µ

Speed_var

Negative Positiveµ

c outputs:

v modification of water flow: Water_f_varv modification of chlorine flow: Cl_f_varv modification of speed: Speed-var

A session with an experienced operator, amicrobiology specialist and a lettuce “taster”produces the following membership functions(see fig. 19 ):

Fig. 19 : piece-wise linear membership functions.

3.4. Rules and outputs

Writing fuzzy rulesA meeting with operators enables the sevenrules below to be determined, eachcorresponding to a specific case:

c Lettuce badly washedIF Turbidity IS High AND Water_f IS NOT HighTHEN Water_f_var IS Positive big.c Lettuce badly washed but high conveyor beltspeedIF Turbidity IS High AND Water_f IS High THENSpeed_var IS Negative.c Too many micro-organismsIF Micro_ratio IS High THEN Cl_f_var IS Positivebig.c Everything is fine and production can beincreasedIF Turbidity IS Low and Micro_ratio IS NOT HighAND Speed IS NOT High and CL_ratio ISAcceptable AND Water_f IS NOT High THEN

Speed_var IS Positive AND Cl_f_var IS PositiveAND Water_f_var IS Positive.c Lettuce tastes of chlorine, but there are nomicro-organismsIF Cl_ratio IS High AND Micro_ratio IS NOT HighTHEN Cl_f_var IS Negative.

c Everything is fine and production is maximum:save water.IF Speed IS High AND Cl_ratio IS AcceptableAND Turbidity IS Low THEN Water_f_var ISNegative.

c No micro-organisms: save chlorineIf Micro_ratio IS Low THEN Cl_f_var IS Negative.

Defuzzification

Insofar as the aim is progressive behaviour ofthe rule base in all cases and an interpolationbetween the rules, the centre of gravity is chosenas the defuzzification operator.

Cahier Technique Schneider no 191 / pp.16

4 Implementation

4.1 When can fuzzy rule bases be used?

Fuzzy rule bases can be chosen to solveapplication problems when the followingconditions are satisfied:

c it is possible to act on the process(controllability),c an expertise or knowhow exists,

c the variables (inputs and outputs) can bemeasured or observed, (measurability),c qualitative expertise (if it is mathematical,conventional automatic control should bepreferred),c gradual expertise (if it is boolean, expertsystems are more suitable).

4.2 Designing an application

Choice of operators

In most applications, “Mamdani” rule bases areused. This choice is suitable except if theexpertise contains indeterminations.

In most cases, the choice is also made to use“trapezoidal” membership functions as theyare easier to implement and simplify thegathering of expertise. Output membershipfunctions are often singletons, except when rulesare concatenated. A triangular outputmembership function in fact implies anuncertainty on the output to be applied, and doesnot have much effect on interpolation betweenthe rules.

Finally, defuzzification takes place using the“centre of gravity” for control (all active rules aretaken into account): the use of the “average ofmaxima” for decision-making problems enablesa decision to be made when rules are“conflicting” and avoids intermediate decisions.

Professional expertise level:

- Expert- Operator- Designer

Programming level:

- Automatic control engineer- Ladder / Grafcet

Gathering knowledge

Validation of principle

Validation of operation

Interpretation in form of rulesand membership functions

« Open loop » testsImplementation

Methodology

Designing a fuzzy rule base is an interactiveprocess. The largest portion of the task consistsof collecting knowledge. One of the advantagesof fuzzy logic is the possibility of having the rulebase validated by the people who provided theexpertise before testing it on a real system.Figure 20 illustrates the procedure used.

Collecting knowledge

This is a three-step process:c listing the variables to be taken into account:they will become the linguistic variables of therule base;c listing the qualitative quantities to be taken intoaccount and specifying when they are true andfalse: these quantities will become the linguisticterms of the rule base;c formulate how these concepts are manipulated:which cases should be considered, how they arecharacterised, how should you act in each case.

Fig. 20 : design methodology.

Cahier Technique Schneider no 191 / pp.17

Transcription in fuzzy rule form is then straightforward. However as few membership functionsand rules as possible should be written in orderto limit the number of parameters which will haveto be tuned later on and to ensure legibility of thebase. We observe that it is easier to add rules inorder to take new situations into account than toremove them.

Validating the knowledge base

This takes place in a number of steps:

c presentation of the rule base to the expertswho helped collect knowledge, and discussion.The aim of the discussion is to identify pointsthat have not been covered and to ensure thatthe rules are understood by everyone;

c “open loop” simulation: the experts comparethe behaviour of the rule base to the behaviourthat they expect on cases chosen beforehand;

c if the process can be simulated, closed loopsimulations can also be performed.

Tuning

The rule bases written in this manner often givesatisfaction right away. However the rule basemay need to be modified or tuned. The followingprinciples will act as a guideline in searching forthe probable cause of the deviation observed:

c if the behaviour of the closed loop controller isthe opposite to what you expected, some ruleshave most likely been incorrectly written;

c if you wish to optimise performance, it isnormally preferable to properly tune themembership functions;c if the system is not robust and works in somecases but not all the time, it is likely that not allcases have been taken into account and thatrules must be added.

4.3 Using an application

The function of the operatorsThe degree of involvement of operatorscontrolling an application using fuzzy logic variesconsiderably.

The following cases can be observed:c completely autonomous system: the end-useris not familiar with fuzzy logic and is not aware ofits use,c fuzzy logic is a “black box” which can bedisconnected or changed to “manual mode” bythe operator,c the operator is able to modify (tune) themembership functions according to the situation,and he does this for a production change (forexample);c the operator is able to read the rules (e.g. theirdegree of activation): he understands and is ableto interpret the actions of the rule base. Forexample he can control the rule base inexceptional situations;c the operator is the main designer of the base:he has been given the means to record his own

knowhow and to validate the resultingbehaviour.

Production changes

During an application, the rule base must be ableto be adapted to changes in the productionsystem and the products manufactured. Thesechanges can be of various kinds:

c objectives have changed (cookingtemperature, etc.), for example due to a changein product manufactured. The setpoints or ruleinput membership functions must then bemodified;c system dimensions have changed; themembership functions must then be modified;c the type of system has changed (e.g. portageof the rule base from one machine to another);the rules and membership functions must thenbe modified.

The most common changes are of the first type.They can then be managed by qualifiedoperators.

4.4 Choosing the implementation technology

Most of today’s applications run on standardhardware platforms (micro-controller, micro-processor, programmable controller, micro-computer, etc.).

Many software programs designed to helpdevelop fuzzy rule bases and aimed at micro-controllers, programmable controllers and micro-computers (to name but a few), enable rapid

implementation of fuzzy rule bases withoutprogramming.

Fuzzy inferences can be directly programmed(assembler, C language, etc.). The disadvantageof this solution is that it is slower in the prototypephase and requires programming skills andcommand of fuzzy logic algorithms.

Cahier Technique Schneider no 191 / pp.18

now commonly integrated inside micro-controllers, even low cost ones, where they areused to accelerate fuzzy inferences.

Figure 21 shows as an example theapplicational needs that can be encountered innumber of rules (complexity of the application)and cycle time (rapidity) as well as the possibletechnologies (1993 figures). The rulesconsidered have one predicate and oneconclusion.

The necessary technical-economic choice isthus a compromise between the flexibilityprovided by software solutions, scale economyand the performance of dedicated hardwaresolutions.

10-7

10-6

10-5

10-4

10-3

10-2

10-1

1

1 10 100 1 000 10 000

10

102

103

RISC

32 bits

16 bits

8 bits

4 bits

Number of rules

Micro-programming technology ASIC technology Analog technology

Cycle time (s)

Image processing

Control system, car

Cameras

ControlWashing machines Financial analyses

Medical diagnosis

Fig. 21 : performance of components and application areas.

4.5 Standards

Components

Absence of standards is one of the mainproblems holding up the use of fuzzy logic chips.This is because these components are notcompatible with one another as each one is theresult of choices made by manufacturers.

SoftwareRegarding software, lack of portability has alsoslowed down widespread use of fuzzy logic inindustry.

Today, a work group in which Schneider playsan active part, has incorporated the “fuzzy logic”language standard into the language standard ofprogrammable controllers (first official draft ofstandard IEC 61131-7 available in 1997). Otherinitatives in the field of fuzzy logicstandardisation should spring from this.

For applications with exacting response timedemands or in order to obtain very low massproduction cost prices, use of fuzzy logic ICs isadvantageous. Use of such electronic chips isincreasing as:

c the operations required to produce fuzzyinferences are elementary and feasible inintegers,c some operations can be carried out in parallel,c the calculation takes place in successivesteps, thereby enabling simple “pipeline”architectures to be made.

In particular, numerous ASIC componentsdesigned for specific markets exist (car,electrical household appliances, etc.). They are

Cahier Technique Schneider no 191 / pp.19

5.1 Application types

Functions performed

The following table shows the functions mostoften performed in industry by means of fuzzysystems (X means possible use, XX that thetechnique is suitable for this type of problem).Rule bases excel in cases when interpolationand action are required, whereas classificationmethods are suitable for evaluation anddiagnosis tasks normally performed upstream.Applications sometimes combine several ofthese functions, while retaining the graduality ofthe information.

Fuzzylogic

Theory ofpossibilities

ExpertiseFuzzy rules

Neuronnetwork

Data

Conventionalautomatic control

Model

Imprecisionand graduality

Uncertainty

Probabilities

Rule Classificationbases algorithms

Regulation, XXcontrol

Automatic XXparametersetting

Decision-making help XX X

Diagnosis X XX

Quality XXcontrol

Fuzzy logic and other techniques

Fuzzy logic is above all an extension and ageneralisation of boolean logic. It enablesgraduality to be introduced into notions whichwere previously either true or false.

Probabilities, without challenging the binarynature of events (either true or false) enable theuncertainty of these events to be managed.

On the boundary between these twoapproaches, the theory of possibilities (inventedby Lotfi Zadeh) enables both graduality anduncertainty to be taken into account (see fig. 22 ).

Fuzzy base rules are often compared for control/regulation applications to neuron networks andconventional automatic control. These threeapproaches require respectively, in order to beapplied, an expertise, data for learning purposes,and a dynamic model of the process.

These approaches can only be compared whenall three are available at the same time, which isoften the case in theoretical studies but rare inpractice. If all three are available, practicalconsiderations often take priority. In particular,

fuzzy logic may be preferred for the ease withwhich it is understood by operators.

Hybridation of techniques

Fuzzy logic is often used in combination withother techniques. These combinations areadvantageous when each approach make use ofits own strong points.

c Learning fuzzy rules or neurofuzzy

Fuzzy rule bases can be modified using learningmethods.

The first methods known as “self-organizingcontroller” were developed as early as 1974 andaimed at heuristically modifying the content offuzzy rules belonging to a “rules table”. Theactual expertise is modified by the learning, butthe membership functions remain the same.

A second approach, consists of modifyingparameters representative of the membershipfunctions. Unlike the first method, the rules andstructure of the expertise are not altered. Themembership function parameters are modifiedusing optimisation methods, for examplegradient methods, or global optimisationmethods such as genetic algorithms or simulatedannealing. This approach is often referred to as

Fig. 22 : comparing fuzzy logic with other controltechniques.

5 Fuzzy applications

Cahier Technique Schneider no 191 / pp.20

“neurofuzzy”, in particular when the gradient isused. Use of the gradient to optimise theseparameters is likened to “retropropagation” usedin neuron networks known as “multi-layerperceptrons” in order to optimise weightsbetween neuron network layers.

A third approach (that can be qualified asstructural optimisation of the rule base) aims atsimultaneously determining rules and membershipfunctions by learning. The learning process thennormally takes place without referring to anexpertise. The resulting rules can thentheoretically be used to help build an expertise.

c Using fuzzy logic in association with automaticcontrol

A fuzzy rule base is sometimes part of acontroller. Use of fuzzy logic to simulate aproportional term allows all kinds of non-linearities. Specific cases of downgradedoperation such as overloads, maintenance orpartial failures are easily integrated.

A fuzzy rule base is used to greater advantageoutside the control loop, to supervise acontroller. It then replaces an operator in order totune controller parameters according to controlsystem operating conditions.

5.2 Examples of industrial achievements

Today fuzzy logic is accepted as being one ofthe methods commonly used to control industrialprocesses.Although PID controllers still suffice for mostapplications, fuzzy logic is increasinglyrecognised and used for its differentiatingadvantages, particularly for controlling quality ofproduction and costs. Due to the competitiveadvantages offered by fuzzy logic in someapplications, the integrator or end-user do notnormally wish to mention the subject. Theseapplications benefit from extensive acquisition ofknowhow or use of a crafty technical short-cut.Confidentiality is then essential. This explainswhy it was not possible to describe in a detailedway all the examples given below.

Sewage plant

Most modern sewage plants use biologicalprocesses (development of bacteria in ventilatedtanks) to purify sewage water before dischargingit into the natural environment. The organicmatter contained in the waste water is used bythe bacteria to create its cellular components.The bacteria discharges carbon dioxide (CO2)and nitrogen (N2). Air is blown into the tanks.The energy used for ventilation purposesfrequently accounts for more than half the globalenergy consumed by the plant. In order toensure correct development of bacteria andsewage, the NH4 and O2 concentrations in theventilation tanks must be carefully controlled, allthe more so since in order to reduce energy

costs, air flow is kept to a minimum compatiblewith the biological process.

Added to these requirements is the considerationof some specific operating cases, such as forexample a very high upstream flow, which is anextreme circumstance under which parametersare seriously modified and sewage capacityaffected.

Although partial mathematical models of plantsare available, there are no complete models, andthe overall control strategy must often beheuristically developed.

Use of fuzzy logic is relatively commonnowadays in sewage plants. The plant shown infigure 23 , based in Germany, has been inoperation since 1994. Fuzzy logic was producedon a Schneider Modicon programmablecontroller by means of its standard fuzzy controlfunctional modules.The designer highlights the advantage of usingfuzzy logic in control: exceptions, i.e. situationswhen sewage capacity is partially downgraded,are treated simply and without discontinuity.

The method chosen to introduce theseexceptional states into a control loop isdescribed below:

A proportional term which must adapt to theexceptional circumstances is identified in thecontrol loop: this term is first transcribed in fuzzylogic, then this fuzzy logic element is inserted inthe control loop.

Cahier Technique Schneider no 191 / pp.21

Precipitant tanks for phosphates

Blower

Outlet

Recirculation

Control station and operating building

Grid building

1 - Sewage water supply 2 - Inlet mechanism lifting 3 - Ventilated sediment removal basin 4 - Venturi drain 5 - Excess sludge 6 - Recycled sludge 7 - Sludge scraper 8 - Final purification I 9 - Final purification II10 - Nitrification channels11 - Denitrification basin

1234

8 7

567

10

9

11

Once the membership functions have beensuitably tuned, two rules are sufficient todescribe the proportional controller:

IF low input THEN low output.IF high input THEN high output.

A third rule is added at the operators’ request asthey find it improves their understanding of theoperation:

IF average input THEN average output(see fig. 24 ).

Once the proportional term has been simulated,the exceptions are introduced in the form ofother rules depending on other input variablecombinations.A simple example of this possibility is illustratedin figure 25 .

Fig. 23 : block diagram of the sewage plant.

µ

Low input

Average input

High input

µ

Low output

Average output

High output

Fig. 24 : simulating a controller proportional term.

Exception y

Controlled output z

Input variable x

Area corresponding to the proportional controller

Exception influencing area

Fig. 25 : introducing an exception into a proportional term.

Cahier Technique Schneider no 191 / pp.22

Below is another treatment using fuzzy logic: partof the sludge deposited in the downstream basinis recycled and re-injected upstream. The table infigure 27 lists the rules for sludge recycling. Thefirst rule expresses an exception due to anexcessively high upstream flow. In theseconditions, a high degree of recycling wouldresult in increased overload of the installation.

The exceptional condition is detected by thestrong turbidity, as sludge deposits minimumsediment due to the excessively high flow.

For information, other installation functions usefuzzy logic:c air injection,c management of excess sludge.

Fig. 27 : sludge recycling function rules table.

IF turbity AND drained off quantity AND sludge level THEN quantityof discharged water of recycled sludge

High Low Low

Normal Low Low

High Low Normal

Low Normal High

Normal Normal Normal

High Normal High

Low High Normal

Normal High High

Food produce

Automation of industrial oven production linesused for cooking biscuits interests biscuitmanufacturers both in France and Germany. Forthis control type, a conventional solution is notsatisfactory due to the non-linearities, multiplicityand heterogeneity of sensitive parameters.Modelling of the cooking process is bothcomplex and uncomplete. However, experiencedoperators are perfectly able to control cookingusing their empirical knowledge.

The table in figure 26 lists the rules forrecirculation. The proportional term is createdfrom the input variable “NOx content”. The two

Fig. 26 : recirculation function rules table.

IF nitro O 2 content AND denitri O 2 content AND NO x content THEN recirculation quantity

Not low Greater than 0 Low

Low Low

Normal Normal

High High

input variables “nitri O2 content” and “denitri O2content” define an exceptional situation in thefirst rule.

The chosen example is an aperitive biscuitproduction line.

A French group contacted Schneider who then,in co-operation with ENSIA (French HigherInstitute of Agricultural and Food Industries)worked out an automated solution.

The main characteristics that can be measuredin a biscuit are its colour, humidity anddimensions. These characteristics can beaffected by variations in quality of pastry

Cahier Technique Schneider no 191 / pp.23

ingredients, environmental conditions and thetime the biscuit remains in the oven... Theseinfluences must be compensated by oven settingand conveyor belt speed. Control of productionquality of this kind of food process can be brokendown into the following functional steps:

c conditioning and merging of data,c evaluation of subjective quantities (linked toquality),c diagnosis of quality deviations,c decision-making,c subjective evaluation

Fuzzy logic enables qualitative variables to betaken into consideration and existing“professional” expertise to be used. Fuzzy rulebases have been used associated with othertechniques (see. fig. 28 ).

Functions Associated techniques

Sensor melting

Subjective evaluation Fuzzy classification

Diagnosis Fuzzy ladder

Decision making Fuzzy rule bases

Fig. 28 : functions and associated techniques.

Bottom of biscuitwell cooked

Top of biscuitwell cooked

Bottom of biscuita little over cooked

Top of biscuita little over cooked

Section 1temperature too low

High biscuit humidity

Bottom of biscuitfar too cooked

Top of biscuitfar too cooked

Bottom of biscuitundercooked

Top of biscuitundercooked

Fig. 29 : fuzzy ladder for quality deviation diagnosis.

c Subjective evaluation

Most quality defining notions depend on anumber of variables. One of the factors forevaluating quality is colour which is three-dimensional: hence the interest of definingmembership functions upon several variables.Classification algorithms, based on the inputvariables perform a gradual evaluation of suchqualitative variables (top of biscuit well cooked,over cooked,...).

c Diagnosis

The fuzzy ladder was used to diagnose qualitydeviations observed on biscuits (see fig. 29 ).The oven has 3 sections.

The overall operating evaluation is satisfactory.

Other examples

c Automation systems

G.P.C.s (Global Predictive Controllers) areextremely effective, but require the setting of 4parameters: N1, N2, Nu, l (2 control horizons,prediction horizon, weighting factor). Suchsetting is both lengthy and difficult and normallyrequires an expert. Schneider’s NUM subsidiaryis currently developing numerical controls andwould like to use G.P.C.s in future productions.

Cahier Technique Schneider no 191 / pp.24

c Classed as an artificial intelligence technique,fuzzy logic is used to model and replace processcontrol expertise and designer/operator expertise.

c A tool for enhancing quality and increasingproductivity, fuzzy logic offers competitiveadvantages to industrial firms seeking technical-economic optimisation.

c This Cahier Technique specifies the areas inwhich this interesting approach can be used toadvantage.

c Thanks to suitable programmable controllersand user-friendly tools, fuzzy logic is nowaccessible to all automatic control engineerswishing to increase the scope of their skills andthe performance of their achievements. Thesetools are available in the developmentenvironment of some programmable controllers

(see fig. 30 ), and offer simple evaluationpossibilities.

c Evaluation limited to competition with the otherconventional control tools is not productive assuch tools (e.g. PID controllers) continue to beuseful in most application areas.

c Fuzzy logic has its own special areas in whichit works wonders: these are areas involvingexpertise, nuanced decision-making,consideration of non-linear phenomena andsubjective parameters, not to mentioncontradictory decision-making factors. Contactwith Schneider specialists will enable users anddesigners to find a suitable answer to theirperfectly understandable question:

“What decisive advantages can fuzzy logic offerme in my application?”.

6 Conclusion

Schneider has thus developed for NUM amethod for automatically setting the parametersfor such controllers by means of fuzzy rulebases. Some twenty rules suffice for rapid,reliable parameter setting. Moreover, thepresence of a monitoring and control specialist,hard to find in numerical control installations, isno longer necessary.

c Car industryRenault and Peugeot (PSA) have announced anautomatic gear box which uses fuzzy logic toadapt to the type of driving of the person behindthe wheel.

c Cement plants

The first industrial application of fuzzy logic, thencopied by other manufacturers, was produced by

the Danish company, F.L. Smidth Automation, tocontrol cement kilns. This process takes manyvariables into account, and in particular theclimatic influences on the kiln which is severaldozen metres high.

c General public electrical and electronichousehold appliancesA large number of applications are now availableto the general public, especially in Japan. Forexample, compact size digital camcorders arehighly sensitive to movement. Fuzzy logiccontrols the stadyshop image stabilization ofthese devices.

Cahier Technique Schneider no 191 / pp.25

Fig. 30 : for fuzzy logic, the Schneider programmable controllers are equipped with user-friendly development tools on PC.

a - configuration of the fuzzy logic module

b - definition of membership functions d - simulation - validation

c - writing of rules

Cahier Technique Schneider no 191 / pp.26

Appendix

Fig. 31 : operators between fuzzy sets.

Singleton output membership functions

“Singleton” membership functions are oftenused as output membership functions for fuzzyrules.This is because they allow the sameinterpolation effect between rules as fortriangular membership functions (for example)for far simpler calculations. There is no need tocalculate the maximum of output membershipfunctions (aggregation), and the centre of gravityis also simplified. Figure 32 illustrates thiscalculation.

Fig. 32 : defuzzification of singleton membershipfunctions.

µA∩B = MIN (µA, µB)

µA∩B

µA∪B

µA

µA∪B = MAX (µA, µB)

µA = 1 - µA

Intersection

ZADEH operator

Logic operation

Union

Negation

AND

OR

NOT

A∩BA B

A B

A_

_µA

_

A

A∪B

µB

µA µB

µA

A

µ

Action

Low

Average

High

Output

1

Operators between fuzzy sets

The table in figure 31 shows the ZADEH operators.

Cahier Technique Schneider no 191 / pp.27

Rules (implications)

Facts observed ConclusionsModus Ponens

A ⇒ B

A

Implication Modus Ponens

B

0 1

10 0

11 1

B'

A'

A ⇒ B

0 1

00 0

01 1

Rules (fuzzy implications)

Fuzzification DefuzzificationInputs OutputsGeneralised Modus Ponens

Fuzzy inferences: fuzzy implication andGeneralised Modus Ponens

As shown in figure 33 , the conventional forwardinference mechanism “from the front” or “modusponens” consists of using rules, also known asimplications, and a deduction mechanism (themodus ponens) to deduce conclusions fromobserved facts.

The implication “A ⇒ B” is considered to be trueas long as it is not invalidated (A true andB false): see figure 34 . With knowledge whetherthe implication is true or false, the modus ponensenables a conclusion B’ to be deduced from anobservation A’.

The same theoretical principle can begeneralised in fuzzy logic. The general diagramis given in figure 35 .

Fig. 33 : principle of inference from the front.

Fig. 35 : principle of fuzzy inferences.

The mechanism generalising the implication isknown as the “fuzzy implication”. There areseveral fuzzy implication operators, includingthose mentioned below:

MAMDANI: µA⇒B = MIN (µA, µB)LARSEN: µA⇒B = µA . µB

LUKASIEWICZ: µA⇒B = MIN (1,1 - µA + µB)The fuzzy implication works like a conventionalimplication, where A and B are fuzzy sets.

The mechanism generalising the modus ponensis known as the “generalised modus ponens”. Itobeys the following formula, and is used todetermine a B’ conclusion fuzzy set. In mostcases the operator T used is the Minimum(known as the Zadeh operator).

µB’(y) = MAXx (T(µA’(x), µA⇒B (x,y)) )where T: modus ponens operator (t - standard),

The Lukeziewicz operator behaves like theconventional implication when we limit ourselvesto boolean values. This is not the case for theLarsen and Mamdani operators used in theMamdani rule bases. These operators are themost extensively used as:

c they offer a high degree of robustness inapplications.

c calculations are considerably simplified andallow simple graphic interpretation (see section2.4.). Calculations on input x and output y aredecoupled, as the formula below shows:

µB’(y) = MAXx (Min (µA’ (x), µA(x), µB(y)) )

= Min (µB(y), MAXx (Min (µA’(x), µA(x)) )

Fig. 34 : principle of implication and Modus Ponens.

Cahier Technique Schneider no 191 / pp.28

Bibliography

Standards

IEC 61131-7: Programmable Controllers part 7Fuzzy Control Programming.

Miscellaneous worksc Fuzzy models for pattern recognition.IEEE Press, 1992.James C. BEZDEK & Sanker K. PAL.

c Fuzzy sets and systems: Theory andapplications.Academic Press 1980, Mathematics in Sciencesand Engineering vol. 144.D. DUBOIS, H. PRADE.

c Evaluation subjective ; méthodes, applicationset enjeux.Les cahiers des clubs CRIN, club CRIN logiquefloue.

c A.I. and expert system myths, legends andfacts.IEEE Expert 02/90, pp 8-20, 29 réf.M.S. FOX.

c La logique floue et ses applications.Addison-Wesley, 1995.Bernadette BOUCHON-MEUNIER.

Internet

c http://www-isis.ecs.soton.ac.uk/research/nfinfo/fuzzy.html

c http://www.ortech-engr.com/fuzzy/reservoir.html

c http://www-cgi.cs.cmu.edu/afs/cs.cmu.edu/project/ai-repository/ai/areas/fuzzy/0.html

Schneider Direction Scientifique et Technique,Service Communication TechniqueF-38050 Grenoble cedex 9Télécopie : (33) 04 76 57 98 60

Edition: SchneiderReal: AXESS - Saint-Péray (07).Printing: CLERC-Fontaine-France-1000-100FF- ©

199

8 S

chne

ider

12-98007431