Freescale Semiconductor M68HC08 User Manual

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 Semiconductor 3
Dimmable Light Ballast with Power Factor Correction, Rev. 1
4 Freescale Semiconductor
Draft 2 for Review

Contents

Chapter 1
Introduction
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Benefits of this Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 The MC68HC908LB8 Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Chapter 2
Control Theory
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1.1 Fluorescent Lamp Control Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1.2 Fluorescent Lamp Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1.3 Controlling the Fluorescent Lamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2 PFC Control Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2.2 Digital Power Factor Concept — Hysteresis Current Control Mode . . . . . . . . . . . . . . . . . . 16
2.2.3 Digital Power Factor Concept — Discontinuous Conduction Mode. . . . . . . . . . . . . . . . . . . 17
2.2.4 Concept Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Chapter 3
Reference Design
3.1 Application Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2 Dimmable Light Ballast Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3 Application Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3.1 Light Ballast Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.3.2 Power Factor Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.3.3 Protection Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.4 Software Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.5 Hardware Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Chapter 4
Hardware Design
4.1 Hardware Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.2 System Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.2.1 Input and PFC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.2.2 Inverter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.2.3 Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.2.4 Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Dimmable Light Ballast with Power Factor Correction, Rev. 1
Freescale Semiconductor 5
Chapter 5
Software Design
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.2 Control Algorithm Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.2.1 Power Factor Correction Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.2.1.1 DC-bus Voltage Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.2.1.2 Phase Shift Synchronization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.2.1.3 Reference Sine Wave Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.2.1.4 Generation of Output PFC Control SIgnal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.2.2 Light Ballast Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.2.2.1 Tube Start Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.2.2.2 Luminance Level Control (Tube Run Mode). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.3 Software Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.3.1 Initialization Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.3.1.1 PWM Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.3.1.2 HRP Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.3.2 Main Program Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.3.3 Synchronization Interrupt Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.3.4 Sine Wave Generation Interrupt Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.3.4.1 Fault Detection and Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.4 Detailed Software Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.5 Microcontroller Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.5.1 Microcontroller Peripheral Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.5.1.1 High Resolution PWM (HRP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.5.1.2 Pulse-Width Modulator (PWM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.5.1.3 Comparator Module (CM). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.5.1.4 Timer Interface Module (TIM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.5.1.5 External Interrupt (IRQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.5.2 Program and Data Memory Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.5.3 I/O Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.6 Definitions of Constants and Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.6.1 System Setup Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.6.2 System Constants and Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Chapter 6
Demo Setup
6.1 Hardware Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.2 Software Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.2.1 Required Software Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.2.2 Building and Uploading the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.2.3 Executing the Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
6.2.4 Project Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

Appendix A. Schematics and Part List

A.1 Schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
A.2 Parts List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

Appendix B. References

Dimmable Light Ballast with Power Factor Correction
6 Freescale 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 Semiconductor 7
EN 61000-3-2 and the international standard IEC 1000-3-2.
Introduction
Energy saving
Ease of adapting software for different lamps
Ease of re-programming the system behavior
Software can simplify the hardware
Diagnostic functions — fault state, tube end-of-life, ignition fault, tube removed
Open to innovation
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
8 Freescale 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
7-channel, 8-bit successive approximation analog-to-digital converter (ADC)
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)
Available packages: – 20-pin small outline integrated chip (SOIC) package – 20-pin plastic dual in-line package (PDIP)
On-chip programming firmware for use with host personal computer which does not require high voltage for entry
System protection features: – Optional computer operating properly (COP) reset – Low-voltage reset – Illegal opcode detection with reset – Illegal address detection with reset
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 Semiconductor 9
Introduction
Dimmable Light Ballast with Power Factor Correction, Rev. 1
10 Freescale 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
Freescale Semiconductor 11
Control Theory
Figure 2-1. Typical Low Pressure Fluorescent Tube I/V Characteristic
The value of V
is a function of several parameters:
strike
Gas filling mixture
Gas pressure and temperature
Tube length
Tube diameter
Temperature of electrodes: cold or hot
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
12 Freescale 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 Semiconductor 13
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
14 Freescale 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
Parameters Half-bridge Push-pull
V(BR)CER 700 V
Inrush Current 3 to 4 times I nom
tsi window 2.6 – 3.6 µs 1.9 – 2.3 µs
Drive High and Low side Low side only
Intrinsic Galvanic Isolation no yes
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 Semiconductor 15
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
16 Freescale 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
Freescale Semiconductor 17
Control Theory
DC Bus Voltage
L
AC
LINE
Reference
AC
DC
Zero
Crossing
ADC
IC
MCU
PWM
FAULT
PIN
Voltage
PWM0
PWM1
Actual
Current
Comparator
+
-
MOSFET
Current Sensing
Figure 2-6. Discontinuous Conduction Mode Principle
+ DC BUS
+
GND
Figure 2-7. Discontinuous Conduction Mode Current Waveform
Dimmable Light Ballast with Power Factor Correction, Rev. 1
18 Freescale 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 Semiconductor 19
Control Theory
Dimmable Light Ballast with Power Factor Correction, Rev. 1
20 Freescale 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
Supported power supply: 110V/60Hz and 230V/50Hz
•Low THD
High power factor achieved using the PFC circuit
Control techniques incorporating: – Preheating –Strike – Run mode
User interface (dimming level potentiometer, monitor mode interface)
Flickering effect removal
Lamp aging recognition
Fault detection – DC-bus under-voltage detection (software) – DC-bus over-voltage detection (software) – Ignition fault (software) – Zero current fault (software)

3.2 Dimmable Light Ballast Characteristics

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 Semiconductor 21
Reference Design
Table 3-1. Light Ballast Characteristics
Parameter Unit Value
Lamp Type F18W/33
Input Power W 8...31
Input Current
(230VAC)
Preheat Output
Frequency
Preheat Output
Volt age
Preheat Time ms 900
Running Output
Frequency Range
Running Output
Voltage Range
Input AC Voltage VAC 110V/60Hz, 230/50Hz
Ambient
Temperature Range
Power Factor 0.94...0.99
Total Harmonic
Distortion
Output Ignition
Volt age
mA 40...290
kHz 86
Vpp 345
kHz 50...100
V 200...235
°C 0.50
% 5.2...24.6
Vpp 510

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
22 Freescale Semiconductor
Loading...
+ 50 hidden pages