Home

software manual - FDG Austria, DI Norbert Exler

image

Contents

1. FID User s guide c 1993 97 FDG Systems N Exler Page 20 in path FID EX2 TWOP_H DSP TWOP_WH DSP in path FID EX3 FIRST_H DSP FIRST_S DSP FIRST_R DSP in path FID EX4 FPID_H DSP TWOP_H EXE TWO_H SYM TWOP_PT1 DSP TWOP_PT1 EXE TWO_PT1 SYM TWOP_WH EXE TWO_WH SYM FIRST_H EXE FIRST_H SYM FIRST_S EXE FIRST_S SYM FIRST_R EXE FIRST SYM wn FPID_H EXE FPID H SYM in path FID EZ LAB EZ_LAB ACH EZ_LAB SYS in path FID FUZLIB FUZLIB A FUZTOOLS LIB FUZLIB TXT FID User s guide c 1993 97 FDG Systems N Exler Page 21 4 Description of the dialogs Menus 4 1 The Toolbar Difco tal AAlir E Under the main menu is a tool bar with several buttons The different buttons mak e the access of commonly used funtions and menus very fast Here is a short description HAE L gt Save fuzzy resource to disk File menu Save Open an existing fuzzy resource file File menu Open Open a new fuzzy resource File menu New mlale Ly Show fuzzy control map Fuzzy menu Fuzzy control map ome Defuzzification method Fuzzy menu Defuz Definition Rule definition Fuzzy menu Rule Definition Linguistic variable definition Fuzzy menu Ling Var Definition FID User s guide c 1993 97 FDG Systems N Exler Page 22 E A Ly Sta
2. small medium tall fuzzy sets Fig 38 Fuzzy sets for three groups of people This overlapping region of the fuzzy sets can be described by using membership functions MFs wit h different shaped edges e g In figure 39 trapeziu m shaped MFs straight lines with a finit slope are used to FID User s guide c 1993 97 FDG Systems N Exler Page 116 describe fuzzy sets The main other shapes used ar e triangular Gau and cos shaped MFs With this concept a person with a height of 1 79 m belongs with a degree of 0 75 to the fuzzy set medium and with a degree of 0 25 to the fuzzy set fall In a linguistic interpretation this means this person is a little bit more medium height than tall It is now clear that the fuzzy concept describes the decision making process o f humans much better than the classical mathematica concepts fuzzy sets Fig 39 Membership functions for fuzzy sets Now it is necessary to give some definitions befor e going further on The fuzzy sets are described b y functions called membership functions as alread y defined in figure 37 and 39 which describe the degree of membership of every input value to a fuzzy set between the values 0 and 1 or O and 100 In this case th e fuzzy sets are normalized to the range of 0 to 1 Mathematically the fuzzy sets can be described in different kinds of definitions The most commo n FID User s guide c 1993 97 FDG Systems N Exler Page 117 defi
3. This dialog window shows you all defined rules for th e actual selected fuzzy resource file Every Rule starts with an IF statement and alway s consists of at least one condition antecedent and on e conclusion consequent which are written in brackets If there is more than one condition in a rule these conditions are linked together with an operator between them The operator between the conditions is defined in the Rule Definition Dialog The conclusion of the rule sta rts with a THEN and may also consists of more than one part The inference operator can be selected by the combo box in the Rule Resource Editor and defines the method of inference This method of inference links all output s which are fired by several rules to the same fuzzy set at the output together with this operator e g MAX MI N inference the first operator links the same output fuzz y sets together FID User s guide c 1993 97 FDG Systems N Exler Page 30 To create a new rule you have to make sure no rule is selected select the rule type by checking one of the radio buttons under the list box and press the lt Add Rule gt button The according Rule Definition dialog will appear and you can enter the new rule If you want to change a rule select that rule and pres s the lt Edit Rule gt button According to the rule type the appropriate Rule Definition dialog will appear To change the rule type of a rule select the rule and check the r
4. This is a guide to designing fuzzy elements with one input and one output SISO fuzzy systems for linear and non linear characteristic curves The theoretical background for this design is mentioned in the general description of fuzzy logic in this manual Let us start to design a static linear characteristic with a lower and upper limit value The following declaration for the data format on the ADSP for input values and output values is valid for the whole example All values for the input and output are normalized to the range of 1 to 1 The format for input and output values is 5 11 and 4 12 for grades of membership FID User s guide c 1993 97 FDG Systems N Exler Page 85 Umin k lt 0 6 HEV 0 6 Qc 0 Umax 0 6 lt amp amp Fig 17 Membership functions NEG ZE POS for error e Source file STAT_FS FLC FID User s guide c 1993 97 FDG Systems N Exler Page 86 The membership functions above can be described as followed e_NEG p F800 m OFFF p F800 s 4000 p FB33 m OFFF p 0000 s 001A e_ZE p FB33 _ m 0000 p 0000 s 001A p 0000 m OFFF p 04CD s O001A e_POS p 0000 m 0000 p 04CD 0014A p 07FF m 0FFF p 07FF S 4000 and the dash dotted membership function for zero e_ZE p FB33 m 0000 p FE66 0028 p 019A m OFFF p 04CD s 0028 The numerous numbers of degrees of freedom in designing membership functions sho
5. 4 4 LingVar Editor Linguistic Variable Editor Linguistic Variable error Abbreviation max 4 chars Input L Automatic Fuzzy set generation iC Output vi Appears when you press the lt Add LV gt button of the Fuzzy Resource Editor You can enter the name the abbreviation and the state input or output of the ne w linguistic variable Ensure that you enter the right name and abbreviation as you are not able to change it later If you want to change the abbr eviation and or the full name of the linguistic variable you must delete the linguisti c variable and define it again The other properties can be entered and changed later inside the Fuzzy Resource Editor To ease the design of your fuzzy sets it is possible t o check the Automatic Fuzzy set generation box If the checkbox is marked 5 fuzzy sets are automaticall y FID User s guide c 1993 97 FDG Systems N Exler Page 27 generated when you press the OK button 4 5 Fuzzy Set Name Editor Fuzzy Set Name Editor Fuzzy Set Name Negative Short FS Name max 3 chars NE The Fuzzy Set Name Editor appears whenever you press the lt Add FS gt button of the Fuzzy Resource Editor You can enter the fuzzy se t name and the abbreviation of the new fuzzy set Ensure that you enter the right name and abbreviation as you are not able to change it later If you want to change the abbreviation and or the full name of a fuzzy set you must delete the
6. User s guide c 1993 97 FDG Systems N Exler Page 134 8 Bibliography Altrock v C Uber den Daumen gepeilt c t 1991 Heft 3 S 188 200 Gupta M M and Yamakawa T Fuzzy Computing Theory Hardware and Appplications 1988 Amsterdam New York Oxford Tokyo Gupta M M and Qi J Theory of T norms and fuzzy inference methods Fuzzy Sets and Systems 40 1991 p 431 450 Kickert W J M Mamdani E J Analysis of a fuzzy logic controller Fuzzy Set and Systems 1 1978 p 29 44 Koch M Kuhn T Wernstedt J Ein neues Entwurfskonzept f r Fuzzy Regelungen 1993 at Automatisierungstechnik 41 1993 5 Oldenburg Verlag Kosko B Neural Networks and Fuzzy Systems 1992 Prentice Hall International Inc Mamdani E H and Assilian S A case study on the application of fuzzy set theory to automatic control Proc IFAC Stochastic Control Symp Budapest 1974 McNeill D Freiberger P Fuzzy Logic The revolutionary computer technology that is changing our world 1993 A Touchstone book Mizumoto M Fukami S and Tanaka K Some methods of fuzzy reasoning in M M Gupta et al Eds Advances in Fuzzy Set Theory and Applications North Holland Amsterdam 1979 p 117 136 Pedrycz W Fuzzy Control and Fuzzy Systems 1989 John Wiley amp Sons Inc Raju G V S Zhou J Kisner R A Hierarchical fuzzy control Int J Control Vol 54 1991 5 p 1201 1216 Sugeno M Ed Industrial Applicatio
7. Rulel AR DM f_et H 02 AYO DM f_setH 02 MAX_OP AYO DM f_de H 02 MAX_OP DM _u H 02 AR Rule2 AR DM f_et H 01 AYO DM f_se H 01 MAX_OP AYO DM f_de H 01 MAX_OP DM f_u H 01 AR FID User s guide c 1993 97 FDG Systems N Exler Page 81 Rule3 AR DM f_e H 00 AYO DM f_set H 00 MAX_OP AYO DM f_de H 00 MAX_OP DM _u H 00 AR Defuzzification I0 fue LO I4 center_u L4 Scenter_u call DEFUZ_WC DM u_HSW AR scaling_output u_HSW u_LSW scale_u End of fuzzy control sourcecode Use the output value stored in the uLHSW variable t o write the crisp value to an output device or use it as a n input to a further classical or non classical module Include a plant simulation here if you want to simulat e the fuzzy module in advance before you try it at the real plant ENDMOD It is also possible to copy all parts of the FPID DSP file into your application at the appropriate position The fuzzy source code above uses subroutines an d macros in the essential parts of the fuzzy logic algorithm The variable choice of the I and L registers for different purposes is fixed in the subroutine calls This is in general no disadvantage In comparision to a macr o implemen tation it is not possible to change the assignment of the I and L registers to the input values membership values and so on FID User s guide c 1993 97 FDG
8. Will be interpreted as 4 s 1 6 s 3 8 s42 0O s 1 FID User s guide c 1993 97 FDG Systems N Exler Page 43 4 19 Linear Plant Definition Multiple steps Linear Plant definition hit 2 h 5 New Plant Edit Zero Pole representation O Num Denum representation OK Multiple steps Cancel If you select the Multiple steps radio button and the n press the lt Edit gt button you can define a step or multiple steps A step or multiple steps used for simulating disturbance is generally a kind of plant This plant ha s no input but one output 4 20 Multi Step definition Multi Step definition Value Z Every step consists of two values one in each edit bo x FID User s guide c 1993 97 FDG Systems N Exler Page 44 and interpreted as one step The step value and the step time have to be define d absolutely You define at which time it will become which value So the steps will not be added For example step value 2 step time 5 seconds Will be interpreted as the step is zero before 5 seconds and afterwards 2 4 21 Non linear Plant Definition FID Windows Application The immense number of non linear plants makes it impossible to include them here If you require this feature however please contact FDG Systems Unfortunately there are very many different non linea r plants in the real world and everyone needs a differen
9. Zeros 2 1 Poles 5 4 4 Gain 1 5 Deadtime 3 sec will be interpreted as s 2 s 1 G s 1 5 3s s 5 st 4 s 4 4 17 Linear Plant Definition Numerator Denominator Linear Plant definition P s 4 182 2542 New Plant Edit Zero Pole representation Num Denum representation OK 3 Multiple steps Cancel This defines a plant given by the Numerator an d Denominator If you select the Num Denom representation radio button and then press the lt Edit gt button you can define a plant by the numerator denominator and deadtime The numerator and denominator are polynomials in the Laplace space FID User s guide c 1993 97 FDG Systems N Exler Page 42 4 18 Numerator Denominator amp Deadtime input Numerator Denominator amp Deadtime input Numerator BO O Denominator 1 22 f You can enter the plant by entering the factors of th e polynomial representing the plant Separate the factor s with a colon The order of the polynomial is defined b y the numbers of factors entered in the edit boxes Soif one factor is zero you have to enter a zero value at th e right place otherwise the plant is not correctly defined Be sure that the order of the numerator is always less or equal to the order of the denominator Additionally you can define a dead time of the plant For example Numerator 4 1 Denominator 6 8 0 1
10. 5 Resolutions and Formats 75 Input values and scaling factors 75 Membership functions for the input values 76 Membership values grades 76 Membership functions singletons for the fuzzy output wrasse ites E EAEAN hens ale he Peles ac 76 FID User s guide c 1993 97 FDG Systems N Exler Crisp output values 000000 76 5 3 6 Implementation of the generated ADSP 21xx source code in your specific application 77 6 Examples running on EZ LAB board 85 6 1 Design of linear and non linear static fuzzy elements 85 6 2 Design of a two level fuzzy controller 00 94 6 3 Design of a simple fuzzy PlI controller compared to a classical PI controller 0 oe eee eee 100 6 4 Design of a simple fuzzy PID controller 108 7 Introduction to Fuzzy Logic 2 eee 113 TV OyervieW rr aed ee aod gf gs ache apo Bee ede a 113 7 2 Fundamentals of Fuzzy Logic 113 7 2 1 Fuzzy sets and membership functions 114 7 2 2 Shape of membership functions 119 7 2 3 Set op fatots 2 0 ee ee eee 121 7 3 Structure of a fuzzy system 004 124 7 3 4 Puzzification 2 0 eee 125 7 3 2 Inference and Composition 127 7 3 3 Defuzzification 0 0 00 000008 130 7 4 Fuzzy Control 0 0 eee 132 7 4 1 Control structure 0 eee ee 132
11. 7 4 2 Design steps of a fuzzy controller 132 8 Bibliography sain 24 Gane oe ek Se ee ea tae 134 IN OX eec ela ae ee da ea Sh 136 FID User s guide c 1993 97 FDG Systems N Exler Preface Fuzzy logic was first introduced in 1965 by Lofti A Zadeh but it was ridiculed and not taken seriously b y many of Zadeh s contemporaries The following years therefore saw limited work on fuzzy logic and only a small number of people concentrated on developing the first applications of it Inspite of this though the firs t fuzzy controller was realized by Mamdani and hi s colleagues in the 1970 s and was successfully used fo r the controller of a rotary cement kiln in Denmark At the end of the 1980 s and beginning of the 90 s Japanes e engineers showed the world that they had taken fuzz y logic very seriously indeed and were able to presen t numerous applications of fuzzy logic many of whic h were to be found in household appliances and consumer articles The world woke up and suddenly there was a worldwide fuzzy boom Many human decision processes can be reproduce d relatively accurately with fuzzy logic This means it i s possible to reproduce those processes carried out b y humans for which there is no control model Thi s reproduction is generally not very difficult More problematic however is the implementation of fuzz y logic onto hardware especially for cheap and fast single processor solutions There are some spe
12. AND de is NEgative gt THEN du is ZEro IF e is POsitive AND de is POsitive THEN du is POsitive In order to implement the rulebase numerically it is necessary to number the output membership functions from zero to the highest number i e NE 0 ZE 1 PO 2 For the loop mode it is necessary to store the Karnaugh Veitch type diagram for the fuzzy rules row by row i e rulebase 0 1 1 2 The rulebase needs 4 program memory locations and these values will be incremented during the initial stage by the start address of the field for the fuzzy output values Therefore the whole code and data for fuzzy controllers is fully relocatable in program and data memory Mamdani s Max Min inference method is used for the evaluation of the rulebase and the resulting output membership values which are stored in a field with 3 data memory locations FID User s guide c 1993 97 FDG Systems N Exler Page 103 By choosing a defuzzification method for the evaluation of a crisp output value the change in a manipulated variable can be derived The simplest defuzzification method is the first type with singletons representing the centroids of the membership functions for the fuzzy output An accurate defuzzification uses rectangular membership functions for the evaluation of the crisp output value The simulated control map for this example looks like this eer TITEL 7 LYALL Leeper is a ATE pif ee TF Li LE Yep
13. FLC With three MFs fuzzy sets for each input variable the maximum number of the linguistic rules is 3 x 3 x 3 These rules can be graphically shown in a kind of 3 dimensional Karnaugh Veitch type diagram which has the following structure FID User s guide c 1993 97 FDG Systems N Exler Page 109 Fig 33 Karnaugh Veitch type diagram for all fuzzy rules It is not necessary to use all rules for a working FPID controller A very good result can be reached by using only three rules out of 27 rules These three rules are marked in bold boxes in the 3 dimensional K V type diagram above Using all rules means that it is possible to tune the FPID controller for special behaviour like good disturbance suppression The rulebase used can be written as IF e is pos OR se is pos OR de is pos THEN u neg IF eis ze OR seis ze OR de is ze THEN u Ze IF e is neg OR se is neg OR de is neg THEN u pos Normally the AND operator is used for the antecedents but here the OR operator is a very good alternative and quite effective FID User s guide c 1993 97 FDG Systems N Exler Page 110 The formula for a PID controller in the continuous case is R s Kg IST sT U s E s in discrete from 1 u k K p e k T Ty X e k TWT e k e k 1 This formula can be used to demonstrate the connection between a FPID controller with a control map quite similar to the control map of a
14. PID controller The most commonly used controller is a PID controller This example describes the design of a very simple fuzzy PID controller with only 3 rules The input values of the FPID controller are the error between the reference r and the controlled value y the sum of the error and the change of error The pure fuzzy module FID module then has a PID behaviour The same dynamic behaviour could be attained by using the error the change of error and the 2nd change of error as input values and an integration element used after the defuzzified output All input and output values can be changed by using scaling factors scaling values from 16 to 16 are possible For this purpose a scaling macro or a scaling subroutine can be used The following structure fig 32 represents one possibility for a FPID controller FID module AL wie oe en rule oe Pr Mise base L 4 ude u de Fig 31 Fuzzy controller with PID behaviour amp T FID User s guide c 1993 97 FDG Systems N Exler Page 108 The inputs and the output in fig 32 are defined as followed e Se de e e U Uu For demonstration purposes all three inputs have the same shape and universe of discourse With the different scaling values for each input it is possible to change the universe of discourse u e u se u de neg Umin Umax Fig 32 Input and output fuzzy sets for the FPID controller Source File FPID
15. Systems N Exler Page 88 symmetrical to the maximum U max and the minimum output value U nin respectively If you want to convert the fuzzy element into ADSP source code you must restrict the outermost fuzzy sets to their minimum and maximum values dashed lines in fig 19 The necessary centroids for the output Mfs are u_neg F800 u_ze 0000 u_pos 07FF If you want to change the linear characteristic to a non linear characteristic with dead band than it is only necessary to change the membership functions for the input values e fig 20 FID User s guide c 1993 97 FDG Systems N Exler Page 89 ek Fig 20 A different set of membership functions NEG ZE POS for a different characteristic Source file STAT_TNC FLC The membership functions above can be described as followed e_NEG p F800 m 0FFF p F800 s 4000 p FB33 m OFFF p FCCD s 0050 e_ZE p FB33 m 0000 p FCCD s 0050 p 0333 m OFFF p 04CD s 0050 e_POS p 0333 m 0000 p 04CD s 0050 p 07FF m 0FFF p 07FF S FID User s guide c 1993 97 FDG Systems N Exler Page 90 4000 and the dash dotted membership function for zero e_ZE p FB33 m 0000 p 0000 s 001A p 0000 m OFFF p 04CD s O001A The simulated characteristic in a 3 dimensional graph looks like this Fig 21 The non linear characteristic for the example in fig 20 The
16. TT re CHUA LTT TTT TA ATLL Fig 30 Control map of the FPI controller In this case when we know exactly the behaviour of the plant in form of a mathematical description it is possible to compare the fuzzy PlI controller to a FID User s guide c 1993 97 FDG Systems N Exler Page 104 classical PI controller An optimal classical PI controller can be designed by a criterion with the restriction of 5 overshoot The result for such an optimization for the plant above is K Ty 2 T G 0 74074 In continuous form the formula can bewritten as C s K 1 sTy 1 sTy U s E s dU s E s U s dU s in discrete form by using the seperation before u kT e kT T y e kT e k 1 T T T K Ty 5 du kT This formula can be used to demonstrate the connection between a FPI controller with a control map quite similar to the control map of a classical PI controller The values calculated out of this formula for the scaling values can be used as a good starting point for further optimization of the FPI controller se 1 sde T T 20 sdu T K T 0 03704 This FPI controller has a very similar behaviour to a classical PI controller The reasons for this are the very simple rulebase and two triangular membership functions The simulation results for the classical and the fuzzy PlI controller are shown in fig 31 FID User s guide c 1993 97 FDG Systems N Exler Page 105 Fuzzy
17. You can toggle between the two characteristics fig 17 fig 20 by pressing the IRQ2 button In this example it is only necessary to change the shape of the fuzzy sets FID User s guide c 1993 97 FDG Systems N Exler Page 93 6 2 Design of a two level fuzzy controller This example demonstrates the design of a two level fuzzy controller Designing multiple level fuzzy controllers afterwards is a quite simple task Let us start with a two step controller without a hysteresis DOWN 1 UP 1 0 1 Fig 22 Membership functions DOWN UP for error e Source File TWOP_WH FLC FID User s guide c 1993 97 FDG Systems N Exler Page 94 The membership functions above can be described as followed e_DOWN p F800 m OFFF p F800 s 4000 p 0000 m OFFF p 0000 s 4000 e_UP p 0000 m OFFF p 0000 s 4000 p O7FF m OFFF p 07FF S 4000 From experience it is well known that a two level controller works like as in the following description If the error e is positive then the output is u mas and when the error e is negative then the input is u mine This knowledge enables us to define the rulebase for a fuzzy two level controller IF e is UP THEN u is pos IF e is DOWN THEN u is neg For the serialized mode it is not necessary to define a rulebase like in the examples above With this set of rules and the following rectangular membership functions for the output the exact cr
18. an exac t description of the computer system used as well as the condition s under which the faults appeared After receiving the disks and th e confirmation the refund will be given The owner grants no other warranties on the FID Fuzzy Application Software and any liability of the owner for breach of any othe r warranty or condition express or implied whether by statute o r otherwise including any iability for indirect or consequential loss or damage with the use of the FID Fuzzy Application Software i s hereby expressly excluded The owner further disclaims an y watranties or representations made by persons other than the owner Including but not limited to the owner Software distributers an d dealers FID User s guide c 1993 97 FDG Systems N Exler The owner may at its sole discretion offer the customer up dates of the FID Fuzzy Application Software The owner retains the right to require payment of an a dditional fee for such up dates The customer may of course decline such up dates The customer is solely resp onsible for the selection of the FID Fuzzy Application Software to achieve the customer intended results This Licence is effective until terminated The customer ma y terminate it at any time by sending back the original disks an d documentation at the customers expense and destroying the copies modifications and merged portions in any forms It will als o terminate if the customer fails to comply with any
19. clarify the two possibilities separate antecedent and consequent processing IF e is PO AND de is NE THEN du is PO IF e is PO AND de is PO THEN du is PO IF e is PO AND de is ZE THEN du is PO FID User s guide c 1993 97 FDG Systems N Exler Page 64 combined antecedent and consequent processing IF eisPO AND deisNE OR eis PO AND de is PO OR eisPO AND deis ZE THEN du is PO As mentioned above there are two modes for the production rule processing The modes are the loop mode and the sequential mode The loop mode is designed for fuzzy control applications with two or three antecedents inputs It is possible to build a cascad e hierarchical structure of two or three input FID modules because it is possible to use the fuzzy output of the first FID module as an input for the second FID module see fig 7 The resulting program code is ver y short and the inference speed is very high Fuzzy PID controller with a cascade structure Fig 7 Hierarchical structure with the same FID modules The sequential mode is also designed for fuzzy contro applications as well as fuzzy expert systems but with no restrictions on the number of antecedents and consequents The only restriction is the available memory space of the ADSP 21xx In sequential mode it is possible to have fewer or more production rules tha n the product of the number of MFs FID User s guide c 1993 97 FDG Systems N Exle
20. classical PID controller The values calculated out of this formula for the scaling values can be used as a good starting point for further optimization of the FPID controller ke T kde T T kse T Ty ku 1 It is possible to use this formula to interpret the universe of discourse of the input fuzzy sets in a different way than in fig 33 above fig 35 u e se u de T 0 T 0 R KR e rag ming se mak umin de Uma Fig 34 Input fuzzy sets for the FPID controller The step response of a FPID controller is quite similar to a step response of a classical PID controller fig 36 By changing the fuzzy sets for the inputs and the output the behaviour can be changed quite a lot We FID User s guide c 1993 97 FDG Systems N Exler Page 111 can say that the FPID controller is a kind of non linear controller whereas the linear PID controller is just a special case Fig 35 Step response of a FPID controller The following example on the EZ LAB board demonstrates the behaviour of the FPID controller explained above Filename fpid_h exe In this example the step response of the FPID controller is displayed on an oscilloscope DACO Fuzzy PID Output DACI error signal DAC2 sum of error signal DAC3 difference of error signal FID User s guide c 1993 97 FDG Systems N Exler Page 112 7 Introduction to Fuzzy Logic 7 1 Overview Fuzzy logic is a generalization of binary logi
21. domain Inputs Outputs Crisp to Fuzzy to Fuzzy Rule base Crisp Transform Transform Fuzzification Inference and Defuzzification Composition Fig 47 Fuzzification Inference Defuzzification process This basic fuzzy rule based structure can be used in many different types of applications including control process control decision making scheduling prediction and estimation By allowing high flexibility in the definition of fuzzy logic operations and especially i n how the combination of the firing strength of all rule s and the defuzzification is performed the area of applications is even further increased 7 3 1 Fuzzification Consider a fuzzy temperature controller with two inputs The two inputs are the temperature T and the change i n temperature AT The actual measured temperature T and the calculated change in temperature AT T T are crisp values FID User s guide c 1993 97 FDG Systems N Exler Page 126 For a classical temperature controller e g PID only the error in temperature is used as an input The output o f this PID controller is the actual control action for a control unit e g heating system If a fuzzy temperature controller represented by fuzz y terms is used then it is necessary to convert or transform the current inputs into fuzzy inputs by finding the degrees of membership fuzzy truth values for al 1 input membership functions This conversion from the cri
22. end of this chapter Bibliography If you area beginner in Fuzzy Logic you should rea d chapter 7 first Then continue with chapter 2 2 3 Manual System Conventions To ease the reading of the manual all parts of the manual share several common same name and display conventions and defined terms The s subheader like this one marks highlights features or technical points The subheader gives hints for handling the program Every windows button or special keyboard ke y which you should press will be written in brackets FID User s guide c 1993 97 FDG Systems N Exler Page 15 For example lt OK gt means that you should press the OK button of the actual dialog box or lt enter gt means that you should press the enter or return ke y of your keyboard Whenever you should type something to perform a function or enter data infor mation it will be written in typewriter style For example L indicates that you should type the L key while first flc lt OK gt instructs you to type first flc and then press the OK button 2 4 The FID Software Package Please be sure the following items are included One 3 diskette containing the FID program an d additional tools One FID License Agreement found inside the fron t cover of this manual It is important to read an d understand the Agreement Check also if the license is correctly written One License Registration Card at the end of
23. following 4 examples running on EZ LAB board will demonstrate different functions and characteristics of fuzzy elements in a very simple manner The outputs of the DAC are used to represent different signals on an oscilloscope The input signal to the fuzzy element e for all examples is a calculated sinus function which can be taken from DAC output 0 Every 50 us a new FID User s guide c 1993 97 FDG Systems N Exler Page 91 output value will be calculated Filename stat_fs exe This example displays the three input fuzzy sets on an oscilloscope in x y mode Fuzzy set NEG at output DAC1 ZE at output DAC2 and finally POS at output DAC3 Filename stat_inf exe This example displays the results of the inference mechanism on an oscilloscope on channel 1 channel 0 is always the input signal to the fuzzy element Membership value f_u_neg at output DACI f_u_ze at output DAC2 and finally f_u_pos at output DAC3 Filename stat_ki exe This example displays the linear or non linear characteristic of a fuzzy element By pressing the IRQ2 button the sign of the slope of the characteristic can be changed This can be done by just changing the rulebase If you hold the Flag In button down when you press the IRQ2 button then the scale out value is divided by two FID User s guide c 1993 97 FDG Systems N Exler Page 92 Filename stat_tnc exe This example displays two different non linear characteristics of a fuzzy element
24. fuzzy set and define it again The othe r properties can be entered and changed later inside th e Fuzzy Resource Editor FID User s guide c 1993 97 FDG Systems N Exler Page 28 4 6 Fuzzy Set View du The Fuzzy Set View which shows the currently defined fuzzy sets appears either when you press the lt Draw Fuzzy Set gt button in the Fuzzy Resource Editor or whenever you change the shape of a fuzzy set When this view is active you can change the fuzzy set s the four points pl p2 p3 p4 simply by locating th e cursor inside the box representing one of these points pressing the left button and moving the point horizontally to a place you want If there is more than one point at the same location an d you want to select the second one press the SHIF T button and hold it when you press the left mouse button Three different sizes for the fuzzy sets are available and can be changed in the Fuzzy Set View By double clicking the right mouse button you can enlarge reduc e the fuzzy sets FID User s guide c 1993 97 FDG Systems N Exler Page 29 4 7 Rule Resource Editor Rule resource editor Rulebase IF eis NE AND de is NDE THEN du is NDU IF eis PE AND de is NDE THEN du is ZDU Add Rule IF eis NE AND de is PDE THEN du is ZDU IF eis PE AND de is PDE THEN du is PDU Delete Rule Inference MAX MIN 5 aK KV Type OExpertType
25. now reading the on line help via Fl when you start the program and the README TXT file The user manual is a comprehensive description of what the FID software package is and what the include d additional tools and prog rams are Its chapters are briefly described as followed Chapter 1 Table of Contents Chapter 2 Contains some general useful hints abou t the program and the manual Chapter 3 Describes how to install the FID application software and how to start the first example Chapter 4 Tells you more about FID How you can use it and what the different menus do It start s with a small simple example which you will find again in several places in this documentation Chapter 5 Explains how you can link the generate d source code to a program Chapter 6 Documentation of the sample programs for the EZ LAB Here it will be explained what FID User s guide c 1993 97 FDG Systems N Exler Page 14 Chapter 7 Chapter 8 the sample programs for the EZ LAB are what they do and how you can downloa d and start them on the EZ LAB For all who do not know a lot about fuzz y logic It is a short introduction to fuzz y logic but it should not be understood as an exhaustive tutorial We have tried to writ e clearly and make it easy to read and we have also included s ome mathematics where we think it might be useful For more information about fuzzy logic you should read one of the references included at the
26. really necessary to define membershi p functions but it makes it easier to understand the difference between membership functions and crisp o r fuzzy sets later on U degree of membership membership functions height m small medium tall crisp sets Fig 37 Membership functions describing the degree of membership u of crisp sets The great disadvantage of this division see figure 3 6 and 37 is that a person with a height of 1 79 m belongs FID User s guide c 1993 97 FDG Systems N Exler Page 115 to the group of medium people but a person who is just 1 centimeter taller than the person before belongs to the group of tall people Normally we would say that th e second person is just a little taller than the first person One solution could be the definition of more sets but the discrimination between the sets remains still very crisp The division of human beings and also of nature in general is much smoother than in the Boolean logic and therefore multi levels of separation are used e g in th e brain four different signal levels are known The only solution to this problem is uncertain quantities called fuzzy sets in the fuzzy set theory The fuzzy se t theory can be seen as a generalization of the ordinary set theory To extend the crisp sets to fuzzy sets it 1s necessary to overlap the crisp sets see figure 38 Th e overlapping region is the fuzzy part of the overlappin g sets height m
27. t one So if you really need it for simulating a specia problem feel free to contact us for a consultation Please describe the problem very accurately by mathematica means or measured values and consider if you reall y cannot linearise it 4 22 Simulation Definition FID User s guide c 1993 97 FDG Systems N Exler Page 45 Simulation Definitions Simulation time Step response of Sampling time 1 e 002 Fuzzy closed loop Step value Cancel Connect Disturbance The Simulation Definition dialog box above shows yo u the basic settings for all simulations In the three edit boxes you can change the simulatio n time the sampling time and the step value The simulation time always starts at zero and ends at the time which is written in the edit box Simulation time With the Sampling time you can choose the discretion in time of the simulation i e This is the time between tw o simulated values For example If you have a simulation time of 10 seconds with a sampling time of 0 01 seconds this will need a total of 1000 calculation steps If yo u have a rulebase with nine rules then 9000 rules must be calculate d for the simulation time Depending on your computer system thi s might take a bit longer The step value is the reference value for closed loo p systems otherwise it is the input value in a plant or PID controller or one input in a fuzzy module In the combo box Step response of you c
28. 000 H 080000 INIT scale_var H 019900 H 001400 H 080000 INIT scale_u H 2000 Include further variable initializations here FID User s guide c 1993 97 FDG Systems N Exler Page 78 Initializing registers for incremental purposes If you use these registers M0 M1 M4 M5 in your program please insure that the right values are WRONG VALUES WILL CAUSE FAILURES stored whenever calling Fuzzy Routines I PEPE EPP PPP TEE EE CUE EERTE ee After a reset start here to initialize all variables an d registers The initilization can also take place in another boot page if necessary MO 0 M1 1 M4 O M5 1 ENA AR_SAT Initializing of fuzzy sets I4 pointer_member L4 Spointer_member AR 3 PM I4 M5 AR AR e_neg PM I4 M5 AR AR e_ze PM I4 M5 AR AR e_pos PM I4 M5 AR AR 3 PM I4 M5 AR AR se_neg PM I4 M5 AR AR se_ze PM I4 M5 AR AR se_pos PM I4 M5 AR FID User s guide c 1993 97 FDG Systems N Exler Page 79 AR 3 PM I4 M5 AR AR de_neg PM I4 M5 AR AR de_ze PM I4 M5 AR AR de_pos PM I4 M5 AR I4 pointer_f L4 Spointer_f AR f_e PM I4 M5 AR AR f_se PM I4 M5 AR AR f_de PM I4 M5 AR Initializing linguistic Variables and Rulebase I0 f_e LO f_e init_member 0x0000 10 LO I0
29. Fuzzy Application Software Users Manual Demo Version 1 6 Windows based Fuzzy Development Tools for ADSP 21xx c 1993 97 FDG Systems Dipl Ing Norbert Exler Vienna Austria All rights reserved PROGRAM LICENSE AGREEMENT made between and hereafter called the customer M Bammer and N Exler trading as FDG Systems hereafte r called the owner Leystrasse 48 25 1200 Vienna Austria Europe 100043 15 1 CompuServe com BY OPENING THE SEALED DI SK PACKAGE YOU INDICATE YOUR ACCEPTANCE OF THE FOLLOWING FID FUZZ Y APPLICATION SOFTWARE LICENCE AGREEMENT IF YO U DO NOT ACCEPT OR AGREE TO THESE TERMS YOU MAY WITHIN FIFTEEN DAYS AT YOUR EXPENSE RETURN THE UNOPENED DISK PACKAGE AND ALL ACCOMPANYIN G ITEMS TO THE OWNER FOR A FULL REFUND 1 FID The owner hereby grants the customer a non exclusive licenc e to use the FID Fuzzy Application Software on a single computer workstation The FID Fuzzy Application Softwar e shall not be shared between multiple computer workstations Each computer workstation must have its own separately licenced software Ownership of the FID Fuzzy Applicatio n Software Package is not transferred to the customer User s guide c 1993 97 FDG Systems N Exler 2 The customer may copy t he FID Fuzzy Application Software in whole or in part only for back up and archival purposes No more than one copy may be in existence at any time That copy must include any and all confidential pr
30. PI versus classical Pl contraller i sec Fig 30 Comparison of classical and fuzzy Pl controller The following 3 examples running on an EZ LAB board will demonstrate different functions and characteristics of two level fuzzy controllers The outputs of the DAC are used to represent different signals on an oscilloscope The input signal to the fuzzy element e for the first and second example is a calculated sinus function which can be taken from DAC output 0 Every 50 us a new output value will be calculated Filename first_r exe This example displays the control map of the FPI controller on an oscilloscope x y mode Input e FID User s guide c 1993 97 FDG Systems N Exler Page 106 DACO of the FPI controller output on DAC1 is fed by a sinus function whereas input de is kept constant With IRQ 2 it is possible to change this value in steps from its minimum to its maximum By pressing Flag In and IRQ2 button together it is possible to swap the step value between the minimum and the maximum Filename first_s exe This example displays the step response of the closed loop control structure in fig 26 With the IRQ2 button you can toggle between two different inference methods MAX MIN Alg Prod MIN Filename first_h exe This example displays the step response of the FPI controller defined before FID User s guide c 1993 97 FDG Systems N Exler Page 107 6 4 Design of a simple fuzzy
31. PLN Two membership functions are selected for each input value and are shown in fig 27 i NEG POS i NEG POS 0 0 1 0 1 1 1 0 e de Fig 27 MFs for error e and change of error de The necessary membership functions are defined as followed e_NEG de_NEG p F800 m OFFF p F800 s 4000 p F800 m OFFF p 07FF s 0008 e_POS de_POS p F800 m 0000 p 07FF s 0008 p 07FF m OFFF p 07FF s 4000 FID User s guide c 1993 97 FDG Systems N Exler Page 101 The number of membership functions for the fuzzy output of the FID controller chosen is 3 For these MFs of the fuzzy output just the centroids of the MFs are stored see fig 28 du Fig 28 Output MFs with the centroids If the output MFs do not have the same size then this can be taken into consideration by storing the scaled areas and the centers of the MFs With two MEFs fuzzy sets for each input variable the maximum number of the linguistic rules is 2 x 2 These rules can be graphically shown in a kind of Karnaugh Veitch type diagram which has the following structure Fig 29 Karnaugh Veitch type diagram for the fuzzy rules FID User s guide c 1993 97 FDG Systems N Exler Page 102 If the rules are written in a linguistic form then the 4 rules are as follows IF e is Negative AND de is NEgative THEN du is NEgative IF e is Negative AND de is POsitive THEN du is ZEro IF e is POsitive
32. Systems N Exler LIMITED WARRANTY The owner hereby warrants that for a period of 60 sixty days from the date of delivery to the customer the FID Fuzzy Applicatio n Software shall materially conform to the performance defined in the documentation of the FID Fuzzy Application Software relatin g thereto manuals guides and computer aided instructions Th e owner does not warrant that the operation of the FID Fuzz y Application Software will be uninterrupted or error free or that th e FID Fuzzy Application Software will meet the customer s requirements or will operate in the combinations chosen by th e customer The customer s sole and exclusive remedy for failure o f the FID Fuzzy Application Software to substantially conform to the performance defined in the applicable documentation is for th e customer to return the FID Fuzzy Application Software to the owner whose sole obligation shall be at its option to either provide th e customer with FID Fuzzy Application Software conforming to th e express warranty above or to refund to the customer the licence fee paid therefore In the event of a refund the customer shall send th e original disks and documentation back to the owner free of an y charges for the owner and promptly destroy all copies of the FI D Fuzzy Application Software in its possession if any and confirm in writing to the owner that all copies were destroyed In order to claim the guarantee services the customer must provide
33. Systems N Exler Page 82 General remarks There are some necessary definitions for a workin g algorithm at the beginning of the initial stage MO 0 M1 1 M4 0 M5 1 ENA AR _ SAT The other M registers canbe used for differen t increment or decrement values 0 or 1 After a boot or reboot some program and data memor y fields must be initialized before starting the differen t parts of the fuzzy algorithm Initialize the pointer_member field in the program memory with the number of the membershi p functions per linguistic variable and the first address of all membership definition fields Initialize the pointer_f field in the program memor y with the first address of all membership value fields Initialize all membership value fields in the data memory with a starting value normally 0 Initialize the rulebase with the actual addresses of the fuzzy output variables Be careful by using I and L registers for other routine s than the fuzzy routines In the text file fuzzylib txt i n FID FUZLIB the used I L registers for each subroutine are explained The possible I and L registers for FID User s guide c 1993 97 FDG Systems N Exler Page 83 MACRO calls are explained in the macro librar y fuztools lib in the same directory mentioned above FID User s guide c 1993 97 FDG Systems N Exler Page 84 6 Examples running on EZ LAB board 6 1 Design of linear and non linear static fuzzy elements
34. Y 0 ccc ce ee Trademarks 305 ccies AR Ta a a Ae a ae BS Le ontents o8 ica hea eo ete ake he bee WB ee Pr face disossea San arasinan 8 dates bth oe wheels ek 2 Overview 26 eee o seit ee ee eee 2 1 Just one other importantthing 0 2 2 About the user manual 2 2 0 eee 2 3 Manual System Conventions 2 4 The FID Software Package 0 2 5 Program extensions used by this program 2 6 System requirements 0 0 00048 3 How toinstall the FID Program 0 0 4 Description of the dialogs Menus 045 4 1 The Toolbar mirei ii Salt stare a eh be 4 2 Fuzzy Resource Status View 000 4 3 Fuzzy Resource Editor 0000 4 4 LingVar Editor 0 0 ce eee 4 5 Fuzzy Set Name Editor 00 0 4 6 Fuzzy Set View e ue E O ee eee ee 4 7 Rule Resource Editor 00 0 4 8 Rule Definition Karnaugh Veitch 4 9 Rule Definition Expert type 0 4 10 Defuzzification 0 0 0 0 0 eee eee 4 11 Fuzzy Map Dialog 0 eee eee eee 4 12 Define Inputs NOT used for map 4 13 Fuzzy Map View 0 0 0 eee 4 14 PID input dialog 0 eee ee eee 4 15 Linear Plant Definition Zero Pole representation FID User s guide c 1993 97 FDG Systems N Exler 4 16 Zero Pole Gain a
35. _ze 8 VAR PM CIRC se_pos 8 VAR DM CIRC f_se 3 diff error de Input VAR PM CIRC de_neg 8 VAR PM CIRC de_ze 8 VAR PM CIRC de_pos 8 VAR DM CIRC f_de 3 actuation u Output VAR DM CIRC f_u 3 VAR PM CIRC center_u 3 VAR DM scale_u VAR DM u_HSW u_LSW further declarations VAR PM CIRC pointer_member 12 VAR DM CIRC input_var 3 VAR PM CIRC scale_var 3 VAR PM CIRC pointer_f 3 Include non fuzzy variables and port label declarations here Initialization pl m1 p2 51 p3 m2 p4 s2 INIT e_n eg H F80000 H 0FFFOO H F80000 H 400000 H F80000 H OFFFO0 H 000000 H 002000 INIT ze H F80000 H 000000 H 000000 H 001000 H 000000 H 0FFF00 H 080000 H 001000 INIT e_postH 000000 H 000000 H 080000 H 001000 H 080000 H OFFFO0O H 080000 H 400000 INIT se_neg H F80000 H OFFFO0O H F80000 H 400000 H F80000 H 0FFF00 H 000000 H 001000 INIT se_ze H F80000 H 000000 H 000000 H 001000 H 000000 H OFFFO0O H 080000 H 001000 INIT se_pos H 000000 H 000000 H 080000 H 001000 H 080000 H OFFFOO H 080000 H 400000 INIT de_neg H F80000 H OFFFOO H F80000 H 400000 H F80000 H 0FFF00 H 000000 H 001000 INIT de_ze H F80000 H 000000 H 000000 H 001000 H 000000 H OFFFOO H 080000 H 001000 INIT de_pos H 000000 H 000000 H 080000 H 001000 H 080000 H 0FFF00 H 080000 H 400000 INIT center_u H F80000 H 000
36. able add 27 definition 25 Plant add 40 Disturbance 50 examples 42 43 45 extension 17 type 40 Page 42 44 Resolution input 75 membership function 76 output 76 scaling 75 Rules add 31 33 antecedents 57 consequent 57 delete 33 edit 31 32 expert type 33 KV type 31 87 102 110 129 no rules 32 Page 137 status 30 type 31 Simulation controller 39 definition 46 47 Disturbance 44 50 examples 46 48 49 fuzzy 48 fuzzy closed loop 49 Fuzzy PID 105 PID 112 plant 39 save 52 SDF definition 52 53 view 51 FID User s guide c 1993 97 FDG Systems N Exler FID Fuzzy Registration Form Register immediately to receive these benefits e Information on FID fuzzy application software e Information on new Hard and Software for control applications e Upgrade Information Return this form to FDG Systems Dipl Ing Norbert Exler Leystrasse 48 25 1200 Vienna Austria Europe First Name Last Name Company Name if applicable Job Title Address City State Country ZIP Code Telephone Number Fax Number include Area Code eMail Address FID Fuzzy Application Software Serial Number If you have any suggestions or comments concerning the manual or software please write th em on the reverse of this form or send us an eMail
37. adio button you want To change the inference type select the one you want in the combo box 4 8 Rule Definition Karnaugh Veitch Rule Definition Karanaugh Veitsch Type Input Variable Input Variable om dlclehcl ie ie EATEN Input AND Operator Output Operator You can define the rules by means of a schedule Read it as follows The linguistic variable at the top is the first input variable and will be the first part of the first condition Under the FID User s guide c 1993 97 FDG Systems N Exler Page 31 linguistic variable the first row shows all defined fuzz y sets of that linguistic variable which will become th e second part of the first condition On the left side you find the same system for the second input which will become the second condition Each combo box has all fuzzy sets of the selected output variable and a no rule Now just select the conclusions of each rule Select the operator which should be taken for the AN D operation of the two conditions and the operator of th e output variable These Operators will be taken for every tule If you have selected a rule before pressing the lt Kdit Rule gt button the rules already defined will be shown in the related combo boxes You can only create rules consisting of one or two inpu
38. ain quantities of objects or values First of all the meaning of uncertain quantities fuzzy sets will be explained starting with crisp quantities 7 2 1 Fuzzy sets and membership functions The separation of people into groups sets according to their height can give an idea of crisp and uncertain fuzzy sets If for example three crisp sets small medium tall are defined and the appropriate people are allocated to them classical set theory crisp sets demands the definition of two thresholds for three sets These setsare assigned by the system designer and are given labels such as small medium tall e g threshold 1 1 70 m threshold 2 1 80 m The three sets have then the following ranges small lt 1 70m 1 70m medium lt 1 80m 1 80m tall This is shown graphically in figure 36 The circles around the ranges along the height axis are just to visualize these ranges as in the classical set theory Six people with different heights are marked along the height axis person A 1 65m person B 1 85m person C 1 73m person D 1 78m person E 1 70m person F lt lt FID User s guide c 1993 97 FDG Systems N Exler Page 114 1 80m height m small J io tall crisp sets Fig 36 Crisp sets for three groups of people The degree TRUE or FALSE of membership u to a crisp or fuzzy set small medium tall can be described by using membership f unctions see figure 37 For crisp sets it isn t
39. alter the digital configuration of the FID Fuzzy Application Software or solicit others to cause th e alteration of the digital configuration of the FID Fuzz y Application Software so as to change the FID Fuzz y Application Software FID User s guide c 1993 97 FDG Systems N Exler 5 The customer agrees to use all reasonable efforts to ensure that persons employed by the customer or under the customer s direction and contro 1 who come into contact with the FID Fuzzy Application Software abide by the terms and conditions of this agreement including without limitation not knowingl y permitting anyone to use any portion of the FID Fuzz y Application Software for the purpose of deriving its sourc e code If the customer becomes aware that the FID Fuzz y Application Software is being used by such persons in a manner not authorised by this Agreement the customer shal immediately use all reasona ble efforts to have such unauthorised use immediately cease The customer shall notify the owner in writing of the unauthorised use if it continues for an unreasonable period after the customer becomes aware of it 6 The FID Fuzzy Application Software is protected by copyright and other proprietary rights of the owner The customer may be held directly responsible by the owner for acts done by him or on his behalf relating to the FID Fuzzy Application Softwar e which are not authorised by this agreement FID User s guide c 1993 97 FDG
40. an choose the response of a plant PID controller Fuzzy module PI D FID User s guide c 1993 97 FDG Systems N Exler Page 46 closed loop system or a Fuzzy closed loop system If you choose the response of a plant or PID controlle r no other settings are possible for the simulation If yo u choose Fuzzy or Fuzzy closed loop you must decid e how to connect all inputs to the fuzzy module To do this press the lt Connect Fuzzy gt button If you want to simulate the influence of a disturbance on a closed loop control press the lt Connect Disturbance gt button only available for PID closed loop and Fuzzy closed loop 4 23 Connect Fuzzy Inputs Connect Fuzzy Inputs Fuzzy Inputs Connections Operation e Se Ts l onoeenoononenonnnenononn de Tdev e difference Add O deviation 2nd deviation sum CO integration Fuzzy Output 9 constant du step Ceme E Connection factor In this dialog box you can define all connections fro m the inputs and outputs at the fuzzy controller The first list box is only a list of all linguistic inpu t variables defined in the fuz zy resource file In the second list box you can add the wanted connections by selecting an operation and a connection factor and then pressin g the lt Add gt button If you make a mistake you can delete the whole connection list for each input by selecting the wrong connection list and press
41. and name the data will be saved in the selected format FID User s guide c 1993 97 FDG Systems N Exler Page 52 4 27 SDF Definition SDF Definition Columns fixlength 15 chars delimited with al Records O Cancel Standard Data Formats can have different formats e Either the length of each field has a particular fixe d length no matter of the data size in that field or e the data are separated by delimiters Each record i s terminated with a carriage return cr or a carriag e return line feed cr lf In the FID program both versions are available B y default a fixed length with 14 chars per field will b e taken If you choose lt delimited with gt the first character in the edit box will be used at the beginning and the end of each field the second character separating the different fields The data will be stored in the order displayed in the save list box of the save simulation data dialog box FID User s guide c 1993 97 FDG Systems N Exler Page 53 4 28 Convert Fuzzy to ADSP Code Convert Fuzzy to ADSP Code Convert actual Fuzzycontroller into File FIRST DSP O ADSP 21xx Code ol KY Type Conversion E ATHIP 2 pax Code El Include interrupt table Cancel Whenever you want to create an ADSP source cod e choose the menu item ADSP Source code Enter th e name and path of the source code file by pressing th e lt Browse gt button and for what ADSP you
42. c Boolean logic and therefore a fuzzy logic based system can completely represent a crisp logic system The converse is not true Fuzzy logic is based on fuzzy set theory and provides a rigorous framework for representing non crisp situations Similarly the fuzzy set theory is a generalization of classical set theory In 1965 Lofti A Zadeh a professor of electrical engineering at the University of California Berkeley expanded the concept of a classically defined set to that of a fuzzy set The basic fuzzy rule based structure can be used in many different types of applications including control process control decision making scheduling prediction and estimation By allowing high flexibility in the definition of fuzzy logic operations and especially in how the cobination of the firing strength of all rules and the defuzzification is performed the area of applications is even further increased 7 2 Fundamentals of Fuzzy Logic Unlike binary logic and binary algebra used in all standard computers fuzzy logic is multivalued Instead of an element being a member of a set or not fuzzy logic allows degrees of membership so that something FID User s guide c 1993 97 FDG Systems N Exler Page 113 can be partially true and partially false at the same time or in other words something can be a member of two or more fuzzy sets Fuzzy sets which are therefore an essential part of the fuzzy set theory can be defined as uncert
43. chical structure the number of input variables is unlimite d memory limit In loop mode very little memory space is necessar y gt low cost version ADSP 2105 06 can be used gt especially for fuzzy control applications In sequential mode a large number of antecedent s and consequents can be used gt especially for fuzzy control and fuzzy expert systems High speed inference processing by single cycle instructions 24 9 us for 2 conditions antecedents and 1 consequent 49 rules and 16 MHz Efficient fuzzification and defuzzification for an y number of input and output variables 15 5 us for fuzzification with 2 input values with 7 membership functions each 3 84 us for a crisp value evaluation of 7 output MFs of the second or third type of center of gravit y method FID User s guide c 1993 97 FDG Systems N Exler Page 56 e Up to 1kx16 Bit on chip data RAM e Up to 2kx24 Bit on chip programm RAM enoug h for almost all control problems e Interfaces to standard microprocessors e Modified Harvard architecture e No other processors are necessary for mixed control strategies classical P PI PD PID state space and fuzzy e Easily readable algebraic assembler code 5 2 Function List Fuzzification Any number of input variables are allowed Triangular and trapezoid shapes for the membership functions Inference Functions Loop mode Indirect addressing of antecedents and consequents For 2 antecede
44. cial fuzzy processors but these ar e mostly employed as just coprocessors and are therefor e not likely to become standard Regular microprocessors mostly lack the necessary speed for fuzzy logic FID User s guide c 1993 97 FDG Systems N Exler applications As fuzzy algorithms are principly complex and systematic signal processing problems the signa processor is the best suited hardware for dealing wit h them The Analog Devices ADSP 21xx series has lon g since not just processed signals but also has a timer serial ports host interface ports ADC DAC along wit h much more on chip ADSP s therefore cover both fuzzy logic as well as regular signal processing tasks such a s FFT digitial filters PID controllers and so on Thi s means the combination of the processor family ADSP 21xx with one development tool and varied softwar e packages along with their libaries can be used in a ver y wide range of development areas The FID Application Software is one of the 3rd part y software packages for the ADSP 21xx family that supports Fuzzy development on DSP s The FID Application Software is an easy to use Microsoft Windows based application software for developing writing and testing fuzzy programs based on the ADSP 21xx system This makes you independent of specia fuzzy controllers Vienna August 1994 FID User s guide c 1993 97 FDG Systems N Exler 2 Overview Welcome to the world of fuzzy logic Thank you
45. defined by means of Zero Pole FID User s guide c 1993 97 FDG Systems N Exler Page 17 representation SYM Symbol files used for the ADSP simulator TXT Files which contain readable text 2 6 System requirements To run FID Fuzzy Application software you must fulfi 1 the following needs IBM AT PS 2 and all 100 compatible machines 4MB RAM Harddisk with LOMB free memory and Windows 3 1 or a compatible program We suggest in order to get an acceptable performance at least 486 33MHz If you want to use the program in a network ask for an FID network license FID User s guide c 1993 97 FDG Systems N Exler Page 18 3 How to install the FID Program Before you continue make a copy of the disk by mean s of DOS diskcopy Write the name of the software th e license number and the copyright on the label and keep the original diskette in a safe place Continue the installation with the copy you have made The diskette is not copy protected but every diskette has an uniqu e serial number Start Windows insert the copied diskette into your disk drive A and start the installation program through th e Program Manager File Run a setup lt enter gt The installation program w ill ask you where to install the FID Fuzzy Application Software That s all you have to do After some minutes the installation is finished an d the program ready to use Although we are sure that we deliver this softwar e
46. e stored in separate data memory fields Th e output membership values are also stored in a data memory field For direct addressing it must be possible to reference each value in a data field by its name se e fig 9 This facility makes it possible to use as man y antecedents as desired and to use different triangula r norms for antecedent processing Instead of the rule base in a program memory field th e rulebase is coded as individual instructions in progra m memory The inference mechanism in sequential mod e needs therefore much more program code than in loop mode but it is very flexible in that norms for antecedent and consequent processing can be selected separately There is no restriction on the number of antecedents and consequents FID User s guide c 1993 97 FDG Systems N Exler Page 67 Rules and inference in sequential mode DM f_e_NE DM f_e PO Rules amp f_du_NE f_du_ZE DM Inference TaT f_de_NE f_de_PO Fig 9 Memory model for the inference mechanism in sequential mode The inference process needs data memory fields for the MVs of each input variable circular buffers are not necessary data memory fields for the MVs of each outpu t variable circular buffers names for each membership value for direct addressing 5 3 3 Defuzzification In order to get a crisp output value it is necessary t o defuzzify the fuzzy logic output data Three dif
47. essing the right mouse button you can walk ove r the map The actual coordi nates will be shown on the top of the view and marked in the map A mousemovement to the right or left correspodents with the first linguisti c variable X axis up down movement correspodent s with the second linguistic variable Y axis FID User s guide c 1993 97 FDG Systems N Exler Page 38 4 14 PID input dialog PID Input Dialog Enter the factors of the standard PID controller you want to have here The formula of calculation is written in the dialog box above the edit boxes This controller is used for you to compare the results of a standard PI D controller to a Fuzzy Controller You can do this by simulating the controller in a closed loop with a plant or just by studying the step response of the controller If you have deticated to solve the problem with a PID controller it is possible to convert it into an optimise d ADSP source code FID User s guide c 1993 97 FDG Systems N Exler Page 39 4 15 Linear Plant Definition Zero Pole representation Linear Plant definition 1 Open Plant otha tew riam Edit Zero Pole representation Num Denum representation OK oO Multiple steps Cancel P s You need a plant to simulate the system in a closed loop with the fuzzy controller to see the quality of your designed fuzzy controller By pressing the lt Edit gt butto
48. f_se LO Sf_se init_member 0x0000 0 L0 I0 fi de LO f de init_member 0x0000 10 LO I0 f_uy LO Sf_u init_member 0x0000 10 LO Include interrupt settings like ICNTL IFC IMASK here and enable timer interrupt if necessary The IDLE loo p should also be included here The interrupt service routines start here The following lines are the real control code If you want to make a loop it is best to start above this comment The following should be part of an interrupt servic e routine from here onwards e g in a timer interrup t FID User s guide c 1993 97 FDG Systems N Exler Page 80 service routine I0 input_var LO input_var I4 scale_var L4 S scale_var You can NOW make any necessary calculations for the inputs Store each value according to the initializing order simply with DM I0 M1 AR Store the INPUTS here Include all necessary inputs in the right order here Th e right order can be seen from the initializing procedure of fuzzy sets above The input values can come from a n ADC a serial port and or a memory mapped host Make sure you calculate the input values correctly so as to run the ADSP source code like the simulation in the FI D Application Software scaling the itputs call scaling_input Fuzzification I4 pointer_member L4 pointer_member I5 pointer_f L5 pointer_f call FUZZIFY Inference Serialized Type
49. feren t kinds of the center of gravity method are implemente d for defuzzification The first type uses just singletons for the output MF s which represent the center of the output MFs For an accurate defuzzification from the mathematical point of view it is necessary to use symmetrical MFs of the same size The arrangement of these MFs should be regula r along the abscissa linguistic variable FID User s guide c 1993 97 FDG Systems N Exler Page 68 The evaluation used for defuzzification is shown below fuzzy logic output label names NB NS ZE PS P FFI output pages i f 0 G Q G G G 800 center points singletons 7FF Fig 10 Defuzzification with singletons for the MFs The crisp value for the output can be calculated by using the following formula crispvalue yX f C J f The second type uses singletons and scaled areas for the output MFs The singletons represent the center of th e output MFs and the areas are scaled to the largest area of the MEFs The only restriction is that the MFs should b e symmetrical The evaluation used for defuzzification is shown below FID User s guide c 1993 97 FDG Systems N Exler Page 69 fuzzy logic output label names ZE area Yalues i scaled to 1 G G G G G 800 center points singletons 7FF Fig 11 Defuzzification with singletons and areas for the MFs The crisp value for the output can be calculated by using the fo
50. field for every membership function triangular or trapezoid 8 program memory locations for every input variable linguistic variable an y number from one to seven membership function s fuzzy sets i e 8 to 56 program memory locations more than seven membership functions is mostly not useful or necessary afield with the number and start addresses of all the membership functions for all input variables and an I register to point to the first address in this field for indirect addressing for every input variable a field for the membershi p values with as many membership functions a field for the start addresses for all membershi p value fields and an I register to point to the firs t address in this field 5 3 2 Inference mechanism The whole inference mechanism is based on Zadeh s compositional rule of inference and comprises two major tasks The first one is the evaluation of the premise par t IF part of the production rules and the second task 1 s the union of all conclusions THEN parts The premise comprises two or more antecedents which are normall y evaluated by means of triangula r norms e g MIN ALG FID User s guide c 1993 97 FDG Systems N Exler Page 62 PRO BOU PRO DRA PRO Antecedent processing is the process of obtaining the firing strength of a production rule using the grades o f different input variables If Mamdani s mini fuzz y implication is used the minimum operator is used f
51. for choosing the FID fuzzy applicatio n software We are sure that you will enjoy working with this program A solid sound working useable software is a good software Its documentation should be comprehensiv e and clear and we have endeavored to make ours so But everyone makes mistakes Considerable time and effort have been spent in the development of this product I f you are happy with the software we would like to hea r from you If you find any mistakes in our software o r think a part of the documentation could be more clearly written we would really like to hear from you For your convenience a reply form is provided at the back of this manual or just send us an eMail 2 1 Just one other important thing We think this software is not expensive as it is at a price that everyone can afford In fact we think the price o f the software is cheap compared to other products Thi s competitive price means people can buy it and use it legally Although we do not think that you will give the software to someone else we know that it happen s sometimes Please read the license agreement carefull y and fulfil your side of the bargain and remember ever y FID User s guide c 1993 97 FDG Systems N Exler Page 13 software you install should be licensed This is the only way we can go on developing cheap software for you 2 2 About the user manual The FID documentation consists of three parts the user manual which you are
52. fuzzification Finally the defuzzification process converts the fuzz y outputs from the rule evaluation step into crisp syste m outputs There are several possible methods of performing the defuzzification A commo n defuzzification method especially for control purposes is the center of gravity COG or centroid defuzzification method There are also a lot of other popular defuzzification methods like the mean of maximum MOM maximum left ML or maximum right MR defuzzification The fuzzy outputs obtained in the inference and composition step are used to truncate the corresponding output membership function by the appropiate trut h values as shown in figure 50 Then the center of gravity of the resulting fuzzy set is found by finding the balance point of the resulting membership function and only the value along the heating axis which is a result of the projection of the center of gravity to the heating axis is used as the crisp output shown in figure 50 with an arrow off med high 1 0 100 me CoG heating Fig 50 Center of gravity defuzzification FID User s guide c 1993 97 FDG Systems N Exler Page 131 The result of the defuzzification using other methods than COG is shown in figure 51 off med high 1 0 0 heating 00 ML MR MOM Fig 51 MOM ML and MR defuzzification Instead of using discrete membership functions for the output fuzzy sets singletons are often used for embedded con
53. he maximum of these rule strengths and assigning the value to the correspondin g fuzzy output MEFs This inference method is called MIN MAX inference i e Take the minimum of each condition antecedant and then combine all output values which are assigned to the same output MF by using the max operator Normally these resulting va lues are applied to the output MFs by using Mamdani s minimum operation rule Another method often used is Larsen s product operation rule The resulting fuzzy output MF is a result of superimposing all fired fuzzy output MFs This proces s is called composition of output MFs to one output MF The rulebase above can also be represented in a Karnaugh Veitch KV type diagram The followin g diagram shows all membership levels for the inputs and FID User s guide c 1993 97 FDG Systems N Exler Page 129 the outputs Each table entry represents a fuzzy rule T heating cold warm negative AT zero positive In figure 49 the whole process of fuzzification inference processing composition and defuzzification is graphically shown for two different rules one rule i s intentionally different to the rule base above THEN H off 1 off ed hi Inference 0 H 1 off ed hi Inference 0 H 2 IF T cold or dT positive THEN H medium Fig 49 A fuzzy controller with 2 inputs 1 output and 2 rules FID User s guide c 1993 97 FDG Systems N Exler Page 130 7 3 3 De
54. he second linguistic v4 Grade Input value 1 Input value 2 Fig 3 The fuzzification process in principle FID User s guide c 1993 97 FDG Systems N Exler Page 60 Memory Model for the fuzzification interface A simple example for the memory model of a FID controller FID Fuzzification Inference Defuzzification with two input variables and two membership functions each is shown in fig 4 The necessary memory space for the input variables and th e membership values must be arranged in data memor y locations The necessary data for indirect addressing and for the MFs is stored in program memory locations The indirect addressing capability makes the necessar y program code very short and the result is a very fast and accurate fuzzification interface Fuzzification PM PM pointer_member e_NE Num e_mem heer pl e NE ml J e_PO p2 Num de_mem sl Ade_NE p3 de_PO m2 p4 DM s2 input_var e FUZ de DM f_e_NE ee f_e_ PO Af_e_NE Af_de_NE a DM pointer_f_i f_de_NE PM f_de_PO Fig 4 Memory model for the fuzzification interface FID User s guide c 1993 97 FDG Systems N Exler Page 61 The fuzzification process needs a field for all input variables linguistic variables in data memory e g input_var in DM and an I register which points to the beginning of this
55. ical model just how the system to be controlled should work e Definition of all input which can be measured or calculated and output variables linguistic variables and their input and output ranges e Definition of membership functions for each input and output variable FID User s guide c 1993 97 FDG Systems N Exler Page 133 For the output MFs normally just singletons are used FID Fuzzy Application Software uses automatically singletons where applicable Establishment of a set of fuzzy rules rule base in the form of IF THEN rules which describe how the system works Use the process knowledge and the experience of human experts Definition of an inference method Normally the MIN MAX inference is used Definition of a defuzzification method Normally the center of gravity COG method Simulate the system and tune the design by modifying the scale values and the membership functions Compile membership functions and rules for target digital signal processor ADSP 21xx This is a task where a development tool with optimized code generation really enhances the performance of the fuzzy solution Add pre processing and post processing code to complete the application Conventional and fuzzy approaches can coexist on an ADSP 21xx for very flexible high dynamics and low cost controls Download and test your code with a hardware development system and your target application like EZ Lab EZ Teach Fuzzy EZ Teach FID
56. ing the lt Delete gt button FID User s guide c 1993 97 FDG Systems N Exler Page 47 The output of the fuzzy module which should be used as the input to the plant or just as the calculated output can be selected in the combo box above the lt OK gt button The connection list has two different interpretation s depending on the selection of the step response in the Simulation Definition dialog If Fuzzy is selected the connection list is interpreted a s follows example from the dialog above Aya h IT Ay 2 hy thy 0 0 0 0 0 01 0 1 0 h k 0100000 0 0 T Eh 1 0 h k y du h step value y output value du FID User s guide c 1993 97 FDG Systems N Exler Page 48 If Fuzzy closed loop is selected the connection list i s interpreted as follows example from the dialog bo x above Cka Ok Cra eW T Cp 42 2 e 4 tE Oe Ce es N Le Oo 10 000070 gt 0 T Ze 1 0 h y h reference value step value y output value output value of the plant e error value e h y FID User s guide c 1993 97 FDG Systems N Exler Page 49 4 24 Connect Disturbance Connect Disturbance Bx to Input STOER PLH C to Output Connect You can either connect a step or multiple steps to the input and or to the output of the closed loop system To connect check the check box for the input and o r output and press the appropriate lt Connect gt button and select a plant by means of the pla
57. inguistic variable Then the fuzzification interface stores all membership values of an input variable in a field of variables linguistic labels Th e resolution of the input variables can be any number o f bits up to 12 bits and the membership value resolution is always 12 bits for the MFs mentioned above The general shape of a membership function is the trapezium and it is characterized by 8 values see fig 1 A membership function can be d efined for each fuzzy set linguistic label There are some constraints for the definition of MFs The vertices should be connected by straight lines The slope evaluation should be made by truncatin g the resulting decimal value The slope ata right angle must be 4000h my P P gt P3 P4 init order p1 m1 p2 sl p3 m2 p4 s2 Fig 1 General shape of membership functions The trapezium can by certain definitions take on th e shape of a triangle or rectangle FID User s guide c 1993 97 FDG Systems N Exler Page 59 The following figure 2 shows examples of MFs tha t can be so defined FFF Grade MV 0 800 Input data FFF 1 1 Fig 2 Possible membership functions which are allowed The fuzzification process is a process to obtain membership values grades for a linguistic variable b y using the input value and all membership functions fo r this input see fig 3 MF for the first linguistic variable MF for t
58. isp output can be evaluated FID User s guide c 1993 97 FDG Systems N Exler Page 95 Fig 23 Output membership functions neg pos with the centroids For the output fuzzy sets the same declarations as in the example before are valid The centroids for the output MFs are u_neg F800 u_pos O7FF The two level controller above has one great disadvantage It always fulfills a control action by changing its output value This disadvantage can be reduced by introducing a hysteresis to the two level controller The necessary fuzzy sets for the input value e are shown below FID User s guide c 1993 97 FDG Systems N Exler Page 96 k 1 0 2 0 02 1 Fig 24 Membership functions DOWN KEEP UP for error e Source File TWOP_H FLC The fuzzy set KEEP works like a holding element which keeps the last output state until another fuzzy set is not equal to zero The same rulebase can be used as before but we need an IF statement to check if the fuzzy set KEEP is not zero FID User s guide c 1993 97 FDG Systems N Exler Page 97 Then the rulebase looks like this IF e is KEEP THEN jump old_state IF e is UP THEN u is pos IF e is DOWN THEN u is neg old_state This simple change in the rulebase can not be done with the FID Application Software It is necessary to do this change manually in the ADSP source code The conclusion of all this is that you can have very simple rulebases by
59. just introducing non classical fuzzy IF THEN rules The two level fuzzy controller with a hysteresis can be used to control a plant with PT1 behaviour The control loop has the following structure FID PT1 1 aon y 1 2 35s Fig 25 Closed loop control structure with a fuzzy two level controller The following 3 examples running on an EZ LAB board demonstrate different functions and characteristics of two level fuzzy controllers The outputs of the DAC are used to represent different signals on an oscilloscope The input signal to the fuzzy element e for the first and second example is a calculated sinus function which can be taken from FID User s guide c 1993 97 FDG Systems N Exler Page 98 DAC output 0 Every 50 us a new output value will be calculated Filename twop_wh exe This example displays the characteristic of a two level controller without a hysteresis on an oscilloscope The best display mode is the x y mode DACO0 x DAC1 y Filename twop_h exe This example displays the characteristic of a two level controller witha hysteresis on an oscilloscope The best display mode is the x y mode DAC0 x DAC1 y Filename twop_ptl exe This example displays the step response of the closed loop control structure in fig 25 With the IRQ2 button you can toggle between two reference values and by pressing the Flag In button and IRQ2 button together the width of the KEEP fuzzy set is changed FID User
60. ler Page 36 4 13 Fuzzy Map View View 23 90 58 Max 0 669271 Min 0 669271 This shows you a 3 dimensional fuzzy map of one output related to one or two input linguistic variables After the Fuzzy Map has appeared you can look at i t from any point you want On the top left you can see the coordinates of your view point You can change the coordinates of your view point in two different ways e You can go back to the Fuzzy Map Dialog and change the coordinates there or e you can press the left mouse button hold it and move the mouse This will cause the moving of th e fuzzy map and the respective changes in your vie w points coordinates The left right motion will be translated as a circular motion in the X Y plane o f the two inputs the up do wn motion follows a sphere FID User s guide c 1993 97 FDG Systems N Exler Page 37 The minimum and maximum outp ut values shown on the map and the coordinates of the view point are always in the top left corner of the window If you have chosen the color view you will see on the left side under the Max value a color bar with differen t colors corresponding to the different heights of the map If the view is white the grid of the cube in which the map is placed will not be painted behind the map If the net view is selected between the calculated points jus t lines are drawn By double clicking the left mouse button the defaul t view will be restored By pr
61. llowing formula crispyalue X f A C Xf 4 e g IF aland a5 are equal and bigger than a2 a3 a 4 then the scaled areas are Al and A5 set to 1 1 15 and A2 a2 al A3 a3 al A4 a4 al The third type uses rectangular MFs for the output fuzzy sets These MFs are characterized by their points at th e abscissa In order to use the same defuzzificatio n method as for the second type it is necessary to stor e instead of areas the distances between the points next to each other For the centers it is necessary to store th e mean value of two adjoining points The evaluation used for defuzzification is shown below FID User s guide c 1993 97 FDG Systems N Exler Page 70 fuzzy logic output label names NS ZE PS Py P gt P3 P4 Ds Ps 800 TFF Fig 12 Defuzzification with rectangular MFs The crisp value for the output can be calculated by using the following formula crisp value gt X F Puai P Dir PA X2 fi Dini Pi When the d nominator 0 division does not take place and the crisp value is set to 000h This is the valu e between 800h and 7FFh Memory model for the defuzzification The same example as for the fuzzification and th e inference memory model should be used The outpu t membership values fuzzy logic output are stored in a data memory field The necessary values centers areas distances or mean values for the defuzzification ar e stored in a program mem
62. membership functions Fig 42 Cos shaped membership functions FID User s guide c 1993 97 FDG Systems N Exler Page 120 Fig 43 Singletons for membership functions In practice the system designer choose the membership functions and the fuzzy sets are a result of this choice The same labels which are used for the membershi p functions are used for the fuzzy sets and vice versa Each of the labels represent a fuzzy set positioned in the operational domain of possible crisp values The representation in form of numbers can be therefor e simplified quite a lot using II shaped membership functions with only 4 corner points and a linear interpolation between these points Another possibilit y for the representation of the membership functions with arbitrary shapes could be the representation by arrays of numbers but that consumes a lot of memory spac e Therefore PI shaped MFs are well suited for practica implementations on microprocessors especially DSP s 7 2 3 Set operators Up to now the differences between fuzzy sets and membership functions are described Therefore the membership function is the mo st important part for fuzzy set operations Operations with fuzzy sets uncertai n sets are defined via their membership functions The basic operators for the Boolean logic are AND OR FID User s guide c 1993 97 FDG Systems N Exler Page 121 and NOT and these operations can also be used for se t operatio
63. mp Deadtime input 41 4 17 Linear Plant Definition Numerator Denominator 42 4 18 Numerator Denominator amp Deadtime input 43 4 19 Linear Plant Definition Multiple steps 44 4 20 Multi Step definition 0000 44 4 21 Non linear Plant Definition 45 4 22 Simulation Definition 0 0 0 0 28 46 4 23 Connect Fuzzy Inputs 0 8 b ee 47 4 24 Connect Disturbance bee eee 50 4 25 Simulation View 0 08 Ue ee 51 4 26 Save simulation data se sani ee eee 52 4 27 SDF Definition pe g ee 53 4 28 Convert Fuzzy to ADSP Code 54 4 29 About FID 24 eee ee 55 5 Fuzzy Logic on an ADSP 21xx 2 0 ee eee 56 Del Features ye at es ite eae oak koi R Sheets 56 5 2 Function Pist gee ee ee 57 5 3 Specifications yo eee ee ee 58 5 3 1 Fuzzificatton 2 0 2 eee eee 58 Memory Model for the fuzzification interface 61 5 3 2 Inference mechanism 04 62 Memory model for the inference mechanism in loop mode Errera a tana ed dled doled bd 66 Memory model for the inference mechanism in sequential mode 0 000 67 5 3 3 Defuzzification oer eean eae eA 000 002 68 Memory model for the defuzzification 71 DSA TUNING eeen E ee seg as Whee len E 74 Input variable tuning 0 2 0000 74 Output variable tuning 00 0 75 5 3
64. n you can define a plant which is given by zeros poles gain and deadtime You also can design a classical PID controller for a plant but this is not the goal of FID Fuzzy Applicatio n Software The plant is shown in the list box in the top half of th e Linear Plant Definition dialog box If this list box is empty no plant is defined Each plant can be saved by pressing the lt New Plant gt button To open an already existing plant press the lt Open Plant gt button FID User s guide c 1993 97 FDG Systems N Exler Page 40 4 16 Zero Pole Gain amp Deadtime input Zero Pole Gain amp Deadtime input Zeros Poles 1 2 Gain 1 Deadtime o sec Cancel The rules for entering the data are as follows e Every zero you have in the description of the plan t has to be entered as a numerical value If you hav e more than one zero then separate the different zeros with semicolons If there is no zero in the plant description leave the edit box clear e Every pole you have in the description of the plan t has to be entered as a numerical value If you hav e more than one pole then separate the different poles with semicolons If there is no pole in the plant description leave the edit box clear Additionally you can define a gain of the plant and a deadtime By default these two values are 1 and 0 respectively FID User s guide c 1993 97 FDG Systems N Exler Page 41 For example
65. ng the scaling values in program memory locations fo r direct addressing two data memory locations for storing the change d crisp output values double precision 5 3 5 Resolutions and Formats Input values and scaling factors The input values can have a re solution of up to 12 bits A signed 12 bit format is used for input values i e 800h is equal to 1 5 11 and 7FFh is equal to 1 1 LSB 5 11 The input variable tuning changes the input values b y multiplying them by the scaling values The resolution of the scaling factors is 16 bits and th e FID User s guide c 1993 97 FDG Systems N Exler Page 75 chosen format is signed 5 11 with values from 16 to 16 Membership functions for the input values The p values are in a signed 12 bit format and th e membership values m are in an unsigned 12 bit format The values for the slopes s are in a 12 4 format Therefore the slope values can extend from 1 1 6 theoretically or better 1 practically see possible MFs to 4096 Membership values grades All membership values are in an unsigned 12 bit format 0 to FFFh Membership functions singletons for the fuzzy output The c values are in a signed 12 bit format The scaled areas are inan unsigned 1 15 format The distances are in a signed 1 15 format and the mean values are in a signed 12 bit format Crisp output values The crisp output values use a signed 12 bit format an d they must be cha
66. ng system input s and system outputs Individual rules represent parts o f the solution to a problem All rules considered togethe r determine the final solution Rule evaluation takes the fuzzy inputs degrees o f membership from the fuzzification step and the rule s from the knowledge base and calculates fuzzy outputs A typical rule base for a temperature controller belo w shows in principle the rule evaluation The membership functions for the output heating are shown in figure 47 FID User s guide c 1993 97 FDG Systems N Exler Page 128 RULE STRENGTH IF Tiscold 0 75 AND AT is zero 0 8 THEN heatingishigh 0 75 IF Tiscold 0 75 AND AT is negative 0 2 THEN heatingishigh 0 2 IF Tiscold 0 75 AND AT is positive 0 0 THEN heating is medium 0 0 IF Tis warm 0 25 AND AT is negative 0 2 THEN heating is medium 0 2 IF Tis warm 0 25 AND AT is zero 0 8 THEN heating is off 0 25 IF Tis warm 0 25 AND AT is positive 0 0 THEN heating is off 0 0 Next to each of the membership labels in the IF part s antecedants the corresponding fuzzy inputs obtained in the fuzzification step are shown in brackets To the right of each rule the resulting firing strength of the rules ar e shown These values can be calculated by using a se t operator like the min operator for the AND operation If more than one rule fires at the same fuzzy output then the rule that is most true will dominate This can b e implemented by taking t
67. nged if necess ary to an unsigned 12 bit format FID User s guide c 1993 97 FDG Systems N Exler Page 76 5 3 6 Implementation of the generated ADSP 21x x source code in your specific application This example FPID DSP explains the implementatio n of the fuzzy ADSP 21xx source code to create a running sample on the EZ LAB board or on your specific targe t hardware Additional code segments must be implemented at the following positions marked by extra lines to make a running example on the EZ LAB board Change the boot page the absolute start address and o r the module name if necessary for your application MODULE BOOT 0 ABS 0 FPID_FLC TR RR ky RR RR RRR KR KKK OK KKK KK RAS ADSP SourcecodesGeneration c 2993 1994 Bamm r Exler ae EDG Systems mb en Created Thu Dec 08 17 04 59 1994 Fuzzy sourcefile FPID FLC generated for ADSP 21xx Serialized TR RR RR KK KR KK KK RK KK KKK KKK KKK RK include lt fuztools lib gt If necessary include other libraries here External calls EXTERNAL scaling_input EXTERNAL FUZZIFY EXTERNAL DEFUZ_WC Declaration of fuzzy variables error e Input VAR PM CIRC e_neg 8 VAR PM CIRC e_ze 8 VAR PM CIRC e_pos 8 VAR DM CIRC f_e 3 sum error se Input VAR PM CIRC se_neg 8 FID User s guide c 1993 97 FDG Systems N Exler Page 77 VAR PM CIRC se
68. nitions are A fuzzy set A in X is a set of ordered pairs A pax xex where u x is the membership function of x in A which maps the collection of objects in the range of definitio n X universe of discourse to the membership space M That means in discrete form for the fuzzy set mediu m before medium 1 68 0 0 1 70 0 5 1 72 1 0 1 74 1 0 1 76 1 0 1 78 1 0 1 80 0 5 1 82 0 0 height 1 50 2 50m and in continous form 0 0 height lt 1 68 m 25 height 14 88 1 68 m lt height lt 1 72 m medium 1 0 1 72m lt height lt 1 78 m 25 height 14 88 1 78 m lt height lt 1 82 m 0 0 height lt 1 82 m Beside the first definition the following definition i s quite common A pg X uA Xt onn u amp xii 1l1 n or A f Ma x x That means in discrete form for the fuzzy set medium A 0 0 1 68 0 5 1 70 1 0 1 72 Further definitions and examples about fuzzy sets can be FID User s guide c 1993 97 FDG Systems N Exler Page 118 found in numerous books and papers describing fuzz y logic see chapter 8 7 2 2 Shape of membership functions The shape of membership functions has an influence on the weighting of the input values in the range o f definition e g A triangular shaped MF has only on e input value where the de gree of membership DOM u is 1 If it is necessary to have a range of input values where the DOM values should be it is necessa
69. ns But these basic operators are just used fo r fuzzy set operations in order to describe the problems in a linguistical form For the actual calculation of fuzz y values the basic operators AND and OR are substitute d by different set operators The most used set operators for fuzzy contro applications are the minimum an d the maximum operator and sometimes the complement operator negation These operators were origionally used by Zadeh an d Mamdani Intersection of 2 fuzzy sets C ANB can be described by the minimum operator u x min u 2 Hp x xeX Union of 2 fuzzy sets C A UB can be described by the maximum operator M x max u x Mpa x x EX Complement of a fuzzy set A lt A can be described by the complement operator My x 1 u0 xeX e g u x 0 5 u g x 0 8 ANB min 0 5 0 8 0 5 AuB max 0 5 0 8 0 8 A Hax 1 wy x 0 5 The binary AND operator and the min operator are very closely related to each other Similarly the binary O R operator and the ma x operator are very closely related to each other The reason for the first relation is that th e result of an AND operation is only 1 if both or all input FID User s guide c 1993 97 FDG Systems N Exler Page 122 values are 1 For the set operator minimum the sam e conclusion can be used The same relation is valid fo r the OR and the maximum operator The three basic fuzzy operations are graphically show n in figure 46 n
70. ns of Fuzzy Control North Holland Amsterdam 1985 Tilli T Fuzzy Logik Grundlagen Anwendungen Hard und Software 1991 M nchen Franzis Verlag FID User s guide c 1993 97 FDG Systems N Exler Page 135 Zadeh L A Fuzzy Sets Information and Control 1965 p 338 Zadeh L A Outline of a new approach to the analysis of complex systems and decision process IEEE Trans Systems Man Cybernet 3 1973 p 28 44 Zimmermann H J Fuzzy Sets Theory and its Applications 2 Ed 1991 Kluwer Academic Publishers FID User s guide c 1993 97 FDG Systems N Exler Page 136 Index ADSP source code extension 17 features 56 fuzzy 54 generation 26 39 implementation 77 KV type 54 Controller design 132 examples 85 94 100 108 fuzzy 39 94 132 Fuzzy PID 65 100 108 PID 39 Defuzzification 58 130 memory model 71 methods 34 58 68 130 File extension 17 Fuzzification 57 58 125 memory model 61 Fuzzy Logic composition 127 crisp set 115 defuzzification 130 fuzzification 125 fuzzy sets 114 116 inference 127 introduction 113 membership function 114 115 operator 121 Fuzzy map 35 Fuzzy resource file extension 17 status 24 Fuzzy sets FID User s guide c 1993 97 FDG Systems N Exler add 28 definition 25 59 introduction 114 shapes 26 116 119 Fuzzy System structure 124 Inference 57 127 MAX MIN 30 128 memory model 66 67 methods 57 58 62 128 operator 30 31 Linguistic vari
71. nt definition Multiple steps with the extension PLH To eradicate the distur bance to the input or output cancel the according check box FID User s guide c 1993 97 FDG Systems N Exler Page 50 4 25 Simulation View This window shows the result of a defined simulation By default the output of the controller plant or close d loop system will be shown By clicking a button on th e tool bar the view will toggle the visibility of the input error output or the actuation The channels correspon d to the following diagram FID PT1 FID User s guide c 1993 97 FDG Systems N Exler Page 51 4 26 Save simulation data Save simulation data Not save z Format Step i MATLAB Time SDF Definition After you have simulated a system you can store before you close the simulation view the simulated data in a file The format can be selected from the combo bo x Format You can choose between two data formats MatLab or a Standard Data Format If Standard Dat a Format is selected then it is possible to press the lt SDF Definition gt button for further settings There are two list boxes with all available data Selec t the data you want to store by selecting them in the no t save list box and moving them into the Save list box by pressing lt gt gt gt gt gt button After pressing the lt Save gt button you will be asked for the filename and after entering a valid path
72. nts and 1 consequent the following methods are used MAX MIN Inference MAX ALG PRO Inference ALG SUM MIN Inference ALG SUM PRO Inference For 3 antecedents and 1 consequent the following methods are used MAX MIN Inference FID User s guide c 1993 97 FDG Systems N Exler Page 57 Sequential mode Direct addressing of antecedents and consequents No restriction on the number of inputs MIN MAX ALG SUM ALG PRO BOU SUM BOU PRO operators for the inference Defuzzification Any number of membership values foreach output Three different kinds of center of gravity methods consequent MFs are represented as singletons consequent MFs are represented as singleton s and areas consequent MFs are represented as rectangula r functions Tuning by scaling factors Scaling factors for all input and output variable s are individual 5 3 Specifications 5 3 1 Fuzzification First of all the input values must be fuzzified in order to assign the input values by certain grades to the fuzz y sets The fuzzification interface is therefore the bridg e between the measured or evaluated crisp values and the compositional rules of inference for fuzzy logic evaluation The fuz zy sets are restricted to triangular and trapezoid shaped membership functions MFs The fuzzification process determines for every input valu e FID User s guide c 1993 97 FDG Systems N Exler Page 58 the membership values MVs of all fuzzy sets belonging to a l
73. o n0 uu ulu Hy ulu u u u Fig 46 Minimum maximum and complement operation The following mathematical characteristics are valid for the min and max operators commutative op U Upg Op Hp Ha associative OP Ha Mp Hc OP OP H a He Mc This two characteristics are mainly important if mor e than two input values are used in a linguistical rule If the min operator is compared to human decisio n making then it can be interpreted as a pessimisti c operator which always takes the smallest value Therefore this operator has no compensation feature Sometimes this feature is desirable but on the other side itis often an undesirable feature e g People compensate some weaknesses in certain areas by their strengths in other areas The max operator is very optimistic an d therefore it is an extremely compensative operator Besides the min and max operator a lot of other operators can be used for the AND and OR operation e g algebraic product algebraic sum drastic product drastic sum FID User s guide c 1993 97 FDG Systems N Exler Page 123 FID User s guide c 1993 97 FDG Systems N Exler Page 124 7 3 Structure of a fuzzy system All fuzzy logic systems use a rule base knowledge base as their central structure Rules typically cast in an IF THEN syntax represent system operation and mapping inputs to outputs Measured and calculate d crisp input values are fuzzified u
74. oprietary and copyright notices or markings contained on the original FID Fuzz y Application Software in readable format That copy become s automatically the property of the owner and is subject to thi s agreement You may physically transfer the program from on e computer to another over a network but the customer may no t install the FID Fuzzy Application Software on a network to be used by more than one workstation at any time 3 The customer may transfer the FID Fuzzy Application Software provided that i this software licence agreement is transferred with the FI D Fuzzy Application Software ii the transferee fully accepts the terms and conditions of this agreement and iii all complete or partial copies of the FID Fuzzy Application Software including copies on data storage devices are als o transferred or destroyed In case of a licence transfer the original disks shall be sen t back to the owner with the full name and address of the ne w customer and all backup disks have to be destroyed The s o named new customer will receive a new licenced version of the FID Fuzzy Application Software Until the delivery of the new version the customer is allowed to use the old licence Afte r receiving the new licence the customer shall recompile al written applications The customer of the software may not sub licence sell lend rent or lease any portion of the FID Fuzz y Application Software 4 The customer may not
75. or the antecedent processing The firing strength of the rule i s the minimum of all antecedents see fig 5 This minimum value is used in consequent processing union of all conclusions MF for the first linguistic variable MF for the second linguistic vari Grade p Input value 1 Input value 2 MIN value of the two grades firing strength of the rule Fig 5 Antecedent processing with two grades In consequent processing the firing strength of the rul e obtained in antecedent processing is compared with th e firing strength of other rules so that a fuzzy output i s obtained for each consequent label In Mamdani s Max Min compositional rule of inference method the fuzz y FID User s guide c 1993 97 FDG Systems N Exler Page 63 output is evaluated by the maximum operator see fig 6 In loop mode the two tasks are not separated They ar e combined via the memo ry model and indirect addressing facility to one iterative task In sequential mode it i s possible to separate the two tasks or to perform the same combined processing strategy as in the loop mode Rules with the same consequence label firing strength firing strength firing strength rule 1 rule 2 rule 3 Oh 100h AOOh MAX operation A00h Fuzzy logic outpu Fig 6 Consequent processing for three values with the same consequent label A simple example with three rules out of a set of rule s should
76. ory field The length of thi s field depends on the type of center of gravity method A variable in data memory for the crisp output value i s FID User s guide c 1993 97 FDG Systems N Exler Page 71 needed The defuzzification needs an I register to point to the fuzzy output field and the corresponding L register to store the length of this field an I register to point at the singleton field singleton and area field or the distance and mean value field aDM variable to store the crisp value Defuzzification first type PM center_du c_NE c_ZE c_PO DM f_du_NE du f_du_ZE DEFUZ f_du_PO FID User s guide c 1993 97 FDG Systems N Exler Page 72 second type DM f_du_NE f_du_ZE f_du_PO third type DM f_du_NE f_du_ZE f_du_PO Defuzzification PM area_center_du a_NE a_ZE a_PO c_NE c_ZE c_PO DEFUZ Defuzzification PM area_center_du P2 Pi P3 P2 P4 P3 pp py 2 p3 py 2 4 P3 2 DEFUZ du Fig 15 Memory models for all kinds of defuzzification FID User s guide c 1993 97 FDG Systems N Exler Page 73 5 3 4 Tuning An easy to use tuning facility for the input and outpu t variables are the scaling factors Their role is to tune the fuzzy controller to obtain the desired dynamic pro
77. package free of viruses we suggest that you chec k the FID Software with a virus scanner if one is available before you start it the first time During the installation the following directories will b e created path FID contains the program and all additional tools needed for running the FID software path FID SAMPLES contains all sample programs FID User s guide c 1993 97 FDG Systems N Exler Page 19 path FID EZ LAB contains all files needed for running the samples on the EZ LAB path FID FUZLIB contains the fuzzy library files The following files should be located in the directories in path FID FID EXE the main program FID HLP the help file README BAT additional information to the program README LAB additonal information for the EZ LAB samples README WIN additional information for the FID Application Software in path FID SAMPLES FIRST FLC FPID FLC IMAGCODE FLC KV1I10 FLC KV2110 FLC SIMTEST FLC FPI_25 FLC FPI_9 FLC STAT_FS FLC STAT_TNC FLC TRUCK FLC TWOP_H FLC TWOP_WH FLC PT2 PLN PT1 PLN PT2S PLN PT2_EX3 PIN PDT2_T PLN PT2 PLZ STOER PLH STOERM PLH TWO PLH PI_EX3 PID PI PID PID PID in path FID EX1 STAT_FS DSP STAT_FS EXE STAT_FS SYS STAT_INF DSP STAT_INF EXE STAT_INF SYM STAT_KI DSP STAT_KI EXE STAT_KI SYM STAT_TNC DSP STAT_TNC EXE STAT_TNC SYM
78. perties of the process control loop So the input and output ar e changed proportionally by these scaling factors The y can also be used for a fine and coarse switching between different dynamic behaviour by using the same FI D elements Input variable tuning The scaling factors are stored in a program memory field with as many locations as the input variable field in data memory The range of the scaling values extend from 0 to 16 The resulting changed input values are stored i n the same input variable fiel d but the format of the values is changed from a signed 12 bit to an unsigned 12 bi t format The memory model is shown below Input variable tuning DM PM DM input_var scale_var input_var e i s_e e de s_de de se s_se se e e e e Fig 16 Memory model for input variable tuning FID User s guide c 1993 97 FDG Systems N Exler Page 74 The input variable tuning needs an I register to point to the data memory field wit h the input values as the corresponding L registe r stores the number of input values an I register to point to the program memory fiel d with the scaling values Output variable tuning The scaling factors for the output variables are store d separately in program memory locations The output variable tuning needs the crisp output values after the defuzzification i n data memory locations single precision for direc t addressi
79. press the lt Add LV gt button and the LingVar Editor will appear To delete select the linguistic variable and press th e lt Delete LV gt button The lower half always shows the membership functions FID User s guide c 1993 97 FDG Systems N Exler Page 25 if there are any of the current selected linguisti c variable Right of the list box you can see and change the properties of the actual highlighted membershi p function There are three different shapes available Pi shape which will always be used when you generate an ADSP source code Gauss shaped and _ cos shape membership functions are also available but only fo r simulation purposes It is not possible to use gauss shaped and cos shaped membership functions in th e ADSP source code because there is no significan t difference in the behaviour of the fuzzy elements Th e four points p1 p2 p3 p4 define the curve completely as follows m Py P gt P3 P4 init order p1 m1 p2 sl p3 m2 p4 s2 To add a new fuzzy set just press the lt Add F S gt button and the Fuzzy Set Name Editor will appear To delete select the Fuzzy Set and press the lt Delete FS gt button FID User s guide c 1993 97 FDG Systems N Exler Page 26 Whenever you press the lt Draw Fuzzy Sets gt button or change the shape of a membership function all membership functions of the current linguistic variabl e will be shown in a Fuzzy Set View
80. r Page 65 Memory model for the inference mechanism in loop mode The same example as for the fuzzification memor y model is used The membership values grades for each input variable are stored in separate data memory fields The output membership values fuzzy logic output ar e also stored in a data memory field The necessar y rulebase for indirect addressing is located in progra m memory and needs one memory location for each IF THEN rule In loop mode an intensive use of the I and L registers is made to get a very short and fast inference processing see fig 8 Rules and inference in loop mode PM Rulebase Mf_du_NE 0 Mf_du_NE 1 Mf_du_NE 1 Af_du_NE 2 DM f_e_NE a fe_PO Rules amp f_du_NE DM Inference f_du_ZE f_du_PO f_de_NE f_de_PO Fig 8 Memory model for the inference mechanism in loop mode The inference process needs a data memory field for each input membershi p value field circular buffers and an I and L register FID User s guide c 1993 97 FDG Systems N Exler Page 66 to point to these fields 1 2 or 3 I s and L s aprogram memory field for all rules and an I register to point to the rulebase a data memory field for the output membershi p values and an I register to point to this field Memory model for the inference mechanism in sequential mode The membership values or antecedents for each inpu t variable ar
81. rt simulation Simulation menu Start Define simulation Simulation menu Definitions Linear Plant definition Plant menu Linear PID controller definition PID menu PID Definition Baa be Save simulation data to disk Simulation menu Save Data Display actuaction Simulation menu Show Actuaction Show error in simulation view Simulation menu Show En Show step in simulation view Simulation menu Show Ste Give Help to a specified object Some information about FID Help menu About FID Print the actual selected View Resource File menu Print Convert fuzzy resource to ADSP source code Convert me FID User s guide c 1993 97 FDG Systems N Exler Page 23 4 2 Fuzzy Resource Status View FID Windows Application FIRST FLC file Fuzzy PID Plant Simulation Convert View Window Help te ARS Sele eee See e l error 256 01 11 2 NE negalive pistaped 1 1 11 PE positive pishaped 1111 de differror 256 0 5 11 2 NDE negative de pishaped 1 1 11 PDE positive de pishaped 1111 du diffoutput 256 02 22 3 NDU negative du pi shaped 1 10 ZDU zero du pishaped 1001 PDU positive du pishaped 0112 IF els NE AND de is NDE THEN du is NDU IF eis PF AND de is NDF THEN duis 7DU IF els NE AND de Is PDE THEN du ls ZDU IF eis PE AND de is PDE THEN duis PDU Center of gravity with singleton discrete_cog 1 1 Shows the state of the fuzzy resource file You can se e
82. ry to us e trapezium shaped MFs Gaub shaped MFs are often used for statistically clustered input values For contro purposes just II shaped MFs are used to map the inpu t values to the fuzzy sets In the example of chapter 7 2 1 just rectangular an d trapezium shaped membership functions MFs hav e been taken into consideration These shapes of MEFs are called IlI shaped Special cases of Il shaped MFs are A shaped or triangular MFs Z shaped and S shape d MFs figure 41 Other shapes for membership functions which are often used are Gau and cos shaped MF s figure 41 and 42 All these MFs can be represente d only by four corner points p p gt P3 p4 and the shape of MF The values betwee n these points can be interpolated very easily For fuzzy outputs a more simpler representation of MFs are often used The used Mfs are singletons of rea membership functions figure 43 which can be described by one or two values The first value is always a crisp value in the output definition range universe o f FID User s guide c 1993 97 FDG Systems N Exler Page 119 discourse and is called c cen ter and the second value is a weighting on that singleton a area The weightin g value a can be understood as the area under the MF describes the influence of a singleton on the crisp output value compared to the other singletons u u Z shape s shape u S shape p pi shape u Fig 40 Different I shaped
83. s guide c 1993 97 FDG Systems N Exler Page 99 6 3 Design of a simple fuzzy PI controller compared to a classical PI controller For this example a plant with two poles in the left half s plane has been chosen The plant has the following values for the time constants T 1s and T 0 5s and a gain of G 1 35 This plant should be controlled by a very simple fuzzy Pl controller and then compared to an optimally designed classical PI controller The control loop has the following structure P a PT2 1 8 1 0 5s Fig 26 Closed loop control structure with a FPI controller The input values of the FPI controller are the error between the reference r and the controlled value y and the change of error The pure fuzzy module FID module then has a PD behaviour If an integrator is used after the defuzzified output with constraints on the upper and lower value it will lead to a PI behaviour The same dynamic behaviour could be attained by using the error and the integral of the error as input values Both input values could be changed by using scaling factors scaling values from 16 to 16 are possible For FID User s guide c 1993 97 FDG Systems N Exler Page 100 this purpose a scaling macro or a scaling subroutine can be used For simulation make sure that the following values and connections are made Sampling time 50ms Connection list fe sep on Paros Source Files FIRST FLC PT2_EX3
84. sing membershi p functions into fuzzy truth values or degrees of membership These are then applied as conditions to the rules contained in the rule base with triggered rule s specifying necessary act ions again as fuzzy truth values These actions are combined and defuzzified into crisp executable system ou tputs Where inputs and outputs are continuous as in control a pplications this fuzzification inference defuzzification process is performed on an ongoing basis at regular sampling intervals Conceptually this process is similar to the use of a Fas t Fourier Transform FFT to transform time domai n signals into the frequency domain to process the resulting frequencies and then to transform the result s back into time domain The added expense of transforming from the time to the frequency domain i s justified because the system model is easier to understand and to manipulate in terms of frequencies Similarly a fuzzy system transforms signals from th e crisp domain to the fuzzy domain makes decision s based on these fuzzy values and a knowledge of the desired system operation cast in fuzzy terms rules and then transforms the resul ts back into the crisp domain for execution figure 47 The justification is as with FID User s guide c 1993 97 FDG Systems N Exler Page 125 frequency domain processing that the system model i s easier to understand and to manipulate in the fuzz y domain than in the crisp
85. sp input space into the fuzzy input space is called fuzzification The two input variables T and AT are called linguistic variables an d each of these variables consist of a few membershi p functions fuzzy terms The membership function s MFs are assigned by the system designer figure 48 and are given labels such as cold warm for T and negative zero positive for AT Each of these labels representa fuzzy set positioned in the operationa domain universe of discourse of possible crisp values In figure 48 the fuzzification process for input values of T 10 C and AT 2 C time unit shown on the x axis The degree of membersh ip is the grade value at the intersection the system input value makes with a membership function FID User s guide c 1993 97 FDG Systems N Exler Page 127 H negative warm zero positive 0 75 0 25 o T 10 40 T C T Citime Fig 48 Fuzzification for two input variables In figure 48 this yields a fuzzy input value for T of 0 75 for MF cold and of 0 25 for MF warm This process is repeated for the change of temperature input yielding 0 2 for MF negative 0 8 for zero and zero for MF positive 7 3 2 Inference and Composition The inference processing rule evaluation is the central part of the knowledge based decision making and i s expressed by linguistical rules Rules are statement s expressing a dependancy relation amo
86. term or condition of this Licence Agreement The customer agrees upon suc h termination to send back at the customers expense to the owner the original disk and documentation and destroy any copies modifications and merged portions in any form This software licence agreement comes under Austrian jurisdictio n and Austrian law is applicable FID User s guide c 1993 97 FDG Systems N Exler Trademarks CompuServe is a registered trademark of CompuServe Inc EZ LAB is a registered trademark of Analog Devices Inc Hewlett Packard Laserjet HP and PCL are registered trademark s of Hewlett Packard Company IBM PC DOS and OS 2 are registered trademarks of Internationa Business Machines Corporation MatLab is a registered trademark of The MathWorks Inc Novell and Netware are registered trademarks of Novell Inc NT is a registered trademark of Norhtern Telecom Limited in th e USA and other countries Windows and MS DOS are trademarks of Microsoft Corporation Other trademarks are the property of their respective holders Printing History Preliminary release 6 94 Reprint Preliminary release 8 94 Final release 1 4 12 94 Electronic release 1 5 2 97 FID User s guide c 1993 97 FDG Systems N Exler Thanks to Paula Goodwin and Assumpta Petit for their patience and help FID User s guide c 1993 97 FDG Systems N Exler 1 Contents PROGRAM LICENSE AGREEMENT LIMITED WARRANT
87. the linguistic variables fuzzy sets rules and the defuzzification method in a short form An empty fuzzy resource file shows the following three lines No linguistic variables defined No rules defined No defuzzification defined If one of the three parts above is missing the appropriate indication will be shown in the Status View FID User s guide c 1993 97 FDG Systems N Exler Page 24 4 3 Fuzzy Resource Editor Fuzzy Resource Editor Linguistic Variables Add L Delete L diff error Resolution 256 Scal Value 0 diff output minValue i maxValue 1 Input Output O Add FS Delete FS Shape of Fuzzy Set pl fa E i pi shaped 4 I p3 ja 1 Draw Fuzzy Sets OK Cancel This dialog window consists of two halves e the upper half shows you the Linguistic Variables the lower half the Fuzzy Sets On the top left of the window a list box shows al 1 linguistic variables already defined Each line has thre e entries the abbreviation the state if it is an input or an output and the name of the linguistic variable If a linguistic variable in the list box is selected th e resolution the scale value and the minimum and maximum of the selected linguistic variable is shown to the right of the list box Whenever a linguistic variable is selected you can change their properties To add a new linguistic variable just
88. thi s manual The serial number of your FID program i s printed on the license agreement When placing a call to FID technical support please have this number available and include it in all mail you send If you wish to receive further information abou t other programs and newer releases fill it out an d send it back to FDG Systems FID User s guide c 1993 97 FDG Systems N Exler Page 16 One FID documentation If this package does not contain all these items pleas e eMail to FDG Systems 2 5 Program extensions used by this program A short description of commonly used file extensions A DEF DLL DSP EXE FLC HLP INI LIB OBJ PID PLH PLN PLT PLZ Subroutine libraries Files which contain internal definitions These files are Dynamic Linked Libraries called by programs running under Windows and contain executable code Files with ADSP source code text file generated by the program Files are executable and can be started either under DOS or Windows Files contain the Fuzzy resources such as linguistic variables rulebase defuzzification Help files for the FID application software Initialization file of the program Library file Object files generated by the ADSP compiler Definition of conventional PID controller Definition of steps used for simulation Plants defined by means of Numerator Denominator representation Plants defined either by Numerator Denominator or Zero Pole means Plants
89. trol applications Then the following simple computation formula can be used Centroid we u x x ae u x where u x is the fuzzy output value and x are the centroids in the universe of discourse of X For the example mentioned in chapter 2 2 the output becomes heating 0 25 0 0 25 50 0 75 100 0 25 0 25 0 75 70 This crisp output value can be used directly to perform a control action or some other data post processing can be performed FID User s guide c 1993 97 FDG Systems N Exler Page 132 7 4 Fuzzy Control 7 4 1 Control structure The standard control loop structure is shown in figur e 52 The ADSP performs all the data pre and post processing and the fuzzy c ontrol on a single processor If itis necessary the fuzzy controller can be combined with classical controllers like PID s to realize mixed contro 1 solutions with a very high performance at low cost ADSP Fuzzy Controller control reference Rulebase action value Data s F D 7 Data output pre u f z D values processing gt E Z i gt pos gt gt Plant i Z i e g FFT i f i 3 processing filtering g y f g measured values 11D Fig 52 Fuzzy controller with 2 inputs 1 output and 9 rules 7 4 2 Design steps of a fuzzy controller e Start with a definition of the problem Normally this is not a mathemat
90. ts and one conclusion FID User s guide c 1993 97 FDG Systems N Exler Page 32 4 9 Rule Definition Expert type Rule Definition IF a is NE AND de is NDE E THEN duis NDU le NE Operator Ling Var s Fuzzy Sets AND Operator OR Operator MIN Max Scale Value Add Cancel With this type of definition you can freely design th e rule But be aware of what you do as the system just follows the rules you define No checks of plausibilit y will be made and so some rules can cause nonsensica results The system of entering the rules is as follows Each Line in the list box shows one condition or conclusion of the rule Every rule must start with an IF part the first line an d must have at least one conclusion If you want to enter a new rule part select the Operator the LingVar the Fuzzy Set and press the lt Add gt button The new part will be added either before the current selected part or at the end of the rule part list To delete a rule part select it and press the lt Delete gt button In the combo boxes for the type of operators you ca n select the appropriate operators for the AND and OR operator for the actual rule The scale value for each rule FID User s guide c 1993 97 FDG Systems N Exler Page 33 has no function at the moment 4 10 Defuzzification Detuzzification z Defuz procedure Yariante Center of gra
91. uld be restricted to PI shaped membership functions fig 17 The 3 fuzzy sets above in combination with the following rulebase and the output fuzzy sets fig 19 describe the linear characteristic in fig 17 The rules only map the fuzzy sets from the input to the output For a negative slope the map of the fuzzy sets is just inverted The rulebase is therefore very simple In fig 18 the rules are shown graphically in a kind of Karnaugh Veitch type diagram Fig 18 Rulebase for a positive slope of the linear characteristic FID User s guide c 1993 97 FDG Systems N Exler Page 87 fork gt 0 if e NEGative then x negative if e ZEro then x zero if e POSitive then x positive fork lt 0 if e NEGative then x positive if e ZEro then x zero if e POSitive then x negative For the loop mode it is necessary to store the Karnaugh Veitch type diagram for the fuzzy rules row by row as followed k gt 0 0000 0001 0002 k lt 0 0002 00015 0000 With this set of rules and the following rectangular membership functions for the output the exact crisp output can be evaluated uu neg Umin 0 Umax Fig 19 Output membership functions neg ze pos with the centroids For the simulation of the fuzzy element on the FID simulation surface it is necessary to define the output fuzzy sets so that the two outermost fuzzy sets are FID User s guide c 1993 97 FDG
92. vity singleton E Defuz for Simulation Eal Output Integration Limit Values lower ja upper moo Choose the method of defuzzification the variant an d the limits ofthe output You have to enter the limits of the output Whenever the values of the output exceed these value it will b e limited to them Additionally you can make an automatic integration of the output and if you want select Defuzzification Variante for Simulation second is not implemented in this Version Available Defuzzification methods are Center of gravity CoG Maximum left ML Maximum right MR an d Mean of Maximum MoM The variants for eac h defuzzification method are Singleton Singleton amp Area and Rectangle FID User s guide c 1993 97 FDG Systems N Exler Page 34 4 11 Fuzzy Map Dialog Fuzzy Map FIRST FLC X Map Points Viewer Input 1 Je x X 80 Input 2 de Y 30 The Fuzzy Map dialog gives you the possibility o f setting the input and output variables the map resolution the View type and the position of the viewpoint to the required values On the left hand sid e you can select one or two variables for the inputs an d one variable for the output in the combo boxes Th e values of the input variables are automatically increased from the minimum up to the maximum value by the number of steps you have defined in the points edi t boxes for the X and Y a
93. want to generate the source code not implemented in thi s version Check the KV Type Conversion box if you only have a Karnaugh Veitch Rulebase The resulting code wil be faster shorter and more efficient than the expert type rulebase conversion For more details see the documentation of the source code If the Include interrupt table check box is checked than a default interrupt table will be included in the source code The default file name for the interrupt table is inthand dsp The radio button for the floating point ADSP 21xx x code generation is grayed and disabled Only ADSP FID User s guide c 1993 97 FDG Systems N Exler Page 54 21xx code generation is possi ble in this software version 4 29 About FID About FID PEER T FID Application Software Fuzzy Development Tool Version 1 4 Copyright 1994 by FDG Systems M Bammer and N Exler Austria Available Memory 22243 KB Free Math Co processor Present Disk space 72192 KB Free Shows you important information about the FID program and the computer FID User s guide c 1993 97 FDG Systems N Exler Page 55 5 Fuzzy Logic on an ADSP 21xx 5 1 Features Up to 12 bit high resolution for input variables an d membership values and up to 16 bit high resolutio n for output variables Fuzzy logic operation in sequential mode or loop mode In loop mode the number of input variables is restricted to a maximum of 3 but with a hierar
94. xis You can choose betwee n three different view types Color Net White for th e fuzzy map by selecting the appropriate type in the View combo box It is possible to change the coordinates of your viewpoint by changing one or more values in the View edit boxe s X Y Z By pressing the lt Default gt button the default values for all edit and combo boxes will be set With the lt OK gt button you can delete the Fuzzy Map dialog and if th e Fuzzy Map View is already shown it will also be deleted When you press the lt Draw Map gt button the rules will be calculated for every point of the grid in the FID User s guide c 1993 97 FDG Systems N Exler Page 35 map This can take a long time so be patient After the 3 dimensional Fuzzy Map has appeared yo u can look at it from any point you want 4 12 Define Inputs NOT used for map Define Inputs NOT used for map Input ij E Range Min Max set to If you have more inputs defined in the fuzzy resource e file than as you use for the map the rest of the inputs can be freely defined That dialog box shows a list of al 1 linguistic input variables Select the one you want t o define as a constant input and enter the value The range must be between the minimum and maximum valu e defined by the Fuzzy Resources By default ever y linguistic variable is set to the mid value between th e minimum and maximum value FID User s guide c 1993 97 FDG Systems N Ex

Download Pdf Manuals

image

Related Search

Related Contents

User Manual - DJO Global  Windows XP Mode とは  Massive Wall light 15028/31/10  Dialogic DM/IP481-2T1-PCI-100BT Network Card User Manual  Wiley Canon EOS Rebel T1i/500D Digital Field Guide  Installation manual  232 kB  LE PRODUIT - Provence Nuisibles  Avena 109/109 DUO    

Copyright © All rights reserved.
Failed to retrieve file