AN2459
Applica t ion note
Digital Power Factor Correction for Tube Lamp Ballasts and
other digital power supplies controlled by an 8-bit microcontroller
1 Introduction
The electronic ballast market has undergone dramatic changes over the last few years. It
has moved from full analog, very differentiated applications made by a collection of drivers
and controllers, where use of custom ASICs was widespread, to a couple of standard
platforms.
The basic building bloc ks are st i ll the same. They include a power factor corrector s tage and
an inverting high voltage stage (Figure 1 ). On the one hand, analog platforms are targeting
the low cost/basic performance applications. Their main drivers and controllers are widely
used and well known ICs such as Power Factor Correctors (L6561/2/3) and High Voltage
Ballast Controllers (L6569x/ L6571x/ L6574). On the other hand, a new digital platform
concept has gained more interest and acceptance. A microcontroller with a simple Half
Bridge Driver (L638x) has replaced the ballast controller. The Half Bridge Driver is used
mainly for high-end applications, especially where the microcontroller has to deal with
communication tasks (e.g. using the Dali protocol).
STMicroelectronics' digital ballast reference design STEVAL-ILB002V1 introduces a safe
operating Power Factor Controller (PFC) and Ballast Controller. Even with relatively simple
microcontroller firmware routines, the results for power control and ballast protection are in
line with advanced analog controlled ballasts, while adding flexibility, for example, the
possibility to drive a wide variety of lamps, or to easily introduce different protection
schemes.
This application note deals in detail with the first block of the digital ballast, which provides
stable DC bus voltage for the halfbridge in all load conditions, as well as controlling the input
current shape which fulfills IEC standards (6.: IEC 61000-3-2 "Electromagnetic
compatibility".).
The final description of the digital ballast - the lamp control block - will be described in detail
in a separate application note.
Figure 1. Digital ba llast scheme
Input Filter
8-Bit
Microcontroller
ST7FLITE19B
January 2007 Rev 1 1/35
Power
Management
L6382D5
Unit
www.st.com
Contents AN2459 - Application note
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Power Factor Correction (PFC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1 Transition Mode operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Digital implementation - Enhanced One Pulse Mode . . . . . . . . . . . . . . . . . 6
3 Power circuits design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1 Power components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.3 Bill of material (STEVAL-ILB002V1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4 Signals measurement, processing & control . . . . . . . . . . . . . . . . . . . . 15
4.1 Input vo ltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.2 Output voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.3 Zero Current Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.4 MOSFET current measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5 Conclusion and outlook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
6 References and related materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Appendix A Components calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
A.1 Input capacitor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
A.2 Output capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
A.3 Boost inductor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
A.4 Power MOSFET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
A.5 Boost Diode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
7 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2/35
AN2459 - Application note List of tables
List of tables
Table 1. Bill of material - PFC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Table 2. Bill of material - Lamp Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Table 3. Bill of material - general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Table 4. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3/35
List of figures AN2459 - Application note
List of figures
Figure 1. Digital ballast sch eme. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Figure 2. PFC Transition Mode principle (frequency is not to scale) . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Figure 3. Principle of the Enhanced One Pulse Mode, inside the ST7Lite1B . . . . . . . . . . . . . . . . . . . 7
Figure 4. Input voltage & current with modified EMI filter
(compared to STEVAL-ILB002V 1) PF = 0.994 THD = 10.3% . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 5. Input voltage & current measured on STEVAL-ILB002V1 (old EMI filter)
PF = 0.991 THD = 10.4% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 6. Schematics of STEVAL-ILB002V1 reference des i gn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Figure 7. Modified EMI filter (not included in STEVAL-ILB002V1 reference design . . . . . . . . . . . . . 11
Figure 8. General flowchart of PFC software. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Figure 9. Input voltage sensing circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Figure 10. Inpu t voltage sensing circuit output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 11. The mains turn-on . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 12. Out put voltage sensing circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 13. Out put v oltage control loop flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 14. Application start-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Figu r e 1 5 . Lamp re s tart - behavi o r o f the con t r o l lo o p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 16. Zero current crossing dete ction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Figure 17. PFC M OSFET overcurrent detection circuit and zero coil current detection circuit with
indicated testing connection and microcontroller inner structure . . . . . . . . . . . . . . . . . . . . 24
Figu r e 1 8 . Maxim u m MOSFET's TON p r o tection routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Figure 19. Overcurrent reaction demonstration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4/35
AN2459 - Application note Power Factor Correction (PFC)
2 Power Factor Correction (PFC)
Theoretically, any switching topology can be used to achieve a hi gh power factor but, in
practice, the boost topology has become the most popular because of the advantages it
offers. These include:
● Circuit requires the least external parts, thus it is the cheapest available.
● Boost inductor, located between the bridge and the switch, lowers the input di/dt, thus
minimizing noise generated at the input and consequently reducing the EMI filter input
requirements.
● Switch is source-grounded and therefore easy to drive.
Three methods of controlling the PFC preregulator are currently widely used. They are:
● T he Fixed Frequency Average Current Mode PWM.
● The Transition Mode (TM) PWM (fixed on-time, variable frequency).
● The peak current mode with fixed off-time.
Control of the first method is complicated and requires a sophisticated IC controller (e.g.
either ST's L4981A or ST’s L4981B which offers frequency modulation) and a considerable
component count.
Control of the second method is simpler (e.g. ST's L6561/2/3 family) and requires fewer
external parts. It is therefore much less expensive.
With the Fixed Fre quency Average Current Mode method, the boost inductor operates in
continuous conduction mode, while the TM method causes the inductor to work on the
boundary between continuous and discontinuous modes. Thus, for a given throughput
power, TM operation involves higher peak c urrents, suggesting it is more efficient at lower
power ranges (typically below 200W). In contrast, the Fixed Frequency Average Current
Mode is recommended for higher power levels.
A third method of control, that of applying constant. Toff control, results in continuous
conduction mode. The same simple TM-controllers may be used, as may a small RC
network to set the off-time. This method is described in AN1792 (7 ) It is optimal for an input
power of between 200 and 400W.
2.1 Transition Mode operation
As mentioned above, the typical PFC topology used in electronic ballasts is a step-up
(boost) regulator (Figure 1 ) working in transition conduction mode. Figure 2 outlines the
Transition Mode principles. When the MOSFET is turned on, the inductor is charged from
the input voltage source. When the MOSFET is turned off, the boost inductor discharges its
energy into the load until its current falls to zero. When the latter occurs, the boost inductor
has no energy and a zero current (ZCD) signal is detected, due to a demagnetization
change on the auxiliary winding. This drives the MOSFET on again, whereby another
conversion cycle starts. As the drain voltage drops before turn-on, the turn-on switching
losses are minimized. Figure 2 indicates the geometric relationship of average and peak
currents. Due to the triangular shape of the inductor current, the peak current is twice the
average current.
5/35
Power Factor Correction (PFC) AN2459 - Application note
Figure 2. PFC Transition Mode principle (frequency is not to scale)
Peak current
enveloppe
Inductor current
Average current
On
MOSFET
On
2.2 Digital implementation - Enhanced One Pulse Mode
To provide good switch control, as described in Chapter 2.1 above, a simple 8-bit
microcontroller may be used and a special PWM timer mode has been introduced. The
timer mode, called "Enhanced One Pulse Mode" of the PWM generator (12-bit autoreload
timer) is found inside the ST7FLITE19B microcontroller. It is explained in Figure 3 and in
datasheet ST7Lite1xB (4 ). In principle, when a zero current e v ent occurs the microcontroller
will reset the timer and turn -on the PFC MOSFE T. If there is no signal from ZCD, the timer
will overflow and turn-on the MOSFET anyway (it means a minimum switching frequency is
secured). The on-time of the MOSFET is set by a software control routine and is constant
during the mains half-cycle (this is detailed below in Chapter 4 ). The control routine
executed by the MCU alters the on-time depending on the input voltage level and the load
current.
AI12647
6/35
AN2459 - Application note Power Factor Correction (PFC)
Figure 3. Principle of the Enhanced One Pulse Mode, inside the ST7Lite1B
Compare event
Timer
Events ignored, because
MOSFET is turned-on
ZCD
On
MOSFET
Off
Timer reset caused by
ZCD
Event
Timer reset caused by
autoreload value match
Event
No event
occured
}
AI12651
7/35
Power circuits design AN2459 - Application note
3 Po wer circuits design
3.1 Power components
All components have been calculated following application note AN966 (3 ). A full description
of the design and selection of each component, based on the analog TM PFC controller
L6561, is also given in Appendix A . At the moment, input voltage is limited for European
mains. Future Software updates will include wide range input capability.
Besides the passive and discrete components of the microcontroller, the most important
part is the power management unit, L6382D5, which helps control the power. It provides a
stable (±2%) 5V supply for the microcontroller during the whole operation. It also supplies a
high voltage start-up. In addition, one of the general purpose gate drivers integrated inside
L6382D5 is used to translate TTL PWM signals from the microcontroller to the boost
converter gate of the MOSFET.
Figure 4. Input voltage & current with modified EMI filter
(compared to STEVAL-ILB002V1) PF = 0.994 THD = 10.3%
Note: Brown = Mains voltage, Blue = Input current.
8/35
AN2459 - Application note Pow er cir cuits d esign
Figure 5. Input voltage & current measured on STEVAL-ILB002V1 (old EMI filter)
PF = 0.991 THD = 10.4%
Note: Brown = Mains voltage, Blue = Input current.
Reference board design measurements of STEVAL-ILB002V1(Figure 5 ) show a THD value
of 10.4% and a PF value of 0.991. Between the manufacturing of the STEVAL-ILB002V1
reference design and publication of this application note, design work has continued and
some improvements have been made. For example, EMI filter parameters have been
changed from C-L-C to C-L filters, which give better results for waveform, power factor, and
THD .This optimized version is given in Figure 7 and result in the measured waveforms
shown in Figure 4 with THD = 10.3% and PF = 0.994.
9/35
Power circuits design AN2459 - Application note
3.2 Schematics
Figure 6. Schematics of STEVAL-ILB002V1 reference design
CC
C11
J2
123
1.8mH
C13
L6382
C12
100nF
47µF
25V
+
+
D13
STTH1R06A
3k9
C20
R28
100nF
100nF
50V
1n
1k5
4
10n
C16
400V
Q3
STP5NK60Z
2
1600V
58W T8 lamp
DC5V
R29
1M
mpDetection
C17
10n
R30
10k
La
,
R2312W,1%
Vcap
R31
220nF
300k
CSO
C14
C14
10n
10n
10p
High Side Input
Low Side Input
18
20
17
19
16
OSC2/PC1
/CLKIN/PC0
PA0(HS)/LTIC
PA1(HS)/ATIC
OSC1
U1
DD
SS
V
RESET3COMPIN+/SS/AIN0/PB04SCK/AIN1/PB15MISO/AIN2/PB26MOSI/AIN3/PB37COMP-/CLKIN/AIN4/PB48AIN5/PB59AIN6/PB6
V
2
1
10nF
C10
RESET
R21 100
R22 33
Not assembled
RsenseCurrent
1N4148 SMD
D4
PFC Zero Current Detect
C28
10k
R45
DC5V
R44
10k
10k
R43
R42
10k
DC5V
C9
R33
300k
R32
300k
D6
R35
PeakLampVoltage
LampDetection
PFC Gate Driv er
11
12
13
DATA
CC
CLK/BREAK
CC
ST7LITE1B 20pinU1ST7LITE1B 20pin
PA4(HS)/ATPWM214PA3(HS)/ATPWM115PA2(HS)/ATPWM0
PA7(HS)/COMPOUT
PA6/MCO/I
PA5(HS)/ATPWM3/I
10
AverageCurrent
PeakCurrent
PFC OC
PeakLampVoltage
PFC Vout Sense
PFC VinWaveform
R34
100k
1N4148 SMD
C194n7
75k
R36
24k
C23
68n
AverageLampVoltage
AI12648
100V
Vcap
R37240k
R38
240k
R39
240k
R40
2k4
R41
2k4
DC5V
C7
22uF 450V+22µF 450V
T2
2
CM Choke
1
R21M350V
275VAC
N
3
8
C29
PE
R11R11
750k
NTC1
10
STTH1R06
5
1
R3
750k
C3
–
2
100n
275VAC
AC
+
R12
R6
PFC Zero Current Detect
R4
R4
100n
100n 275VAC
C2
750k
750k
R141kR14
Sense
PFC V
2
Q1
27k
1n
1k
OUT
STP5NK60Z
3
1
R710R7
PFC Mosfet Gate
PFC VinW
PFC Vi aveform
275VAC
PFC OC
R101kR10
C4
10n
R5
20k
DC400V
1 2
D2
1 2
D12
1N4007
Not assembled
2 1
TRANSFORMER
TRANSFORMER
3
D7
BRIDGE RB156
+
4
1
4
T1
3
R11M350V
C1
100n
FUSE
F1
L
J1
C18
470n
AverageLampVoltage
R13
10k
R13
C6
4n7
2n7
C5
R9
0.5
R8
47k
C27
10p
PFC Gate Driv er
RsenseCurrent PeakCurrent
D5
BAT46
R25
4k7
RsenseCurrent AverageCurrent
R24
10k
2
C22
470n
C21
R26
R18
DC5V
Vcap
C15
C15
Out pin
L1
L1
Q2
STP5NK60Z
R19 100
R20 33
0 0.6W
20
U2
U2
10p
C25
C26
10p
C8
C8
Out pin
470n
7
4k7
CSI
19
VREF
PFI1LSI2HS
Low Side Input
CSI
D3
O
CS
18
16
O
NC
HEG17CS
I
HEI4PFG5NC6TPR7GND8LS
3
PFC Mosfet Gate
gh Side Input
Hi
R46
R16
2.2nF
1000V
15
HVSU
1N4148 SMD
12
13
14
NC
OUT
9
R27
Not assembled
11
G
HS
BOOT
G
V
10
18 0.6W
18 0.6W
1
RsenseCurrent CSI
10/35
AN2459 - Application note Pow er cir cuits d esign
Figure 7. Modified EMI filter (not included in STEVAL-ILB002V1 reference design
F1
+
4
D7
BRIDGE RB156
2
3
C3
C3
100n 275VAC
100n 275VAC
AI12646
J1
PE
AC
FUSEF1FUSE
C1
L
N
275VAC
C2
C2
1n
1n
275VAC
275VAC
100n
R1
1M
350V
R2
1M
350V
3
1
T1T1
CM
Choke
45m
4
1
2
H
11/35