How to Perform Freeform Optical Design


This article describes how to undertake 'freeform' optical design using the Freeform-z object. This can be used for a complete design, or to generate starting points for subsequent work. An LED collimator lightpipe is used as an example 

Authored By: Mark Nicholson

Introduction

Usually in Zemax we work with parametric models of surfaces and objects, so that (for example) a radius of curvature defines the surface of a lens at any point on its surface. This is both compact and easy to optimize.

A 'freeform' surface by distinction is often defined by points on the surface. A curve-fitting routine fits these points to some function, and then the function is used to define the surface height at all points on the surface. So rather than define the coefficients of a function that yield a surface, we define the points on a surface that yield the coefficients of the polynomial.

The functions used to fit the input data are usually chosen to be smooth functions, such as cubic splines, Bezier curves, or NURBS. The Freeform-Z non-sequential object is formed by drawing a cubic spline curve through a series of points in the YZ plane, and then sweeping this curve around the Z axis to form either a solid volume or shell. Cubic splines are formed by a piece-wise concatenation of curved segments. Within the bounds of each segment, the curve is defined by a third order polynomial. The polynomial coefficients describing each segment are determined from the sag values of the defined segment boundaries. The determination of the coefficients is driven by the boundary requirements that the curve goes through the defined points, and both the first and second derivatives be continuous across segment boundaries.

For a third order spline, it is not possible to require higher order derivatives to be continuous across segment boundaries. For this reason, splines are of limited accuracy and usefulness in high precision (imaging) optical design. Note that fundamental optical properties, such as surface power, are determined  by second order derivatives, and basic aberrations such as coma and spherical are controlled by third and fourth order derivatives.

This is, of course, why high order polynomials are commonly used for aberration correction in imaging system design.

However spline shapes can be very useful in non-imaging work, as 'optical power' can be added wherever needed. In the following pages we will design a collimator optic for an Osram LED. The Freeform-z object is used, along with its associated FREZ optimization operand. The two should be used together, as the FREZ operand allows the freeform object to be controlled during optimization at any point on its surface, and not just at the points where the defining data exists.



The Starting Design

The file 'starting point.zmx' (which is provided as a ZAR file at the end of this article) shows an OSRAM LB_T67_C LED emitting light into a simple 4 mm wide, 40 mm long lightpipe produced by the Freeform-Z object:





Our goal is to produce a collimated beam from this LED. The LED is modeled using a CAD object and source datafile provided by Osram. We use the 100k ray source file in this case. As the CAD object used does not affect the ray-tracing and is for display only, it is omitted from the other examples to reduce download size.

The lightpipe is modeled by a Freeform-z object. This object is defined by a number of points, which can be between 5 and 124. We recommend that you always use the minimum number of points needed, and add further points as the design progresses, if necessary. This is discussed later in the article.

Note that the detector object uses pickup solves on its z-location and x, y aperture size, and that these lock the detector relative to the end of the Freeform-z object. This is one of the key benefits of the NSC editor, in that relationships between multiple objects can be easily defined.

The merit function for this design is simple, and consists of three major sections. The first section simply clears the detector and traces rays. Then the second section computes the desired optical performance of the system. This consists of two goals: the first is that the RMS angular radius be as small as possible (best collimation) and the second is that the total power on the detector be as high as possible. We are therefore balancing best collimation with maximum efficiency.

The third section uses the FREZ operand to constrain the lightpipe shape. With most parametric objects, it is adequate to control the optimization by defining limits on the parameters using NPGT and NPLT (non-sequential parameter greater than, less than) operands. However, because freeform surfaces are formed by fits to the defined data points, it is possible for the fitted surface to deviate strongly at points away from the control points. The FREZ operand allows control of the shape of the object at all points on the surafce, not just the specified control points, and this provides stable optimization without multiple turning points ("ringing") between the defining data.

The Freeform-z object allows up to 124 (y, z) data points along its length, and there is no requirement for these to be equi-spaced. This means that the control points can be optimized in z as well as y, so the control points can move to where they do most good. In order to provide smooth optimization, FREZ can be used to control:

  • maximum and minimum y-values
  • maximum z-values (the minimum z-value is always zero by definition)
  • maximum and minimum y and z increments
  • maximum and minimum slope
  • monotonic deviation
  • object volume

In this example, we use the FREZ operand to constrain the overall length of the pipe, and to prevent it becoming too thick or too thin.

The starting design has the following optical performance:

- peak brightness = .48 lm/sr
- RMS angular radius = 49 degrees
- total received power = .99 lm.



DLS Optimization
We will now optimize this design using the Damped Least Squares (DLS) optimizer:



Note that each evaluation of the merit function traces 100,000 rays. On the author's dual-quad-core machine, this optimization completes in 20 minutes and yields this design (available as freeform_after_dls at the end of this article):



This design yields a total power of .89 lm, and a peak brightness of 4.2 lm/sr, which is almost 10 times brighter than the starting point. The RMS angular radius is now about 16° (was 49°). At its narrowest point the pipe has a radial height of 1.6 mm. Of the five inital equi-spaced datapoints, three are now in the first bump, and so the data points have moved down to 'shape' the light as it is emitted from the LED.

If we now use the Hammer optimizer on this design, we will get this result  (freeform_after_dls_hammer):



Remember that the Hammer optimizer does not self-terminate, and it will carry on forever until the user stops it. In this case the Hammer was run unattended for a few hours. Note that the Freeform object has optimized into a shape very similar to a Compound Parabolic Concentrator (CPC) object. Zemax supports a rotationally symmetric CPC object and a Rectangular CPC object. It is left as an exercise for the reader to see if native CPC objects yield better or worse performance than the freeform object in this case.

This is a nice example that sometimes the 'non-parametric' Freeform will tend to an underlying parametric shape if that is a good fit to the problem in hand. Generally speaking, parametric objects will optimize faster than the Freeform object because they require fewer defining parameters.

The hammered design yields a total power of .87 lm, and a peak intensity of 27 lm/sr (>50 times brighter than the starting design!), and has an angular RMS radius of 6°.

OD Optimization
We now return to the starting design, and repeat the optimization using the Orthogonal Descent (OD) optimizer:



This design is very different to the other two:



It can be seen that by using a narrow neck at the start of the freeform shape, high-angle light is lost, but the remaining energy is well collimated. Only 0.61 lm of power is transmistted, but the peak beam brightness is almost 10 lm/sr, and the RMS angular cone is 8°. The file is available as freeform_after_OD at the end of this article.

Running the Hammer optimizer with the Orthogonal Descent optimizer used as the local optimizer yields a radically different design:



Note that this design does not use total internal relection at all, and is purely refractive. This implies that a two-lens solution exists and is worth investigating! The design yields a total transmission of 0.99 lm, a peak brightness of 78 lm/sr (>150 times the original brightness) and an RMS angular radius of 4°.

This demonstrates another of the key benefits of the freeform object. A CPC object when optimized can only yield the best-form CPC object, obviously. The Freeform object can take whatever shape yields the lowest merit function. This may be useable directly itself, or it may point to other objects to be used. In this case, it is worth investigating what a two-lens design could offer instead of a lightpipe.

Adding More Data Points
It is worth paying attention to some of the details in this last design. Note that the rays only interact with the surface at a few points, and where the rays do not hit the surface, the surface is some distance away from the rays:



Generally speaking, under optimization the 'unused' parts of the surface tend to become larger than is necessary, because no constraint exists to pull the surface in. Using the FREZ operand to minimize the object volume is a good idea to prevent designing freeform objects that are larger than they need to be.

Note also that this object looks like it has too few data points near the 'neck' between the two major sub-volumes:



The design uses only 5 data points, and initially they are at z = 0, 10, 20, 30 and 40.  After this optimization, they are at z = 0, 21.2, 23.5, 23.9, and 49.5. The design clearly needs more datapoints to give a smoother surface near the neck.

Now you can simply add more datapoints by increasing the 'number of points' parameter. This will add extra points in the editor, and you will have to transfer data around by hand, as the data must be entered in order of increasing z. A better option is to look on the Non-Sequential Components Editor's Tools menu:



(Note the Insert/Delete Freeform z menu items are only available if you click on a Freeform-z object in the editor first.) You then get a dialog box in which you can enter the z-coordinate of the desired new data point:



Zemax will then add a new datapoint at the correct location in the editor, and set the y-coordinate of this datapoint to lie on the existing curve. This does not perturb the design at all, and all you then need to do is to set variables and re-optimize.

Note also that you can create more complex objects by adding other objects (including other Freeform-z objects) to the end faces of the Freeform-z. Here is a rather odd-looking object formed by two Standard lens objects and a Freeform-z object:



This file is Freefrom pipe with curved edges.zmx Note how the objects are referenced to each other and how pickups maintain the relative positions and edge thicknesses of the three objects so that a single assembly results. Note also that if you move object 1, the whole asssembly will move with it.






Summary
This article has given an overview of how to design with the Freeform-z object. This object is rotationally symmetric around z, and allows a smooth curve to be fit to user-supplied (z, y) data pairs. The FREZ operand should be used to control it under optimization, and it can be linked via pickups to any other object.





© All Rights Reserved.