ACEEE Int. J. on Electrical and Power Engineering, Vol. 4, No. 2, Aug 2013 © 2013 ACEEE DOI: 01.IJEPE.4.2. Long Paper 1384 FPGA Optimized Fuzzy Controller Design for Magnetic Ball Levitation using Genetic Algorithms Basil Hamed 1 , Hosam Abu Elreesh 2 Electrical Engineering Department, Islamic University of Gaza, Gaza, Palestine 1 Email: bhamed@iugaza.edu 2 Email: m_hossam@hotmail.com Abstract— This paper presents an optimum approach for designing of fuzzy controller for nonlinear system using FPGA technology with Genetic Algorithms (GA) optimization tool. A magnetic levitation system is considered as a case study and the fuzzy controller is designed to keep a magnetic object suspended in the air counteracting the weight of the object. Fuzzy controller will be implemented using FPGA chip. Genetic Algorithm (GA) is used in this paper as optimization method that optimizes the membership, output gain and inputs gains of the fuzzy controllers. The design will use a high- level programming language HDL for implementing the fuzzy logic controller using the Xfuzzy tools to implement the fuzzy logic controller into HDL code. This paper, advocates a novel approach to implement the fuzzy logic controller for magnetic ball levitation system by using FPGA with GA. Index Terms: — Fuzzy Control, PI, FPGA, Genetic Algorithms Magnetic Levitation Ball, VHDL. I. INTRODUCTION In the recent years Fuzzy controller is used to control complex engineering problems which are difficult to solve by classical methods. Finding many different hardware implementations of fuzzy logic systems (FLSs), general- purpose microprocessors and microcontrollers are mostly used for implementing FLS in hardware, but with the complex systems these devices cannot perform operations assigned to it as required. In recent years many studies emerged illustrate the different ways to implement fuzzy control using FPGA in different application. The advantage of using FPGA is suitable for fast implementation and quick hardware verification. FPGA based systems are flexible and can be reprogrammed unlimited number of times. J.E. Bonilla, V.H. Grisales and M.A. Melgarejo [1]; the fuzzy controller architecture in this paper focused on the treatment of errors and changes in errors with tuning gains. There are many ways of how to use GA in fuzzy control. The most extended GFS type is the genetic fuzzy rule-based system (GFRBS), where an EA is employed to learn or tune different components of an FRBS. The objective of a genetic tuning process is to adapt a given fuzzy rule set such that the resulting FRBS demonstrates better performance [2]. This paper presented the development of an FPGA-based proportional-differential (PD) fuzzy LUT controller. The fuzzy inference used a 256-value LUT. This method was used due to its reduced computation time cost. McKenna and Wilamowski [3] have investigated method to implement fuzzy logic controller (FLC) on a field FPGA and obtained very smooth control surfaces. Vuong et al [4]; described a methodology of implementing FLS using very high speed integrated circuit hardware description language (VHDL). The main advantages of using HDL are rapid prototyping and allowing usage of powerful synthesis tools such as Xilinx ISE, Synopsys, Mentor Graphic, or Cadence to be targeted easily and efficiently. S. Ravi and P. A. Balakrishnan [5] presented Genetic Algorithm based Fuzzy Logic Controller for temperature control in a plastic extrusion is developed and tested through a simulation study. A novel GA based FLC method is implemented to design a practicable advanced controller. Mohanad Alata, Mohammad Molhem and Khaled Al Masri [6] presented a solution of first, second, and third order systems, using the absolute average error as a fitness function, the genetic algorithm manipulate all parameters of the fuzzy controller to find the optimum solution. II. FUZZY CONTROL Fuzzy Control applies fuzzy logic to the control of processes by utilizing different categories, usually ‘error’ and ‘change of error’, for the process state and applying rules to decide a level of output. There are many models of FLC, but the most famous are the Mamdani model, Takagi- Sugeno- Kang (TSK) model and Kosko’s additive model (SAM) [7]. This paper uses Mamdani model. Figure 1: Mamdani Model IF (X is A) and (Y is B) … THEN (Z is C). Where A, and B are membership of the inputs, C is membership of the output as shown in Figure 1. Mamdani model block consist of three stages. Fuzzification: - Fuzzification means converting a crisp value of process variable into a fuzzy set. In order to make it compatible with the fuzzy set representation of 58