Anda di halaman 1dari 5

(IJCNS) International Journal of Computer and Network Security, 77

Vol. 1, No. 3, December 2009

Design and VLSI implementation of Fuzzy Logic


Controller
Balwinder Singh 1, Rajneesh Goyal 2, Rakesh Kumar 3 and R.P.P Singh 4

1,3
Centre for Development of Advanced Computing (CDAC), Mohali, India
(A scientific Society of Ministry of Comm. &Information Technology, Govt.of India)
balwinder@cdacmohali.in
2
Electronics and Communication Department,
Jagannath Gupta Institute of Engg. & Technology, Jaipur, India
2
Electronics and Communication Department,
Sri Sai institute of Engineering and technology, Pathankot India

simplifies implementation and reduces hardware costs. [8,


Abstract: Fuzzy systems implemented in hardware can operate 9].
with much higher performance than software implementations on
standard micro controllers. Implementation of a fuzzy logic
controller on an FPGA using VHDL for motor control is presented Conventional Design Fuzzy Design
in this paper. The hardware implementation of fuzzy logic
Understand physical
controller (FLC) on FPGA is very important because of the System and control Understand physical System and
increasing number of fuzzy applications requiring highly parallel Requirement control Requirement
and high speed fuzzy processing. This paper describes the
hardware implementation of two inputs (error and change in
error), one output fuzzy logic controller using VHDL. Develop a linear
model of the plant,
sensor and Actuator
Keywords: Fuzzy Logic Controller, Hardware implementation,
VHDL, Field Programmable Gate Array.

Determine a
simplified controller
1. Introduction from control timer Design the controller Using
Fuzzy Rules

Fuzzy logic is a problem-solving- control system


Develop an algorithm
methodology that lends itself to implementation in systems for controller
ranging from simple, small, embedded micro- controllers to
large, networked, multi-channel PC based data acquisition
and control systems. It can be implemented in hardware,
software, or a combination of both. The hardware/software Simulate, debug and
implementation on traditional processors takes longer implement the design
Simulate, debug and implement
processing time, while hardware implementations by the design
dedicated. Fuzzy processors run faster and exhibit more
compactness. [1] The advantage of the fuzzy logic control is
that we don't need to measure the parameters of the model.
Hence, many complex systems can be controlled without
Figure 1. Comparison of Conventional and Fuzzy Design
knowing the exact mathematical model of the plant.
In section II, we will discuss the some prior work related to
In the conventional based design there are five stages used fuzzy logic controller, section III will give the theoretical
but in fuzzy based design there are three stages used. So concepts of fuzzy logic controllers, the discuss the stepper
design development cycle is reduced and time to market of motors membership functions. Finally in section V will give
fuzzy design system is fast then conventional design shown a discussion on the simulation and synthesis results of the
in figure 1. Faster Fuzzy Logic reduces the design fuzzy controlled stepper motor.
development cycle, simplifies design complexity, improves
time to market and also improves control performance that
78 (IJCNS) International Journal of Computer and Network Security,
Vol. 1, No. 3, December 2009

2. Prior Work Figure 3. Fuzzy Logic Controller


Many researchers studying about Fuzzy Logic Controller,
which described the different type of methods for In this paper, triangular membership function is used. The
fuzzification, rule base, de-fuzzification. Some researchers triangular membership function for error and change of
control the motor using fuzzy logic. S. Singh [4] introduces error with 8-bit center points in the interval [00, FF] and
the position control of a brush less DC servo motor using with 3-bit fuzzy labels NB (negative big), NM (negative
fuzzy logic controller is implemented on an FPGA. In this medium), NS (negative small), ZO (zero), PS (positive
controller monitors and maintain voltage, current and small), PM (positive medium) and PB (positive big) for
torque along with the direction of rotation. Shabiul Islam error and change in error. (Figure 4 a)
[6] has described a Fuzzy Logic Controller (FLC) algorithm
for designing an autonomous mobile robot controller
(MRC). The controller enables the robot to navigate in an
unstructured environment and that avoid any encountered
obstacles without human intervention. In [7], Daijin Kim
proposed a fuzzy logic controller (FLC) on a Reconfigurable
field-programmable gate array (FPGA) system. Mort et al
[15], describes the modeling and control of a high speed
manufacturing machine and the response of the system
using a conventional PI controller is also compared with
that of a fuzzy logic controller. Figure 4(a). MFs for error

3. Fuzzy Logic Controller

The Basic block diagram fuzzy logic controller (figure 2)


consists of three-sub blocks. Fuzzification, Inference
Engine, De-fuzzification. These are sub blocks are explained
in this section with help of detailed figure 3 of FLC

Figure 4(b). MFs for change in error

For an error input signal e, NS and ZO fuzzy subsets are


active and the membership value for the two fuzzy subsets
within that region depend on the point at which the input
line cut the two slopes. (Figure 4 b)
Figure 2. Fuzzy Logic Controller
3.2 Inference Engine
3.1 Fuzzification
The first component in the FLC is the fuzzifier that The degree of membership is determined in the fuzzification
transforms crisp inputs into a set of membership values in stage. The next step is to create rules to decide what action
the interval [0, 1] in the corresponding fuzzy sets. The should be taken in response to the given set of degree of
membership function shapes are typically triangular, membership function. The process of determining the fuzzy
trapezoidal or exponential. output from the input fuzzy sets is called inference
evaluation. The process of inference evaluation is
accomplished by using the knowledge base. As inputs are
received by the system, the rule base is evaluated. There
standard fuzzy operator which can be used to define a rule
are “AND”, “OR” and “NOT”. The “AND” and “OR” fuzzy
operators are best used for rules with multiple antecedents.

MIN-MAX Operator

The antecedent (IF X AND Y) blocks test the inputs and


produce control actions. The consequent (THEN Z) blocks
of some rules are satisfied while others are not. The control
actions are combined to form logical sums. These control
actions feed into the inference process where each output
member function's firing strength (0 to 1) is determined.
The inference mechanism, proposed by Mamdani, uses the
maximum and minimum as basic operators. The MAX-MIN
(IJCNS) International Journal of Computer and Network Security, 79
Vol. 1, No. 3, December 2009

method tests the magnitudes of each rule and selects the 4. Fuzzy Logic Controller For Stepper Motor
highest one. A rule usually takes the form of IF-THEN
statement as follow:
Many applications related to positioning systems are being
IF x is A AND y is B THEN z is C implemented with stepper motors. It has some applications
in Robotics, Computer peripherals, Industrial servo quality
“AND” is a fuzzy operator, which is the minimum operation drivers and so on. One of the main advantages of stepper
between the two antecedents. There is also an implied “OR” motors is the strong relation between electrical pulses and
operation between successive rules when more than one rule rotation discrete angle steps. The application area for fuzzy
is involved with the same output. The linguistic rule, IF (x1 control is really wide, there are many possible controller
is A1 AND y1 is B1) OR (x2 is A2 AND y2 is B2) THEN z structures, some differing significantly from each other by
is C, can be implemented by taking the maximum value of the number of inputs and outputs, or less significantly by the
all the results with the same consequent block.[2] number of input and output fuzzy sets and their membership
functions forms, or by the form of control rules, the type of
inference engine, and the method of defuzzification

In the proposed FLC, total of 3 outputs of the motor which


two of them are 3-bit in size and one of them is 4-bit in size.
The 3-bit output is to control the horizontal and vertical
motor movement and the 4-bit output is tilt motor
movement. Each of the bits represents the degree and the
direction of the rotation. There are total number of 17
movement is designed for the output which each of the
represented by the output bit. If all the output bits are ‘0’, it
represents the home position (Position 1) or the reset
Figure 5. MIN-MAX Evaluator position which indicates the original position of the motor.
The bit and the movement it represents are shown is the
3.3 De fuzzification Table1.
The result for the current rule evaluation is then sent to the
multiplier and the accumulator l (figure 3) of the de Table 1: Direction and Degree of Rotation Each of the
fuizzification block. The accumulator2 adds each of the position of the output is represented by a singleton
results from multiplier. The sum in the accumulator2 will be membership function.
used as the numerator and sum in the accumulator l will be
used as the denominator for the division. The multiplier
multiplies the result of the min-max evaluator by a factor
representing the weighted strength of the ith output
membership function. The factor is obtained from the
linguistic variables of output membership function. The
multiplied result is accumulated in accumulator2. The
multiplication is then repeated for the weight of the second
output and the result is accumulated and so on. The
multiplier part is implemented by using shift and adds
technique, the results are accumulated in accumulator2 and
the results of rule evaluation are summed using accumulator
1.
During the defuzzification process, each fuzzy output is
multiplied by its corresponding singleton position. The sum
of this product is divided by the sum of all fuzzy output to
obtain the result of the final output.

Where wi, is weighted strength of i-th membership function


from rule-base stage and zi is the output membership
function center points. [4]
80 (IJCNS) International Journal of Computer and Network Security,
Vol. 1, No. 3, December 2009

Figure 6. Rule Matrix

weighted average. This is done by multiplying fuzzy output Figure 7. RTL view of FLC
obtained from the rules evaluation with its corresponding
singleton value, then sum of this value is divided by the sum Table 3: Comparison output between PID [4] and Fuzzy
of all fuzzy output obtained from the rules evaluation. The Logic Controller
result from this calculation is the final single output, which
can be used to control the motor movements.
Parameter PID Fuzzy
Controller Logic
5. Simulation and Synthesis Result Controller
Rise Time(Tr) 415.38ms 400.00ms
The design of fuzzy logic controller is implemented using Settling Time 538.46ms 100ms
VHDL. Synthesis process has performed using Xilinx tools (Ts)
[14] for synthesizing the compiled VHDL design codes into %Overshoot 0% 16.0%
gate level schematics. The VHDL codes are synthesized for
converting into RTL view of the FLC architecture as shown
in figure 7. The Technology mapping has chosen in this
project from Spartan 3E(xc3s1600) with FG484 package
and a speed grade of -4. The synthesized schematic is also
simulated to ensure the synthesized design functions. The
simulation results for the fuzzy controlled stepper motor are
shown in Figure 8.

Table2: Device utilization summary

1610 out of
Number of Slices 83%
1920
Number of Slice Flip 1416 out of
36%
Flops 3840
Number of 4 input 1826 out of
47%
LUTs 3840
Number of bonded 81 out of
46%
IOBs 173
Number of 6 out of
50%
MULT18X18s 12
1 out of
Number of GCLKs 12%
8
Minimum period: 16.476ns Figure 8. Simulation results of Fuzzy Logic Controller
Maximum Frequency: 60.694MHz
Total memory usage is 516524 kilobytes
(IJCNS) International Journal of Computer and Network Security, 81
Vol. 1, No. 3, December 2009

6. Conclusion [11] M. McKenna and B. M.Wilamowski, "Implementing a


Fuzzy System on a Field Programmable Gate Array", in
This paper presents an approach for the implementation of a Proc. Internat. Joint Conf. Neural Networks,
fuzzy logic controller for Stepper motor on an FPGA using Washington, DC, USA, pp. 189—194, 2001.
VHDL. This paper presents the implementation of a fuzzy [12] T. Hollstein, S.K. Halgamuge and M. Glesner:
logic controller for a Stepper motor on a Xilinx Sparten III "Computer-Aided Design of Fuzzy Systems Based on
FPGA using VHDL. The implementation of the fuzzy logic Generic VHDL Specifications", IEEE Trans. on Fuzzy
controller is very straightforward by coding each component Systems, vol. 4, no. 4, pp.403417, Nov. 1996.
of the fuzzy inference system in VHDL according to the [13] J. Bhasker, VHDL Primer, Addison Wesley Longman
design specifications. The design of the FLC is highly Singapore Pvt Ltd, third edition.
flexible as the membership functions and rule base can be [14] Xilinx ISE 9.2i Software Manuals
easily changed. By simply changing some parameters in the www.xilinx.com/itp/xilinx92/books/manuals.pdf
codes and design constraint on the specific synthesis tool, [15] Mort, N. Abbod, M.F. Linkens, D.A. “Comparative
one can experiment with different design circuitry to get the study of fuzzy DC servo motors and stepper motors for
best result in order to satisfy the system requirement. The mechatronic systems”, IEEE Colloquium on
FLC can also be used for control purposes in other Innovations in Manufacturing Control Through
applications. Mechatronics, pages 6/1-6/5, 1995

References

[1] Oscar Montiel, Roberto Sep´ulveda, Patricia Melin,


Oscar Castillo, Miguel A. Porta, Iliana Marlene
Meza, “Performance of a Simple Tuned Fuzzy
Controller and a PID Controller on a DC motor” In
Proceedings of the IEEE Symposium on Foundations of
Computational Intelligence, pp 531 - 537, 2007
[2] S.P. Joy Vasantha Rani, P. Kanagasabapathy and A.
Sathish Kumar, “Digital Fuzzy Logic Controller using
VHDL”, In Proceedings of the IEEE Indicon
Conference, Chennai pp 463- 466,2005.
[3] PhilipT. Vuong, Asad M. Madni and Jim B. voung.
“VHDL Implementation for a Fuzzy Logic Controller” ,
BEITechnologies,Inc. 2005
[4] Sameep Singh and Kuldip S. Rattan “Implementation
of a Fuzzy Logic Controller on an FPGA using VHDL”,
IEEE. (2003)
[5] Bohdan Butkiewicz “About Robustness of Fuzzy Logic
PD and PID Controller under Changes of Reasoning
Methods” , Institute of Electronic Systems, Warsaw
University of Technology , 2002
[6] Md. Shabiul Islam, Md. Anwarul Azim, Md. Saukat
Jahan, Masuri Othman, “Design and Synthesis of
Mobile Robot Controller” using Fuzzy” , IEEE
International Conference on Semiconductor Electronics
(ICSE 2006), vol.2 Proc., Kuala Lumpur, Malaysia,pp
825-829, 2006
[7] Daijin Kim, “An Implementation of Fuzzy Logic
Controller on the Reconfigurable FPGA System”, IEEE
transactions on industrial electronics, vol. 47, no. 3,
june 2000
[8] A.M.Ibrahim, "Fuzzy logic for Embedded Systems and
Applications", Elsevier Science, 2004
[9] Zadeh L. A. “Fuzzy algorithms”, Information and
Control Volume 12, Issue 2, February 1968, Pages 94-
102
[10] L. A. Zadeh, “The concept of a linguistic variable and
its applications to approximate reasoning – I”,
Information Sciences, vol. 8, pp. 199-249, 1975.

Anda mungkin juga menyukai