University of Moratuwa ADAPTIVE FUZZY SYSTEMS 0 7 2 7 0 2 University of Moratuwa Submitted in part ia l fulf i l lment for the degree of Master of Engineer ing in Electronics and Telecommunications G L P J De Silva June 2000 • 7 2 7 0 2 The work presented in this dissertation has not b e e n submitted for the fulfi l lment of any other degree G L P J D e S i lva Dr. J A K S Jayasingha Mr. B S Samarasiri Candidate Supervisors ACKNOWLEDGEMENT I would like to thank all the academic and Non-academic staff of the Department of Electronic and Telecommunication Engineering, who have advised, spent their valuable time and have helped in various ways in making this project a success. I should specially mention Prof. (Mrs) I.J Dayawansa and Prof. K.K.Y.W Perera who are the Course Co-ordinators of the MEng degree course, Dr. J.A.K.S Jayasinghe and Mr. B.S. Samarasiri the project Supervisors, and Dr. (Mrs) Dileeka Dias the Head of the Department who gave valuable advise and guidance throughout the entire Degree programme and specifically with regard to this project work. It is worth mentioning the support given by Mr. and Mrs. Punchihewa, Mr. Terrance Fernando of the Microwave laboratory, and technical officers attached to the Computer systems laboratory. A B S T R A C T Fuzzy sets offer a possibility to formally describe linguistic expressions. An adaptive fuzzy logic system not only adjusts to time or process phased conditions but also changes the supporting system controls. A real time target tracking system has been selected as a situation where an adaptive fuzzy controller can be implemented. The inputs to the system will be the Error, The rate of change of error and the previous velocity of the platform with respect to the target for elevation as well as for the azimuth. The output will be the velocity required for the platform to track the target. Target tracking systems have been designed in various methods, and in the project I have selected to use an adaptive fuzzy system to simulate the target tracking system. Objectives (a) to design a Matlab interface to study the behaviour of a fuzzy system. The inputs, outputs, term sets and the rules to be specified in the system and to be used subsequently to study the system behaviour. (b) to simulate a target tracking system and to design its controller. (c) to test an adaptive technique on the system and to compare the adaptive system with the normal fuzzy system to decide on the optimum controller. The interface was designed using Matlab version 4.00, and the inputs are the number of inputs and outputs, names of inputs and outputs, term sets and the rules. Separate Matlab .m files were written to implement the controller. Adaptive techniques can be used in the system with modifications to the controller implementation. The number of rules to be used can also be increased by modifying some of the functions. It can be shown that when an adaptive technique is used the target can be tracked with a minimum error. i LIST OF FIGURES Fig. 1 - Block diagram of a target tracking system ... 2 Fig. 2 - Positions of the platform and the target 4 Fig. 3 - Overlapping fuzzy set values 5 Fig. 4 - Correlation minimum encoding 7 Fig 5 Correlation product encoding 8 Fig. 6 - Cetroid defuzzification 8 Fig. 7 - Fuzzy control system as a parallel FAM bank with Centroidal output 9 Fig. 8 - Flow chart showing the function of the program indef.m 11 Fig. 9 - Flow chart showing the function of the program Outdef.m 11 Fig. 10 Input fuzzy set of the variable 'error' 13 Fig. 11 Rule number 1 for the target tracking system ( Graphical user interface) 14 Fig. 12 Data in Rules Out using a Neural network.. 15 Fig. 13 Conventional fuzzy systems 16 Fig. 14 An adaptive fuzzy system 17 Fig. 15 The structure of the neural fuzzy controller. 21 Fig. 16 Expected Error vs time when using a conventional fuzzy controller... 29 Fig. 17 Expected Error vs time when using a adaptive fuzzy controller 29 ii LIST OF TABLES Table 1 - Rules when ek = ZE LIST OF ABBREVIATIONS USED fig. - figure AFAM - Adaptive fuzzy associated memory BIO - Binary input output eg. - for example CONTENTS Abstract i 1 Introduction 1 1.0 Fuzzy systems 1 1.1 Adaptive fuzzy systems 1 1.2 Objective of the project 1 1.3 Target tracking system 2 2 The fuzzy controller 4 2.0 Controller for the target tracking system 4 2.1 Quantising of inputs 5 2.2 Rules for the fuzzy system 5 2.3 FAM rule encoding 7 2.4 Denazification.... 8 3 Simulation of fuzzy controller in software 10 3.0 Introduction of the simulation 10 3.1 Entering input and output variables 10 3.1.1 Matlab programme file ( m file ) indef.m... 10 3.1.2 Matlab programme file ( m file ) outdef.m... 10 3.2 Defining of fuzzy sets for input and output 12 3.3 Design of Rules of the fuzzy system 13 3.4 Feeding values for input variables 14 4 Adaptive fuzzy systems 15 4.0 Introduction 15 4.0.1 Data in Rules Out 15 4.1 Overview of adaptive fuzzy systems 15 4.1.1 Conventional vs adaptive fuzzy system 16 4.1.2 Rule weights : 19 4.1.3 Changing the region : 19 4.2 Adaptive fuzzy associated memory rules ( AFAM rules ) 19 4.2.1 Learning fuzzy rules from scratch 20 4.2.2 Changes in fuzzy sets of a self adaptive neural fuzzy controller 20 4.2.3 The fuzzy error back propagation algorithm. 20 4.2.3.1 Fuzzy error propagation 22 4.2.4 fuzzy systems with neural network s 22 4.2.4.1 Concurrent neural / fuzzy models. 22 4.2.4.2 Corporate Neuro fuzzy models 23 4.2.4.3 Hybrid Neuro-fuzzy models. . 23 4.2.4.3.1 Neuro-fuzzy networks based on sampled fuzzy sets. 23 4.2.4.3.2 Neuro-fuzzy systems using parameterized fuzzy sets stored in "neurons" : 24 4.2.4.3.3. Neuro-fuzzy systems using fuzzy sets as weights : ... 24 5 Matlab implementation and introducing adaptivity 26 5.0 Matlab implementation 26 5.1 Introducing adaptivity to the controller 26 5.1.1 Adaptive FAMS : Product space clustering in FAM cells 26 5.1.2 Adaptive FAM rule Generation 27 5.1.3 The learning algorithm to be used in the target tracking system 28 6 Results and Conclusion 30 7 Scope for future work 31 8 Appendix 32 8.0 Matlab .m file indef.m 32 8.1 Matlab .m file outdef.m 33 8.2 Matlab m file makeset.m 36 8.3 Matlab m file dgrule.m and makerule.m 38 8.4 Matlab m files fitvec.m and outw.m 41 8.5 The function rulebase 42 8.6 The file fitvec.m 43 8.6.1 An example of the use of the file fitvec.m 44 8.7 The Outw2 funtion 46 8.7.1 Example for the use of the outw2.m file 49 8.8 Using the software diskette 52 9 References 53