True LINEAR LEDs PWM

Hello,

for those of you who have kindly followed me in my previous post...you already know that I am experimenting with LED PWM.

Now, clearly the LEDs don't light up linearly to the PWM but I wanted to get the smoothest transition possible, so I thought of a test that I could run to determine precisely how the LEDs light up accordingly to the PWM so to be able to use the numerical data to light them up in a more linear way.

I write this post, first of all, to understand if I might be on the correct path to deal with what I am facing and, secondly, with the hope that the data collected may be of help for others (as it is quite boring to do this...).

So here it's how it works...
I've 3D printed a black cone (30 cm long), one side open the width of the LED (in my first case 10mm, white LED), the other side it fits on my exposimeter (Sekonic L-758D Digital Master, for those who are interested).
I've attached a 10mm white LED (driven with a MOSFET with a 12V input) on one side and the exposimeter at the other side (set on EV mode) and I've gone through all the PWM values taking reading of them.

Here is the, unsurprisingly, result:


Now, the idea is to take only the values where there is a true increment in lightness and create an array to use in any for cycle (or whatever you may use) to create a dimming effect, so to have a better light transition (I hope I explained myself, sorry, I'm not a native speaker).

If you have any comments, ideas, I'll be glad to hear them and I hope you may find this interesting.
If you do, please let me know and I'll take readings also for 5mm and 3mm LEDs and I'll post the numerical values.

Many thanks for your attention,

Alesssandro

I’ve found the simplest way is a 256 byte array with a lookup of the appropriate value needed.
There are a few on the web, and it’s simple to tweak the values if you want to modify the curve.

Put the array in FLASH as a constant to save RAM.

You could do it algorithmically, nut the simple array lookup is faster and probably uses less program memory anyway !

Actually, PWM is perfectly linear but your eyes & brain are not. :wink: I’m not a photographer but I assume the light meter is calibrated similar to perception.

Our perception is logarithmic/proportional. If we go from a PWM value of 1 to 2, that’s a very noticeable 100% increase but when we go from 254 to 255 that’s an unnoticeable change of less than 1/2 %.

That’s an interesting interpretation...

Our perception is logarithmic/proportional. If we go from a PWM value of 1 to 2, that's a very noticeable 100% increase but when we go from 254 to 255 that's an unnoticeable change of less than 1/2 %.

You are absolutely right about this!
That's exactly the same when it comes to computers display and/or print calibration.
I guess that the exposimeter gives "absolute" values and not somehow interpreted accordingly to human perception as, otherwise, it would lead to inconstant and subjective results. It is used to have a clear ideas of the light characteristics so to use them in conjunction with the camera, which, in turns, behaves like a machine and not like the human eye.
At the same time, my exposimeter as a 0.1 EV precision so it is absolutely possible (and I guess it is the case) that, for higher PWM values, there is actually a change in lightnness, but it is so unperceivable that it falls outside of the precision range of my instrument.

Still, my original assumption was that LEDs, just like display and prints, might need to be somehow calibrated (technically "characterized"). Just like when we double the amount of ink on a piece of paper doesn't necessarily mean that we have doubled the "intensity" of that color.

I don't know...

I can imagine this curve needs some fine tuning based on the characteristics of different LEDs but not expecting a major change. After all it's indeed mostly your eyes and brain that are very good at "correcting" brightness levels, levelling it all out.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.