A simple yet counterintuitive optical feedback controller for spectrally tunable lighting systems

Abstract. We explore methods that efficiently replicate arbitrary spectra with both high precision and accuracy using multichannel light-emitting diode (LED) lighting systems. It is well known that LED-based light sources deteriorate over time and change their spectral output with varying operating junction temperatures. A simple open-loop approach to the spectral matching problem would bring about unbearable spectral and color inaccuracies. In the literature, different solutions have been studied that make use of integrated spectrometers as closed-loop feedback elements that warrant spectral awareness and self-correction. However, the prohibitive cost of small spectrometers (that generally involve CMOS-based gratings) constitutes a high barrier that prevents their integration into final lighting products. We demonstrate how a cost-effective colorimeter can be used not only to preserve the color point of the target spectrum but also to keep the spectral matching error extremely low (relative spectral error <10  %  ). With the proposed system and methods, we obtain relative color differences between target and emitted spectra below Δu  ′  v  ′    <  0.002, always with spectral shape preservation.


Introduction
For centuries, humans performed all daily activities under the light of the sun. Its well-defined, dynamic, broadband, and ever-changing spectrum is what we perceive as natural. Today, while the influence of the sun's spectrum in our biology remains unchanged, we have mastered several artificial lighting technologies. This is because our main activities have shifted to happen inside buildings, shortening our daily natural light exposure.
The blueprint for lighting in occupational settings is based on the well-established visual effects of light, with aspects such as illuminance, glare, color-rendering index (CRI), and correlated color temperature (CCT) being considered. 1 Even though provided with all these quality indicators, the main artificial lighting technologies used nowadays are whitelight-emitting diodes (LEDs) and fluorescent lights, sources known to have a spectral power distribution (SPD) that substantially differs from natural light. 2,3 However, today we know that in parallel to the neural pathway that processes visual responses to light (the socalled "visual pathway"), there is also a nonvisual pathway that shapes many cognitive functions in our brains. Currently, the role that light plays in the regulation of our approximate 24-h circadian rhythm is well accepted. 4,5 It also affects our body temperature, 6 attention, 7 hormonal secretion, 8 and sleep. 9 The discovery of a third type of retinal photoreceptor, the intrinsically photosensitive retinal ganglion cells (ipRGCs), in 1990s was the missing link proving that light does not only play an image-forming role but has an equally important nonvisual influence on our sleep-wake cycle. Furthermore, melanopsin is a photopigment found in the ipRGCs of the eye and is the most sensitive to wavelength of ∼480 nm. 10 This explains why not only illuminance levels or colorimetric properties, such as the CCT or CRI, of light are important, but the whole spectral aspect of light, i.e., the SPD, needs to be considered. Spectrally tunable lighting systems are now being used in residential, office, and public health settings, as well as commercial and industrial sectors. 11,12 The traditional lighting market is struggling today with a redefinition of its very own language, one that incorporates the ever-growing scientific evidence of the influence that dynamic light has on animals and biological species. However, some obstacles need to be overcome before the different parts combine into a mainstream technology. The first obstacle relates to the fact that daylight always implies dynamism. The spectrum of the sun changes over the course of the day, which from a product development perspective means that the varying signals applied to the LEDs lead to a distribution of different junction temperatures. Since LEDs are made of semiconductor materials, they are very sensitive to temperature variations and change their emission peak wavelength and intensity. Not only is the spectral accuracy compromised if temperature effects are not properly accounted for, but also the associated color variations are easily perceived by the naked eye. All these effects need to be corrected in order to end up having a technology that aims at competing with the current standards of the lighting industry.
Multichannel LED light engines are good candidates to satisfy the demand that a shift to a truly spectral lighting would imply. The problem that we are facing here is twofold. (i) How can multichannel LED sources, where every channel has its own temperature dependency and aging mechanisms, guarantee spectral and color stability over their lifetime? (ii) How can this be done without a significant cost increase? Technically speaking, several approaches can be considered as follows.
i. The simplest approximation involves measuring the SPDs of the different channels as factory defaults or presets and further assumes they are immutable over temperature changes and time. All the calculations related to spectral or color matching algorithms will assume the presets are correct. This is what is called an open-loop method, because it does not incorporate any sensor feedback. ii. One could also consider using a small spectrometer embedded inside the light engine that monitors and corrects the spectral shape of the emitted light in real time. This would be probably the most logical solution to come with for preventing color and spectral shifts due to temperature changes or wearing out of the LEDs. iii. Optical feedback with a, i.e., RGB, colorimeter constitutes another possibility if the main aim is to improve color consistency. However, there is no way a strategy based solely on a color sensor can provide an acceptable level of spectral accuracy, since there are an infinite number of spectra that represent the same color point. This would be equivalent to say that color, by itself, is not a good predictor of spectral shape accuracy because it contains less information. iv. As a final option, several photodiodes or colorimeters could be placed in front of every light channel to account for color or intensity variations. Technically speaking, this would be pretty challenging since there would be cross talk between lights from neighbor channels. This could be theoretically solved through sequential measurements by switching on/off the channels with a frequency not perceivable by humans. However, the complexity of the solution and the concern about the visible flicker renders this approach infeasible.
In the literature, several works based on the first approach (i) can be found. Fryc and Brown 13 proposed a light engine to match CIE standard illuminants, Kolberg et al. 14 developed an LED solar simulator with the ability to modulate certain wavelengths, and Burgos et al. 15 developed a spectral LED-based tunable light source. Although some of these works at first achieve good-quality results, none of the proposed methods takes into account spectral shifts due to temperature changes or wear out of the LEDs (a widespread and inevitable problem that affects all LEDs), 16 and none of them includes a feedback control system to monitor the emitted light, a key issue if a high-quality and long-lasting light source is pursued.
Considering that our main objective is to reliably match a given target spectrum, the obvious choice would be to use a spectrometer to measure the emitted spectrum, and from the SPD calculate the color point, thereby using a combination of (i) and (ii). In a previous work, we already studied such a system involving (i) and (ii) and the results were also published in this journal. 17 The present work can be considered as the natural research evolution of our first paper on this topic, where we have expanded our methods to include a colorimeter instead of a spectrometer as a sensing element, preserving the spectral accuracy to a good extent. It is worth noting that the conclusions of our first work still hold true, and a method based on an embedded spectrometer is still the best approach to attack the spectral consistency problem. Our aim with the present work is to expand our first method to color sensors, which are two orders of magnitude cheaper, and thus can be afforded by the general lighting market and create an impact.
Alternatively, combining (i) and (iv) would also be very similar to our previous work, since using a photodiode or color sensor for each LED channel is, in effective terms, a simplified spectrometer tailored to the particular LED.
Throughout the following sections, we shed light onto the nonobvious gap between the combination of (i) and (iii). Indeed, it may seem a counterintuitive combination due to the fact that the function that relates SPD and color is not bijective, that is, every SPD has a well-defined color point, but a given color point cannot be associated to a single parent SPD, and as a matter of fact, there are an infinite number of SPDs giving rise to the same color point because it is a continuous space. So, if color is not a good spectral predictor, how can it be used to preserve spectral stability?
This question deserves some thought beforehand, since it is important to understand the value of this research not only for the scientific community but also for those aiming to build commercial spectrally tunable solutions that are both reliable and cost-effective.
The key idea here is that color is not a good spectral predictor when the spectral space is too sparse. For the sake of illustration, let us consider a seven-channel light engine as the one that will be used later on the experimental section of this work. Every channel has 4096 intensity levels, so the number of different spectra that can be produced with such a light engine is an astonishing 4096 7 ∼ 10 25 . Using dimensional analysis, we can now calculate the average number of spectra associated to a single color point. We can do this by assuming a grid in the CIE 1931-xy color space with basic area elements of the size Δ x ¼ Δ y ¼ 10 −4 (100 million of colors), giving rise to ∼10 25 ∕10 8 ¼ 10 17 spectra per color. To put this number into perspective, 10 17 not only is the number of different spectra that have the same color point, but it is also the age of the universe in seconds. It is only when we see these numbers that we realize that color is not a good predictor of SPD, because with no other information, if we try to minimize a color difference the SPD can crystallize into any of the 10 17 different options.
But if we can narrow down the spectral space to a small subset of possibilities, it is possible to find positive correlates between color and spectral accuracy. This can be done for a particular case where the channel SPDs are known in advance (SPD presets measured at production time). The input variables are the target spectrum (and its associated color point) and the preset SPDs of the LED channels. The preknowledge of the preset channel SPDs is important because it can be utilized to narrow down the spectral possibilities for a given color. To do that, a first fitting algorithm is carried out with any available mathematical method borrowed from the literature, 17 i.e., a simple non-negative least squares method. This initial guess of the target spectrum would be errorless if the conditions (temperature junctions and aging) were the same as those present when the factory presets were measured. There are multiple ways these conditions may change; i.e., the junction temperatures when measuring the individual channel SPDs at production time are not representative of those obtained in real application cases. The heatsink thermal resistance may be different from the one used in the factory, the power supply may also change, and of course the aging processes that might have occurred would also differ.
Even though these differences between the estimated output spectrum (obtained using the preset channel SPDs) and the target spectrum may be important in some cases, the initial guess helps in reducing the sparsity of the spectral space, because now the distance between our initial guess and the final solution determined by temperature variations or aging processes has been dramatically reduced. Under these circumstances, where the whole spectral search space composed of about 10 17 spectra has been reduced to a local region around the solution under (unreal) factory conditions, it turns out that color is now a good predictor of spectral shape. This can also be seen in this way: when the number of spectral possibilities has been dramatically reduced, a cooperative effect between color and spectral shape shows up, so that an effort to match the color point to the target color also has a positive effect on correcting the spectral shape toward the target.
In the following section, we perform an in-depth study of a proportional integral-derivative (PID) controller system having a colorimeter as a sensing element and acting over the pulse width modulation (PWM) signals of the LED channels to reduce the color difference to a target, while at the same time obtaining acceptable spectral errors between the output and target spectra.

Methods
For this work, we have used a LEDMOTIVE (model VEGA07) tunable light engine 18 that is composed of 48 commercial monochromatic LEDs (from Lumileds Luxeon C: 19 Red, PC Amber, Lime, Green, Cyan, Blue, and Royal Blue) arranged in 7 individual channels (a channel should be regarded as an arrangement of LEDs having the same peak wavelength), essentially spread all over the visible part of the visible spectrum (400 to 700 nm, see Fig. 1.). The different radiometric powers for each individual channels are (from red to blue) 0.95, 2.53, 2.2, 0.64, 1.18, 1.08, and 1.26 W.
A block diagram of the hardware can be found in Fig. 2. The control system is executed in a microcontroller in the light engine. The same microcontroller also handles the PWM signals, the communications, and the sensor acquisition system, which include readings from the power sensors, the temperature sensors, and the color sensor. The PWM constant current driver has a resolution depth of 12 bit. The overall system is controlled with a Python 3.4 program and a PC (Intel i5, 8 GB RAM) through a serial communications system RS-485.
Changes in the PN junction temperature and aging of the LEDs always lead to undesired fluctuations in the emitted SPD (that can be at short or long time scales depending on whether the originating mechanism is temperature or aging). These changes imply depreciation in both the luminous flux and wavelength shifts. Furthermore, the PWM modulation may not follow a perfect linear relationship with power, which may induce further errors in the output spectrum.
Our method of joint color and spectral matching can be succinctly summarized in the following steps.
1. Once a target spectrum has been set, either the firmware of the light engine or an external PC performs an optimization to find the PWM weights that constitute the best-fit to the target spectrum, considering the preset SPD channel calibration data using advanced heuristic algorithms. 17 (1)  In other words, the PWM weights of the channels are first adjusted to minimize a spectral shift with respect to the target spectrum and are second adjusted in a closed-loop to minimize color deviations with respect to the target color. This is equivalent to say that we are prioritizing color accuracy (closed-loop) against spectral fidelity (open-loop). This is a good strategy for the market of general lighting since color reproducibility is critical because it is the most easily perceivable evidence of a light source malfunction. However, as pointed out before, the cooperative relationship between color and spectral shape arises when we have a decent (openloop) initial guess of the spectral solution. So, even if the spectral solution is not optimized directly in a closed-loop as in our previous work, 17 the color closed-loop is enough for preserving the spectral shape to an acceptable accuracy.

The controller sets the PWMs obtained from
In our implementation, the on-board color sensor is used as the sensing element for a PID control system. The light is collected from the diffuser element where all the light channels with different peak wavelengths are mixed. A polycarbonate waveguide (with an almost flat transmission response in the visible range) is in direct contact with the diffuser so that a number of rays are collected by the waveguide and are conducted to the entrance slit of the color sensor. The color information of the mixed light is then passed to and processed by the microcontroller to execute a new iteration of the PID algorithm. New PWM weights for each channel are generated at every step in the loop until the calculated color error is below an acceptable threshold. The spectral error is also monitored at each iteration step. A schematic of the modeled system is shown in Fig. 3.
At each iteration, the color of the emitted light is compared to the target color, and a decision-making block optimally determines how the PWM weights need to be modified so that the emitted light color gets closer to the target color. There are multiple ways to design this decision-making block. After some trial and error, we have observed that the best approach implies an initial determination of the LED channels that will reduce faster the error between the measured and the target color. For this, we have implemented a metrics that indicates the capacity that a channel has to influence the final color point. The metrics assumes that projections of vectors in the CIE 1976 L Ã ; u Ã ; v Ã (CIELUV) color space ðu 0 ; v 0 Þ 20 constitute a good representation of the capacity of channels to impact convergence speed. As an example, a first vector can be determined corresponding to the observed color deviation between the emitted light and the target color points. In a similar way, for each light channel, a second vector can be determined corresponding to a color shift between the color point of the target spectrum and  Llenas and Carreras: A simple yet counterintuitive optical feedback controller for spectrally tunable lighting systems the color point of the SPD for that light channel. Finally, we can compute the projection of the first vector onto the second vector for each of the light channels. The light channels that obtain a greater projection also have a higher capacity of shifting the color point toward the target color in less iterations. This projection metrics are passed as inputs to the feedback loop and indicate which channels need to participate at each iteration for the sake of a fast convergence to the solution.
A schematic of the different color points and vectors is shown in Fig. 4. The projection of one vector into the other, for the i'th LED channel, can be defined as E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 1 ; 6 3 ; 3 7 1 projection i ¼ã i ·b ja i j : Since there is no cross talk among the peak wavelengths of the preset SPDs, independent PID controls can be assigned to each LED channel. The PID controllers follow Eq. (2), where uðtÞ is the signal, eðtÞ is the current error [defined by Eq. (1) as the projection of the two vectors in the CIE 1976 color space], k p is the controller path gain, T i is the integral time constant, and T d is the derivative time constant: E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 2 ; 6 3 ; 2 4 6 uðtÞ ¼ k p eðtÞ þ Since we are working with a digital signal, Eq. (3) can be used instead of Eq. (2). The PID has three different proportional, integral, and derivative parameters. The integral part acts on accumulated past errors and the derivative part is a prediction of future errors that depends on the rate of change.
The PID parameters are generally found following a trial/ error process until a fast convergence with a low overshoot is obtained (in our system, this tuning process resulted in values E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 3 ; 3 2 6 ; 5 0 3

Results
The color difference was measured using the CIE 1976 20 since it is a wellaccepted metric for assessing the chromaticity of SSL products. 21 When the feedback is off, there is a flux decrease in the SPD with time, which is stronger in the red region [see Fig. 5(a)]. Thus, the color coordinates show a trend toward more bluish colors, with a Δu 0 v 0 > 0.005 when comparing the spectra at time zero and after 1 h of operation [see Fig. 5(c)]. Even if we are in the best-case scenario where the spectrum is static and the time windows is only 1 h, the observed color shifts would never be acceptable by the lighting industry, which reinforces the message that cost-effective solutions based on optical sensors are required to increase their market acceptance.
When active, the implemented feedback monitors the system evolution and infers changes in the spectral shape to correct drifts. Figure 5(b) shows the time response of the feedback control, acting to preserve the color point over time. Starting from the calculated SPD (obtained with the preset SPD estimation of the channels), the feedback control acts at a millisecond timescale, modifying the PWM channel weights in order to get closer to the target color despite changes in both temperature and aging of the LEDs. Due to the colorimeter feedback, the color difference, after 1 h, is below Δu 0 v 0 < 0.002, while the SPD preserves its shape with a small error, as we will see later on.
To validate spectral errors, we have used an external spectrometer (CAS 120 by Instrument Systems). Figure 6(a) shows the emitted SPD at time zero (black solid line) generated by the best-fit to a 3000K blackbody SPD (blue dashed line). Although this is theoretically the spectral bestfit to the target, because of the local and immediate effect of the junction temperature distribution, the color point is at time zero far from the target color point [being the color difference Δu 0 v 0 > 0.007, see Fig. 6(b)]. When the feedback control is activated, it effectively corrects this color deviation, resulting in a Δu 0 v 0 < 0.002 in 60 s, which is way below the limit established by the lighting industry  standards. 21 At the same time, the SPD shape evolves to meet the color condition, applying slightly more power at some wavelengths and slightly less in others [see red solid line in Fig. 6(a)]. The interesting point here is that in this process the error incurred in the target SPD is as low as 10%, as measured by the mean absolute percentage deviation. 17 The method presented here is not dependent on the selected target SPD or color point, and our results are general and can be applied to any desired target spectra. Figure 7 shows the precision and accuracy of the system for different CCTs and compares the results with the MacAdam industry standards. 21 For different CCTs across the Planckian locus, the color points are kept within two-step MacAdam ellipses. Moreover, the methods presented here hold also for different implementations of the spectrally tunable lighting system, for example using a different number of LED channels, and can be used to compensate for a failure of a small number of LEDs.
As a future work, it would be helpful to consider developing a temperature controller for the LEDs junction temperature to improve the first spectral match and the subsequent color minimization. Thus, the system would start from a color point closer to the target point and convergence to an optimal solution would be faster.

Conclusions
Despite the great possibilities of spectrally tunable light engines to create healthier living indoor environments, multichannel LED light sources still need to surmount intrinsic challenges associated with the technical aspects of using several LED channels, i.e., temperature and aging dependence of the spectral shapes and color points. This makes the development of these technologies and its application to real case scenarios difficult unless all these issues are attacked holistically. Even though there are some strategies in the literature that provide good results in spectral stability, they are based on expensive optical sensors, such as CMOS-grating spectrometers or interferometers, that prevent from an easy market adoption due to its price point. In this work, we provide for the first time a cost-effective solution that not only ensures color stability over time (Δu 0 v 0 < 0.002 over the product lifetime) but also warrants spectral accuracy (spectral errors to a target <10%), the cornerstone of all the recent advanced lighting applications such as human centric lighting.
Our methods provide tools and offer robustness to spectrally tunable solutions that are increasingly being used for different applications, by carefully engineering light spectra. These methods generally apply to systems having more than five channels, because the number of metamers representing a target color becomes unbearable, while at the same time the huge number of different spectra in the search space makes it possible to optimize for a target spectral solution fulfilling one or several preferred metrics. Museum lighting, health lighting, graphics arts industry, horticulture, or high-end offices with strong productivity needs are good examples of market spaces that demand highly accurate spectral solutions that are reliable and stable over time.
All the components utilized in this study have been selected to be suitable for mass-production and scale up significantly with volumes, which is the only manner they can make an impact and be directly applicable to the general lighting market. Aleix Llenas received his BS degree in physics from the University of Barcelona and his MS degree in photonics from Universitat Politècnica de Catalunya. He has worked in several international research projects in optics, photonics, and nanotechnology. He also worked for the NTT-Nippon Telegraph and Telephone Corporation, Japan, before joining the Catalonia Institute for Energy Research (IREC), where he is conducting research with multichannel LED light engines in collaboration with the R&D team at Ledmotive Technologies.
Josep Carreras received the BS, MS, and PhD (cum laude, hons.) degrees in physics from the University of Barcelona, Barcelona, Spain. He has authored over 60 articles in several SCI journals, holds two patents, and has participated in more than 20 different projects at the national and international level. He is also the president, founder, and chief technology officer of the spin-off Ledmotive Technologies. Since 2009, he has been with the IREC, Barcelona, as the leader of the Lighting Group, where he leads research on innovative concepts for energy-efficient lighting, color science and technology, simulations, photometry, and intelligent lighting with advanced communication and computation functionalities. He supervises several national and European projects in close collaboration with industrial partners.