How to design a microcontroller-based three-channel LED driver (Part 1 of 2)
LEDs offers a combination of flexibility and efficiency unmatched by conventional forms of lighting, and are being adopted in architectural- and stage-lighting applications because they emit highly reliable, long-lasting light from small packages. Each lighting application is unique, however, because every marketing department finds value in different features.
Rather than rely on specialized integrated circuits to implement comprehensive control of LEDs, designers are turning to programmable mixed-signal microcontrollers which integrate the necessary peripherals, including pulse-width modulators (PWM), communication interfaces, amplifiers, comparators and data converters, onto a single device.
Complex functions, such as dimmable buck converters, are controllable by combining some of the peripherals described above. Buck converters used in LED-driver applications are required to be current-mode regulators because LEDs are current-mode devices. The LED V-I (voltage versus current) curve shows that slight variations in the forward voltage will have exponential effects on current. Hence, the feedback in any LED driver circuit should represent the current.
Additionally, constant current is used because the color and intensity of LEDs are rated and binned at particular forward-current levels by manufacturers. These properties are important because they are used as values to maintain compliance with overall system specifications.
A typical LED system, Figure 1, will have a communication interface, LEDs of various colors with each color representing a channel, some sort of intelligence, and a constant-current driver for each channel.

Figure 1: System block diagram
(Click on image to enlarge)
The communication interface could be anything from standard lighting protocols such as DMX512 or DALI, to ZigBee or Wireless USB. Intelligence is provided by a microcontroller with built-in analog-to-digital converters (ADC) and LED-dimming peripherals. The ADC monitors system variables, such as temperature, LED current, and color-mixing tasks. The driver provides a constant current for each LED in the channel. The complexity and quality of the driver determines the price of the driver.
Hysteretic buck controller
Integrating the LED driver into the microcontroller reduces the size of the overall system solution. Presently, however, few off-the-shelf devices exist which incorporate the high-power components of a switch-mode power supply (SMPS) with the intelligence of a microcontroller. Alternatively, feedback and control circuitry for the SMPS can be incorporated into the microcontroller using programmable mixed-signal resources. The SMPS topology for such a design uses a current mode controlled hysteretic buck converter architecture such as shown in Figure 2.

Figure 2: Hysteretic controller
(Click on image to enlarge)
At start up, the current through the inductor ramps up until the voltage on the positive input of the comparator is larger than the voltage on the negative input of the comparator. Afterwards, the converter acts as a free-running oscillator, with the current charging and discharging between two levels as shown in Figure 3.

Figure 3: Ideal LED current waveform
(Click on image to enlarge)
The level of ITH_HIGH and ITH_LOW are set by the shunt resistor, the two feedback resistors RIN and RHYST, and a voltage output DAC using the equations below. You can see that selecting larger RHYST values results in smaller differences between the high and low threshold values.

The charging phase (Figure 4a) starts when the PFET is turned on and the inductor begins charging. The comparator monitors inductor current by measuring the shunt voltage. The discharge phase (Figure 4b) begins when the threshold ITH_HIGH is reached.

Figure 4: Charging (a) and discharging (b) phases of the buck converter
(Click on image to enlarge)
During the discharge phase, the current discharges through the freewheeling diode, which protects circuit components from inductive kickback and keeps the LED on. The charging phase starts again when the current in the LED crosses the value ITH_LOW.
The converter starts up in the charging phase until the inductor current reaches the ITH_HIGH threshold. The time it takes to reach this threshold is called the rise time, trise, and is dependent on the input voltage and the inductor value:

where VF is the forward voltage of the string of LEDs.
Since the inductance is in the numerator of the above equation, the rise time is directly proportional to the inductor value. Short rise time is important for dimming because smaller pulse widths allow the use of higher-resolution modulators, but that is not the only reason to use smaller inductor values. Small-value inductors, with comparable rated current, are physically smaller and less expensive than large-value inductors because they can handle more current in the same size package as the large-value inductors.
(Part 2 looks at average current error, level shift circuits, and dimming resolution; you can read it by clicking at www.planetanalog.com/features/showArticle.jhtml;?articleID=205602682)
About the author
Patrick Prendergast is Senior Applications Engineer for Cypress Semiconductor Corp., San Jose, CA, and develops applications using Cypress' PSoC mixed-signal microcontroller and EZ-Color LED microcontroller. He earned a BSEET from Western Washington University in Bellingham, WA.
Most Read
-
Currently no items
Most Commented
-
Currently no items


Loading comments... Write a comment