The resultant Y values of the product are the lumen output of each respective LED that is necessary to create the requested color and flux. At this point, all math operations give rise to two benefits of doing the math this way. If any of the final product's Y values are negative, it signifies that the color coordinate that was requested is invalid. In other words, the requested color was outside the color gamut. Also, check if any of the product's Y values are larger than the maximum lumen output of any of the three LEDs. This means that the Ymix input was too large. In this case, the firmware scales back the values so that they produce the maximum possible flux at the requested (x, y) coordinate.
The flowchart in Figure 7
describes the steps required for four-channel color mixing algorithm. If the color points of four LEDs are mapped onto the chart, it forms four triangles. These triangles are made up of the following LED triplets: (R,G,B), (R,A,B), (R,G,A), and (G,A,B). These triangles are referred to as TRI1, TRI2, TRI3, and TRI4 in the flowchart. The three-channel algorithm is implemented to solve dimming values for each of these triangles. Each triangle is solved to calculate TRx. If any of the three dimming values obtained from this process are negative, then the solution is invalid. If the solution is valid, the three dimming values are saved. When two sets of three valid dimming values are obtained, there is no need to proceed with the other triangles. The operation flow skips down to the “Add Two Sets of Dim Values” process as shown in Figure 7
. The six saved dimming values are added together so that there are four values: one for each of the four LEDs in the system. These four values are scaled to the appropriate dimming resolution and the dimming value solution is complete.
Lastly, these four dimming values are given as inputs to the external or internal drivers which control the brightness of LEDs by modulating the current flowing through each channel. If any three of four solutions are invalid that means the desired color is not present in the color gamut. The user can implement this error condition. It may be done by continuing to retain the old color, turning off the LED, and so on. These three-channel and four-channel color mix algorithms can be extended to more LEDs, as well as to a variety of lighting applications.
Figure 7: Flowchart for four channel color mixing
About the author
Anshul Gulati holds a Bachelors degree in Electrical and Electronics from BITS – Pilani, India. She has 8 years of experience in embedded systems design. Her interests include firmware development, digital design, and firmware/hardware co-design. She has worked on 8-bit, 16-bit and 32-bit controllers from different semiconductor companies likes Cypress, Motorola, Microchip and STMicroelectronics. She is currently working in CSBU R&D team developing solutions based on Cypress' PSoC products.
Visit Cypress website
Courtesy of EETimes Europe
If you found this article to be of interest, visit SmartEnergy Designline
where you will find the latest and greatest design, technology,
product, and news articles with regard to all aspects of clean
technologies. And, to register to our weekly newsletter, click here.