Software Design
Dimmable Light Ballast with Power Factor Correction, Rev. 1
38 Freescale Semiconductor
level adjustment (brightness linearization). The regulation error is then the input value for the PI regulator.
The output value from the PI regulator is the HRP period for half bridge power stage.
Input required luminance level adjustment adapts the required luminance level to its exponential value.
This is done because of the nonlinear function dependence of luminance on the lamp current. The
transformation table is used. The table contains the required current values.
The values in the table can be calculated using the following expression.
i
req
Ae
ki
reqAD
⋅
q+⋅= (EQ 5-1)
where:
•i
reg
is the required current in the exponential expression used for the control algorithm calculation
•i
regAD
is the required current measured by the AD converter
• A is the exponential curve gain
• q is the exponential curve offset
To calculate the coefficients A and q correctly, the following values must be known.
• Minimum HRP frequency f
min
• Maximum HRP frequency f
max
• Tube current measurement range i
max
• Minimum required tube current i
t
min
• Maximum required tube current i
tmax
• ADC maximum value AD
max
• ADC minimum value AD
min
• Minimum required tube current value converted to ADC range i
tADmin
• Maximum required tube current value converted to ADC range i
tADmin
• k determines function precision
Then:
i
tADmin
round i
tmin
AD
max
i
max
⁄ 0;⋅()=
i
tADmax
round i
tmax
AD
max
i
max
⁄ 0;⋅()=
A
i
tADmax
i
tADmin
–
e
kAD
max
⋅
e
kAD
min
⋅
–
----------------------------------------------------=
qi
tADmin
Ae
kAD
min
⋅
⋅–=
(EQ 5-2)
(EQ 5-3)
(EQ 5-4)
(EQ 5-5)
This is a time-consuming calculation, but it can be simplified by using the sheet “HRP_Setup” provided in
the Excel file “DLB_Setup.xls”. This file can be downloaded along with this designer reference manual.