Software Design
4
Run mode
Set Dimming value and Dimming value array
to minimal value
Set zero current checking interval counter
(currFltMS)
Set values of PI PFC stage regulator for run mode:
-proportionalGain = PI_KP_RUN;
-integralGain = PI_KI_RUN;
1
yes
Measure lamp currents
Has 1ms gone?
yes
Is time to measure Dimming value ?
yes
Get dimming value and compute moving avg. filter
no
Is current through Tube1 or Tube2 zero ?
Test
Is enabled PI PFC stage regulator calculation ?
no
yes
no
Reset current checking interval counter
no
yes
Calculate PI PFC stage regulator for reference sine gain
no
Is enabled PI ballast stage |
|
|
| no | |
regulator calculation ? |
| |
|
|
yes
Control lamp currents
Has zero current checking
interval gone?
no
Trimming internal oscillator
yes
Is attemp to start > 0 ? | yes | 1 |
no
faultISR()
Figure 5-10. Flow Chart — Main Flow, Part 4
Dimmable Light Ballast with Power Factor Correction, Rev. 1
50 | Freescale Semiconductor |