Вы находитесь на странице: 1из 4

International Journal of Emerging Technology and Advanced Engineering

Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 8, August 2012)

Design and implementation of Fuzzy logic controller for a DC motor


1
1 2

Salma Khan, 2Prof. Uma Kulkarni

Department of Electronics and Communication Engineering, VTU University KLEs College of Engineering and Technology, Belgaum-590008, Karnataka
2 1 smkh178@gmail.com inkl_2000@yahoo.com

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.

International Journal of Emerging Technology and Advanced Engineering


Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 8, August 2012) Lastly, Defuzzification Interface that converts back the fuzzy outputs of the Rule-base to crisp ones. The components are as shown below [1]: . The crisp values of input variables are mapped to the membership functions in a fuzzy plane thus relating each input variable to a fuzzy set. The universe of discourse of output variable divided intentionally into seven symmetrical values so that it simplifies the defuzzification process. o1 to o7 are mean of each function and act as weightings to weighted average method of defuzzification. Each input variable can take seven linguistic variables. Since here only one input is taken into consideration, there arises only seven rules (=1x7) [3]. The rules have fuzzy rule structure and uses linguistic variables in both antecedent and consequent. The rules are specified in IFTHEN manner. The general form of any fuzzy rule is: R: IF x is A, THEN y is B The type of Fuzzy logic model used in this paper is the Sugeno model. The Sugeno fuzzy model or the TakagiSugeno-Kang method of fuzzy inference was first introduced in 1985. The output membership functions for the Sugeno method are always linear or constant. The output membership functions can be thought of as singleton spikes that undergo a simple aggregation. The singleton output spikes can move around in a linear fashion in the output space depending on what the input is. This makes the system notation very compact and efficient. Higher order Sugeno fuzzy models are possible, but they introduce significant complexity. A Sugeno rule operates as shown in Fig 3.

Fig 1: Fuzzy logic components

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

Fig 2: Membership function of input variable

International Journal of Emerging Technology and Advanced Engineering


Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 8, August 2012) method is used since it can be viewed to be an appropriate technique for systems involving hardware implementation. Due to the fact that the output membership functions are symmetrical in nature, the mean of the fuzzy sets are used as weightings for the defuzzification process. In this technique several multiply operations are required and only one division process. Rule base decides the functionality of the system and the rules are basically formulated on some human understanding of the system [6]. The counts are given to the fuzzy logic which is implemented on the FPGA. The number of counts detected lie in a set of range, such as, Very Low (0-20 counts), Low (20-40 counts) and so on. The rule base in the fuzzy logic determines what action should be performed. If the applied load (strain) is increased, the speed decreases thus decreasing the counts at the IR sensor. The counts are in turn interfaced to a Pulse Width Modulated code. As the number of counts increases the pulse width increases and vice versa. This pulse is applied at the enable pin of the driver IC. This drives the motor. The current speed of the motor is compared with no-load speed. The difference between the current speed of the motor and the no-load speed is processed by the Fuzzy Logic controller and appropriate speed is obtained. V. SIMULATION RESULTS

Fig 4: Block diagram showing internal organization of Fuzzy Logic Controller

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 6: Speed-Load Characteristics of the DC Motor obtained by implemented FLC Approach

Fig 5: Block diagram explaining working principle of FLC interfaced to 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

Fig 7: Waveforms of the implemented Fuzzy Logic with PWM Module

International Journal of Emerging Technology and Advanced Engineering


Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 8, August 2012) Fig 7 shows the simulation results of the Fuzzy logic with the PWM module implemented on the SPARTAN 3 FPGA. When the clock goes high, the counter increments and when the counter reaches the maximum value, it comes down to zero. The pulses generated by the PWM are used to enable the driver circuitry. The driver then supplies voltage required to drive the motor. As the number of counts increases the pulse width increases. This pulse is applied at the enable pin of the driver IC. This drives the motor at the required speed. The current speed of the motor is compared with no-load speed. The difference between the current speed of the motor and the no-load speed is processed by the Fuzzy Logic controller and appropriate speed is obtained. VI. EXPERIMENTAL SETUP In this section, an experiment is set up to demonstrate the performance of the Fuzzy Logic Controller. Configuration is a process by which the bit streams of the design, as generated by the software are loaded into the internal configuration memory of the FPGA [2]. The performance of the controller design on Hardware is verified by downloading the VHDL code (bit file) into the target FPGA device (Spartan 3 family X3CS200). The experimental setup consists of a DC motor, FPGA kit, a driver circuitry to drive the motor. The specifications of the DC motor used are as given in table 1 below. TYPE VOLTAGE CURRENT TORQUE SPEED DC gear motor 12V 3.6A 172mN.m 1000rpm
Table 1: Parameters of DC Motor Fig 6: Experimental setup showing interface between the motor And FPGA VII.

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

Вам также может понравиться