You are on page 1of 6

FPGA-Based Digital Control Implementation of a

Power Converter for Teaching Purposes


José I. Artigas, Luis A. Barragán, Isidro, Urriza, Denis Navarro, and Óscar Lucía
Department of Electronic Engineering and Communications. University of Zaragoza.
María de Luna, 1. 50018, Zaragoza. Spain
E-mail: jiartigas@unizar.es

Abstract- - European universities are nowadays immersed in There are DSPs that include a floating point unit (FPU) to
curricula changes to adapt them to the European Higher speed up floating point operations in software [13]. This way,
Education Area commitments. The new criteria give significant
importance to hands-on training sessions in order to develop
the control algorithm can be written in C language using float
specific skills of the students according to their professional type variables, what is straightforward with regard to a fixed-
training. point implementation. The advances in silicon technology
This paper presents the development and application of a have resulted in FPGAs, which in addition to the configurable
digital controller of a power converter for teaching purposes. logic elements integrate several hardware multipliers, RAM
This design if based on an FPGA and its development is made as blocks, embedded processors… [14], [15]. This technology
close as possible to a real design. The digital controller is allows the designer to use an FPGA to efficiently implement
implemented using three different approaches. Firstly, two real-time controllers.
hardware implementations using fixed-point and floating-point
arithmetic are proposed. The use of the VHDL 1076-2008 Following this trend, this work presents an FPGA-based
standard that includes fixed and floating point packages digital control implementation for a dc-dc converter using
shortens the design cycle. The third approach is a software three different approaches for teaching purposes (Fig. 1). The
implementation based on the embedded soft-core first two approaches are hardware implementations using
microprocessor MicroBlaze. The design of the proposed fixed-point and floating-point arithmetic [16], respectively.
platform is explained, and its use in the hands-on training
sessions is detailed. The third approach is a software implementation using the
embedded soft-core microprocessor MicroBlaze from Xilinx.
I. INTRODUCTION In order to verify the functionality, the power converter,
the analog to digital converter (ADC), and the digital
Electronics curricula in European universities are evolving controller are simulated in closed-loop using VHDL [17].
to converge in common criteria according to the European This paper is organized as follows. Section II describes the
Higher Education Area [1]. The new trends emphasize the power converter selected as a case of study for digital control
importance of developing specific skills of the students, design, along with its implementation. Section III explains
where hands-on training sessions play a key role [2]. In the digital controller design and the three proposed
particular, an applied and professional orientation of the implementation approaches. Section IV describes the use of
developed activities is desired. the proposed platform in a digital control course and, finally,
This paper is focused on the digital control applied to Section V summarizes the main conclusions of this paper.
power converters. Digital control has become a key aspect of
the power converter design process [3], determining the final
reliability and performance. In order to cover the whole
controller design process, a hands-on training tool is
proposed.
Most of the digital controllers developed up to now have
been implemented on Digital Signal Processors (DSPs) [4]-
[6], or Field-Programmable Gate Arrays (FPGAs) [7]-[9].
The DSP user develops software code using high level
languages, such as C. The FPGA user describes digital
hardware using a Hardware Description Language (HDL)
[10].
Control algorithms are usually designed in a floating-point
format often using tools, such as MATLAB. The conversion
of these algorithms to run on a fixed-point DSP is a laborious
and time-consuming task [11]. In the same line, [12] Fig. 1. Reference example: Buck converter digitally controlled.
identifies floating-point to fixed-point conversion as a
difficult aspect of implementing an algorithm on an FPGA.

978-1-4577-0133-7/11/$26.00 ©2011 IEEE 55


II. SYSTEM DESCRIPTION The error between the desired and measured output voltage is
Fig. 1 shows the reference example used along the paper. processed by a digital controller C(z) to determine the value
The power stage is a synchronous buck converter with the of the switch duty ratio. The digital pulse width modulator
(DPWM) generates the driving signals that control the buck
following parameters: input voltage VIN = 5 V, L = 68 H,
switches.
C = 220 F, capacitor ESR (equivalent series resistance)
A printed circuit board including the buck converter,
RC = 80 m, inductor DC resistance RL = 98 m, load
ADCs, and conditioning circuits has been developed for lab
resistances RO = 5 , and switching frequency exercises. Fig. 2 shows a detailed schematic of the board.
fsw = 100 kHz. The output voltage vo has to be regulated at Two ADCS7476 12-bit serial A/D converter chips are
Vo_ref = 2.5 V. Switch Q3 is included to produce load included. The circuitry around IC3 and IC5 conform 2-pole
transients. Bessel low-pass anti-aliasing filters. Connector JP2 fits to the
The output voltage is measured by using an ADC with full 12-pin Pmod connectors available in several low cost Digilent
scale voltage VFS = 3.3 V. A current shunt monitor with a FPGA development boards, like Nexys2, Atlys or Genesys.
second ADC is also included to sense the inductor current in Next Section describes the digital controller designed, and
order to evaluate different control strategies. the different implementations considered for digital control
This paper describes a voltage control strategy, where the courses.
voltage ADC converts the output voltage to a digital word.

Fig. 2. Proposed buck-converter board schematic.

56
III. FGPA-BASED DIGITAL CONTROL
The continuous time transfer function of the plant Gp(s),
including the buck converter, the ADC gain Kadc, and the
PWM gain Kpwm is:
Gp ( s )  K pwm  Gvd  s   K adc . (1)

The small signal model of the buck converter in s domain


[18] is shown in (2) where R  R0 2 or R  R0 depending
on the state of the switch Q3.
R
VIN  RCCs 1
R  RL
Gvd  s   . (2)
 R  RC  2  L 
LC   s   RCC   R / / RL  C   s 1
 R  RL   R  RL 
Fig. 3. Open-loop Bode plot.
With R  R0 2 :

8.468 105 s  4.811 b0  b1 z 1  b2 z 2


Gvd ( s )  . (3) C ( z)  , (7)
1.486 10 8 s 2  6.452 105 s  1 1  a1 z 1  a2 z 2

where:
In a simple counter-based implementation, the DPWM
resolution is equal to the FPGA clock frequency (50 MHz)  b0 , b1 , b2    0.0528,  0.0964, 0.0438 ,
(8)
divided by the switching frequency (100 kHz), yielding 500  a1 , a2    1.5182, 0.5182  .
in this case. The 9-bit duty cycle command is regarded as an
unsigned fraction. Thus, the gain is [6]:
Fig. 3 shows the open loop frequency response of the
512 discretized plant with the controller. Notice that the frequency
K pwm  . (4) domain performance parameters agree quite well with the
500
specifications.
The ADC resolution must be lower than the DPWM in After obtaining the digital controller, the next step is the
order to avoid limit-cycling oscillations. Then, only the 8 FPGA implementation of the control system. Next
most significant bits of the ADC are used. The 8-bit ADC subsections describe the different proposed implementations.
measures analog voltages in the range [0.0, 3.3 V]. The result A Fixed-Point and Floating-Point Implementations
is considered as an unsigned integer. Thus, the gain is [6]:
Fig. 4 shows the block diagram of the digital circuit to be
28 1 implemented in the FPGA. It consists basically of five
K adc  V . (5)
3.3 blocks: the DPWM generator, the ADC interface, the digital
For a better performance, the ADC resolution could be controller, the user interface, and the control unit.
increased by implementing a high-resolution DPWM. A counter-based DPWM has been implemented, with a
Several methods can be used in order to design the digital free-running counter CNT_D, a register REG_D that stores
controller. A digital redesign of a suitable analog controller the duty command, and a digital comparator. The signal Q1
GC(s) has been used here. The transfer function of the that controls the converter switch is set to turn on it when the
proposed analog controller is: duty command is greater than the counter value. The ADC
interface block generates the NCS and SCLK signals that
k ( s  z1 )( s  z L ) control the ADC converter, reads its serial data output
GC ( s )  (6)
s ( s  pL ) SDATA, and stores the conversion result in ADCREG register.
The user interface block reads four slide switches (SW1 to
The system bandwidth is set at 5 kHz with a phase margin SW4) connected to the FPGA. SW1 allows the circuit to
(PM) of 60º. Then, the analog controller must be designed operate on closed-loop or open-loop mode. In the last mode,
with a PM of 69º to take into account the phase lag the duty-cycle is held constant. SW2 allows generating load
introduced by the DPWM. The discrete-time controller GC(z) transients by controlling Q3. SW3 increments, and SW4
obtained by using the bilinear transformation from the former decrements the reference command (Vref) in closed-loop, or
analog controller is: the duty command (REG_D) in open-loop. The ADC

57
measures are displayed in the four-digit seven-segment The custom peripherals are DPWM and ADC Interface.
display included in the FPGA board. The control unit The DPWM block generates the gating signal Q1 of the
synchronizes all the blocks by means of a finite state machine power converter. Besides, it also generates an interrupt signal
(FSM). at the end of the switching period in order to implement the
The digital controller reads the conversion result closed-loop control. The ADC Interface block generates the
(ADCREG), computes the error between the desired (Vref) NCS and SCLK signals that control the ADC converter, reads
and measured output voltage, and calculates the new duty its serial data output SDATA, and stores the conversion result
command DUTY. The block ToInt is included to perform the in a register.
format conversion from DUTY to the DPWM input register 2) Software platform: This platform contains the program
REG_D. The implementation of the controller, including the which runs on the MicroBlaze processor. This interrupt-
word-length selection and the format-conversion tasks can be driven program implements two main tasks. Firstly, it
carried out as explained in [19], [20]. Besides, the VHDL manages the user interface in background. Secondly, it
1076-2008 [21] fixed_pkg and float_pkg are used to obtain executes the closed-loop control algorithm associated to the
straight-forward fixed-point and floating-point DPWM interrupt, in order to obtain a new duty command
implementations respectively. every switching cycle. The proposed controller can be
implemented either using fixed-point arithmetic or floating-
B Embedded-Processor Implementation
point arithmetic. For this design, floating-point arithmetic is
used taken advantage of the floating point unit (FPU).
Fig. 5 shows the block diagram of the FPGA embedded
processor implementation. A System on Programmable Chip
(SoPC) arquitecture based on the soft-core processor IV. CASE STUDY
MicroBlaze from Xilinx has been implemented [22], [23].
The system consist therefore of the processor plus a set of A Background
peripherals which are connected to MicroBlaze through the
Processor Local Bus (PLB). The implementation is therefore The proposed teaching tool has been developed for the
divided into two platforms: Hardware platform, and Software subject Digital Control of Power Converters of the
platform. Electronics Master taught in the University of Zaragoza,
1) Hardware platform: This platform contains the digital Spain. This is an elective subject included in the Power
hardware of the system. It consists of two types of hardware Electronics curricula of the master. The main skill to be
blocks: Intellectual Property (IP) cores, which are provided developed by the students is the implementation of digital
by Xilinx through the library of components; and custom controllers for power converters, focusing on the FPGA
hardware peripherals, which have been described in VHDL technology. In this subject, the hardware implementation
language and implement specific tasks. using fixed-point arithmetic is proposed.
The following IP cores have been used: The MicroBlaze
processor, which is an embedded 32-bit RISC (Reduced
Instruction Set Computer) soft-core optimized for Xilinx
FPGAs; Block RAM (BRAM), memory block of 32 kB that Software Platform (C)
includes program data and instructions; and Watchdog, timer 4
SW1-SW4
module which helps ensure that the processor is running. CLOSED–LOOP
CONTROL
USER
INTERFACE
12
Display
Q1 Q3

IP CORES CUSTOM HW
DPWM Control Unit
FPGA

A>B
Interrupt

A B
Modulator

4
SW1-SW4 LMB
DPWM
BRAM

CNT_D User 12 MicroBlaze Q1


LD
FSM Display 32
®
REG_D Interface
Q3
9
FPGA

Processor Local Bus 32


ToInt EndC StartC
2 NCS,
Watchdog ADC Control SCLK
DUTY Vref SDATA
2
ADCREG

NCS
1
b0  b1z  b2 z 2
e(k) + 8 8 Interface SCLK
-
1  a1z 1  a2 z 2 Control SDATA
Hardware Platform (VHDL)

Digital controller ADC Interface


Fig. 5. FPGA embedded processor implementation of the digital
control.
Fig. 4. FPGA hardware implementation of the digital control.

58
B Hands-on Training Sessions

The materials required for the sessions are the power


converter board, the FPGA board, a 5 V, 1 A power supply,
and an oscilloscope; apart from the Integrated Design
Environment (ISE) tools from the FPGA vendor. The power
converter has been designed and implemented in the
University, whereas affordable Digilent FPGA boards are
used to implement the digital controller. Fig. 6 shows the
final aspect of the buck converter attached to a Nexys2 FPGA
board.
The hands-on training sessions are divided into 3 major
topics:
(a)
1. A/D Converter Interface and DPWM
This topic is divided into two 2-hours sessions where the
students design and test the A/D converter interface and the
DPWM, as shown in Fig. 4. The A/D converter interface is
tested by measuring and displaying the buck output voltage
from a constant duty-cycle, i.e., from an open-loop buck
control. The measures are displayed in the four-digit seven-
segment display included in the FPGA board. Besides, some
guidelines about the need and implementation of high-
resolution DPWMs are given.

2. VHDL Modeling of Power Converters (b)


In this session the students learn how to model a power Fig. 7. Load transient. (a) Simulation results. (b) Experimental
converter by using a hardware description language, VHDL. measurements (50 mV/div, 50 µs/div).
The aim of this session is to obtain a VHDL model of the
power converter, which will be used to simulate the whole
3. Digital Control of the Buck Converter
system including the digital control hardware and the power This session is also divided into two 2-hours sessions. The
converter. students learn how to design and implement a digital
controller. A special emphasis is placed on the arithmetic
implementation using fixed-point representation. The students
simulate the complete system by using the VHDL model
obtained in previous sessions. Besides, the final controller is
tested by using the experimental platform previously
described.

C Future Developments

The proposed platform has been introduced during the


2010-2011 academic year with a group of 15 students,
obtaining a positive feedback from them. Future
developments include an analysis including both teachers and
students to assess the main benefits and drawbacks of the
proposed platform. This will allow improving the hands-on
training sessions for teaching digital controller design.
Several features included in the converter board have not
tested yet. Switch Q2 can be controlled in order to have a
Fig. 6. Buck converter prototype and Nexys2 FPGA board used in synchronous buck. Besides, advanced control strategies may
hands-on training sessions.
be implemented by using the available current loop.
In addition to this, the platform is intended to be also used

59
for teaching the elective subject Embedded Systems. In this [7] C. Paiz, M. Porrman, "The utilization of Reconfigurable Hardware to
Implement Digital Controllers: a Review", Proc. IEEE ISIE, pp. 2380-
subject, the FPGA-based control architecture includes an 2385, 2007.
embedded processor and additional digital hardware. The [8] A. de Castro, P. Zumel, O. García, T. Riesgo, and J. Uceda,
buck converter and the proposed digital controller can be "Concurrent and Simple Digital Controller of an AC/DC Converter
with Power Factor Correction Based on FPGA", IEEE Trans. on
introduced as an easy to understand application example. Power Electronics, vol. 18, no. 1, pp. 334-343, January 2008.
[9] S. Saggini, P. Mattavelli, G. Garcea, and M. Ghioni, "A Mixed-Signal
V. CONCLUSIONS Synchronous/Asynchronous Control for High-Frequency DC-DC
In this paper, a hands-on training platform for teaching Boost Converters", IEEE Trans. Industrial Electronics, vol. 55, no. 5,
pp. 2053-2060, May 2008.
digital control applied to power converters has been [10] T. Riesgo, Y. Torroja, and E. de la Torre, “Design methodologies
proposed. It is composed of a buck converter and an FPGA- based on Hardware Description Languages,” IEEE Trans. Industrial
based control architecture. Electronics, vol. 46, no. 1, pp. 3-12, February 1999.
[11] K. Godbole, "Converting Analog Controllers to Smart Controllers
Three different implementations of the digital control have with the TMS320C2000 DSPs", Texas Instruments, Application
been proposed. Two of them are hardware implementations Report SPRA995, June 2004.
[12] T. Hill, "AccelDSP synthesis tool floating-point to fixed-point
using fixed-point and floating-point arithmetic, and the third conversion of MATLAB algorithms targeting FPGAs", Xilinx WP239,
is a software implementation using a soft-core embedded 2006.
processor. [13] A. Mohammed, " Floating-point Digital Signal Controllers in
Embedded Applications", Texas Instruments Inc., TIDC 2007.
The proposed platform has been introduced during the [14] J.J. Rodríguez-Andina, M.J. Moure, and M.D. Valdes, "Features,
academic year 2010-2011 in the elective subject Digital Design Tools, and Application Domains of FPGAs", IEEE Trans.
Control of Power Converters obtaining positive results. Industrial Electronics, vol. 54, no. 4, pp. 1810-1823, August 2007.
[15] E. Monmasson, and M.N. Cirstea, "FPGA Design Methodology for
Future improvements based on the assessment of this Industrial Control Systems – A Review", IEEE Trans. Industrial
methodology will be performed, and the proposed platform Electronics, vol. 54, no. 4, pp. 1824-1842, August 2007.
will be extended to other subjects. [16] P. Zumel, C. Fernandez, M. Sanz, A. Lazaro, and A. Barrado, "Step-
by-step design of an FPGA-based digital compensator for DC/DC
converters oriented to an introductory course," to be published in IEEE
Transactions on Education, vol. PP, no. x, pp. 1-1, 2011.
ACKNOWLEDGMENT [17] L.A. Barragán, I. Urriza, D. Navarro, J.I. Artigas, J. Acero, and J.M.
This research was supported in part by the Spanish Burdío, "Comparing simulation alternatives of FPGA-based
controllers for switching converters", Proc. IEEE ISIE, pp. 419-424,
MICINN under Project TEC2010-19207 and Project 2007.
CSD2009-00046, by DGA under Project PI065/09, and by [18] W. Al-Hoor, J. Abu-Qahouq, L. Huang, I. Batarseh, "Design
the Bosch and Siemens Home Appliances Group. Considerations and Dynamic Technique for Digitally Controlled
Variable Frequency DC-DC Converter" ", Proc. IEEE PESC, pp. 846
The authors are with the Department of Electronic – 850, 2007.
Engineering and Communications and the Aragon Institute of [19] I. Urriza, L. A. Barragán, D. Navarro, J. I. Artigas, and O. Lucía,
"Word length selection method for controller implementation on
Engineering Research (I3A). FPGAs using the VHDL-2008 Fixed-point and Floating-point
packages," EURASIP Journal on Embedded Systems, vol. 2010, no. 1,
pp. 1-12, 2010.
REFERENCES [20] I. Urriza, L. A. Barragán, J. I. Artigas, D. Navarro, and O. Lucía,
"FPGA implementation of a digital controller for a dc-dc converter
[1] J. J. Rodriguez-Andina, L. Gomes, and S. Bogosyan, "Current trends
using floating point arithmetic " in IEEE Annual Conference of the
in industrial electronics education," IEEE Transactions on Industrial
Industrial Electronics Society, 2009, pp. 2913-2918.
Electronics, vol. 57, no. 10, pp. 3245-3252, 2010.
[21] IEEE Standard VHDL Language Reference Manual (1076-2008), E-
[2] A. Mohan, D. Merle, C. Jackson, J. Lannin, and S. S. Nair,
ISBN: 978-0-7381-5800-6, January 2009.
"Professional skills in the engineering curriculum," IEEE Transactions
[22] O. Lucía, L. A. Barragán, J. M. Burdío, O. Jiménez, D. Navarro, and I.
on Education, vol. 53, no. 4, pp. 562-571, November 2010.
Urriza, "A versatile power electronics test-bench architecture applied
[3] N. Mohan, et al., "Restructuring of first courses in power electronics
to domestic induction heating," IEEE Transactions on Industrial
and electric drives that integrates digital control," IEEE Transactions
Electronics, vol. 58, no. 3, pp. 998-1007, March 2011.
on Power Electronics, vol. 18, no. 1, pp. 429-437, 2003.
[23] O. Lucía, I. Urriza, L. A. Barragan, D. Navarro, O. Jiménez, and J. M.
[4] A. Prodic, D. Maksimovic, R.W. Erickson, "Design and
Burdío, "Real-time FPGA-based hardware-in-the-loop simulation test-
Implementation of Digital PWM Controller for a High-Frequency
bench applied to multiple output power converters," IEEE
Switching DC-DC Power Converter", Proc. IEEE IECON, pp. 893-
Transactions on Industry Applications, vol. 47, no. 2, pp. 853-860,
898, 2001.
March/April 2011.
[5] A. Mohammed, "Digital Control of Power Converters", IEEE APEC,
vol. 1, Seminar 4, February 2008.
[6] H. Al-Atrash, I. Batarseh, "Digital Controller Design for a Practicing
Power Electronics Engineer", Proc. IEEE APEC, pp. 34 – 41, 2007.

60

Powered by TCPDF (www.tcpdf.org)

You might also like