Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
net/publication/224164858
CITATIONS READS
7 699
3 authors:
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
HVDC System Control between Different Frequencies Networks and Fault Analysis with HVAC System View project
All content following this page was uploaded by Ali M. Eltamaly on 04 June 2014.
Abstract—This paper introduces an implementation of a Logic Controller (GPFLC) is used in a Maximum Power
general purpose fuzzy logic controller for use with general Point Tracker (MPPT) of PV power system as an example
purpose embedded processors. This controller is used in the as shown in Fig.1.
applications of maximum power point tracker of photovoltaic
energy system as an application. However, the proposed model II. DESIGN METHDOLOGY
is very flexible to be applied in various and different C language is the standard language for embedded
applications. The design is made to be scalable in terms of
number of inputs and number of membership functions (MFs)
system programming, most of new processors generations
in both inputs side and output side. The proposed model was are optimized to be efficiently programmable in C. Beside
written in C language due its popularity and efficiency in its nature as a high level programming language, C is very
embedded and control applications. An example of maximum efficient in bit-manipulation which makes C an attractive
power point tracker of photovoltaic energy system with 2- alternative to assembly programming. Adding to all
inputs/7-MFs each and 1-output/7-MFs is used for mentioned advantages of, C is a machine-independent
demonstration and verification purpose. The general purpose language as long as the programmer avoids using of
fuzzy logic controller shows consistency with the result machine-specific features. The proposed model is intended
obtained from simulation. to be a GPFLC that can run on any machine without any
Keywords- Fuzzy, Modeling, Photovoltaic, MPPT, C, restrictions, therefore, C was used as a standard language to
Embedded Control develop this model. An embedded development
environment used to compile and debug the model. Pre-
I. INTRODUCTION computed results compared to system responses for known
Design reuse involves various activities that utilize test vectors.
existing technologies to address new design problems. The
ultimate aim of design reuse is to assist the designers to III. A TYPICAL FUZZY CONTROLLER DESIGN
develop products that maximize the value of the designed A design and optimization methodology suitable for
artifacts with minimal resources, cost and effort [1]. The FLC is presented in [7]. It is illustrated in Fig.2, the block
modern design methodologies involve standard styles of diagram of a FLC inserted in closed loop together with the
programming that allow one piece of code to be used in plant under control. Physically, FLC itself corresponds to
different applications. Such kind of methodologies started the shaded block, wherein the three basic fuzzy operations
with the invention of object-oriented programming are highlighted. The knowledge base provided by an expert
concepts. In order to have a design that is reusable in is also represented in Fig.2. It comprises a data base and a
different applications and can run efficiently on different rule base. The first provides the linguistic variables, their
embedded processors, the designer must take into his term sets, the membership functions shape and position, the
account the underlying architecture of new modern inference method and the de-fuzzification method. The rule
embedded processors and their capabilities. In this paper an base includes the source and the contents of the set of rules,
efficient model of a general purpose fuzzy logic controller which can be derived from modeling the human operator’s
(FLC) is introduced. The model was designed with the actions or from the linguistic description of the controlled
goals to be reusable and in the same time it adheres the plant (i.e. a kind of "fuzzy inverse modeling"). Finally,
computation capabilities of modern embedded processors learning or tuning algorithm adapts the parameters of the
and the underlying architectures. Implementation of FLC on controller by minimizing, for instance, the RMSE (Root
digital tools like FPGA, microcontrollers and DSP has been Mean Square Error) between the desired and actual outputs
shown in the literatures [2-6] but most of them are used in of the plant.
specific application as PV and it can't be used in any other
application without changing in the logic. A. Fuzzification
FLC methods and algorithms, including many In fuzzification stage, each input to FLC is mapped to a
specialized software and hardware are available on the set of MFs. A FLC can have any number of inputs with any
market today. But still the general purpose FLC that can be number of MFs for each input. The most common shape of
used in any application with any numbers of input and MFs is the triangular shape. Fig.3 shows an example of 2-
output parameters and any number of membership functions inputs/7-MFs in triangular shape. For each input/MF pair, a
(MFs) for each parameters are still not available. This is the fuzzy value is computed. A triangle with one side lies on
motivation of this research. The General Purpose Fuzzy the X-axis can be characterized by four constants S, M, E,
௦௨௧ିௌ
݄ൈ ǡ ܵ ൏ ܿ ݐݑ݊݅ݏ݅ݎ൏ ܯ
ெିௌ
ݐݑݐݑݕݖݖݑܨൌ ൞݄ ൈ ாି௦௨௧ ǡ ܯ ܿ ݐݑ݊݅ݏ݅ݎ൏ ܧ (1)
ாିெ
Ͳǡ݁ݏ݅ݓݎ݄݁ݐ Fig.1 PV energy system with MPPT.
623
Segment.3 C code calculates fuzzy output of a MF from a crisp input. COGx is computed as shown in Fig.5 and given by (4). In
addition to COG, the shaded area shown in Fig.5 is
computed using equations (5) and (6). To have the final
crisp output after the de-fuzzification process, the
equivelant X-coordinate of the cenetr of gravity of all active
output MFs must be computed as shown in Fig.6 and given
by (7). The division operations used in equations (4)-(6) are
completely avoided by choosing H as a power of 2 constant,
therefore the division can be replaced by a simple shift-to-
right operation. In this model, H is set to 214.
In order to simplify output MFs calculations in
suggested implementation; a new data structure written in C
to define a new data type called FuzzyOutputMF which
must be used whenever a new output MF is added to the
system. Code segment.5 is used to define the new data
structure provided to handle output MFs in C code. The
data object FuzzyOutputMF includes all constants required
Each input must be applied to its set of MFs. A C to calculate the required output as stated in (4), (5), and (6)
routine in code sgment.4 implement a loop accepts the and shown in Fig.5. All FuzzyOutputMF object members
index of the input and the crisp input value. In the loop a must be initialized prior to use it.
call to the routine Fuzzy_CalcInputMF is done with new Segment.5 C Model of an output membership function.
MF each time. The loop continues until the crisp input is
applied to all respective MFs.
Segment.4 C routine calculates all MFs fuzzy outputs for a given input.
624
Segment.7 C function for output MF calculations.
625
refers to the rules table to be used with this function call Figure-8 is a simplified block diagram showing FPGA
(First dimension in FuzzyRules array). The fourth argument hardware/software configuration used in PV MPPT
CrispOutputPtr is a pointer to a variable in which the controller plus the outside connections to internal logic.
defuzzification result will be returned (the final crisp Xilinx EDK provides a standalone software development
result). The function Fuzzy_Defuzzifiy performs tool (SDK) to develop C software applications to run on
defuzzification using center of gravity technique using MicroBlaze based on configured hardware architecture.
formula shown in (7). Two software projects built and developed in C to run the
presented fuzzy logic controller model. The first project
Segment.11 Example of initializing a rule as null (no-rule). used to verify that logic interprets crisp inputs and perform
all FLC computations and produce the correct output. A
number of test vectors and associated results used to verify
logic functionality. Intensive debugging and tracing to code
execution performed to assure the consistency of the
implemented logic. The second project is the PV control
loop using the fuzzy logic controller presented here.
626
the experimental results showing agreet consistance with REFERENCES
the simulation results shown in [8]. Fig.10 shows the [1] S K Ong, Andrew Y C Nee, Q L Xu "Design Reuse in Product
Development Modeling, Analysis and Optimization", World scientific
experimental results of the duty ratio and the voltage output Publishing Co., Singapore, 2008.
from PV system. The signal in the first trace is the output [2] M. Nikoz, H. Dehbonei, C.Naher, A DSP-controlled photovoltaic
from FPGA with a peak voltage 3.3V. The output voltage system with maximum power pointtracking, Electrical engineering and
from the photovoltaic in the next trace is around the values information technology ITEE, 1-6, Australie 2003.
[3] S.Poorani, T.V.S.Urmila Priya, K.Udaya Kumar and
from simulation of [8].
S.Renganarayanan" FPGA Based Fuzzy Logic Controller for Electric
Vehicle" Journal of The Institution of Engineers, Singapore Vol. 45
Issue 5 2005.
[4] M. McKenna and B. M. Wilamowski, ”Implementing a fuzzy system
on a field programmable gate array”, Proc. Int. Joint Conf. on Neural
Networks, Vol. 1, Jul. 2001, pp. 189-194.
[5] G. Mermoud, A. Upegui, C. A. Peña-Reyes, and E. Sanchez, "A
Dynamically- Reconfigurable FPGA Platform for Evolving Fuzzy
Systems", in The 8th International Work-Conference on Artificial
Neural Networks (IWANN'2005), 2005.
[6] A. Cabrera, S. S´anchez-Solano, R. Senhadji, A. Barriga, and C. J.
Jim´enez, ”Hardware/software codesign methodology for fuzzy
controllers implementation”, Proc. IEEE Int. Conf. on Fuzzy Systems,
May 2002, pp. 464-469.
[7] Godjevac J., "Neuro-Fuzzy Controllers Design and Application",
Presses Polytechniques et Universitaires Romandes, Lausanne,
Switzerland, 1997.
[8] Ali. M. Eltamaly " Modeling of Fuzzy Logic Controller for
Photovoltaic Maximum Power Point Tracker", Solar Future 2010
Conf. Proc., Istanbul, Turkey, Feb.2010, pp.4-9.
Fig.10 Experimental results of the duty ratio and the voltage output from
PV system.
V. CONCLUSIONS
This paper introduced an efficient implementation for a
fuzzy logic controller. The model implemented in C language
for portable, flexible and efficient usage on general purpose
embedded processors. Only standard and non-floating data
types are used for maximum portability and efficiency. The
model is scalable in terms of number of inputs, outputs, and
membership functions. Triangular shapes of MFs used as an
example, however irregular shapes maybe implemented
following the same concepts. The rules implication technique is
extremely flexible and efficient using the power of pointers in
C. Pointers in C are well supported by advanced addressing
modes in modern processors. Example project based on a soft
processor inside FPGA has been used for logic verification.
The design proved its correctness by given correct answers to
known test vectors. The design has an outstanding
performance of 44200 loops per second for a typical
configuration used in PV MPPT tracking systems.
Experimental results from the proposed fuzzy logic controller
shows agreed consistence with the previous published
simulation results.
VI. ACKNOWLEDGMENT
Authors would like to thank the research center of faculty
of engineering, King Saud University and SABIC company for
their financial and technical support during the preparation of
this research.
627