Dimmable Light Ballast with
Power Factor Correction
Designer Reference Manual
M68HC08
Microcontrollers
DRM067
Rev. 1
12/2005
freescale.com
Dimmable Light Ballast with Power Factor Correction
Designer Reference Manual
by: Petr Frgal
Freescale Czech Systems Center
Roznov pod Radhostem, Czech Republic
To provide the most up-to-date information, the revision of our documents on the World Wide Web will be
the most current. Your printed copy may be an earlier revision. To verify that you have the latest
information available, refer to
http://www.freescale.com
Dimmable Light Ballast with Power Factor Correction, Rev. 1
Freescale Semiconductor3
Dimmable Light Ballast with Power Factor Correction, Rev. 1
Dimmable Light Ballast with Power Factor Correction
6Freescale Semiconductor
Chapter 1
Introduction
1.1 Introduction
This reference design describes the design of a fully digital dimmable light ballast with power factor
correction (PFC) control for two parallel connected fluorescent lamps.
This reference design focuses on the lamp ballast hardware and software implementation using the
Freescale MC68HC908LB8 microcontroller (MCU), which is designed specifically for light ballast
applications. This MCU includes a set of peripherals that are appropriate for light dimming and power
factor correction.
The reference design incorporates both hardware and software parts of the system including detailed
hardware descriptions and full software listings. The application uses half-bridge topology, typical for this
kind of applications. The MC68HC908LB8 MCU is well suited to this topology.
Figure 1-1. Dimmable Light Ballast with PFC Demo
1.2 Benefits of this Solution
Microcontrollers offer the advantages of low cost and attractive digital light ballast design. Using a
dedicated on-chip high resolution PWM (HRP) allows easy implementation of dimming features. PFC
improves the efficiency of the light ballast. Harmonic content of the input current for the mains supplied
equipment meets the European regulation
The advantages of the presented digital solution over standard analog solutions can be summarized as
follows:
Dimmable Light Ballast with Power Factor Correction, Rev. 1
Freescale Semiconductor7
EN 61000-3-2 and the international standard IEC 1000-3-2.
The MC68HC908LB8 is designed for light ballast applications. It contains a HRP that is assigned to
control a lamp ballast circuit using half-bridge topology. The HRP provides two complementary outputs
for controlling a half-bridge drive. Pulse Width Modulation (PWM) with constant duty cycle is used for light
ballast control. The HRP frequency can be adjusted easily by software in range 40
kHz to 120 kHz in 256
steps. Dimming levels down to 5% are possible.
The PFC circuit uses an on-chip comparator on the MC68HC908LB8. This peripheral simplifies the
dimming light ballast solution with PFC, since it eliminates the need of external components and thus
decreases the system cost.
The reference design is intended for all geographic regions, so 110V/60Hz and 230V/50Hz input voltage
supplies are supported.
The application can be debugged using the MON08 CYCLONE debug tool in monitor mode.
WARNING
Since the application runs at high voltage, it is dangerous to connect
development tools directly to the board. Therefore, it is recommended
to use an opto-isolation monitor mode board. This separate board
provides an opto-isolated interface for the MON08 debug tool, using
the MON08 standard connector. This allows the user to safely debug
or examine code in-circuit.
1.3 The MC68HC908LB8 Microcontroller
The MC68HC908LB8 is a member of the low-cost, high performance MC68HC08 Family of 8-bit MCUs.
All MCUs in the family use the enhanced MC68HC08 central processor unit (CPU08) and are available
with a variety of modules, memory sizes and types, and package types.
Standard features of microcontroller MC68HC908LB8 are:
•8 MHz internal bus frequency
•Trimmable internal oscillator:
–4.0 MHz internal bus operation
–8-bit trim capability
–25% untrimmed
–2% trimmed
•8K bytes of 10K write/erase cycle typical on-chip in application programmable FLASH
with security option
•128 bytes of on-chip random access memory (RAM)
(1)
memory
1. Non volatile memory that retains its data when the power is removed.
Dimmable Light Ballast with Power Factor Correction, Rev. 1
8Freescale Semiconductor
The MC68HC908LB8 Microcontroller
•Dual channel high resolution PWM (HRP) with deadtime insertion and shutdown input to perform
light control and dimming functions for ballasts. The outputs use frequency dithering to achieve a
3.9 ns output resolution.
•Dual channel pulse width modulator module to provide power factor correction capability
•Comparator for power factor correction capability or for general-purpose use
•7-bit keyboard interrupt
•One 16-bit, 2-channel timer interface module with one output available on port pin (PTA6) for input
capture and PWM
•17 general-purpose input/output (I/O) pins and one input-only pin
–Three shared with HRP module
–Three shared with PWM module
–Three shared with comparator
–Seven shared with ADC module (AD[0:6])
–One shared with timer channel 0
–Two shared with OSC1 and OSC2
–One shared with reset
–Seven shared with keyboard interrupt
–One input-only pin shared with external interrupt (IRQ)
•Low-power design; fully static with stop and wait modes
•Standard low-power modes of operation:
–Wait mode
–Stop mode
•Master reset pin and power-on reset (POR)
•674 bytes of FLASH programming routines in read-only memory (ROM)
•Break module (BRK) to allow single breakpoint setting during in-circuit debugging
•Internal pullup on RST pin to reduce customer system cost
•Selectable pullups on ports A and C
–Selection on an individual port bit basis
–During output mode, pullups are disengaged
•High current 10 mA sink / 10 mA source capability on all port pins
Dimmable Light Ballast with Power Factor Correction, Rev. 1
Freescale Semiconductor9
Introduction
Dimmable Light Ballast with Power Factor Correction, Rev. 1
10Freescale Semiconductor
Chapter 2
Control Theory
2.1 Introduction
This chapter covers fluorescent lamp theory and two PFC concepts - discontinuous conduction mode and
hysteresis current control mode.
2.1.1 Fluorescent Lamp Control Theory
To light a low-pressure fluorescent lamp, the electronic circuit must perform the following four main
functions:
•Provide a startup voltage across the electrodes of the lamp
•Maintain a constant current when the lamp is operating in the steady state
•Ensure that the circuit will remain stable, even under fault conditions
•Comply with the applicable domestic and international regulations (PFC, THD and safety)
Most generally, light ballast topology fairly closely matches target lamps in terms of tube wattage, length,
and diameter. The digital electronic lamp ballast includes also additional features like dimming capability,
tube end-of-life, startup fault, tube removed indication, and so on. Different tubes require different
software settings; also, some hardware components may have to be adapted accordingly.
2.1.2 Fluorescent Lamp Operation
When the lamp is off, no current flows through the tubes, and the apparent impedance is nearly infinite.
When the voltage across the electrodes reaches the V
an arc is generated across the two terminals of the lamp. This behavior is depicted by the typical operating
curve shown in
Figure 2-1.
value, the gas mixture is highly ionized and
strike
Dimmable Light Ballast with Power Factor Correction, Rev. 1
Typically, values of V
to the on-state voltage (V
the tube. Typically, V
are in range 500 V to 1200 V. Once the tube is on, the voltage across it drops
strike
, the magnitude of this voltage being dependent upon the characteristics of
on)
is in range 40 V to 110 V.
on
The value of Von will vary during the operation of the lamp but, in order to simplify the analysis, we will
assume, as a first approximation, that the on-state voltage is constant when the tube is running in steady
state.
Consequently, the equivalent steady state circuit can be described by two back-to-back Zener diodes as
shown in
Figure 2-2. The startup network is far more complex, particularly during ionization of the gas.
This is a consequence of the negative impedance exhibited by the lamp when the voltage across its
electrodes collapses from V
strike
to Von.
Dimmable Light Ballast with Power Factor Correction, Rev. 1
12Freescale Semiconductor
Introduction
Figure 2-2. Typical Fluorescent Tube Equivalent Circuit in Steady State
Up to now, there is no model available to describe the start up sequence of these lamps. However, since
most of the phenomena are dependent upon the steady state characteristics of the lamp, one can simplify
the analysis by assuming that the passive networks control the electrical behavior of the circuit. This
assumption is wrong during the time elapsed from V
to Von, but since this time interval is very short,
strike
the results given by the proposed simple model are accurate enough to design the converter. When a
fluorescent tube is aging, its electrical characteristics degrade from the original values, yielding less light
for the same input power, and different V
and Von voltages. A simple, low-cost electronic lamp ballast
strike
cannot optimize the overall efficiency throughout the lifetime of the tube, but the circuit must be designed
to guarantee the operation of the lamp even under worst case “end of life” conditions. As a consequence,
the converter will be slightly oversized to make sure that, after 8000 hours of operation, the system will
still drive the fluorescent tube.
2.1.3 Controlling the Fluorescent Lamp
As already stated, both the voltage and the current must be accurately controlled to make sure that a
given fluorescent lamp operates within its specifications.
The most commonly used network is built around a large inductor, connected in series with the lamp, and
associated with a bimetallic switch generally named “the starter”.
schematic diagram for the standard, line operated, fluorescent tube control.
Figure 2-3. Standard Ballast Circuit for Fluorescent Tube
Figure 2-3 gives the typical electrical
Dimmable Light Ballast with Power Factor Correction, Rev. 1
Freescale Semiconductor13
Control Theory
The operation of a fluorescent tube requires several components around the tube, as shown in Figure 2-3.
The gas mixture enclosed in the tube is ionized by means of a high voltage pulse applied between the
two electrodes.
To make this startup easy, the electrodes are actually made of filaments that are heated during the tube
ionization startup (i.e. increasing the electron emission), their disconnection being automatic when the
tube goes into the steady state mode. At this time, the tube impedance decreases toward its minimum
value (depending upon the tube internal characteristics), the current in the circuit being limited by the
inductance L in series with the power line. The starting element, commonly named “starter”, is an
essential part to ignite the fluorescent tube. It is made of a bimetallic contact, enclosed in a glass envelope
filled with a neon based gas mixture, and is normally in the OPEN state. When the line voltage is applied
to the circuit, the fluorescent tube exhibits a high impedance, allowing the voltage across the “starter” to
be high enough to ionize the neon mixture. The bimetallic contact gets hot, turning ON the contacts which,
in turn, will immediately de-ionize the “starter”. Therefore, the current can flow in the circuit, heating up
the two filaments. When the bimetallic contact cools down, the electrical circuit is rapidly opened, giving
a current variation in the inductance L which, in turn, generates an over-voltage according to Lenz’s law.
Since there is no synchronization with the line frequency (the switch operates on a random basis), the
circuit opens at a current level anywhere between maximum and zero.
If the voltage pulse is too low, the tube does not turn on, and the startup sequence is automatically
repeated until the fluorescent tube ionizes. At that time, the tube impedance falls to its minimum value,
yielding a low voltage drop across its end electrodes and, hence, across the switch. Since the starter can
no longer be ionized, the electrical network of the filaments remains open until the next turning on of the
circuit.
We must point out that the fluorescent tube turns off when the current is zero; this is the source of the
Hz flickering in a standard circuit. This is an important problem, which can lead to visual problems due
50
to the stroboscopic effect on any rotating machines or computer terminals.
To take care of this phenomena, the fluorescent tubes, at least those used in industrial plants, are always
set on a dual basis in a single light spreader, and are fed from two different phases (real or virtual via a
capacitor) in order to eliminate the flickering.
On the other hand, the magnetic ballast provides a very low cost solution for driving a low pressure
fluorescent tube. To overcome the flickering phenomenon and the poor startup behavior, the engineers
have endeavored to design electronic circuits to control the lamp operation at a much higher frequency.
The efficiency (Pin/Lux) of the fluorescent lamp increases significantly, as soon as the current through the
lamp runs above a few kilo Hertz.
The electronic circuits that can be used to build a fluorescent lamp controller can be divided into two main
groups:
•Single switch topology, with unipolar AC current, (unless the circuit operates in the parallel
resonant mode)
•Dual switch circuit, with a bipolar AC output current
Manufacturers of fluorescent lamps usually recommend operating the tubes with a bipolar AC current.
This avoids constantly biasing the electrodes as an anode-cathode pair, which, in turn, decreases the
expected lifetime of the lamp. In fact, when a unipolar AC current flows into the tube, the electrodes
behave like a diode and the material of the cathode side is absorbed by the electron flow, yielding a rapid
wear out of the filaments. As a consequence, all of the line operated electronic lamp ballasts are designed
with either a dual switch circuit (the only one used in Europe), or a single switch, parallel resonant
configuration (mainly used in countries with 110
V lines), providing an AC current to the tubes. A few low
Dimmable Light Ballast with Power Factor Correction, Rev. 1
14Freescale Semiconductor
PFC Control Theory
power, battery operated fluorescent tubes are driven with a single switch fly-back topology, but, the output
transformer is coupled to the tube by a capacitive network and the current through the lamp is alternating
current. However, the filaments (if any) cannot be automatically turned off by this simple configuration and
the global efficiency is downgraded accordingly.
Dual switch circuits are divided into two main topologies:
•Half-bridge, series resonant
•Current fed push-pull converter
The half-bridge is, by far, the most widely used in Europe (100% of the so-called “energy saving” lamps
and industrial applications are based on this topology), while the push-pull is the preferred solution in the
USA with around 80% of the electronic lamp ballasts using this scheme today.
Both of these topologies have their advantages and drawbacks, the consequence for the associated
power transistors being not at all negligible, as shown by
Table 2-1. The half-bridge topology controlled
by the dedicated MC68HC908LB8 MCU is implemented in Chapter 3. For more details about electronic
lamp ballast theory see Reference [1.].
Table 2-1. Main Characteristics of the Dual Switch Topologies
ParametersHalf-bridgePush-pull
V(BR)CER700 V
Inrush Current3 to 4 times I nom
tsi window2.6 – 3.6 µs1.9 – 2.3 µs
DriveHigh and Low sideLow side only
Intrinsic Galvanic Isolationnoyes
NOTES:
1. These numbers are typical for operation on a 230 V supply.
2. I nom is the current into the transistors in steady state.
(1)
(2)
2 to 3 times I nom
1100 - 1600 V
(1)
(2)
2.2 PFC Control Theory
2.2.1 Introduction
The most practical electronic systems contain a conventional single-phase full-bridge rectifier and an
input filter capacitor. It is well known that this type of circuit draws high current peaks from the power line
and produces a high level of harmonics. High total harmonic distortion (THD) and low power factor
therefore reduce the maximum power available from the mains and the efficiency of the electricity supply
networks. The European Normative EN 61000-3-2 defines the limits of the harmonic content of the input
current for mains supplied equipment.To meet the norms, new designs require an active PFC at the input.
Many specific integrated circuit devices (ICs) are available on the market to perform power factor
correction. This approach requires additional electronic components, which increases the system cost
and complexity. On the other hand, there is a way to implement PFC control using the MCU, in addition
to the MCU’s main control tasks, such as motor control. Digital PFC allows missing out these specific ICs,
thereby reducing the system cost. Another benefit of the software implementation is the potential for easy
modifications without changing the hardware.
Two power factor correction approaches were implemented in this design, discontinuous conduction
mode and hysteresis current control mode. Each of these topologies has advantages and drawbacks.
Both topologies are described in the following.
Dimmable Light Ballast with Power Factor Correction, Rev. 1
Freescale Semiconductor15
Control Theory
2.2.2 Digital Power Factor Concept — Hysteresis Current Control Mode
The control technique is based on hysteretic current control. The system operates in continuous
conduction mode with variable switching frequency (30–100 kHz) (see
This PFC concept is designed to have the minimum of MCU performance requirements. The basic
principles of the scheme are depicted in
Figure 2-4. The PFC control algorithm includes two control loops,
a fast one for input current control and a slow one for output voltage control. The output voltage controller
is implemented digitally using the MCU. A value proportional to the required input current is modulated by
the PWM and is taken as an input to the current control loop, which is realized by the analogue
comparator. The comparator switches the MOSFET in order to maintain the required current value.
The desired shape of the input current is a sine wave. The generated current waveform is shown in
Figure 2-8.
A hysteresis current control mode PFC concept has several drawbacks, including variable MOSFET
switching frequency, non sinusoidal input current waveform and switching under current, which causes
higher losses than other PFC topologies.
The input current harmonics content, however, complies with EN 61000-3-2 standard.
The advantages are simple control circuit, low MCU resources consumption, continuous conduction
mode operation, and low total harmonic distortion (THD).
Figure 2-5).
AC Line Voltage
AC Line Current
0
L
DC Bus
MCU
ADC
Voltage
PWM
Reference
Voltage
Comparator
+
-
Actual
Current
Current Sensing
AC
LINE
AC
DC
Zero
Crossing
IC
Figure 2-4. Hysteresis Current Control Mode Principle
+ DC BUS
MOSFET
+
GND
Dimmable Light Ballast with Power Factor Correction, Rev. 1
16Freescale Semiconductor
Figure 2-5. Hysteresis Current Control Mode Current Waveform
2.2.3 Digital Power Factor Concept — Discontinuous Conduction Mode
PFC Control Theory
The control technique is based on discontinuous conduction mode with a current loop with a constant
switching frequency (40 kHz) (see
Figure 2-7).
The basic principles of the scheme are depicted in Figure 2-6. The PFC control algorithm includes two
control loops, the same as the previous approach. The output voltage controller is implemented digitally
using the MCU. A value proportional to the required input current is modulated by the PWM0 and is taken
as an input to the current control loop, which is realized by the analog comparator. The comparator output
is connected to the PWM fault pin that disables the PWM output. PWM1 is used directly for switching the
MOSFET in order to maintain the required current value. PWM1 is switched off in every period where the
reference sine wave signal generated by PWM0 is higher than the actual current sensed signal on the
shunt resistor.
The desired shape of the input current is a sine wave. The generated current waveform is shown in
Figure 2-8.
The discontinuous conduction mode PFC concept has several drawbacks — higher THD than hysteresis
current control mode, non sinusoidal input current waveform, and the discontinuous conduction mode
itself. The input current harmonics content, however, complies with EN 61000-3-2 standard.
The advantages are a simple control circuit, with low MCU resource consumption, and low losses.
Dimmable Light Ballast with Power Factor Correction, Rev. 1
Figure 2-7. Discontinuous Conduction Mode Current Waveform
Dimmable Light Ballast with Power Factor Correction, Rev. 1
18Freescale Semiconductor
Figure 2-8. Generated Input Current Waveform
2.2.4 Concept Summary
PFC Control Theory
Both the PFC solutions can be used for applications that do not require a large portion of the MCU’s
resources, because they consume only a fraction of the MCU performance. Compared to a dedicated IC
solution, digital PFC offers high flexibility and cost reduction in the overall design, as the PFC function can
be provided within the MCU capability of the main application. Digital PFC also provides additional
benefits such as a wide range of input voltages (85
V to 265 V AC) at a constant output DC voltage.
However, hysteresis current control mode is more suitable for power above 100W, and discontinuous
conduction mode for low power consumption.
Dimmable Light Ballast with Power Factor Correction, Rev. 1
Freescale Semiconductor19
Control Theory
Dimmable Light Ballast with Power Factor Correction, Rev. 1
20Freescale Semiconductor
Chapter 3
Reference Design
3.1 Application Outline
The presented system is designed to control two parallel connected fluorescent lamps. The reference
design meets the following performance specification:
•Single board solution with MC68HC908LB8 microcontroller
Table 3-1 provides the basic characteristics of the Dimmable Light Ballast Demo with PFC at 25°C and
400 V DC-bus voltage.
Dimmable Light Ballast with Power Factor Correction, Rev. 1
Freescale Semiconductor21
Reference Design
Table 3-1. Light Ballast Characteristics
ParameterUnitValue
Lamp TypeF18W/33
Input PowerW8...31
Input Current
(230VAC)
Preheat Output
Frequency
Preheat Output
Volt age
Preheat Timems900
Running Output
Frequency Range
Running Output
Voltage Range
Input AC VoltageVAC110V/60Hz, 230/50Hz
Ambient
Temperature Range
Power Factor0.94...0.99
Total Harmonic
Distortion
Output Ignition
Volt age
mA40...290
kHz86
Vpp345
kHz50...100
V200...235
°C0.50
%5.2...24.6
Vpp510
3.3 Application Description
The system concept is shown in Figure 3-1. The system consists of:
•Control board with MC68HC908LB8 microcontroller
•Two fluorescent lamps
The MC68HC908LB8 MCU runs the main control algorithm. According to the dimming level potentiometer
It generates output signals for the half-bridge inverter which controls the ballast circuit. It also controls
PFC. The desired dimming value is set by the potentiometer, because the human eye is more sensitive
at lower light levels. The input values from the potentiometer are converted using brightness linearization.
The HRP uses a frequency control method for dimming. It incorporates hardware that allows dithering
between two adjacent frequencies for smooth light level dimming.
Dimmable Light Ballast with Power Factor Correction, Rev. 1
22Freescale Semiconductor
Loading...
+ 50 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.