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 e lectron ic b allast. A brief su mmar y of h ow t he m icroc ontroller oper ate s and th e
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 th e mos t comm on function s 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
INPUT
POWER FACTOR
CONTROLLER
VCO
CONTROL
HALF BRIDGE
DRIVER
Ref.
450 V
Lres
DC BLOCK
LAMP
Cres
This is a v ery simp le di agram of an ex isting el ectroni c ba llast. To day, the volt age co ntrol led
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 includ ed in the sam e package (for examp le, the L657 4 Ballas t Control ler
IC). This is a good solution for having a basic platform from which new designs can easily be
made. In some c ases, it ma y b e necess ary to i nclude a m ore flexible solution tha t allows for
parameters that are usually fixed in an analog s olution – such as i gnition profiles and restart
methods. It is in the se an d many othe r c ase s tha t a m icroc ontroll er can be us ed to de fine a
more user specific operating profile.
AN1501/0202 1/13
1
SIMPLE MICROCONTROLLED BALLAST
A simplified diagram of a microcontrolled ballast is shown below.
LINE
INPUT
POWER FACTOR
CONTROLLER
MICRO
HALF BRIDGE
DRIVER
450 V
Lres
DC-BLOCK
LAMP
Cres
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 log ic that has be en re placed by t he micro is esse ntially th e b rains o f t he cont rol
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
2
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 t o first be unders tood. One of th e few basic comp onents that will be used
are “inputs” and “outputs”. By this we mean that when the us er prog rams the micro, the programming code tells it which pins are t o be an input or an ou tput. N ot all pins ca n be c onfigured 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 ty pe of voltage it is to l ook 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
In this example we configure the pin to be an i nput pin and to l ook 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 t he f ilament is disconnec ted from the 1 o hm res istor, for ins tance i n the
case of lamp removal (as shown in the picture), the vol tage on the input pin rises to 5v. The microcontroller sees this voltage level shift, and can then take the appropriate ac tion. The action
taken is dete rmined 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.
C
3/13
SIMPLE MICROCONTROLLED BALLAST
1.2 ANALOG INPUT EXAMPLE
5V
Analog Input
µ
C
HALF BRIDGE
+HV
Q1
Q2
L
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 i n the m icro may then in
turn tell an output pin to change the frequency of the half br idge to that of a 50% dimming level.
How does the mi crocontr oller change th e freque ncy of the half br idge? This i s 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 equ ivalent to the V cc of th e microc ontro ller wi th a limit ed curre nt sour cing capabi lity
(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