top of page
Writer's pictureMatt Johantgen

Lens Design Process with Zemax: Selection of a Starting Point

Updated: Oct 3, 2023

Part II:

In our last post Selection of a Starting Point Part I we walked through how the optical engineer selects a lens type using the field angle and F/#, then finds an existing starting point lens design from a known library of designs. We continue now by getting deeper into the "Zemax" part of the "Lens Design Process with Zemax". We start from the same Zemax file from the last post (US08416512-1.zar).

Zemax OpticStudio: System Explorer Update Settings

Before we start to adjust the lens to meet our desired specifications there are a few steps that should be done first to prepare the lens for modification. First, we want to change the automatic update properties from “All Windows” to “Editors Only” since we won’t be evaluating the performance until we have the file set up properly.



Zemax OpticStudio: Multi-Configuration Editor

Next, we want to remove all configurations except the longest object distance (since our lens does not require macro). To do this, we open the multi-configuration editor, right click on the configuration we want to delete and click “delete configuration”.



We want to now change the ray aiming from “Real” to “Paraxial” (System Explorer -> Ray Aiming). Also, be sure to uncheck “Robust Ray Aiming”. This will allow for faster optimization of the lens.


We also want to remove all aspheres and conics. To do this, we look down the “Conic” column in the lens data editor (LDE) and make sure all conics are 0. Then we change all surface types to “Standard”. We want to manufacture this lens with only spherical surfaces.


Now we change the wavelengths to 0.450um, 0.540um and 0.650um to work best with color cameras.


Lastly, we want to change the glass types to use our preferred glass catalog. To do this we make all the materials in the lens variable, then remove the current catalogs and add our desired catalog(s), in this case CDGM-202206.


Zemax OpticStudio: Material Catalog and Lens Data Editor
Zemax OpticStudio: Material Catalog and Lens Data Editor
Zemax OpticStudio: Glass Substitution Template

Once we have our preferred glass catalog we can change all the materials back to non-variables, but first we want to narrow the allowed glass types to non-special and reasonably priced materials.


To do this we can open the glass substitution template under the “Optimize” tab. Check the Standard and Preferred glass types only and change the Maximum Relative Cost to 14 so that during optimization only glasses up to 14x the cost of H-K9L (N-BK7 for Schott) will be used.


The materials in the LDE can now be made non-variables which will cause Zemax to select the closest material to the variables specified for each glass while keeping the relative cost of each under 14.


Now that the lens is ready for modification, the first thing to do is to scale the lens to the proper focal length. We know that the design focal length should be 5.6mm, but when we take distortion into account, the focal length only has to be 7mm with 20% distortion. Now we can use the Scale Lens tool in Zemax to scale the lens by the ratio of focal lengths (7/24.67 = 0.284).


Zemax OpticStudio: Scale Lens Tool
Zemax OpticStudio: Scale Lens Tool

Now that the lens is the right focal length, we can adjust the aperture and field angle to match our desired specifications (F/4 and 55°, respectively).


Zemax OpticStudio: Aperture Settings

To change the aperture we will select the aperture dropdown on the System Explorer and change the aperture type to “Image Space F/#”, then type in 4 into the “Aperture Value” textbox to make the lens work at F/4.


We also want to add a 0.75mm clear semi-diameter margin to each lens element to allow space for mounting in the lens barrel. This gives space between the widest ray and the edge of each lens element.



To change the fields we first open the Field Data Editor (double click on Fields under the System Explorer). The original field type is “Real Image Height”. We select the Type dropdown and change it to “Angle”. Now we input 55 into the maximum field box, change the number of fields to 4 and click the “Equal-Area Fields” button to generate 4 fields out to a 55° half-angle.

Zemax OpticStudio: Field Data Editor
Zemax OpticStudio: Field Data Editor

Now a simple merit function can be written to help clean up some of the mess left over from the change in design specifications. We open the Merit Function Editor, click on the Wizard icon and fill in the information in the image below:

Zemax OpticStudio: Optimization Wizard
Zemax OpticStudio: Optimization Wizard

Click OK to generate a default merit function. We must now add a few operands to control the remaining specifications we want to target. (Note: we must also delete the MXCA operand in the default merit function on surface 0 since it is trying to control the infinite object distance to be less than 50).

Zemax OpticStudio: Merit Function Editor
Zemax OpticStudio: Merit Function Editor

Of note are REAY, DIMX and MNCA. REAY 0 1 0 0 on surface 23 targets the real ray height of the chief ray at the image. This will be our image height, so we set the target at 8mm (half the image sensor diagonal). DIMX is the maximum allowable F-tan-theta distortion so we set the target to 20%. The MNCA on surface 22 is the minimum air thickness on surface 22 which is the last lens before the image. We want the distance to be at least 5mm.


Now it is time to start the optimization. We change the thickness on surface “0” to infinity and make all thicknesses and radii variables. Click Optimize under the Optimize tab to start a local optimization.


We stop the optimization after a couple minutes. We can now evaluate the design to see if it has met the specifications. It looks like the design meets the image height spec of 8mm, the telecentricity spec of 15° and the distortion spec of <20%. If we look at the MTF (Modulation Transfer Function) it is nowhere near good enough. If you are unfamiliar with MTF, just think of it as a Contrast vs. Resolution chart, where contrast is the MTF (y-axis) and resolution is the Spatial Frequency (x-axis) and increases from left to right. We will be writing a post on MTF in the coming weeks if you are interested in more details.


Below is the resulting MTF after a short local optimization:

Modulation Transfer Function: Local Optimization
Modulation Transfer Function: Local Optimization

The local optimizer only finds local minima for solutions to the Merit Function. If we want to search for new global minima the local optimizer will not be effective since it will never "climb uphill" to find a better solution. The Hammer optimizer uses large perturbations to the system to allow it to escape these local minima and find lower minima in the solution space.


If we use the Hammer optimizer we can see the improvement below in only a couple of minutes:

Modulation Transfer Function: Hammer Optimization
Modulation Transfer Function: Hammer Optimization

This is a huge improvement! But the design is still not there. In the lens specifications, the customer requested MTF >20% at 145 cyc/mm. As can be seen in the chart, the design doesn’t meet this spec at the corner of the image sensor (yellow curves on the MTF plot).


In our next post we will show how this design can be further optimized to achieve the desired performance. We have provided a Zemax file (7mmF4_110deg_11ELT_01.zar) with the MTF achieved in this post below for your convenience. We do hope you tried it yourself though!

3D View of 7mm F/4 Wide Angle Lens
3D View of 7mm F/4 Wide Angle Lens

Lens Design Process with Zemax: Selection of a Starting Point Survey:

Were you able to improve the MTF?

  • 0%Yes, I made it through the optimization.

  • 0%No, I made it to the optimization but had worse MTF.

  • 0%No, I wasn't able to get to the optimization part.

  • 0%I don't have Zemax.

Thank you for your vote!

1,672 views0 comments

Comments


bottom of page