ST AN1501 Application note

ST AN1501 Application note

AN1501

APPLICATION NOTE

SIMPLE MICROCONTROLLED BALLAST

by Clifford Ortmeyer and Albert Kunickis Jr

INTRODUCTION

The purpose of this paper is to give a basic understanding of a microcontroller and its potential usage in an electronic ballast. A brief summary of how the microcontroller operates and the most common types of functions it can perform will be shown as they relate to being used in an electronic ballast. Next, ideas of how to implement the most common functions and their associated advantages/weaknesses will be examined. Finally, a brief summary of things that should be examined closely will be presented to help assure a good start to a basic microcontrolled ballast design.

First, lets look at a basic diagram of an existing electronic ballast.

LINE

POWER FACTOR

 

450 V

 

 

 

 

INPUT

CONTROLLER

 

 

 

 

VCO

HALF BRIDGE

 

Lres

 

 

 

DRIVER

 

 

 

 

 

 

 

LAMP

Cres

 

 

 

Ref.

DC BLOCK

 

 

 

CONTROL

 

 

 

 

 

 

 

This is a very simple diagram of an existing electronic ballast. Today, the voltage controlled oscillator (VCO) and the half bridge driver are usually combined in a single package. The Control portion, which may be comprised of the fault detection circuitry and an op-amp to close the loop, may also be included in the same package (for example, the L6574 Ballast Controller IC). This is a good solution for having a basic platform from which new designs can easily be made. In some cases, it may be necessary to include a more flexible solution that allows for parameters that are usually fixed in an analog solution – such as ignition profiles and restart methods. It is in these and many other cases that a microcontroller can be used to define a more user specific operating profile.

AN1501/0202

1/13

SIMPLE MICROCONTROLLED BALLAST

A simplified diagram of a microcontrolled ballast is shown below.

LINE

 

 

450 V

 

POWER FACTOR

 

 

INPUT

 

 

CONTROLLER

 

 

 

 

 

 

MICRO

HALF BRIDGE

Lres

 

 

 

DRIVER

 

 

 

 

 

LAMP

Cres

 

 

 

DC-BLOCK

 

In this diagram, the microcontroller takes the place of the VCO and the control logic. The microcontroller has an output(s) that emulates the VCO output which in turn controls the turn-on and turn-off the upper and lower portion of the half bridge. In this manner, the dead time, frequency, and duty cycle of the half bridge output can all be independently controlled.

The control logic that has been replaced by the micro is essentially the brains of the control logic. External analog components will still be needed to scale down and, if needed, filter the fault signals. The micro can then control the response to each fault condition as determined by the users programming code. An example of when this might be useful is when a lamp fails to ignite, the micro could detect this and restart the preheat and ignition sequence but with a longer preheat time.

2/13

SIMPLE MICROCONTROLLED BALLAST

1 MICROCONTROLLER FUNDAMENTALS

To understand how the micro can be used in a ballast, the basic components that will generally be used need to first be understood. One of the few basic components that will be used are “inputs” and “outputs”. By this we mean that when the user programs the micro, the programming code tells it which pins are to be an input or an output. Not all pins can be configured in this manner, but for now we will concentrate on the pins whose functions we can modify.

First lets look at a pin that we have configured as an input pin. An input pin essentially looks at the voltage on the pin and passes this information to the main processor (the “brain” of the microcontroller). It can tell the processor when it sees a rising or falling voltage level, or it can read the exact voltage level on that pin. Which type of voltage it is to look for is something that the user configures when the user programs the microcontroller. Generally, a pin that is configured as an “input” looks for either a high or low voltage level. An “analog input” is an input that reads the exact voltage level on the pin as opposed to looking only for a high or low level. A typical example using an “input” pin is shown below.

1.1 INPUT EXAMPLE

 

 

 

 

 

 

 

 

 

5V

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

10k ohm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Input

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 ohm

 

 

μC

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

In this example we configure the pin to be an input pin and to look for a high voltage. For instance, when the lower lamp filament is connected to the 1 ohm resistor, the 10k ohm and 1 ohm resistor form a voltage divider where the midpoint is brought to the input pin. When the filament is connected to the 1ohm resistor, the voltage divider applies approximately 0 volts to the input pin. When the filament is disconnected from the 1 ohm resistor, for instance in the case of lamp removal (as shown in the picture), the voltage on the input pin rises to 5v. The microcontroller sees this voltage level shift, and can then take the appropriate action. The action taken is determined by what the user tells the micro to do when the microcontroller is programmed. In this case the user may tell the ballast to turn off since the lamp has been removed.

3/13

SIMPLE MICROCONTROLLED BALLAST

1.2 ANALOG INPUT EXAMPLE

5V

+HV

 

 

 

 

 

 

Analog Input

 

BRIDGEHALF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

μC

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Q1

L

Q2

 

 

 

 

 

 

 

 

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

When a pin is configured as an “analog input” it acts as an A/D converter and looks at the voltage on the pin and transforms that voltage of 0V to 5V into a corresponding number between 0 and 255. For example, if the voltage on the Analog Input pin is 2.5 V, then the A/D will convert the 2.5V to a value of 128. The program that has been stored in the micro may then in turn tell an output pin to change the frequency of the half bridge to that of a 50% dimming level.

How does the microcontroller change the frequency of the half bridge? This is done by controlling a pin that has been configured as an “Output” pin.

Just as we configured a pin to be either an “input” or an “analog input”, we can also configure a pin to be used as an “output”. An output pin can configured in two different states – either a “push-pull” output or an “open drain” output.

In the push-pull configuration, a “high” can be applied to the pin. This puts a voltage on the pin that is equivalent to the Vcc of the microcontroller with a limited current sourcing capability (few mA). The second mode in the push-pull configuration is a “low”. In the low state, the pin is shorted to ground and again has a limited capability to sink current up to 30mA (high current pins only). An example of a “push-pull” configuration is given next.

4/13

Loading...
+ 9 hidden pages