The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.

International Journal of Emerging Technology and Advanced Engineering Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 8, August 2012)

Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by , 2017-04-16 22:00:05

Design and implementation of Fuzzy logic controller for a ...

International Journal of Emerging Technology and Advanced Engineering Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 8, August 2012)

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

1Salma Khan, 2Prof. Uma Kulkarni

1Department of Electronics and Communication Engineering, VTU University
2KLE’s College of Engineering and Technology, Belgaum-590008, Karnataka

[email protected]
[email protected]

Abstract—Design of a Fuzzy Logic Controller (FLC) requires The performance of these methods depends on accuracy
more design decisions than usual, for example rule base, of system models and parameters. The fuzzy logic, unlike
inference engine, defuzzification, and data pre- and post conventional logic system, is able to model inaccurate or
processing. This project is a humble effort to implement an imprecise models. Hence FLC is chosen for speed control
FLC using VHDL for motor control. There are three parts to of DC Motor to facilitate an efficient implementation of the
fuzzy controller, the fuzzification of the inputs, the controller.
defuzzification of the outputs, and the rule base. The
controller that is implemented here demonstrates a 1-input, 1- The main objective of this paper is to design and
output fuzzy controller with 7-membership functions. Here a implement a Fuzzy Logic controller on FPGA. The whole
VHDL-based design and synthesis approach is used for paper is divided into two parts, speed sensing and speed
designing which has considerably reduced the design time. A controlling. Here speed controlling is done using Fuzzy
complete description of the controller A fuzzier, defuzzifier Logic Controller. Fuzzy Logic controllers are widely used
and a rule base are written in VHDL and are logically in automation control systems. A FLC is the most
integrated which is further synthesized using logic synthesis commonly used feedback controller and offers a good
tool XILINX ISE9.2i software. The efficiency of the solution to many practical control problems in small as well
implementation is verified using FPGA. as large distributed systems. The FLC controller compares
In this paper, the concept of Fuzzy Logic is used to control the the measured process value with a reference set-point value
speed of a simple DC motor. The hardware descriptive (no-load value). The difference is then processed to
language used for the purpose of design of the Fuzzy Logic calculate a new process input, which will try to adjust the
Controller is VHSIC Hardware Descriptive Language measured process value back to the desired set-point. In
(VHDL) and is implemented on SPARTAN-3 FPGA this project we have designed FLC controller based on
hardware. This method of speed control of a dc motor may Sugeno model and output of the FLC is then applied to the
represent an ideal application for introducing the concepts of Pulse Width Modulator (PWM). PWM in turn drives the
fuzzy logic. Here a sincere effort is made to show, how a fuzzy motor.
controller can be used to control the motor speed, which
represents a very practical class of engineering problems. II. STRUCTURE OF FUZZY LOGIC CONTROLLER
Keywords -Fuzzy logic, fuzzification, rule base, defuzzification,
VHDL, Spartan3 FPGA, DC motor. The fuzzy controller has four main components [5]:
 First, Fuzzification, which modifies crisp inputs
I. INTRODUCTION (input values from real world) into linguistic
DC motors are used in applications such as steel rollick variables.
trains, robotic manipulators that require speed controllers to  Second, the Rule base where fuzzy inputs are
perform tasks. Major problems in applying a conventional compared and based on the membership functions
control algorithm in a speed controller are the effects of a of each input.
non-linearity in a DC motor. The non-linear characteristics  Third, Inference mechanism which evaluates which
like friction and saturation, degrades the performance of control rules are relevant at the current time and
conventional controllers. then decides what the input to the system should
be.

372

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 crisp values of input variables are mapped to the
the fuzzy outputs of the Rule-base to crisp ones. membership functions in a fuzzy plane thus relating each
input variable to a fuzzy set. The universe of discourse of
The components are as shown below [1]: 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
Fig 1: Fuzzy logic components weightings to weighted average method of defuzzification.

III. FPGA BASED FUZZY LOGIC CONTROLLER Each input variable can take seven linguistic variables.
The main reason for using Fuzzy logic for speed control Since here only one input is taken into consideration, there
of DC motor is the flexibility offered by it. The backbone arises only seven rules (=1x7) [3]. The rules have fuzzy
of fuzzy logic controller is embodied in a set of rules with rule structure and uses linguistic variables in both
two aspects [2]: antecedent and consequent. The rules are specified in IF-
THEN manner. The general form of any fuzzy rule is:
 Control strategy must be defined as a set of rules and
not as a set of mathematical equations. R: IF x is A, THEN y is B
The type of Fuzzy logic model used in this paper is the
 Rules deal with an imprecise definition of the Sugeno model. The Sugeno fuzzy model or the Takagi-
system. Sugeno-Kang method of fuzzy inference was first
Standard control techniques use numerical data to relate introduced in 1985. The output membership functions for
input and output signals. Fuzzy logic systems can use both the Sugeno method are always linear or constant. The
numerical information and linguistic information to output membership functions can be thought of as singleton
perform a mapping of an input to an output space. spikes that undergo a simple aggregation. The singleton
The following section describes the development of FLC output spikes can move around in a linear fashion in the
for speed control of DC motor. The universe of discourse output space depending on what the input is. This makes
of input variable is partitioned into seven fuzzy sets or the system notation very compact and efficient. Higher
linguistic variables (very low (VL), low (L), medium low order Sugeno fuzzy models are possible, but they introduce
(ML), medium (M), medium high (MH), high (H), very significant complexity.
high (VH)) as shown in Fig 2. The different types of A Sugeno rule operates as shown in Fig 3.
membership functions that can be used are Γ-function, L-
function and Λ-function which are commonly used and Fig 3: Implementation of Sugeno model
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 2: Membership function of input variable 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
controller’s 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

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 The counts are given to the fuzzy logic which is
technique for systems involving hardware implementation. implemented on the FPGA. The number of counts detected
Due to the fact that the output membership functions are lie in a set of range, such as, Very Low (0-20 counts), Low
symmetrical in nature, the mean of the fuzzy sets are used (20-40 counts) and so on. The rule base in the fuzzy logic
as weightings for the defuzzification process. In this determines what action should be performed. If the applied
technique several multiply operations are required and only load (strain) is increased, the speed decreases thus
one division process. Rule base decides the functionality of decreasing the counts at the IR sensor.
the system and the rules are basically formulated on some
human understanding of the system [6]. 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.

Fig 4: Block diagram showing internal organization of Fuzzy Logic V. SIMULATION RESULTS
Controller
The Fig 6 shows the speed-load characteristics obtained
IV. INTERFACING OF DC MOTOR TO FLC by the Fuzzy Logic controller for the DC motor. Ideally,
Consider the interfacing of the DC motor and the Fuzzy the speed is expected to maintain its speed with increase in
Logic Controller implemented on the FPGA. The block load. In reality, as the load is increased, the speed tries to
diagram is as shown in figure below; 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 Fig 7: Waveforms of the implemented Fuzzy Logic with PWM
interfaced to motor Module

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

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 Fig 6: Experimental setup showing interface between the motor
And FPGA

In this section, an experiment is set up to demonstrate the

performance of the Fuzzy Logic Controller. Configuration VII. CONCLUSION

is a process by which the bit streams of the design, as Fuzzy logic can be used for the implementation of both
generated by the software are loaded into the internal Mamdani and Takagi-sugeno Fuzzy systems using both
configuration memory of the FPGA [2]. The performance triangular and trapezoidal membership functions. In this
of the controller design on Hardware is verified by paper Fuzzy Logic uses Takagi-Sugeno modelling to
downloading the VHDL code (bit file) into the target implement speed control of the DC motor.
FPGA device (Spartan 3 family X3CS200). The
experimental setup consists of a DC motor, FPGA kit, a Here fuzzy logic is implemented for speed control of DC
driver circuitry to drive the motor. The specifications of the motor on an FPGA using VHDL. The implementation of
DC motor used are as given in table 1 below. the fuzzy logic controller is done by coding each
component of the fuzzy inference system in VHDL

TYPE DC gear motor according to the design specifications. The implementation
VOLTAGE 12V of the fuzzy logic controller is successfully used to control
CURRENT 3.6A the speed of a simple DC motor. The design of the FLC is
TORQUE 172mN.m highly flexible as the membership functions and rule base
SPEED 1000rpm can be easily changed. The FLC can also be used for
control purposes in other control applications.

Table 1: Parameters of DC Motor The future scope may involve implementation of FLC on
system on chip (SOC).

The controller is tested for different speed, tracking REFERENCES
performance of the motor both on load and no-load
conditions with a given speed. The motor load is generated u [1]. Davi Nunes Oliveria, Arthur Plinio de Souza Braga and Otacilio da Mota
by applying some amount of tension or strain on the motor Almeida,”Fuzzy Logic Controller implementation on a FPGA using
rotation. This procedure is equivalent to applying friction
load to the motor. The motor speed is detected by using an VHDL”,IEEE, 2010.
IR sensor at the input and fed back to the controllebr to
maintain the motor speed. [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”,
The results show that Fuzzy Logic Controller can
efficiently control and maintain the speed of the DC motor. International Journal of Engineering Science and Technology, Vol. 2(9), 2010,
It also shows that the FLC can work efficiently under no-
load and load conditions. 4511-4519.
[3]. Waleed Abd El-Meged El-badry, “Design and implementation of Real Time
The hardware setup of the interface between the motor
and the FPGA is as shown in Fig 6. 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.

375


Click to View FlipBook Version