The Limits of PWM Resolution
Bob’s LED driver design started with 8 bits of resolution and a 250 Hz PWM frame rate. However fades (dimming ramps) had pronounced stepping at the low end. He increased the resolution to 12 bits with some improvement, but not enough. Finally Bob cranked the resolution up to 16 bits. Surprisingly there were still artifacts, and the 16 Mhz clock left no room to go higher. Was this the limit of smooth LED dimming? Actually no. Bob hit the PWM sampling limit instead.
The bit resolution of a PWM frame sets the maximum resolution attainable, but not the effective resolution. Since each frame takes finite time, PWM is actually sampling the desired intensity at discrete intervals. The number of intervals available creates an additional limit on attainable resolution. For example, with a 250 Hz frame rate, a 3-second fade utilizes 750 PWM frames. For a linear ramp, at most you need only log(750)/log(2)
or 10 bits. Additional bits of PWM resolution remain unused as shown in the following chart.
Typical fade times for general illumination range from a fraction of a second to several seconds. As shown in the chart above, at low frame rates and short fade times you don’t need–and cannot use–high resolution with a linear ramp. Even at 1200 Hz, any more than 12 bits are wasted on a 3 second fade. Yet stepping is just as annoying in a 3 second fade as a 10 second fade.
A Bit More Finesse
The problem here is that the step from intensity 1 to intensity 2 doubles the visible brightness. It doesn’t matter whether the step is 1 of 50 or 1 of 50000, if you double the intensity the eye will register a flicker. Incandescent lamps tend to smooth out the transitions due to filament heating/cooling time, though small filaments can flicker. But LED response times are so fast that flicker is assured. The human eye is to blame. Its logarithmic brightness response ensures absolute lighting levels don’t matter, but its extreme sensitivity to change make even small transients highly visible. And annoying.
A correction factor can be introduced to compensate. In television and digital imaging this is known as gamma correction; in lighting it’s known as a dimming curve, which smoothly maps the majority of available dimming levels into a portion of the intensity range. For example the DALI protocol prescribes a power law curve where the first step is 0.1% of maximum brightness and the last step is 3%. Fading from bright to dark is extremely smooth with this kind of curve.
Unfortunately dimming curves don’t work with every transition. Let’s look at why.
What Goes Down Must Come Back Up
The following chart shows intensity levels for both a linear ramp and a power law dimming curve. The resolution is limited to better illustrate the differences.
The power law ramp is very smooth on the way down. However on the way up the steps at the end are quite large–and very visible. We have robbed Peter to pay Paul. Reduced resolution at the top end is particularly a problem in television, cinema, and stage lighting where luminaires often run at near full brightness. A logarithmic curve can be used for these applications, where, for example, 90% of the available steps are used for the brightest 20% of the range. Alternatively an s-shaped dimming curve would increase the resolution at both the top and bottom of the range, but at double the cost to the middle. Whether or not this is acceptable depends on the application.
Some designers try to combine dimming curves with high resolution, but this doesn’t help as much as you might think.1 Unfortunately this often leads to unpredictable operation, such as poor correlation between commanded and actual intensity levels. And noise or transients in the control system still cause highly visible artifacts in the lighting. Increased resolution also requires a faster clock, is more expensive, and limits the PWM frame rate, causing motion artifacts and issues with video cameras. That’s a lot of trouble for an incomplete solution.
At the end of the day dimming curves all share the same problem. A single static curve helps only some of the time. The answer is to put the higher resolution in the right place every time. ZulchLab original research reveals a little-known aspect of human perception that makes this possible, even at moderate resolution. With the right technique every transition is smooth, whether from bright to dark or dark to bright. Please see Introducing Lumiglide™ for details.
- Increased resolution does reduce the quantization noise, but any such noise is invisible once the PWM frame rate exceeds the eye’s critical flicker frequency. ↩