In this example, the powers of three sources representing red, green and blue LEDs are individually optimized to achieve a user-specified color on a screen illuminated by the sources. The color is specified by x,y chromaticity coordinates that will be targeted during the optimization.
The accompanying FRED file for this example, exampleLEDColorOptimization.frd, is located in the <install dir>\Resources\Samples\Tutorials & Examples\ directory.
Four sources are defined in the Optical Sources folder of the object tree. The first three sources, "Red", "Green" and "Blue", represent LEDs with a 1mm2 emitting area and a Lambertian angular distribution. Each of the three LED sources is linked to the corresponding spectrum node defined in the Spectra folder of the object tree, which define a normalized Gaussian power spectrum centered on a wavelength corresponding to red, green or blue. Each of the three sources are offset laterally in x and y, as can be seen in the 3D view, and are located 10 mm away from an opaque screen that will be illuminated by all three LED models during the raytrace.
The spectral power distributions of the red, green and blue spectrum nodes can be viewed by right mouse clicking on the spectrum node and choosing the "Plot Spectrum" option.
If a raytrace and analysis is performed using the following sequence, then the resulting color image on the screen appears as shown in the image below where the center pixel of the distribution has x,y chromaticity coordinates of approximately (0.3, 0.3). 1.Raytrace > Trace All Sources 2.Analyses > Color Image
The fourth source in the model, "Full Color", is a single Lambertian plane emitter with a weighted set of discrete R,G,B wavelengths applied. The weighting of the wavelengths is such that the resulting chromaticity coordinates of the source color is (0.38, 0.47). This source will be used for comparison with the color formed by the three LEDs after optimization.
Configuring the optimization is a three-step process: 1.Define the variables allowed to vary during optimization 2.Define the aberrations that will be summed together to form the merit function 3.Define the optimization engine method to be applied
The Optimization configuration dialog is accessed by going to Optimize > Define/Edit.
Defining optimization variables With the optimization configuration dialog opened, the variables are defined on the "Variables" tab. Each variable specification is defined on a single row in the spreadsheet, indicating the entity in the model whose property is being varied, the type of property being varied, and the lower and upper range limits that the variable is allowed to traverse during optimization. In this example, the variable Type is going to be the power emitted by each of our three LED sources and, consequently, the Index #, Subindex #, and Fraction Var # specifications for each variable can be ignored. In other variable type specifications, one or more of these specifications may be required (see the Optimization Variables Help topic for more information on these specifications). The source power for each LED model will be allowed to vary between 0 and 2 Watts. The Frac Step setting controls the step size of the initial variable search at the start of optimization, with a value of 0.1 indicating that the variables will step 10% of their limits range (Upper Limit - Lower Limit). The default setting for Frac Step is 0.1 and adjusting this value can affect the outcome of the optimization.
Additionally, we toggle the "soft limits" option for enforcing the variable limits ranges. In this mode of operation, the variable values are allowed to wander outside of their limits ranges but a penalty will be applied to the merit function in an effort to force the variables back into the specified range. This mode of operation has an advantage over the "hard limits" option in that the optimization is allowed to proceed when the variable limits are violated. When "hard limits" are enforced, the optimization will be halted when the variables step outside of their specified ranges.
Defining optimization aberrations The next step in the configuration is to define the metric(s) that will be used to guide the optimization process, which is done on the Merit Function Aberrations tab of the optimization configuration dialog. Each row corresponds to an individual "aberration", which is typically a statistical metric extracted from a 2D analysis grid of data. The individual aberration definitions are combined together into the optimization Merit Function (MF) in the following way: MF = S wi(Ai-Ti)2 . Here, Ai is the evaluated aberration value, Ti is the aberration target value, and wi is the aberration weight.
In our example, we are optimizing the powers of the three LED sources in order to achieve a specific color distribution on the screen plane. In particular, the color distribution will be specified as x,y chromaticity coordinates in the CIE 1931 color space by using the "Centroid X color" and "Centroid Y color" aberration options. For our LED application, the centroid color options will drive the average color across the entire screen. The distribution that we wish to evaluate for its chromaticity coordinates is gong to be calculated by the "screen" analysis surface and we want the target x,y chromaticity coordinates to have a value of (0.382, 0.471).
Defining the optimization method FRED has a number of different optimization methods, but we will use the general purpose Simplex option for our LED example. In addition to specifying the optimization method, we need to specify when the optimization should be considered to have converged. We specify that the optimization will stop when the merit function value changes by less than 0.001 OR after 100 iterations.
The optimization can be executed by going to Optimize > Optimize. As the optimization proceeds , FRED will report various information to the output window. For each optimization iteration, the merit function value and the variable values used in the iteration are reported. Additional information can be optionally reported by configuring the settings of the Output/Results tab of the optimization dialog.
In this example, the optimization is considered converged when the 100 iteration limit is hit. The final value of the merit function and variables are reported to the output window as well as a comparison of the variables and aberration values before and after the optimization. As indicated in the image below, the "after" values for the aberrations, which are the x,y chromaticity coordinates, achieved values of 0.38 (X chromaticity) and 0.47 (Y chromaticity).
With the system optimized, we can calculate the color image formed on the screen plane by taking the following steps: 1.Raytrace > Trace All Sources 2.Analyses > Color Image, then choose "screen" as the analysis surface and hit OK
In the resulting plot interface, click and hold in the center pixel of the color image plot and the corresponding chromaticity coordinates for the pixel will be displayed in the lower left window (the CIE chromaticity chart). As indicated in the plot below, the center pixel has chromaticity coordinates (0.387, 0.468).
Compare this color image formed at the screen plane with that resulting from the "Full Color" source by taking the following steps: 1.Select the Red, Green and Blue LED source models (use CTRL to select multiple nodes) 2.Right mouse click on the selected source and choose "Make All Not Traceable" from the context menu 3.Right mouse click on the Full Color source node and choose "Traceable" from the context menu 4.Raytrace > Trace All Sources 5.Analyses > Color Image, then choose "screen" as the analysis surface and hit OK
In the resulting chart window, the center pixel has chromaticity coordinates (0.382, 0.471).
Note the difference in the color uniformity across the analysis surfaces in the two cases. This is primarily due to the difference in the wavelength sampling for the sources. In the case of the "Full Color" source model, the discrete RGB wavelength list specification means that each ray trajectory is sampled by those three wavelengths. Consequently, each ray intercept in the analysis grid is equally sampled by all three wavelengths. In contrast, the Red, Green and Blue source constructions generate wavelengths "Randomly according to a spectrum". This means that each ray trajectory carries one unique, random wavelength defined according to the associated source spectrum. The result of this construction is that each ray intercept corresponds to a unique wavelength value, which introduces wavelength noise in the sampling of the analysis surface. Another consideration in the Red, Green and Blue source construction is that the three sources are displaced laterally in the X-Y plane at the source locations.
|