Fuzzy Logic Controller
Fuzzy Logic Controller
Department of Electronics and Communication Engineering, VTU University KLEs College of Engineering and Technology, Belgaum-590008, Karnataka
2 1 [email protected] [email protected]
AbstractDesign of a Fuzzy Logic Controller (FLC) requires more design decisions than usual, for example rule base, inference engine, defuzzification, and data pre- and post processing. This project is a humble effort to implement an FLC using VHDL for motor control. There are three parts to fuzzy controller, the fuzzification of the inputs, the defuzzification of the outputs, and the rule base. The controller that is implemented here demonstrates a 1-input, 1output fuzzy controller with 7-membership functions. Here a VHDL-based design and synthesis approach is used for designing which has considerably reduced the design time. A complete description of the controller A fuzzier, defuzzifier and a rule base are written in VHDL and are logically integrated which is further synthesized using logic synthesis tool XILINX ISE9.2i software. The efficiency of the implementation is verified using FPGA. In this paper, the concept of Fuzzy Logic is used to control the speed of a simple DC motor. The hardware descriptive language used for the purpose of design of the Fuzzy Logic Controller is VHSIC Hardware Descriptive Language (VHDL) and is implemented on SPARTAN-3 FPGA hardware. This method of speed control of a dc motor may represent an ideal application for introducing the concepts of fuzzy logic. Here a sincere effort is made to show, how a fuzzy controller can be used to control the motor speed, which represents a very practical class of engineering problems. Keywords -Fuzzy logic, fuzzification, rule base, defuzzification, VHDL, Spartan3 FPGA, DC motor.
The performance of these methods depends on accuracy of system models and parameters. The fuzzy logic, unlike conventional logic system, is able to model inaccurate or imprecise models. Hence FLC is chosen for speed control of DC Motor to facilitate an efficient implementation of the controller. The main objective of this paper is to design and implement a Fuzzy Logic controller on FPGA. The whole paper is divided into two parts, speed sensing and speed controlling. Here speed controlling is done using Fuzzy Logic Controller. Fuzzy Logic controllers are widely used in automation control systems. A FLC is the most commonly used feedback controller and offers a good solution to many practical control problems in small as well as large distributed systems. The FLC controller compares the measured process value with a reference set-point value (no-load value). The difference is then processed to calculate a new process input, which will try to adjust the measured process value back to the desired set-point. In this project we have designed FLC controller based on Sugeno model and output of the FLC is then applied to the Pulse Width Modulator (PWM). PWM in turn drives the motor. II. STRUCTURE OF FUZZY LOGIC CONTROLLER
I. INTRODUCTION DC motors are used in applications such as steel rollick trains, robotic manipulators that require speed controllers to perform tasks. Major problems in applying a conventional control algorithm in a speed controller are the effects of a non-linearity in a DC motor. The non-linear characteristics like friction and saturation, degrades the performance of conventional controllers. 372
The fuzzy controller has four main components [5]: First, Fuzzification, which modifies crisp inputs (input values from real world) into linguistic variables. Second, the Rule base where fuzzy inputs are compared and based on the membership functions of each input. Third, Inference mechanism which evaluates which control rules are relevant at the current time and then decides what the input to the system should be.
III. FPGA BASED FUZZY LOGIC CONTROLLER The main reason for using Fuzzy logic for speed control of DC motor is the flexibility offered by it. The backbone of fuzzy logic controller is embodied in a set of rules with two aspects [2]: Control strategy must be defined as a set of rules and not as a set of mathematical equations. Rules deal with an imprecise definition of the system. Standard control techniques use numerical data to relate input and output signals. Fuzzy logic systems can use both numerical information and linguistic information to perform a mapping of an input to an output space. The following section describes the development of FLC for speed control of DC motor. The universe of discourse of input variable is partitioned into seven fuzzy sets or linguistic variables (very low (VL), low (L), medium low (ML), medium (M), medium high (MH), high (H), very high (VH)) as shown in Fig 2. The different types of membership functions that can be used are -function, Lfunction and -function which are commonly used and some of them such are Gaussian and S-functions are rarely used. Here only L-function and -function is used to represent the input.
Fig 3: Implementation of Sugeno model A typical rule in a Sugeno fuzzy model has the form, If input 1 = x then Output is z = ax + c For a zero-order Sugeno model, the output level z is a constant (a=0). The output is always a single number. The block diagram in Fig 4 provides an overview of controllers internal structure. An input variable is fuzzified to generate the corresponding linguistic value and membership function. The defuzzification technique is chosen depending on the type of implementation stage. Here a weighted average 373
IV. INTERFACING OF DC MOTOR TO FLC Consider the interfacing of the DC motor and the Fuzzy Logic Controller implemented on the FPGA. The block diagram is as shown in figure below;
The Fig 6 shows the speed-load characteristics obtained by the Fuzzy Logic controller for the DC motor. Ideally, the speed is expected to maintain its speed with increase in load. In reality, as the load is increased, the speed tries to maintain its speed but more current is consumed which leads to heating up of the motor and if further the speed is tried to maintain, leads to deterioration of the motor.
Fig 5 explains the working principle of Fuzzy Logic Controller interfaced to motor. The motor speed is checked at no-load condition. The speed of the motor is detected by an IR sensor which is mounted on the DC motor. The sensor senses revolution of the motor at each rising pulse of the clock of the FPGA. The number of counts detected determines the number of revolutions taken by the motor. 374
CONCLUSION
Fuzzy logic can be used for the implementation of both Mamdani and Takagi-sugeno Fuzzy systems using both triangular and trapezoidal membership functions. In this paper Fuzzy Logic uses Takagi-Sugeno modelling to implement speed control of the DC motor. Here fuzzy logic is implemented for speed control of DC motor on an FPGA using VHDL. The implementation of the fuzzy logic controller is done by coding each component of the fuzzy inference system in VHDL according to the design specifications. The implementation of the fuzzy logic controller is successfully used to control the speed of a simple DC motor. The design of the FLC is highly flexible as the membership functions and rule base can be easily changed. The FLC can also be used for control purposes in other control applications. The future scope may involve implementation of FLC on system on chip (SOC). REFERENCES
u [1]. Davi Nunes Oliveria, Arthur Plinio de Souza Braga and Otacilio da Mota Almeida,Fuzzy Logic Controller implementation on a FPGA using VHDL,IEEE, 2010. [2]. G.Sakthivel, T.S.Anandhi, S.P.Natarajan, Real time implementation of a Fuzzy Logic Controller on FPGA using VHDL for DC motor speed control, International Journal of Engineering Science and Technology, Vol. 2(9), 2010, 4511-4519. [3]. Waleed Abd El-Meged El-badry, Design and implementation of Real Time DC motor speed control using Fuzzy logic. [4]. Nasri Sulaiman, Zeyad Assi Obaid, M.H.Marhaban and M.N.Hamidon, FPGA-Based Fuzzy Logic: Design and applications-a Review, IACSIT International Journal of Engineering and Technology Vol.1,No.5, December,2009, ISSN: 1793-8236. [5]. Sham Sagaria a/l Marisinapen, Fuzzy logic design using VHDL on FPGA. [6]. Hao Ying, Analytical structure of the typical fuzzy controllers employing trapezoidal input fuzzy sets and nonlinear control rules, Information science 116 (1999) 177-203.
The controller is tested for different speed, tracking performance of the motor both on load and no-load conditions with a given speed. The motor load is generated by applying some amount of tension or strain on the motor rotation. This procedure is equivalent to applying friction load to the motor. The motor speed is detected by using an IR sensor at the input and fed back to the controller to b maintain the motor speed. The results show that Fuzzy Logic Controller can efficiently control and maintain the speed of the DC motor. It also shows that the FLC can work efficiently under noload and load conditions. The hardware setup of the interface between the motor and the FPGA is as shown in Fig 6.
375