Fuzzy Logic Controller
Fuzzy Logic Controller
Logic Controller
Hedi Abdelkrim, Slim Ben Othman, Slim Ben Saoud
Laboratoire des Systèmes Avancés LSA EPT
Carthage University
La Marsa, Tunisia
[email protected], [email protected], [email protected]
Abstract—Nowadays, new system design requirements the various operating modes that real application case deal,
are increasing more and more. Even though, the SoC FPGA controller should perform real-time parameter tuning to obtain
based is a good choice given their flexibility, the good performances [6]. Enhancing existing system on Chip
Reconfigurable System on Chip (RSoC) is a better flexible (SoC) with partial reconfiguration capabilities has opened a real
solution that allows chip Partial Reconfiguration (PR). In opportunity to designers [7] to best solve problem facing with
this study, we present a PR design approach of FPGA based real conditions utilization. In fact, due to special environment
Fuzzy Logic Controller (FLC) for electromechanical conditions, designers often need to change functionalities or
system. In order to enhance flexibility and performance of adapt some parameters on the fly. With the reconfigurable
System on Chip (RSoC), it becomes possible doing that without
the considered system, a self-reconfigurable system is
turning off the system. It is possible to change only a portion of
designed. Based on Zynq Processor of the Zedboard, the
the chip while the remaining part continue turning on.
system switches between different versions of the HW speed
FLC. Experimental results were validated and the Based on our literature review, several recent projects are
efficiency of the approach was confirmed. dealing with the implementation of fuzzy logic controller. In [2]
and [8], the authors describe FPGA implementation of a fuzzy
Keywords—Dynamic Partial Reconfiguration; Implementation; logic trajectory tracking controller. In [9], the paper presents a
FPGA; Zynq Processor; Fuzzy Logic Controller; Reconfigurability; speed control scheme using a FLC. Others in [10] describe a
reconfigurable implementation of a FLC. For authors in [11],
I. INTRODUCTION the purpose is to implement a FLC for level control. In [12],
Today, the fuzzy logic adjustment lends itself particularly more complex system is proposed with adaptive neuro-fuzzy
well to two areas of applications, which correspond respectively structure controller.
to the design of controllers for processes that are difficult to In this paper, we propose embedded systems able to self-
model and the design of nonlinear controllers for modelled adapt parameters and precisely change FPGA configuration
processes, [1]. depending on the environment conditions change and based on
In the first case, we must apply a heuristic process based on a user-defined scheme. A dynamic partial reconfigurable FLC
the expertise and experiences of the operators. However, it is is designed and implemented on a zedboard to control a DC
often necessary to take a long and difficult approach to obtain motor speed.
good results. In the second case, non-linear characteristics are
In the section 2, we focus on the system drive specifications
used to improve the performance of conventional settings that
and the FLC components. Section 3 presents the system design,
operate in a linear way. hardware and software flows are also detailed and
In addition, fuzzy systems offer designers of implementation results are given.
microelectronic circuits the ability to use non-linear controllers
for their applications. Fuzzy controllers are traditionally II. DRIVE CONTROL STRUCTURE
implemented on a microprocessor [2] [3], but also on dedicated
VLSI circuits like the CMOS case described by Ota [4] and A. Motor Control Specifications
Wilamowski [5]. The considered process is a low power DC permanent
magnet Motor (DCM) associated with a 4-quadrant chopper. It
A fuzzy controller does not handle a well-defined
is composed by (1) the process to control including the
mathematical relationship (control algorithm), but uses
converter circuit, the electric motor and load equipment and
inferences with multiple rules, based on linguistic variables.
different sensors and (2) the digital control unit, which is
These inferences are then processed by fuzzy logic operators.
composed of the digital controller, based on fuzzy logic and the
Currently, the versatility of the FPGAs made them one of necessary interfaces for sensors and control signals generation,
the major solution used in complex system design. It is possible to be implemented on FPGA. The drive system (in fig.1) is
to combine several complex functions in the same chip. With based on a nested closed loop managing the motor speed. The
151
speed control algorithm will be based on an evaluation of input p
parameters the error İ and change of error dİ/dt as shown on
figure 1.
¦ μ .V
j =1
j j
*
X =R p
(1)
¦μ j =1
j
152
Hardware Fuzzy Logic Controller Intellectual Property (Hw Modules (RM) based respectively on 3 and 5 linguistic
FLC IP) has 3 inputs: the speed reference (from PS), the variables version of the FLC. The design can be dynamically
encoder signals (a and b) and 2 outputs (chopper pwm signals). reconfigured using PS sub-system and Processor Configuration
Mainly it consists of 3 parts (figure 4): the FLC calculation and Access Port (PCAP) resource.
data formatting bloc and the pulse width modulate (pwm)
generator 3) The set DC Motor, Chopper and Encoder
represents the operative part. DDR3 PL
Memory Memory
Controller
7000 Series FPGA Board
ARM Hw FLC IP
a
DC RS232 UART Cortex-
Hardware b
AXI IPIC
Interconnect
PS Motor A9 pwm1
PC Fuzzy Logic
Block
pwm2
AXI
UART Device Decoupler
User Interface Ccontroller Configuration RP
IP Pwm Signals Chopper
a PS
(Hw FLC IP) b Encoder RP: Reconfigurable Partition
Fig. 3. Experimental concept The ARM Cortex-A9 PS of the Zynq 7000 is used to create
the reconfigurable peripheral (Hw FLC IP) and to interface
Based on a time stamp, the encoder signals a and b are used user. The static logic part of this IP consists of the processor
to calculate the motor speed. subsystem, the AXI Interconnect, the AXI IPIC of the
reconfigurable peripheral and the remaining parts of the FLC.
ε
20bits register As shown in the figure 6, there is one RP in the FLC, which
ε is the fuzzification. The remaining parts are included in the
Error and
ref static portion.
13bits register error change
calculation dε/dt
Bloc FLC
13bits register ε
PWM Įdig Fuzzification
Speed generator ___________
pwm1
pwm2
153
If ((İ < í0.5) and (İ > í1)) <=> If ((İnum < í0.5*1024) and We give in the table 1 details about hardware synthesis for
(İnum > í1*1024)) the RP. Even the RM1 require less hardware resources, the RP
should be large enough to include the bigger reconfigurable
For inference part, there is no change to do. Indeed, we use module.
the method of inference Max-min, and this method only uses
the operators of max and min, so we will have no treatment to Power consumption estimations for RM1 and RM2 are
apply to manipulated values. given on figures 8 and 9.
The defuzzification consists of determining the barycenter
of the selected surface on the set of the output membership
functions, the ordinates of the center points must be digitalized.
Two version of the FLC were designed based on the number
of membership functions of the fuzzification step. We mean by
RM1 and RM2 respectively the fuzzification with 3 and 5
linguistic variables. The two versions were realized using
VHDL language under. The controllers were individually tested
and verified by flat design experimentation.
.
Step 1: Step 2: Step 3: Step 4:
Generate DCP Load Static and Define Define
for Static and one RM for Reconfigurable Reconfigurable
RM modules each RP Properties Partitions
Step 6:
Step 5:
Create and
Step 7: Step 8: Fig. 8. Power Consumption FLC with RM2
Run Design Create Other Run
Rule Checker Implement First Configurations PR_Verify
Configuration
154
bitstream. But, we notice that the system response is improved
and ε is now about 0.05%. After a Tinit=0.25s a new
reconfiguration is done. RM1 will continue driving the motor
while ε<εth.
Fig. 12. Zoom showing the reconfiguration orders time and effect
155
[7] H. Abdelkrim, et al., "Reconfigurable SoC FPGA based: Overview and [12] T. Tamas, et al., "Adaptive Neuro-Fuzzy Structure Based Control
trends," in 2017 International Conference on Advanced Systems and Architecture," Procedia Technology, vol. 22, pp. 600-605, 2016/01/01/
Electric Technologies (IC_ASET), 2017, pp. 378-383. 2016.
[8] H. Abdelkrim and S. B. Saoud, "Implementation of a fuzzy logic tracking [13] A. Hedi, et al., "Hardware implementation of fuzzy logic controller," in
path algorithm on a field programmable gate array," in International 2005 12th IEEE International Conference on Electronics, Circuits and
Conference on Design and Test of Integrated Systems in Nanoscale Systems, 2005, pp. 1-4.
Technology, 2006. DTIS 2006., 2006, pp. 355-358. [14] Xilinx. (2015, 05/06/0217). ZC702 Evaluation Board for the Zynq-7000
[9] T. Koblara, "Implementation of speed controller for Switched XC7Z020 All Programmable SoC,UG850 (1.5), 81. Available:
Reluctance Motor drive using fuzzy logic," in 2008 11th International https://www.xilinx.com/products/boards-and-kits/ek-z7-zc702-g.html.
Conference on Optimization of Electrical and Electronic Equipment, [15] Xilinx. (2017, 18/07/0217). Vivado Design Suite User Guide : Partial
2008, pp. 101-105. Reconfiguration. ug909. Available:
[10] A. Youssef, et al., "Reconfigurable generic FPGA implementation of https://www.xilinx.com/support/documentation/sw_manuals/xilinx2017
fuzzy logic controller for MPPT of PV systems," Renewable and _2/ug909-vivado-partial-reconfiguration.pdf
Sustainable Energy Reviews, vol. 82, pp. 1313-1319, 2018/02/01/ 2018.
[11] P. N. Lamkhade, et al., "Design and implementation of fuzzy logic
controller for level control," in 2015 International Conference on Energy
Systems and Applications, 2015, pp. 475-479.
156