While messing around with dimmable DC-DC converters for LED drivers, I had the need to quantify the contrast ratio of a dimmable light. Turns out it is not that trivial, specially when combining switching periods, transients and mixed analog/PWM dimming. Looking for contrast ratio on the internet is only useful if you want to buy a TV, not if you want to build a LED driver. Also, on the web not all information seems to be correct, therefore this article and its possible continuation is the result of long investigations and discussions between engineers. And any consideration or feedback from a reader is very well accepted.
In this article I will go through Contrast Ratio definition and how this applies on a mixed analog/digital dimming in a LED system.
Pulse Width Modulation, PWM: digital dimming in an analog world
Experimenting with the LM3405, as example, will show its capability to dim a LED digitally through the Enable pin, in which it will turn on or off the analog DC-DC switching engine. But then there is some non-linearity with the dimming on varying the PWM frequency, as shown here, which honestly surprised me the first time I saw it:

Higher the frequency, lower the provided current, given a fixed duty cycle. As you can find in its datasheet, there is a startup time, including charging up the inductor, step by step ad the switching frequency, up to the programmed current.
This whole time is supposed to be around 100us. This is an example from the same part:

It’s clear that with a PWM of 5kHz, or period of 200us, the total dimming duty cycle is halved since half of it is going to be wasted in waiting the driver to reach the output current.
Also, when turning off there is some delay, and this must be taken into account. In a general driver like this, the control input is in voltage, while the output is in current. The LM3405 in particular, allow only zero or maximum current, thus dimming is only done digitally through PWM.
Now, since the PWM is a digital signal, it is interpreted by the driver as logic high, therefore maximum value during the on-time, and a logic low, threfore minimum value during the off-time. This means that while dimming, the PWM signal must drive the output at the minimum designed value, here for example 0A of the LED driver, during the off-time. Viceversa, while the input goes to maximum logic voltage, one shall ensure that the driver reaches the designed (and therefore maximum set by desing) output current during the on-time, within one PWM period, i.e. before a new pulse will arrive and the cycle begins again.
I mentioned the on and off time to be wide enough to give the driver enough time. As a result, how accurately and fast a driver follows this logical signal? From EDN there’s this nice drawing:

From this picture is clear that the PWM period and duty cycle has some boundaries. To understand what are those boundaries, is important to see that there are 3 types of delays. , which is the propagation from the enable signal to the first output change,
is the time to reach the maximum current and
is the time to shut down the output once the enable signal is gone.
From this it’s easy to find the maximum and minimum duty cycle: where below the minimum the nominal current is never reached leading also to color issues in the white LED, and above the maximum duty cycle the LED may never fully shut down during the off period. So, in order to achieve proper digital dimming, the and
shall be considered.
As a consequence, is the minimum duty cycle just before have the output completely off at 0% of duty cycle, where between 0% and
there is no real control in current output and the value depends on the slope of those ramps. In the same way,
is just before having the 100% of duty cycle. So, between
and 100%, again, the output current depends on the driver’s output current ramps – more on that later. The conclusion is that we want to operate within boundaries which are giving us the control of the output current, therefore, control on the contrast ratio.
Dimming ratio, contrast ratio and dynamic range: special cases and definition
The contrast ratio is defined as the ratio of the maximum output light (i.e. 100% duty cycle, or 100% DC) over the minimum achievable DC, since from the average output current one can relate the average output light, if driving an LED. Now, since the DC definition relates the on-duration measured w.r.t. one PWM period duration, the 100% of DC is the PWM period duration related to the PWM period duration itself, so .
So the contrast ratio (CR) is:
and because from Figure 3 the minimium DC is we obtain:
(1)
Also, the CR seems to be the Dimming Ratio, since is just the ratio achievable from the maximum duty cycle over the minimum, hence, for this case, is exactly the same as the CR. Perhaps because here the defintion is related to an LED only, so all these fedinitions became the same quantity.
Additionally, there is another equality. The Contrast Ration now is also the same as the Dynamic Range, because is the capability of the driver to provide variable output signals at different levels or encoding (since the PWM is a digital modulation) related to the minimum level or encoding value. To make an example, if that would be applied to the audio field, would be the ratio of the loudest sound compared to the minimum which can be reproduced, which is the noise floor level of the amplifier while below you cannot go.
Here in the LED (excuse the rough comparison) the noise is just the rise and fall current ramp defined by the analog parameters of the driver, where its duration makes the equation (1). Now is clear that, except from a fully on LED with 100% or 0% of DC where there is no measurable PWM period, while dimming within duty cycle of and
, the PWM period shall be greater than
, to let the driver fully turn on and give the time to fully turn off. There should be also an optimal PWM period definition, but this is matter of another article.
Analog dimming: does it matter in this digital world?
After having seen what is a Contrast Ratio related to a PWM dimming technique, one may have the need to use an analog dimming. Here the dimming ratio is still there as a definition, but relates directly and in a linear way on the current.
Let’s say there is a current of 1A in a given LED. Some drivers have an input pin, usually the PWM one, in which if an intermediate voltage is detected, they actually drive in an analogue fashion the output current. Note, as just mentioned, that the “PWM Voltage” here is also the analog signal:

The LED light flux emitted is said to be linearly proportional to the current, except of emitted CCT in white LEDs. Or better, is approximated to be linear, as show in some LED datasheets:

This means that being precise would require a conversion function from output current to luminous flux to get the exact amount, in theory. I said so, because the measured flux is subject to a lot of uncertainties and here in Figure 5 is only stated at 25°C. Therefore practically speaking, can be assumed to be linear, while here below 100mA is not even measured.
Getting back to the Contrast Ratio, let’s assume to dim from down to
, meaninig to require a dim down to around 14,28% of maximum current. In Figure 4 this dimming capability is possible, therefore is possible to apply a certain analog voltage to get it dimmed. In this case, the Dimming Ratio, or Contrast Ratio, is just:
To conclude: analog and PWM reinforce each other
The force to support both analog and digital dimming, stands behind the capability to combine the contrast ratios. Indeed the more precise and common used system is the PWM because of its natural capability to reach high CR values. In the previous example the analog is just 7:1, but if a PWM is applied on the same time, the game will change.
Since per each Duty Cycle value, a full analog swing can be applied, the resulting CR will be:
A bare PWM with 100 : 1 can reach the 700:1 value, if color shifting is not a big issue.
Now, based on the previous definitions of CR, we can still achieve a maximum luminous value and a minimum one but without any intermediate values. In fact, what is still missing, is how much precise the dimming could be and what is its resolution. Since it is not that trivial, it will be addressed in a second article.
3 thoughts on “Dimming LEDs (part 1/3) – Analog and digital, not analog vs. digital”