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.