Ballast Demonstrator User Guide
-21
7629A–AVR–04/06
5.3
Lamp_ctrl.c
T h i s f i l e e x e c u t e s L a m p s t a t e m a c h i n e a c c o r d i n g t o t h e s c h e d u l e r in t h e
Main_AT8xEB5114_fluo_demo.c file.
5.3.1
Lamp State Machine
The Lamp state machine functional diagram is shown below:
Figure 5-4.
LAMP state machine
The different states are outlined below:
LAMP_OFF
Nothing happens, the exiting of this state takes place as soon as the
gv_pfc_state
is set
to PFC_CONTROL_LOOP.
CONFIGURE_LAMP_PREHEAT
This is the first time the lamp has tried to be started since the user has requested the
switch on.
Configure the Amplifier0 which is used to measure the current then configure the PSC2
according to the definitions in the config.h file, and initialize all the lamp control
variables.
Then jump to the LAMP_PREHEAT state.
LAMP_PREHEAT
Let the preheat sequence for LAMP_PREHEAT_TIME.
Then jump to the LAMP_NUMBER_CHECK state.
CONFIGURE_LAMP_PREHEAT
START_IGNITION
LAMP_PREHEAT
LAMP_NUMBER_CHECK
g_lamp_time_multiplier >= LAMP_PREHEAT_TIME_MULTIPLIER
gs_lamp_check_number >= 15
LAMP_OFF
gv_pfc_state==PFC_CONTROL_LOOP
g_inverter_comparison_values.ontime1 <
INVERTER_XXX_LAMP_IGNITION_HALF_PERIOD
IGNITION
Get_i_lamp() >= ONE_LAMP_MINIMUM_IGNITION_CURRENT
&& et_v_lamp() < IGNITION_MAXIMUM_IGNITION_VOLTAGE
RESTART_PREHEAT
gs_lamp_ignition_tries <
LAMP_IGNITION_MAX_TRIES
START_RUN_MODE
g_inverter_comparison_values.ontime1 >=
INVERTER_RUN_HALF_PERIOD
RUN_MODE
g_number_of_lamps > 0
TOO_MANY_LAMP_IGNITION_TRIES
NO_LAMP