8-bit MCUs provide cost effective, efficient high-brightness LED control
High-brightness light emitting diodes (HBLEDs) are rapidly gaining popularity in the automotive, consumer, and industrial markets. Brilliant colors, long life, and energy efficiency are some of the reasons why high-brightness LEDs are becoming the future of lighting applications.
In the automotive industry, the HBLED technology differentiates vehicles in terms of styling, safety, and fuel economy, going from simple switch illumination and LCD backlighting through very high-brightness headlamp applications.
Controlling luminosity of HBLEDs efficiently and reliably is not an easy task—power stage efficiency, thermal design, and electromagnetic compatibility (EMC) are some of the most critical design challenges. Typically, dedicated constant current drivers (CCD) are used for driving HBLED strings, overcoming most design issues and simplifying the design. However, CCDs are usually more expensive than a solution based on a microcontroller.
This feature describes the implementation of a smart HBLED lighting control using an 8-bit microcontroller and a low-cost discrete solution, without the need of expensive analog drivers or CCDs; the embedded closed-loop control algorithm that is implemented in the microcontroller ensures the optimal flow of current through a variable number of high-brightness LEDs, maximizing their life and avoiding undesirable visual blemishes.
The microcontroller measures the HBLED’s current and controls the discrete switched-mode power supply (SMPS) through a closed-loop PID control, while simultaneously implementing other features such as dimming, protection, and diagnostics
Important characteristics of high-brightness LEDs
As occurs in a low-intensity LED, the luminosity of a high-brightness LED is proportional to the current flowing through it. This current, typically called forward current (IF), ranges from 100 mA up to 1,000 mA for HBLEDs. At the same time a voltage drop, called Forward Voltage (VF), occurs whenever the HBLED is polarized. In HBLEDs, the luminosity and chromaticity are directly proportional to IF, therefore it is critical to have precise control of the current flowing through the HBLEDs.
Physically, HBLEDs with the same part number and same specification won’t have the exact same VF. When the current IF flowing through two HBLEDs is the same, their forward voltages, VF, might be different. Hence, controlling the LEDs intensity by means of a constant voltage might result in variations in intensity from device to device; a current control is required in order to ensure the same luminosity for all HBLEDs.
Not only does luminous intensity depend on the current flowing through the HBLED, but chromaticity as well. In order to maintain color, the HBLED must be driven with constant current. Therefore, the solution is to use a PWM (pulse width modulation), thus providing a lower average current in the HBLED (light intensity) while maintaining the same instantaneous current (LED color).
Power dissipation for applications involving HBLED is also critical. As the HBLED current increases, the power dissipation will also increase. A HBLED at 350 mA with a voltage drop of 3V will dissipate approximately one watt, without the proper thermal management, this dissipation might result in overheating of the HBLED and its long term degradation. Another important aspect of thermal design is that HBLED luminous intensity is inversely proportional to LED junction temperature, emitter colors can go to higher wavelengths as temperature increases.
Challenges when driving high-brightness LEDs
Using resistors to limit the IF current is very common for low intensity LEDs. In the case of HBLEDs the resistors must be rated for higher power, which would result in system inefficiency. Consequently, switched-mode power supplies (SMPS) are used to improve efficiency and reduce power dissipation in HBLED systems. SMPS are usually more expensive because of the need for energy storage components (inductors and capacitors); also, SMPS might create noise or EMI problems.
A group of HBLEDs can be driven together either in parallel or forming a series string; parallel driving gives the possibility of having different light intensities for each HBLED—but if a control loop is desired, each HBLED would require dedicated control, making it expensive for a large number of HBLEDs.
When connecting HBLEDs in series, forming strings, only one driver and control loop is needed per string; all of the HBLEDs in series will have the same current flowing through them giving a relatively constant brightness.
Depending on the amount of LEDs in series the strings might require voltages lower or higher than in the input voltage.
Microcontroller-based solution for high-brightness LED strings
There is a wide range of solutions in the market for driving constant current to HBLEDs; some of them are based on dedicated intelligent analog drivers while others use digital signal processors (DSPs) or microcontrollers with independent analog drivers.
There is a belief that microcontroller (MCU) based solutions are not good enough for performing the HBLED constant current control—especially because system might become unstable with a switched-mode power supply built out of discrete components, and with EMC certification as an impossible task. Freescale Semiconductor has created a design example for a dual string HBLED cighting Control based on S08MP16 8-bit microcontroller; the microcontroller is in charge of measuring the current feedback coming from the LED strings, processing it with a PID control algorithm and, as a result, controlling the operation of a discrete buck-boost switched-mode power supply, ensuring the optimal flow of current through the HBLED strings.
The microcontroller is also responsible for monitoring user inputs, battery voltage, and temperature sensors and diagnose the status of the LEDs power supply in real time; extra communication features, like LIN bus connectivity, could be also implemented in the same microcontroller.
The switched-mode power supply used to provide the power to the HBLEDs is a discrete buck-boost topology, designed to work with a variable amount of LEDs ranging from 1 to 18 LED strings (from 0 to ~65V, continuous) and up to 500 mA of output current running at a frequency of 350 kHz. The application Block Diagram is found below.
Switched-mode power supply design challenges
For working with a widely range of HBLEDs, a buck-boost power supply is needed, being capable to supply an output voltage VOUT either lower or greater than battery voltage, VBAT.
There are a wide range of buck-boost topologies that can be used, for example the CUK converter or the SEPIC converter, each one with different requirements and benefits in the amount of components required, positive or negative voltage reference, and efficiency.
The switched-mode power supply chosen for this design is a combination of a buck converter and a boost converter sharing the same inductor and capacitor, changing the operation mode from buck to boost and vice versa depending on the status of the transistors Q1 and Q2 in the figure below.
This topology reduces the cost of having an extra inductor and an extra capacitor. Also, its transfer function is reduced to the one of a common buck or boost converter depending on the mode in which the SMPS is working, simplifying design from the control standpoint.
To control EMC using discrete switched-mode power supply topologies, snubber filters where added across switching transistors (Q1 and Q2) and software control strategies, such as center-aligned PWM and turn ON/OFF delays between channels, were programmed.
Choosing the right microcontroller for constant current HBLED control
Switched-mode power supplies require a fine and accurate switching frequency and duty cycle; jitter in the PWM signal is reflected in the output voltage and therefore in the HBLEDs intensity. Also, moving up in the switching frequencies to several hundreds of kilohertz is a requirement to save cost in inductor and capacitor size. Analog-to-digital converters (ADC) resolution and channels availability is also important for monitoring and controlling HBLEDs current and voltage.
The Freescale S08MP16 is a low-cost, high-performance 8-bit microcontroller specially design for control applications. Peripherals like a 12-bit ADC, FlexTimer module (FTM), high-speed analog comparator (HSCMP), programmable gain amplifier (PGA), and programmable delay block (PDB) make this device well suited for HBLED control applications.
For achieving the HBLED constant current control, the microcontroller measures the HBLED string current reflected in a current-sense resistor that is in series with the HBLED string. The embedded 12-bit ADC of the S08MP16 enables the use of a small resistor value with very little power dissipation. Also, with the ADC and by means of a resistor divider, it is possible to measure the SMPS output voltage and have diagnostics of open load, over current, and over voltage conditions.
For controlling the switched-mode power supply frequency and duty cycle, the FlexTimer module is used. With up to 40 MHz timer operating frequency in the automotive qualified version, high frequency and high resolution PWM can be generated, working with a wider range of HBLEDs per string and without any flickering in HBLEDs intensity when a small control action occurs.
Also, the programmable delay block is used in the application to synchronize the ADC readings with the PWM switching frequency, making sure that the ADC readings occur only when current has stabilized in the ON condition. How to compute the constant current control algorithm in the 8-bit microcontroller
A simple control loop is good enough for ensuring the proper driving of HBLEDs most of the time. With closed loop control, the module compensates for battery voltage, temperature, or any other parameter variations that might affect the HBLEDs current in open loop.
When doing constant current control, the module provides the required voltage to keep the HBLED string at the desired current, which also allows a flexible number of HBLEDs per string without any further calibration or hardware changes.
The calculations required in pseudo code are:
Error = Set Point Current – Current Feedback
The output of the PID control is given by the following expression:
Kp is the proportional constant Ki is the integral constant Kd is the derivative constant i is present time value i-1 is the previous time value T is the sampling period (this value is considered = 1 for calculation simplification)
In order to integrate the control loop into the 8-bit microcontroller the use of floating point libraries should be avoided. In this example, 16-bit variables can be used instead to accomplish calculations.
For example, since Kp, Kd, and Ki are typically fractional numbers, the implementation can be done by means of division with integers result of its inverse (1/Kp, 1/Kd, and 1/Ki), for example:
While driving an HBLED is simple, driving HBLEDs efficiently and reliably without compromising cost might not be. Using an 8-bit low cost microcontroller is a cost saving alternative—with the right peripherals. Hardware and firmware design is critical to ensure that HBLEDs applications will have the expected behavior during the expected module’s lifetime.
Further technical details about the described design can be found in Freescale Application Note AN4105. Even though the target of this design is for automotive applications, the concepts and solution can be applied to many other industrial and consumer applications using HBLEDs.
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.