Ljusev
Ljusev
Ljusev
Published in:
Ninth IEEE Workshop on Computers in Power Electronics COMPEL 2004
DOI:
10.1109/CIPE.2004.1428156
Publication date:
2004
Document Version
Final published version
Link to publication
Citation (APA):
Ljusev, P., & Andersen, M. A. E. (2004). Digitally-controlled PC-interfaced Boost Converter for Educational
Purposes. In Ninth IEEE Workshop on Computers in Power Electronics COMPEL 2004 (pp. 023). IEEE. DOI:
10.1109/CIPE.2004.1428156
General rights
Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners
and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights.
Users may download and print one copy of any publication from the public portal for the purpose of private study or research.
You may not further distribute the material or use it for any profit-making activity or commercial gain
You may freely distribute the URL identifying the publication in the public portal
If you believe that this document breaches copyright please contact us providing details, and we will remove access to the work immediately
and investigate your claim.
Digitally-controlled PC-interfaced Boost Converter
for Educational Purposes
Petar Ljubev, Michael A.E. Andersen
!&sted e DTU,Automation
Technical University of Denmark
Elektrovej DTU Building 325
Kgs. Lyngby DK-2800, Denmark
Telephone: +45 4525 3486, Fax: +45 4588 61 1I
Email: pl@oersted.dtu.dk. ma@oersted.dtu.dk
Abslrrrct-Thls paper describes implementation of a simple Due to these capabilities and obvious advantages of the
digital PID control algorithm for a boost converter using P digitally controlled converters, an aim was set for the project
cheap fixed-point &bit microcontroller. Serial commudcation to to: develop a simple DC-DC converter controlled by a mi-
a PC server spplication is established for easier downloading
of compensator pameters and current and voIfage waveform crocontroller using a PID control algorithm; use serial com-
acquisition. At the end, client application is presented which use6 munication RS232 to communicate with a PC, where the
TCPlrP connection for operating the &@tally controUed boogt measured quantities will be processed further and presented
converter over Internet. The aim of this cheap and flexible PC- in a meaningful way; download new PID compensator gahs
interfaced boost converter bench is predomhmtly educatiod, to the microcontroller using a graphical user interface (CUI) of
to allow students to synthesize dlirerent digitPl eontmllers add
compare their performance. the PC application; help students in choosing the stabilizing
gains of the PID compensator to improve the power supply
1. INTRODUCTlON dynamics and reject disturbances; allow the server application
connected to the test bench to communicate with similar
The field of DC-DCConverters and their control has been up client applications distributed over the Internet using TCP/P
to now extensively and thoroughly investigated and elaborated protocol, so that the interested students can access the test
[I], so that there are almost no unresolved issues. While bench and leam by making experiments on a real power supply
the analog control algorithms in general perfom very good, from home.
implementing digital control of DC-DC converters is still The project was done during the three weeks course period
tedious. Analog current mode PWM controllers are common in June-July 2003,as a part of the "Advanced Power Electron-
on the market and their price is affordable, while implementing ics" course at the Technical University of Denmark (DTU) in
the control in a microcontroller with the associated analog Kgs. Lyngby. Due to the narrow time frame, it was decided
measuring and conditioning circuitry can be quite expensive, that mare attention will be pay4 to achieving the educational
not mentioning the time spent to deveIop the code and debug objective i.e. developing a power electronics system that is
it. When implementing the control in a cheap fixed-point easy to control through a PC application and the specially
&bit microcontroller with built-in AID converters and PWM designed GUI, building a bridge from the custom application
counters, many internal restrictions (low clock speed, reduced to MATLAB to alleviate the control design and opening a
instruction set with only 8-bit register manipulation, no in- gateway from the test bench to the internet to let students
struction pipelining and parallelism, no hardware multiplica- access it from a distance. The complexity and performance of
tion, possible limit cycling due to insufficient PWM modulator the power converter itself was put in second plan, although its
resolution) can substantially limit the performance and control selection was done with regard to the educational goals and
bandwidth. Some ways to alleviate these problems have been the student abilities this test bench should develop.
already addressed [23, [3], 141- For this "educational purpose" projW Microchip microcon-
However, once the analog controller has been designed wller PIC16FS77 I51 with the In-Circuit Debugger (MF'LAB
and hard-wired, the product is self contained and no further ICD) was already available. Although the processor core is
changes are possible. Communication with the power supply running at "moderate" dock rate of 20 Mhz and has no
is usually restricted to "Power god' signals, which cannot hardware multiplier, it has plenty of peripheral circuitry like
give enough insight in the power supply condition or help AID converters, timers, counten, PWM modules,USART and
troubleshooting. On the other hand, digital based systems can plenty of interrupt sources that made the implementation much
offer: flexibility in updating the conml program and controller easier. Additional advantage is the relatively small instruction
parameters, lower noise sensitivity, programmability without set of 35 single words to leam as well as plenty of avdabk
external components and easy communication with the host resources and math routine libraries for the aforementioned
system using some protocol (RS232,RS485, SPI, 12C etc). family of micr~controllers.
02004 IEEE.
0-7803-8502-0/04/$20.00
210
Authorized licensed use limited to: Danmarks Tekniske Informationscenter. Downloaded on February 17,2010 at 07:42:36 EST from IEEE Xplore. Restrictions apply.
11. BOOST CONVEXTER Active filters provide also a lower output impedances which
When having the practical and educational considerations in are necessary for faster settling of the sampling section of the
mind, the boost converter operating in continuous conduction sample-and-hold circuit, multiplexer and the AID converter. To
mode (CCM)was a highly appealing DC-DC converter to finish the subject of interfacing, a dedicated gate-driver chip
select. It was concluded that the bench would help students was used for switching the logic-level power MOSFET.
clarify the concept of stepping-up the DC input voltage and
show a power electmnics smchue with complex control-to- Iv. DlGlTAt CONTKOL OF THE CCM BOOST CONVERTER
output transfer function G v d ( s ) (two poles and one right- Students usually find the analog control synthesis easier,
half plane zero). Apart from this educational objective, the with the Bode-diagram loop shaping and phase-margin spec-
construction itself was alleviated due to the possibility of using ifications being their favorite tool. Therefore, the design was
an N-type MOSFET referenced to ground, which necessitates performed entirely in the analogue domain, by mapping all
only a simple low-side driver. the digital transfer functions into the latter.
The boost DC-DC converter design specifications were The implemented control block diagram is given in Fig. 1.
chosen as follows: input voltage V, = 5 V, output voltage Control-to-outputtransfer function G v d ( 8 ) of the continuous
V = 12 V, output power Pat = 12 W,maximum voltage and conduction mode boost converter is [l]:
current ripple: AvmDz= 1% V, and Ai,,, = 0.2 A. With
regard to the capabilities of the PICl6F877 microcontroller,
it was obvious that enough time should be allocated for the
conlrol algorithm to execute. This means that the switching
frequency should be low, but certainly out of the audio where V is the output voltage, D' = 1 - D is the complement
band. Therefore, the switching frequency was chosen to be of the duty-cycle D , L is the filter inductance, C is the filter
f. = 20 kHz. These specifications were used to select the capacitance and R is the load resistance. One of the factors
output filter and semiconductor components. that strongly limits the available performance from a CCM
In order to be able to measure all the desired converter boost converter i s the right half-plane zero at the angular
quantities: converter input and output voltage V,, and V . , frequency of w R H P Z = D"R/L, dropping the maximum
and input and output current li, and lout,the boast converter control bandwidth usually to around W R H p Z / 3 [63.
was supplied with resistive voltage dividers and current sense The transfer function of the implemented third-order anti-
resistors. aliasing filter is:
Regarding the converter control, it was concluded that
implementing digital conlrol of only the output voltage will
suffice,Current programmed conaol, although very desirable
and popular in power supplies, would further complicate both
the design and the program code and will necessitate use of where RI, RQ form a scaling-down resistive divider network
separate analog comparators or more complex microcontrollers and ao, al,a2 are the anti-aliasing filter coefficients.
with built-in comparators to achieve high speed of the inner Due to the short acquisition and conversion time of the AID
loop. converter, it is assumed that it does not introduce any dynam-
ics, so the transfer function is constant KAD = 1023/2.5
111. INTERFACING THE MICROCONTROLLER TO THE POWER ( d e 1023=V,,f = 2.5 V).
CONVERTER The continuous-time PID compensator is given by:
When interfacing a power converter to a digital controller,
properly conditioned analog to digital (AID) conversion is
of profound importance. The project proposal demanded that
the microcontroller is used not only for control, but also
where e ( t ) is the error signal and u ( t ) is the compensator
for data acquisition of the input/output voltages! currents. output.
With four quantities to be measured, the acquisition time was
requested to be rather short and certainly not longer than few
microseconds. This was not possible with the internal 10-bit PID compensator PWM modulator . Boost converter
AID converters of PIC16F877 which have a total conversion
time around 30 ps, so an external l0-bit A/D converter
AD7470 with a parallel output was used, allowing for an order
of magnitude faster acquisitions.
V . I.,
i
In order to provide for proper AID conversion of measured K* n
voltages and currents, AID converter was preceded by third- A/D converter Anti-aliasing aod
order active anti-aliasing filters, designed to give less than 1 switching harmonics film
LSB error at f s / 2 = 10 IrHz, i.e. provide -60 d 3 of atten-
uation, as well as sample-and-hold and multiplexer circuihy. Fig. 1. Digital control system of the boost C O I I V ~ ~ ~
21 I
Authorized licensed use limited to: Danmarks Tekniske Informationscenter. Downloaded on February 17,2010 at 07:42:36 EST from IEEE Xplore. Restrictions apply.
The discrete version of the P D compensator in (3) is: [2]. Digital code of 1023 correspondsto a duty cycle of D = 1,
c so ideally the transfer function of the PWM module is equal
u ( ~ T=) K,e(kT)+K: ) ] ratio. However, the calculated duly cycle from the
e ( n ~ ) + ~ ~ [ e ( k ~ ) - e ( ( k - 1to) ~their
n=O PID compensator takes effect at the end of the PWM period
(4) to allow glitch-6ee PWM operation. Thus a delay of one
where K: = KiT is the discrete integral gain,:'A = Kd/T switching period T, is inuoduced in the PWM modulator.
is the discrete derivative gain, and T is integratiodderivation Unfortunately, the PWM modulator is not the only source of
time period (T = nT, where T, is the sampling period and n delays. After the PID algorithm was implemented in its com-
represents the number of sampling periods T, used to calculate plete form by extensive use of software multiplication, it was
the PID terms). found out that calculation of each of the PID terms resulted in
Using the Laplace transform on (3) the ideal PID compen- one additional switching period delay 5"'. For example, with
sator transfer function in the s-domain is obtained: all terms calculated (three multiplicationddivisioas and many
additiondsubtractions)it was concluded that a maximum of 3
switching periods was needed to calculate the new duty cycle,
based on values measured 3 + l 4 switching periods behind,
Moving to frequency domain s 4j w , ( 5 ) becomes: one being for the delay introduced in the PWM.In order to
do the control synthesis, all of these delays were "dumped"
into the PWM modulator transfer function to yield
The magnitude IGc(jw)I of (6) in dB is:
v. MICROCONTROLLER
PROGRAM IMPLEMENTATION
Microcantroller program was divided into three major parts:
Equations (7)and (8) can be used to calculate K p , Ki and initialization, main program and interrupt service routine.
Kd to achieve certain magnitude A and phase 4 at angular Initialization part of the code is the one which i s executed
frequency of w. From (S), proportional gain is found to be: at start-up and where all the initial settings (ex. defmiag port
direction, PWM period, interrupt configuration, reset of PID
registers, USART speed etc.) are performed.
Main program was made very small and was filled wiih
When the proportional gain K p from (9) is substituted into code for serial communication to the PC server application.
(7),the derivative gain K d becomes: This is logical, since the measured data transfer to the server
application is of lower priority when compared to the control
routine, and therefore can be interrupted whenever necessary.
The interrupt service routine is where most of the "meat"
of the program is situated. There are several interrupts that
or in terms of discrete derivative and integral gain Ki and K::
have been used for proper operation of the converter. The
"overcumnt limit reached" is the most significant one, which
happens when the active switch current is over the limit and
therefore it is not masked at aI1. The USART intempt service
Once the desired compensator magnitude A and phase # at routine, which has a slightly lower priority, only receives the
the angular frequency w are known, K p and K i are determined data from PC for processing, since the transmission of data
by iterating through all achievable discrete integral gains K,! is left to the main program. Reason for the high priority
using equations (9), (1 1). The aforementioned method can be of the latter is that no data flow control was implemented
used to determine the StabiIizing compensator which results and PIC16F877 has only a 2-level deep receive stack, so the
in particular crossover frequency w,, but there is no g u m t e e incoming data should be read as soon as possible to avoid any
neither for sufficient gain throughout the conrrol bandwidth overrun condition. Timer intempt is sch4uled to occur each
nor for stability, since the zero gain crossing of the tFansfer milisecond, taking the last measured values of the inputloutput
function is unique only if the system transfer function is voltagedcumnts and loading them into separate registers
monotonous i.e. without any resonant peaking. to be available for the next serial @ammission to the PC
The PWM counter resolution, with regard to the chosen server application. In this way, control algorithm can continue
switching frequency of 20 W z and the oscillator frequency of sampling and storing new values for V ,,, I,,, Vat, Iout,
20 MHz is almost 10 bits, which barely avoids limit cycling but only those captured at 1 ms instants are sent for further
212
Authorized licensed use limited to: Danmarks Tekniske Informationscenter. Downloaded on February 17,2010 at 07:42:36 EST from IEEE Xplore. Restrictions apply.
Fig. 3. PEBvl.0 - Duty-cycle contml page
Fig. 2. photo of the power elcctrOnics beach
213
Authorized licensed use limited to: Danmarks Tekniske Informationscenter. Downloaded on February 17,2010 at 07:42:36 EST from IEEE Xplore. Restrictions apply.
Open loop transferfundion
-
Fig. 6. PEBvI.0 "Find PID compensator settings" form Fig. 8. Experimental waveforms with step in the reference at k O . 1 s
214
Authorized licensed use limited to: Danmarks Tekniske Informationscenter. Downloaded on February 17,2010 at 07:42:36 EST from IEEE Xplore. Restrictions apply.