Hardware/Software Codesign Guidelines For System On Chip FPGA-Based Sensorless AC Drive Applications
Hardware/Software Codesign Guidelines For System On Chip FPGA-Based Sensorless AC Drive Applications
a, b, c
Reference quantity, estimated quantity.
Three-phase reference frame index.
N OWADAYS, embedded control systems are becoming
more and more sophisticated. This is a direct conse-
quence of the rising of industrial requirements [1], [2]. These
requirements are not just always limited to a higher level of
Stator and rotor currents.
performance. Indeed, the flexibility of the controller, its cost,
d-q stator currents. and its time-to-market reduction are also of prime importance.
DC link voltage. To cope with all of these different challenges, a relevant use of
the current digital technologies becomes crucial.
Among all of these digital technologies, field-programmable
gate arrays (FPGAs) present the advantage to include both
Manuscript received July 20, 2012; revised November 17, 2012; accepted
December 21, 2012. Date of publication February 08, 2013; date of current ver- hardware and software resources. Hardware resources are
sion October 14, 2013. Paper no. TII-12-0489. usually used to accelerate the processing time by exploiting the
I. Bahri is with the Laboratoire de Génie électrique de Paris (LGEP), Univer-
inherent parallelism of the control algorithm to be implemented.
sity of Paris-Sud XI, 91400 Orsay, France (e-mail: [email protected]).
L. Idkhajine and E. Monmasson are with the Systèmes et Applications des This FPGA-based implementation has already been the focus
Technologies de l’Information et de l’Energie (SATIE), University of Cergy- of many researches in the field of ac drive applications [3]–[5].
Pontoise, 95031 Cergy-Pontoise, France (e-mail: [email protected];
More recently, it has also become typical to implement pro-
[email protected]).
M. El Amine Benkhelifa is with the Equipes Traitement de l’Information et cessor cores within FPGAs. Thus, FPGAs can now be consid-
Systèmes (ETIS), University of Cergy-Pontoise, 95031 Cergy-Pontoise, France ered as full system-on-chip (SoC) solutions, always allowing
(e-mail: [email protected]).
more flexibility for the embedded controllers. These SoC-based
Color versions of one or more of the figures in this paper are available online
at http://ieeexplore.ieee.org. solutions include varied components like one or several proces-
Digital Object Identifier 10.1109/TII.2013.2245908 sors, memories, hardware multiplier blocks, analog–digital con-
verters, matrix of programmable logic elements (FPGA Fabric), and its validation. Then, Section V presents the architectural
and busses, all in the same chip. To this purpose, FPGA manu- exploration, where software, hardware, and mixed Hw/Sw
facturers provide more open and efficient platforms introducing SoC implementations are discussed. Section VI presents the
several RISC processor cores. The hard-core processors such as experimental results. Finally, conclusions and perspectives are
Xilinx’s PowerPC 440, Microsemi’s Cortex-M3, and Xilinx’s given in Section VII.
dual ARM Cortex-A9 cores have a custom very large-scale in-
tegration (VLSI) layout that is integrated within the FPGA. As II. HW/SW CODESIGN GUIDELINES PRESENTATION
a general rule, these hard-core processors offer higher clock The proposed Hw/Sw codesign guidelines aims to find an op-
speeds with less flexibility. The soft-core processors such as Al- timal partitioning of control algorithm between modules to be
tera’s Nios-II, Xilinx’s MicroBlaze processors, and Microsemi’s implemented in software and those to be implemented in hard-
Cortex-M1 use existing FPGA logic cells to implement the pro- ware. This method defines a set of steps and rules to be fol-
cessor cores [6]–[9]. The advantage of such approach is the flex- lowed in order to make the design process more manageable and
ibility but this implies slower clock rates. Additionally, hetero- less intuitive. It consists of a top-down design process that starts
geneous multiprocessing architectures (MPSoCs) offer better from the specifications of the control application to the final ex-
performance especially in the case of complex digital applica- perimental validation. As shown in Fig. 1, this method is de-
tions. Indeed, MPSoC architectures provide a high level of scal- composed into four main steps: 1) specifications of the control
ability compared with monolithic cores, in particular in terms of application; 2) algorithm development; 3) architectural explo-
power and performance [10]. ration; and 4) Hw/Sw integration and experimental validation.
To take full advantages of these SoC approaches and to ac- The proposed approach allows an automatic architectural ex-
commodate the ever more demanding control applications, the ploration that integrates both the control (stability margin/band-
use of hardware/software (Hw/Sw) codesign methodology is width) and the resource (time/area) constraints. This automatic
crucial. Along this line, a major issue to be addressed is to ob- architectural exploration allows obtaining an optimal Hw/Sw
tain an efficient partitioning of the control algorithm between partitioning of the functional modules with the help of an ef-
software and hardware resources. During a decade, the Hw/Sw ficient evolutionary algorithm (NSGA-II). Thus, this automatic
partitioning has been addressed by several methods using auto- architectural exploration avoids the manual portioning that is
mated heuristic approaches. These approaches are based on op- one of the SoC design bottlenecks. In the four following sec-
timization algorithms, such as simulated annealing algorithm, tions, each step of the proposed design guidelines is explained
Tabu search algorithm and Genetic Algorithm (GA) [11]–[14]. optimal Hw/Sw partitioning of the functional modules with the
These works focused on optimizing the processing time, the area help of an efficient evolutionary algorithm (NSGA-II). Thus,
and the power consumption. this automatic architectural exploration avoids the manual por-
The majority of these works have been proposed for signal tioning that is one of the major SoC design bottlenecks.
and image processing applications but to our best knowledge, no
optimized Hw/Sw partitioning strategy has been yet proposed III. SPECIFICATIONS OF THE CONTROL APPLICATION
for ac drives applications. Indeed, up to now, the partitioning be- The structure of the developed sensorless control system is
tween Hw/Sw resources for FPGA-based controllers dedicated first overviewed and depicted in Fig. 2. Its hardware and algo-
to power electronics and drives applications was made only on rithm specifications are discussed below.
the expertise of the designer [15]–[18], guided by engineering
experience like implementing PWM and current control in hard- A. Hardware Specifications
ware and position control in software. The power stage consists of a salient pole synchronous
In this paper, we propose Hw/Sw codesign guidelines for motor (SM) mechanically (see Table I) loaded by a powder
SoC FPGA-based sensorless ac drive applications. The main brake and electrically fed by a Voltage Source Inverter (VSI).
contribution of this work is to propose a systematic architec- It consists in a SEMIKRON VSI module (IGBT modules,
tural exploration of the controller. Optimal architectural solu- 800 V, 30 A). The used electrical
tions are obtained via a nondominated sorting genetic algorithm sensors provide measurements of stator currents and dc link
(NSGA-II). The proposed Hw/Sw partitioning procedure takes voltage. The analog-to-digital converter (ADC) board is com-
into account heterogeneous constraints such as the control re- posed of four AD9221 12-b ADCs. In this study, the digital
quirements (bandwidth and stability margin) and the Hw re- control unit is based on a Xilinx Virtex-5 FPGA (XC5VSX50T).
sources (available logic cells, memories, and hardware multi- It consists of 32640 lookup tables (LUTs) of six-input, 32640
pliers). It was tested on a sensorless speed controller of a syn- flip-flops, 288 DSP48E (hardware multiplier and accumulator
chronous machine using an extended Kalman filter (EKF). In- units), 4752-Kb blocks RAM. A transmission interface is
deed, this type of control strategy is representative in terms scheduled so as to ensure a real-time data transfer between the
of complexity of what can be found in current ac drives. The controller and the Host-PC.
FPGA-based SoC platform used in this project consists of a
Xilinx Virtex-5 embedding a Microblaze soft-core processor. B. Algorithm Specifications
The remainder of this paper is organized as follows. The developed sensorless speed controller is composed of the
Section II presents the proposed Hw/Sw codesign guidelines. following subparts:
The specifications of the control application are detailed in • speed controller based on Proportional-Proportional Inte-
Section III. Section IV synthesizes the algorithm development gral (P-PI) speed regulator.
BAHRI et al.: HARDWARE/SOFTWARE CODESIGN GUIDELINES FOR SYSTEM ON CHIP FPGA-BASED SENSORLESS AC DRIVE APPLICATIONS 2167
TABLE II
MAIN EQUATIONS OF THE EKF MODULE
(10)
(11)
(12)
bandwidth, sufficient stability margin, and a good disturbance
rejection. However, the stability of the controlled loop is af- As said before, the algorithm treatment is synchronized with
fected by the time delay . is the sum of the following two the PWM carrier. Knowing that in this case, the sampling period
terms: and the switching period have been fixed to 100 s, it yields that
• Sample and hold delay resulting from the PWM. is equal to 116.67 s.
This introduces a time delay expressed by
, where is the sampling period. C. Digital Realization of the Controller
• Computing time delay of the digital control which The digital realization is the design step where the discretiza-
depends on the complexity of the algorithm and on the tion, the normalization and the data quantization of the con-
performance of the used digital device. troller are achieved.
BAHRI et al.: HARDWARE/SOFTWARE CODESIGN GUIDELINES FOR SYSTEM ON CHIP FPGA-BASED SENSORLESS AC DRIVE APPLICATIONS 2169
Fig. 5. Validation of the EKF Estimation of (a) speed and (b) position.
TABLE III
BIT NUMBER AND FIXED-POINT FORMATS OF THE CONTROLLER
TABLE IV
FEATURES OFCONTROL MODULES
Table IV presents the set of the metrics of each functional sum is taken in the case of a serial implementation (see Fig. 7).
module . All the times are given as number of clock cy- A parallel execution of modules can be assigned to two modules
cles. The exploitation of the concurrency between the func- both implemented in hardware or one in software and the other
tional modules can reduce the execution time. To this purpose, a one in hardware. The case of Sw–Sw modules was not taken
parallelism variable “ ” is introduced. This parameter depends into account since the multiprocessors approach is not studied
on the scheduling and the data dependency between the dif- here.
ferent modules. The variable y is a vector of n-1 components,
. Each of these components is charac- B. SDFG Representation of the Control Algorithm
terized by a binary value {0,1}. The component is equal to 1
(resp. 0) when “ ” can be executed in parallel (resp. in series) In order to prepare the partitioning task, the whole EKF-
with “ .” based sensorless control algorithm was translated into a SDFG.
Thus, in the case of parallel modules, the total execution time As shown in Fig. 8, the proposed SDFG is composed of a set
is the maximum execution time of the two modules. The of nodes and edges. The nodes present the functional modules
BAHRI et al.: HARDWARE/SOFTWARE CODESIGN GUIDELINES FOR SYSTEM ON CHIP FPGA-BASED SENSORLESS AC DRIVE APPLICATIONS 2171
TABLE V
TIME/AREA PERFORMANCES (XILINX VIRTEX-5, XC5VSX50T)
C. Hw/Sw Partitioning
Once the characterization of functional modules and the
SDFG representation are performed, the designer can begin the
Hw/Sw partitioning process. They are three possible types of
implementations:
• full software implementation of the controller using the
soft-core processor.
• full hardware implementation of the controller using only
the FPGA fabric.
• mixed Hw/Sw implementation using the soft-core pro-
cessor and the FPGA fabric.
An in-depth study of the full hardware implementation and
of the software implementation has already been proposed [19],
[20]. These architectures were designed based on a dedicated
design methodology beginning from the system specifications
up to the experimentations. Table V summarizes the obtained
time/area performances of the full software and the full hard-
ware implementation of the sensorless control algorithm. One
can note that a full hardware design takes 25.1% of the FPGA
resources and the software design uses 12.4%. This should be
interpreted by the fact that 12.4% is occupied by the soft-core
processor and its peripherals. As for the execution time, the full
hardware controller has an execution time of 13.4 s and the full
software controller has an execution time of 137 s. It should
be noted that 5 s of the execution time of the Sw implementa-
tion is devoted to the format adaptation of data exchanged be-
tween Sw/Hw and Hw/Sw parts and the context switch. This
latter presents the computing time needed to store and restore
the state of the processor.
The obtained results demonstrate that a full hardware imple-
mentation provides a significant reduction of the execution time
Fig. 8. SDFG of the EKF-based sensorless current controller. but it requires the use of much more resources. This is related
to the complexity of the algorithm. A compromise is the parti-
tioning of functional modules between the modules to be exe-
“ ” while the edges denote the data dependencies and the cuted in software and those to be executed in hardware. This al-
number of exchanged data between the different modules. To lows the controller to reach the expected level of performances
2172 IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS, VOL. 9, NO. 4, NOVEMBER 2013
(13)
BAHRI et al.: HARDWARE/SOFTWARE CODESIGN GUIDELINES FOR SYSTEM ON CHIP FPGA-BASED SENSORLESS AC DRIVE APPLICATIONS 2173
TABLE VII
COMPARISON BETWEEN ACTUAL AND PREDICTED HW/SW ARCHITECTURES
Fig. 13. Experimental results—waveforms of the estimated (red curve) and the
measured rotor position (blue curve).
salient feature of this approach lies in an automatic architectural [12] R. P. Dick and N. K. Jha, “MOGAC: A multi-objective genetic algo-
exploration of the controller which is based on the search of rithm for hardware-software cosynthesis of distributed embedded sys-
tems,” IEEE Trans. Comput.-Aided Des. (CAD) Integr. Circuits Syst.,
the optimal solutions in terms of Hw/Sw partitioning. To this vol. 17, no. 10, pp. 920–935, Oct. 1998.
purpose, the NSGA-II was used to solve the corresponding [13] M.-L. Vallejo and J.-C. Lopez, “On the hardware-software partitioning
multi-objective optimization problem. Indeed, since the early problem: System modeling and partitioning techniques,” ACM Trans.
Design Autom. Electron. Syst., vol. 8, no. 3, pp. 269–297, Jul. 2003.
stages of the optimization process both control specifications [14] M. Savage, Z. Salcic, G. Coghill, and G. Covic, “Genetic algorithm
(bandwidth and stability margin) and FPGA limited internal for codesign optimization of DSP systems in FPGAs,” in Proc. IEEE
resources (FPGA fabric, memory, and hardware multipliers) ICFPT, 2004, pp. 291–294.
[15] S. Jovanovic and P. Poure, “Design of power electronic digital con-
were integrated. Thus, the set of the nondominated architec- troller based on FPGA/SOC using VHDL-AMS language,” in Proc.
tural solutions (Pareto front) was then derived. Among these IEEE ISIE, 2007, pp. 2301–2306.
solutions, the fastest which still respect the area constraint was [16] I. E. Ormaetxea, J. Andreu, I. Kortabarria, U. Bidarte, I. Martínez de
Alegría, E. Ibarra, and E. Olaguenaga, “Matrix converter protection
synthesized and tested on an experimental setup. The chosen and computational capabilities based on a system on chip design with
control algorithm benchmark for this study was a sensorless an FPGA,” IEEE Trans. Power Electron., vol. 26, no. 1, pp. 72–287,
speed drive of a synchronous motor based on an extended Jan. 2011.
[17] V. Delli Colli, R. Di Stefano, and F. Marignetti, “A system-on-chip
Kalman filter. In addition, an important effort was also made sensorless control for a permanent-magnet synchronous motor,” IEEE
to test the accuracy of the proposed solutions given by the Trans. Ind. Electron., vol. 57, no. 11, pp. 3822–3829, Nov. 2010.
NSGA-II algorithm. To this purpose, up to three different [18] Y. S. Kung, R. F. Fung, and T. Y. Tai, “Realization of a motion control
IC for X-Y table based on novel FPGA technology,” IEEE Trans. Ind.
nondominated solutions were synthesized and their actual Electron., vol. 56, no. 1, pp. 43–53, Jan. 2009.
time/area performances were compared to their estimated ones. [19] L. Idkhajine, E. Monmasson, and A. Maalouf, “Fully FPGA-based sen-
These latter are the ones proposed by the NSGA-II algorithm. sorless control for synchronous AC drive using an extended Kalman
filter,” IEEE Trans. Ind. Electron., vol. 59, no. 10, pp. 3908–3918, Oct.
Results were found satisfactory since only a maximum error 2012.
of 2.3% in area and a maximum error of 5.6% in time were [20] I. Bahri, L. Idkajine, E. Monmasson, and M. A. Benkhelifa, “Optimal
obtained. The inclusion of the communication time between hardware/software partitioning of a system on chip FPGA-based sen-
sorless AC drive current controller,” Trans. Math. Comput. Simulation,
the different functional modules of the control algorithm could 2012, accepted for publication.
help to reduce even more the timing error. Taking into account
of the communication time within the partitioning problem is Imen Bahri (M’13) was born in Tunisia in 1982.
one of the direct perspectives to this work. Another one is to She received the Ing. and M.S degrees in electrical
engineering from the National School Engineers of
integrate to the Hw/Sw partitioning other functions that are not
Tunis (ENIT), Tunis, Tunisia, in 2006 and 2007,
directly related to the control of the drive like the interface with respectively, and the Ph.D. degree from Cergy-Pon-
the supervisor and the diagnosis module. toise University, Cergy-Pontoise, France, in 2011.
She is currently an Assistant Professor with
Paris-XI University, Orsay, France, and a member
REFERENCES of the LGEP laboratory. Her current research in-
terests include the control applications applied to
[1] B. K. Bose, “Neural network applications in power electronics and automotive domain, the SoPC-based controllers,
motor drives—An introduction and perspective,” IEEE Trans. Ind. FPGA-based implementation of controllers, hardware/software (Hw/Sw)
Electron., vol. 54, no. 1, pp. 14–33, Feb. 2007. partitioning, and Hw/Sw codesign methodologies.
[2] S. Bolognani, L. Tubiana, and M. Zigliotto, “Extended Kalman filter
tuning in sensorless PMSM drives,” IEEE Trans. Ind. Electron., vol.
39, no. 6, pp. 276–281, Nov. 2003.
[3] Q. N. Le and J. W. Jeon, “Neural-network-based low-speed-damping
controller for stepper motor with an FPGA,” IEEE Trans. Ind. Elec- Lahoucine Idkhajine (M’10) was born in 1983 in
tron., vol. 57, no. 9, pp. 3167–3180, Sep. 2010. Massa, Agadir, Morocco. He received the “Master
[4] T. O. Kowalska and M. Aminski, “FPGA implementation of the mul- Professionnel GEII” and Ph.D. degree from Cergy-
tilayer neural network for the speed estimation of the two-mass drive Pontoise University, Cergy-Pontoise, France, in 2007
system,” IEEE Trans. Ind. Inf., vol. 7, no. 3, pp. 436–445, Aug. 2011. and 2010, respectively.
[5] L. Idkhajine, E. Monmasson, M.-W. Naouar, A. Prata, and K. Boual- From October 2010 to August 2011, he was an As-
laga, “Fully integrated FPGA-based controller for synchronous motor sistant Lecturer with Arts et Métiers ParisTech, Lille,
drives,” IEEE Trans. Ind. Electron., vol. 56, no. 10, pp. 4006–4017, France. He is currently an Assistant Professor with
Oct. 2009. Cergy-Pontoise University, Cergy-Pontoise, France,
[6] E. Monmasson, L. Idkhajine, M. N. Cirstea, I. Bahri, A. Tisan, and W. and a member of the SATIE Laboratory (SETE team).
Naouar, “FPGAs in industrial control applications,” IEEE Trans. Ind. His research interests are focused on the design and
Electron., vol. 7, no. 2, p. 224, May 2011. the implementation (using FPGA SoC devices) of controllers and observers for
[7] J. J. Rodriguez-Andina, M. J. Moure, and M. D. Valdes, “Features, power electronics and drives applications.
design tools, and application domains of FPGAs,” IEEE Trans. Ind.
Electron., vol. 54, no. 4, pp. 1810–1823, Aug. 2007.
[8] M. Finc and A. Zemva, “Profiling soft-core processor applications for
hardware/software partitioning,” J. Syst. Architecture, vol. 51, no. 5, Eric Monmasson (M’96–SM’06) received the
pp. 415–329, May 2005. Ing. and Ph.D. degrees from the Ecole Nationale
[9] R. Lysecky and F. Vahid, “A study of the speedups and competitive- Supérieure d’Ingénieurs d’Electrotechnique d’Elec-
ness of FPGA soft processor cores using dynamic hardware/software tronique d’Informatique et d’Hydraulique de
partitioning,” in Proc. DATE’05 Conf., 2005, pp. 18–23. Toulouse (ENSEEIHT), Toulouse, France, in 1989
[10] R. Obermaisser and P. Gutwenger, “Model-based development of and 1993, respectively. \
MPSoCs with support for early validation,” in Proc. IEEE IECON’09 He is currently a Full Professor and the Head of
Conf., 2009, CD-ROM. the Institut Universitaire Professionnalisé de Génie
[11] K. Deb, A. Pratap, S. Argarwal, and T. Meyarivan, “A fast and Electrique et d’Informatique Indutrielle (IUP GEII),
elitist multiobjective genetic algorithm: NSGA-II,” IEEE Trans. Evol. University of Cergy-Pontoise, Cergy-Pontoise,
Comp., vol. 6, no. 2, pp. 182–197, Apr. 2002. France. He is also with the Systèmes et Applications
2176 IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS, VOL. 9, NO. 4, NOVEMBER 2013
des Technologies de l’Information et de l’Energie laboratory (SATIE, UMR Mohamed El Amine Benkhelifa received the elec-
CNRS8029). He is the author or coauthor of three books and more than 150 tronics engineer degree from the U.S.T.O., Oran,
scientific papers. His current research interests include the advanced control Algeria, in 1987, and the Ph.D. degree in physics
of electrical motors and generators and the use of FPGAs for energy control from Paris-V University, Paris, France, in 1992.
systems. He is now an Assistant Professor of elec-
Prof. Monmasson was the chair of the technical committee on Electronic Sys- trical engineering and computer science with the
tems-on-Chip of the IEEE Industrial Electronics Society (2008–2011). He is ETIS Laboratory, University of Cergy-Pontoise,
also a member of the steering committee of the European Power Electronics Cergy-Pontoise, France. His research interests
Association and the chair of the number one technical committee of the Interna- include coarse-grained and fine reconfigurable
tional Association for Mathematics and Computers in Simulation (IMACS). He arrays, domain-specific FPGAs, reconfigurable
was the general chair of ELECTRIMACS 2011 Conference. He is an associate computing architectures, and operating systems for
editor of the IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS and the IEEE reconfigurable architectures.
TRANSACTIONS ON INDUSTRIAL INFORMATICS.