Implementation of Fuzzy Logic Controller Using VHDL – A Review

advertisement
International Journal of Engineering Trends and Technology (IJETT) – Volume 24 Number 1- June 2015
Implementation of Fuzzy Logic Controller Using
VHDL – A Review
Virendra K. Verma#1, sarika sapre#2
#
EC Dept., SIMS Indore, India
#
SIMS Indore, India
*
SIMS Indore, India
Abstract-This paper deals with the literary introduction and
comparative study of fuzzy logic controller (FLC). In this
paper initiates with the introduction to fuzzy logic controller
and moving towards its comparison to conventional and
modernized implemented FLC. The FLC can be
implemented by using Very high speed integrated circuits
Hardware Description Language (VHDL) code. VHDL has
been used to develop simple FLC on FPGA. The controller
algorithm can be developed synthesized, simulated and
implemented on FPGA Spartan 2E xcv300-6bg432. In recent
years, the interest in implementing fuzzy logic controllers
using FPGA and ASIC technologies has been steadily
increasing. There have been attempts to combine VHDL for
design capture and VHDL-based logic synthesis for
designing complex hardware. The advantage of using this
high- level approach is that, the design time is reduced
significantly and different ways of designing a rule base can
be explored.
Keywords-VHDL (Very High Speed Integrated Circuits
Hardware Description Language), FLC, FPGA, Spartan,
ASIC
I.INTRODUCTION
Fuzzy logic refers to a logical system that generalizes
the classical two-value logic for reasoning under
uncertainty. It is a system of computing and
approximate reasoning based on a collection of
theories and technologies that employ fuzzy sets,
which are classes of objects without sharp boundaries.
More specifically, fuzzy logic generalizes the crisp
true-and- false (or black-and white) concept
fundamental to classical logic to a matter of degree.
The two key features of fuzzy logic include: (a) A
mathematical formalism for representing human
knowledge involving vague concepts, and (b) a natural
but effective mechanism for systematically
formulating cost-effective solutions to complex
problems characterized by uncertainty or imprecise
information.The fuzzifier and defuzzifier components
of the fuzzy system are described using VHDL code
as it involves considerable amount of mathematical
computations.There are three parts to a fuzzy
controller, the fuzzification of the inputs, the
defuzzification of the outputs, and the rule-base.
ISSN: 2231-5381
A. Characteristics of Fuzzy Logic
Fuzzy dedicated circuits are characterized by[18] :
The number of inputs and outputs.
The number and shapes of membership functions
Inference
techniques
including
operators,
consequences, and size of the premises.
Defuzzification method. The number of fuzzy logic
inferences per second,
FLIPS.· Physical size.
Power consumption.
Software available to support the design
II. BENEFITS OF FUZZY CONTROLLERS
The benefits of fuzzy controllers could be summarized
as follows:
1. Validation, consistency, redundancy and
completeness can be checked in rule base (knowledge
acquisition supervision) that could speed up
automated learning and improve user interpretability.
2. Fuzzy controllers are more robust than PID
controllers because they can cover a much wider range
of operating conditions than PID can, and can operate
with noise and disturbances of different nature.
3. Developing a fuzzy controller is cheaper than
developing a model-based or other controller.
4. Fuzzy controllers are customizable, since it is easier
to understand and modify their rule, which not only
use a human operator's strategy, but also are expressed
in natural linguistic terms.
5. It is easy to learn how fuzzy controllers operate and
how to design and apply them to a concrete
application. It is also worth to notice that fuzzy logic
can be blended with conventional control techniques.
This means that fuzzy system does not necessarily
replace conventional control methods. In many cases
fuzzy systems augment them and simplify their
implementation [8], [7].
http://www.ijettjournal.org
Page 21
International Journal of Engineering Trends and Technology (IJETT) – Volume 24 Number 1- June 2015
III.SOFTWARE SELECTION
studied since the 1920s as infinite valued logicnotably
byJan lukasiewicz and Alfred Tarski.
There is a number of different software that could be
used as a template for the fuzzy logic controller. B. Linguistic Variable
Xilinx can be used to integrate easy computation
While variables in mathematics usually take numerical
widely
available
toolbox
and
values, in fuzzy logic applications, the non-numeric
dedicatedintegratedcircuit
.combine
regulation are often used to facilitate the expression of rules and
algorithm and logic reasoning allowing for integrated facts.
control scheam.it become one of the most successful
technology for developing the system which require a C. Fuzzyset
real time operation. When a program execute and
In mathematics, fuzzy sets are sets are whose
implement in an vhdl code can have very short
elements have degrees of membership. In classical set
execution time due to high degree of parallelism of
theory, the membership of elements in a set is assessed
it’sarchitecture. This software has high speed and low
in binary terms according to a bivalent condition an
cost and also easily available. Fuzzy logic can be
element either belongs or does not belong to the set.
directly implemented on FPGA as compared to C and
By contrast, fuzzy set theory permits the gradual
matlab so fuzzy gives a better result. choose this
assessment of the membership of elements in a set;
project because this project will enhance my
this is described with the aid of amembership
knowledge of embedded system and basic
function valued in the real unit interval [0, 1]. Fuzzy
programming.
sets generalize classical sets, since the indicator
functions of classical sets are special cases of the
IV.STRUCTURE OF FUZZY LOGIC
membership functions of fuzzy sets, if the latter only
CONTROLLER
take values 0 or 1. In fuzzy set theory, classical
Fuzzy logic has rapidly become one of the bivalent sets are usually called crisp sets.
mostSuccessful of today's technologies for
developingSophisticated control systems. With its aid,
complexRequirements may be implemented in
amazingly simple, easily maintained, and inexpensive
controllers. Fuzzy control use only a small portion of
the fuzzy mathematics that is available, this portion is
also mathematically quite simple and conceptually
easy to understand. In this heading, introduce some
essential concepts, terminology, and arithmetic of
fuzzy sets and fuzzy logic.
Fig. 1 Block diagram of fuzzy control system
A.Fuzzy Logic
Fuzzy Logics a form of many-valued logic that deals
with approximate, rather than fixed
and
exact reasoning. Compared to traditional binary logic
(where variables may take on true or false values),
fuzzy logic variables may have a truth value that
ranges in degree between 0 and 1. Fuzzy logic has
been extended to handle the concept of partial truth,
where the truth value may range between completely
true and completely false. Furthermore, when
linguistic variables are used these degrees maybe logic
managed by specific functions .The term fuzzy Logic
was introduced 1965 by Lotfi AZadeh. Fuzzy logic
has been applied to many fields from control
theory to artificial intelligence. Fuzzy logic had been
ISSN: 2231-5381
The fuzzy controller,(as explained in Fig. 1), have four
main components:
· The Rule-Base holds the knowledge, in the form of
aset of rules, of how best to control the system.
· The Inference Mechanism evaluates which
controlrules are relevant at the current time and
thendecides what the input to the plant should be.
· The Fuzzification Interface simplymodifies the
inputsso that they can be interpreted and compared to
therules in the rule-base.
·
The
Defuzzification
Interface
converts
theconclusions
reached
by
the
inference
mechanisminto the inputs to the plant [6], [9].
http://www.ijettjournal.org
Page 22
International Journal of Engineering Trends and Technology (IJETT) – Volume 24 Number 1- June 2015
IV. TYPES OF CONTROLLERS
V.FUZZY VARSES. CONVENTIONAL CONTROL
There are several types of control systems that use
FLC as an essential system component
A. Self-Tuning Fuzzy Logic Controller
A self-tuning fuzzy controller is that in which the
control rules, the membership function, or the scaling
factors are self-adjusted. Among them, the control
rules and the scaling factors play important roles [18].
We have used a real time tuning for output scaling
factors. Its main advantages over a general FLC are
stronger control capability, increasedflexibility and
robustness.
B. Fuzzy Supervised Pid Controllers (Fspid)
For controlling of a nonlinear process a
conventionalcontroller is not enough to obtain a
desired performance. Toensure good performances
and stability for all the operationset point in nonlinear
process, the controller gains shouldchange to adopt the
variation of physical parameters.Direct controller
,Supervisory
controlPID
adaptation,
Fuzzy
intervention The majority of applications during the
past two decades belong to the class of PID fuzzy
controllers. These fuzzy controllers can be further
classified into three types: the direct action (DA) type,
the gain scheduling (GS) type and a combination of
DA and GS types. The majority of PID fuzzy
applications belong to the DA type; here the PID
fuzzy controller is placed within the feedback control
loop, and computes the PID actions through fuzzy
inference. In GS type controllers, fuzzy inference is
used to compute the individual PID gains [12], [10], [11].
The simplest and most usual way to implement a
fuzzy controller is to realize it as a computer program
on a general purpose computer. However, a large
number of fuzzy control applications require a realtime operation to interface high-speed Constraints.
Software implementation of fuzzy logic on general
purpose computers cannot be considered as a suitable
design solution for this type of application, in such
cases, design specifications can be matched by
specialized fuzzy processors. Higher density
programmable logic devices such as FPGA can be
used to integrate large amounts of logic in a single IC
[13]-[14]
. Semi-custom and full-custom application
specific integrated circuit (ASIC) devices are also
used for this purpose but FPGA provide additional
flexibility: they can be used with tighter time-tomarket schedules. The Field-Programmable Gate
Array (FPGA) places fixed logic cell son the wafer,
and the FPGA designer constructs more complex
functions from these cells. The term field
programmable highlights the customizing of the IC by
the user, rather than by the foundry manufacturing the
FPGA [17],[15]-[16].
ISSN: 2231-5381
To design a conventional controller for controlling a
physical system, the mathematical model of the
system is needed. A common form of the system
model is differential equations for continuous-time
systems or difference equations for discrete-time
systems. Strictly speaking, all physical systems in
existence are nonlinear. Unless physical insight and
the laws of physics can be applied, establishing an
accurate nonlinear model using measurement data and
system identification methods is difficult in practice.
Even if a relatively accurate model of a dynamic
system can be developed, it is often too complex to
use in controller development, especially for many
conventional control design procedures that require
restrictive assumptions for the plant (e.g., linearity) [5],
[6]
.As an alternative, fuzzy control provides a formal
methodology for representing, and implementing a
human's heuristic knowledge about how to control a
system, which may provide a new paradigm for
nonlinear systems. Fuzzy controller is unique in its
ability to utilize both qualitative and quantitative
information. Qualitative information is gathered not
only from the expert operator strategy, but also from
the common knowledge [5], [6]. Although much of the
opposition to fuzzy logic is based on misconceptions,
fuzzy control is not a cure-all. Fuzzy control should
not be employed if the system to be controlled is
linear, regardless of the availability of its model. PID
control and various other types of linear controllers
can effectively solve the control problem with
significantly less effort, time, and cost. In summary,
PID control should be tried first whenever possible [5].
FLCs have been implemented successfully in various
applications such as process control and robotics [2] ,[3],
[4]
Fuzzy logic provide a certain level of artificial
intelligence to the conventional PID controllers. Fuzzy
PID controllers have self-tuning ability and on-line
adaptation to nonlinear, time varying, and uncertain
systems Fuzzy PID controllers provide a promising
option for industrial applications with many desirable
features [1].
VI. PERFORMANCE COMPARISON
According to the selection of software in this paper,
the performances of both fuzzy logic controller and
conventional controller is evaluated on the parameters
such as no of input, frequency, and short execution
time and high speed with completeness can be
checked in rule base a qualitative discussion by an
analytical approach. Table I shows theperformance
comparison of both controllers. Considering the speed
http://www.ijettjournal.org
Page 23
International Journal of Engineering Trends and Technology (IJETT) – Volume 24 Number 1- June 2015
Parameters
Speed
s/w availability
Cost
Technology
Execution time
Frequency
No of clkpuls
used
h/w and s/w
implementation
No of inputs
No of terms per
input
No of possible rule
No of active
rule(maximum)
Fuzzy logic
controller
High speed
Easily
available(Xilinx)
Low cost
ASIC
Short when high
degree of
parallelism
Low frequency
Conventional
controller
Low speed
Depend on
application
High cost
TTL OR RTL
Long execution
time
Many inputs
Same
Depending on
application used
clk pulses depend
on controller used
used c program and
or preprogramed
microcontroller
used or modelled
based controller
One input
Same
256
16
No rule
No rule
0ne or two
Direct implement
on FPGA easily
get result
and no of inputs, parallelism of the controller. Thus it
can be seen that through both controller we can
achieve short execution time with high speed.
Table I
[4] Essam Natsheh1 and Khalid A. Buragga “Comparison between
Conventional and Fuzzy Logic PID Controllers for Controlling DC
Motors”, IJCSI International Journal of Computer Science Issues,
Vol. 7,No.5, Sept. 2010.
[5] H. Ying, "Fuzzy Control and Modeling, Analytical Foundations
and Applications", Institute of Electrical and Electronic Engineers
Inc., USA,2000.
[6] K. M. Passino and Stephen Yurkovich,
Control",Addison-Weslwey Longman Inc., USA, 1998.
"Fuzzy
[7] Mathworks, "Fuzzy Logic Toolbox User's Guide ", Mathworks,
Inc.,1999.
[8] L. Reznik, "Fuzzy Controllers", Newnes, first edition, 1997.
[9] J. Huang, "Hybrid Fuzzy PID Controller with Adaptive Genetic
Algorithms for the Position Control and Improvement of Magnetic
Suspension System", M. Sc. thesis, Mechanical and ElectroMechanical Engineering, June, 2004.
http://etd.lib.nsysu.edu.tw/ETD-db/ETDsearch/view_etd?URN=etd-06 24104-182807
VII.CONCLUSION
The advantage of using this high- level approach is
that, the design time is reduced significantly and
different ways of designing a rule base can be
explored. Formulating cost-effective solutions to
complex problems characterized by uncertainty or
imprecise information. The fuzzifier and defuzzifier
components of the fuzzy system are described using
VHDL code as it involves considerable amount of
mathematical computations. There are three parts to a
fuzzy controller, the fuzzification of the inputs,
thedefuzzification of the outputs. Besides the
advantages, there are some limitations of FLCs.The
main limitation of FLC (in case of pid)is the lack of
existence of a systematic procedure for design and
analysis of the control system. It is well-known that
tuning of an FLC is a difficult task. To tune an FLC is
a much more difficult job than tune a conventional
controller because there are many more parameters to
adjust in an FLC.such as SFs, MFs and control.
REFERANCES
[1] Abdullah I. Al-Odienat, Ayman A. Al-Lawama, “The
Advantages of PID Fuzzy Controllers Over The Conventional
Types”, American Journal of Applied Sciences 5, 653-658, 2008.
[2] KapilDev Sharma and Mohammad Ayyub, “Fuzzy Logic
Controller(FLC) with Better Performance as Against Conventional
PID Controller ”Presented in 2nd National Conference on “Recent
Advances in Technology and Engineering (RATE-2013)”, March
15-17, 2013, held at Mangalayatan University, Aligarh, India.
ISSN: 2231-5381
[3] ArpitGoel, AnkitUniyal, AnuragBahuguna, Rituraj S.
PatwalAndHusainAhmed ,“Performance comparison of PID and
fuzzy logic controller using different defuzzification techniques for
positioning control of dc motors”, Journal of Information Systems
and Communication Vol.3, Issue 1, pp. 235-238, 2012.
[10] G. K. Mann, B. G. Hu, and R. G. Gosine, "Analysis of Direct
ActionFuzzy PID Controller Structures", IEEE Transactions on
Systems, Man,and Cybernetics-Part B: Cybernetics, Vol. 29, No. 3,
pp. 371-388, June,1999.
[11] J. Li, andB. S.Hu, "TheArchitecture of Fuzzy PID Gain
Conditioner and its FPGA Prototype Implementation", Second
International Conference on ASIC, pp. 61-65, 21-24 October, 1996.
[12] I. del Campo, R. Callao, and J. Tarela, "Automatic
Implementation of Different Inference Architectures for Fuzzy
Control on PLDs", Computer and Electrical Engineering Vol. 24,
No.1/2, January/March 1998.
[13] MichaelMcKenna and Bogdan M. Wilamowski," Implementing
a Fuzzy System on a Field programmable Gate Array", IEEE
International Joint Conference on Neural Networks, 2001.
Proceedings. IJCNN '01, ISBN: 0-7803-7044-9, Volume: 1, p.189194, 2001.
[14] Alessandro Gabrielli ,EnzoGandolfi and Massimo Masetti,"
Design of a Very High Speed Fuzzy Processor by VHDL
Language", Physics Department University of Bologna
VialeBertiPichat
6/240127
Bologna
Italy.
www.bo.infn.it/dacel/papers/96_03_parigi_EDTC.pdf
[15] ValentinaSalapura and Volker Hamann," Implementing Fuzzy
Control Systems Using VHDL and Statecharts", Design Automation
Conference,1996, with EURO-VHDL '96 and Exhibition,
Proceedings EURO-DAC '96, European, ISBN: 0-8186-7573-X, p.
53-58, Geneva, Switzerland,1996.
[16] Masmoudi n., hachicha m. and kamoun l." Hardware Design of
Programmable Fuzzy Controller on FPGA", IEEE International
http://www.ijettjournal.org
Page 24
International Journal of Engineering Trends and Technology (IJETT) – Volume 24 Number 1- June 2015
Fuzzy Systems Conference Proceedings, Seoul, Korea, p. -1675- 1679, August 22-25, 1999.
[17] Jose l. Gonzalez-vazquez, oscar Castillo and luis t. Aguilarbustos,” A Generic Approach To Fuzzy Logic Controller Synthesis
On FPGA”,IEEE international conference on fuzzy systems, p2317 - 2322, 2006.
[18] Hung-Yuan Chung, Bor C. Chen,Jin J. Lin “A PI-type fuzzy
controller with self-tuning scaling factors”, Fuzzy Sets and systems,
pp. 23-28,1998.
ISSN: 2231-5381
http://www.ijettjournal.org
Page 25
Download