Need formula to "linearize" LED PWM duty cycle
Bean
Posts: 8,129
Is there a standard formula that is used to convert from PWM duty cycle to apparent light output for a white LED ?
I have a PWM value that can go from 0 to 127, and I would like to have 32·equally spaced brightness levels.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
Post Edited (Bean (Hitt Consulting)) : 6/7/2006 2:46:42 PM GMT
I have a PWM value that can go from 0 to 127, and I would like to have 32·equally spaced brightness levels.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
Post Edited (Bean (Hitt Consulting)) : 6/7/2006 2:46:42 PM GMT
Comments
Though Im not sure how much use that will be since its non-emperical.
Here is a very insightful document: http://www.lumex.com/MstrCatalog/2_operating_curves.pdf
Where lumex has provided the operating curves for all of thier LEDs, the luminousity vs current is the one of interest.
For the first few you'll see its a negative curavture where efficiency of·luminosity vs current·decreases with increased current, and each has varying degrees of curvature (super blue suffering the worst loss of efficiency). But then you get down to 555nm green, and its the opposite where a positive curvature exists at low currents, then become essentially linear at higher currents. Then when you think you can express the luminosity of an LED with a single constant value for a specific LED (using the e^(K Tratio)), you hit the 565nm green,·590nm super yellow and·635nm high intesity red which exhibit a positive curvature at low currents and a negative curvature at high currents, meaning the formula isn't exact and must include another exponential term.
So the conclusion is,·there is no standard equation to equate current with luminosity for all LEDs, each LED has its own constant(s). So to be able to provide a linear luminosity you must either purchase an LED whose luminosity has already been characterized, or you must use a luminousity meter and do empirical anaysis on the LED you will be using.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life is one giant teacup ride.
Post Edited (Paul Baker) : 6/7/2006 3:50:32 PM GMT
Thanks for that info. I'm not looking for anything accuate. I would just like the LED to APPEAR to increase in intensity linearly.
In other words "Factor in" the human non-linear response to light.
Rather than appear to increase quickly at low PWM values, then increase much more slowly at the higher PWM value.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life is one giant teacup ride.
Here x0 would be the minimum detectible PWM value of an observable illuminated LED. http://hyperphysics.phy-astr.gsu.edu/hbase/vision/bright.html·provides a rough estimation of a by stating a doubling of intensity results in a 1.5 (50% increase) in perceived brightness.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life is one giant teacup ride.
1, 1.94, 3.42, 5.77, 9.50, 15.42, 24.82, 40.32, ... and rounded to the nearest integer would be
1, 2, 3, 6, 10, 15, 25, 40, ...
the - 0.58 factor is the offset to yeild the lowest visible PWM value, which I made the assumption was 1 (result of·e0.462 is 1.58), if the actual lowest visible PWM value were 2 the constant would be + 0.42, and would similarly be calculated for another value.
Given the range of 128·PWM levels, 10 equi bright values can be obtained (e4.62-0.58 = 100.9, with the next brightness value at 160.7), if hyperphysic's claim that a double of intensity equals a 50% increase in brightness is correct, you'd need a 12 bit value for PWM in order to achieve 32 equi bright values.
You might be able to squeeze a few more values out by doing a regional linear approximation of the curve by sacrificing accuracy near the boundry points, but you wont be able to squeeze anywhere close to 3x as many points into a 7 bit space.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life is one giant teacup ride.
Post Edited (Paul Baker) : 6/9/2006 7:35:10 PM GMT
It's not perfect, but it's alot better than linear.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
You may or may not want to try to adapt this algorithm, I tried a bit but it didnt want to fit nicely into 32 slots, but you can use it as a sanity check for the values you used, instead of using the 0.08, just plot the log of the change in value verses the value. The resultant slope should come close to a straight line. This wont hold for the small intesities due to the lack of precision from integer numbers, but the right hand of the graph should be a straight line.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life is one giant teacup ride.
When you say di/i = k = 0.08 are you saying that you need an 8% increase in power (from the present value) to get a noticeable change ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life is one giant teacup ride.