## How to Optimize Non-Sequential Optical Systems

Category: Product News

This blog provides a recommended approach to the optimization of non-sequential optical systems. The methods are to use Pixel Interpolation, aggregate detector data (moment of illumination data) and the orthogonal descent optimizer. As an example, a free-form mirror is optimized to maximize the brightness of an LED from 23 Cd to >250 Cd in just a few steps.

#### Introduction

OpticStudio's optimization feature allows users to improve their design by setting system parameters variable and defining performance criteria in the Merit Function Editor. This process will have a huge impact on the design so it is important to choose appropriate variables and criteria. The type of criteria available differs between Sequential and Non-Sequential (NSC) modes.

Damped least squares vs orthogonal descent

There are two local optimization algorithms in OpticStudio: damped least squares (DLS) and orthogonal descent (OD). DLS uses numerically computed derivatives to determine a direction in solution space which produces a design with a lower merit function. This gradient method has been developed specifically for optical system design and is recommended for all imaging and classical optical optimization problems. In the optimization of pure non-sequential systems however, DLS is less successful because detection is performed on pixelated detectors; the merit function is inherently discontinuous and this can cause the gradient method to fail.

Below is a scan of the merit function of a NSC system as a function of just one variable.

For long regions of merit function space, there is no change in the merit function at all, and when change does come it is sudden and discontinuous. This makes optimization by gradient search techniques difficult.

Orthogonal Descent optimization uses an orthonormalization of the variables and discrete sampling of solution space to reduce the merit function. The OD algorithm does not compute numerical derivatives of the merit function. For systems with inherently noisy merit functions, such as non-sequential systems, OD will usually outperform DLS optimization. It is very useful in optimization problems like illumination maximization, brightness enhancement, and uniformity optimization.

Pixel interpolation and NSDD

In addition to the specific algorithm used, OpticStudio contains several features that significantly improve the optimization of NSC systems.

As mentioned previously, NSC solution space tends be discontinuous due to the pixelated nature of detectors. If the energy in a given ray is assigned to only one pixel, there is no quantitative difference when a system change causes the ray to shift anywhere within that pixel. As a result, optimization is difficult, with discontinuous derivatives in the merit function occurring when a ray crosses the boundary into a new pixel.

This can be illustrated by scanning a single ray across a detector. The universal plot below shows how the irradiance centroid on the detector changes with ray location.

One way to avoid quantization effects due to pixelated detectors is to use pixel interpolation. Instead of 100% of a ray’s energy being assigned to the single pixel struck, a fraction of the energy is apportioned to adjacent pixels based upon the location of the ray intercept inside the pixel. As a result, there is a noticeable change in the merit function as a system change causes a ray to move across a pixel. Pixel interpolation can be enabled in the detector’s Object Properties...Type.

If we scan a ray across a detector with pixel interpolation enabled, the change in irradiance centroid, and most other criteria, is continuous, and DLS can be easily used.

The irradiance centroid reported in the merit function is computed using the NSDD optimization operand. NSDD stands for Non-Sequential incoherent intensity data, and is the most useful operand for reporting incoherent detector data. NSDC is the equivalent for coherent calculations. The syntax for the NSDD operand is as follows:

NSDD  Surf  Det#  Pix#  Data  #Ignored

• Surf defines the Non-Sequential group surface (1 in a pure NSC system)

• Det# defines the desired detector from which to report data (it can also be used to clear one or all detectors)

• Pix# defines the specific pixel or computed value to return, Data defines whether to return flux, irradiance or intensity data

• #Ignored defines the number of edge pixels to be ignored.

These arguments allow optimization of a number of criteria: minimum spot size (min RMS spatial width), maximum energy (total flux), spatial uniformity (standard deviation of all pixels), collimation (minimum RMS angular width), and more. For a detailed description of NSDD capabilities, see the OpticStudio Help File section: The Optimize Tab (Sequential UI Mode)>Automatic Optimization Group>Merit Function Editor (automatic optimization group)>Optimization Operands by Category>Non-Sequential Ray Tracing and Detector Operands.

System Setup

Light-emitting diodes (LEDs) are important light sources in a wide range of applications. In areas like automotive illumination and display lighting, it is often required to improve on the brightness of an LED by adding auxiliary optics to modify the luminous intensity of such a source.

We will start with the measured data from a real LED source. See this article for more details on how the LED is modeled. For now, all we need to know is that a Source Radial is used to input the measured power as a function of angle. The source was measured to have a total output power of 27 Lumens, and is reasonably monochromatic with a peak wavelength of 627 nm. See the article "How to create a simple non-sequential system" if you are not familiar with how to enter this data. The source uses Sobol sampling for best signal/noise with fewest rays.

Under System Explorer...Units we set the system units as follows:

The luminous flux of the LED is measured in units of Lumens so we choose that unit for this simulation. Illuminance is therefore measured in terms of lm/m2, or Lux. Luminous intensity ("brightness") is measured in lumens/steradian or Candela (Cd). Luminance is measured in lm/m2/sr, or Cd/m2, which is sometimes referred to as a nit. The starting system is set up as follows:

The LED source fires rays onto a flat mirror which then illuminates a detector surface. The detector sees the following spatial and angular distributions:

It can be seen that the mirror is slightly overfilled by the LED, and so the spatial and angular distributions are slightly asymmetric. This is done deliberately, just to add a little more complexity to the design.

Looking at the luminous intensity plot, the peak brightness of about 41 Cd occurs at polar angles of around 27 degrees. Rays which are approximately normal to the detector surface have a luminous intensity of only 23 Cd (how this number is obtained will be explained shortly). Such a profile is not good for a headlamp illumination system, or projector illumination system. It is generally desired to have as high brightness for low-angle rays as possible, so the source can be projected over a distance.

We will now optimize the shape of the mirror to give the highest brightness on axis. To do this, we must perform the following steps:

1. Define a merit function that describes what we want to achieve

2. Define how the mirror surface can change

3. Run an optimization

The merit function

A merit function defines the 'quality' of an optical design, in terms of how well the design meets its specified operating characteristics. In this case, we want to get the highest brightness (luminous intensity) at zero degrees angle. This is easily achieved with the NSDD and NSTR operands. In this design, the detector is Object 3, and we want to obtain the luminous intensity at zero degrees. The detector viewer is shown below.

This shows the angular range of the rays that are incident on the detector from the range -90° to +90° in both x and y. No rays land with angles beyond about 35 degrees because the LED does not emit beyond this angle. Peak intensity occurs at around 27 degrees. We are interested in the power landing at angles close to zero. There are two criteria that will target such a distribution: RMS angular width and luminous intensity centroid. The RMS width targets rays to be collimated (i.e. the same angle of incidence), and the centroid targets this angle of incidence to be zero. The following Merit Function retrieves the luminous intensity seen at this angle.

The first NSDD operand reads out detector Object 0, which does not exist; no Object 0 can exist. This is a special usage of the operand: OpticStudio instead clears all detectors. Alternately, detectors may be cleared on an individual basis by defining a negative number (i.e. Det# = -3 clears only detector 3). This is useful in a system with multiple detectors defined.

Next, the NSTR operand tells OpticStudio to trace rays. The second and third NSDD operands read out detector Object 3, centroid x & y (Pix# = -6, -7), data item 2, which is power/unit solid angle. Note that we are targeting the luminous intensity (angular) centroid, not the illuminance (spatial) centroid. The fourth NSDD operand reads out RMS angular width of all pixel data. In addition, the last NSDD operand reports the central pixel (5101) intensity for comparison purposes; note that no weighting is assigned so that it doesn’t contribute to the merit function. This value is approximately 23 Cd.

The last NSDD operand is combined with an OPGT operand to maintain a minimum amount of flux on the detector. We set this to 25 because this is the initial flux on the detector. If this operand didn’t exist, it would be possible to achieve a merit function of zero by removing the mirror altogether! If no energy falls on the detector, the intensity centroid and RMS radius are zero and these are our targets. This “solution” highlights the importance of a well-defined merit function. During optimization, OpticStudio will attempt to drive the merit function to zero, regardless of what this physically means in the system.

The freeform mirror

Free-form surfaces are usually described as multiple low-order polynomials such as splines or Bezier curves. They are often used to describe forms such as turbine blades, car bodies and boat hulls.

In optical system design, however it is often helpful to retain the concept of an underlying conicoid section, and to have free-form deviations from that section. The reason for this will be demonstrated soon. For this reason, we will use the Extended Polynomial Surface object. This surface is described by an equation of the form:

The first term is the standard conic asphere beloved of optical design, and is used for designing spherical, elliptical, parabolic, hyperboloid, etc. mirrors. The second term represents a series of increasingly high-order polynomial deformations from this surface. The polynomials are a power series in x and y. The first term is x, then y, then x*x, x*y, y*y, etc. There are 2 terms of order 1, 3 terms of order 2, 4 terms of order 3, etc. The maximum order is 20, which makes a maximum of 230 polynomial aspheric coefficients. The position values x and y are divided by a normalization radius so the polynomial coefficients are dimensionless. In this design the maximum order of the polynomial is limited to 20 terms, so the highest freeform deviation goes as x0yand x5y0. This is neither necessary nor a recommendation, it was just a choice made during the design process.

Now if we use the Universal Plot, we can show the central pixel intensity as we scan the radius of curvature of the mirror.

This graph illustrates both the difficulty in optimizing NSC systems and the need for a well-defined merit function. If we look at the overall merit function value versus base radius, we can see why centroid and spot radius are better optimization targets.

Now that our merit function properly defines our design criteria, we will compare the results of optimization with DLS and OD using both local and global optimization algorithms.

Optimization

OpticStudio contains two “global" optimization routines used to search a larger region of solution space. The Global Search algorithm uses a mixture of generic optimization, random starting points and local optimization and is good at efficiently searching multi-dimensional parameter spaces for regions of low merit function. The Hammer optimizer also uses generic and local optimizers to exhaustively refine a design once Global Search has found a promising region of parameter space.

The starting value of the Merit Function is 14.8, and the brightness at zero degrees is 23 Cd.

We will first optimize with DLS using the local search routine (Optimize…Optimize!) and compare this with optimization using OD. A final Hammer optimization will be performed in both cases.

Now that our merit function and starting system are defined, the only step left is to allocate variables. We have 22 variables at our disposal: radius, conic, and 20 polynomial coefficients. Assign these parameters variable status and start the local optimizer using the DLS algorithm with an automatic number of cycles.

After a short while, OpticStudio comes to a solution. The Merit Function has fallen to approximately 6.69, with a central pixel brightness of 238 Cd. This optimization illustrates how using pixel interpolation and a well-defined Merit Function allow even the DLS algorithm to work efficiently in Non-Sequential solution space.

We save the resulting file with a new name for comparison, and reopen the starting point file. This time, allocate all 22 variables and instead optimize using the OD algorithm. Based upon our previous discussion comparing the two local optimization algorithms, we might expect this optimization to proceed faster and arrive at a better solution. In this case this optimization takes slightly longer than the DLS run (~6.5 minutes) but achieves a lower merit function value (6.68).

To test that we have arrived at a reasonably optimal solution rather than being stuck in a high local minimum, we will run the Hammer optimizer for both systems. The results organized in the table below show some improvement for the DLS optimization, but the central pixel brightness is still lower than the one achieved with the OD optimization; further illustration of the power of the two local optimization routines. The machine used in these tests had an Intel Quad Core CPU (2.90 GHz) and 16GB of RAM:

 Algorithm MF Value On-axis brightness (Cd) Time for optimization DLS 6.69 238 4.4 min Hammer (DLS) 6.68 24 30 min OD 6.68 254 6.5 min Hammer (OD) 6.68 254 30 min

The starting irradiance and radiant intensity distributions are shown below, along with the optimized systems using DLS and OD algorithms.

#### OD Optimization:

Comparing results, it appears that both optimization methods arrived at similar solutions. Note, however, that although the optimization with OD was slightly longer than the DLS one, the achieved performance is better than the one obtained with a DLS optimization and 30 minutes of Hammer optimization. In fact, it took just several minutes to optimize a system with 22 variables and several different illumination targets! We have gone from a flat mirror to a fully optimized solution in less time than it would take us to tolerance and generate drawings of the system. A sequential system being optimized for spot radius with the same number of variables would require an equivalent amount of time. This example clearly illustrates the efficiency of the OD algorithm when optimizing Non-Sequential systems.

Remember that we never targeted the central pixel brightness directly, but rather it is a by-product of optimizing for RMS radius and centroid location. We could always put a finite weighting on this criterion, however the RMS radius would most likely increase as a result. You will find that if you target central pixel intensity instead of second moment of illumination, system performance is significantly worse.