Optimizing Lens Modules

The Lens Module family of surfaces (Infinite conjugate, finite conjugate, afocal and spherical) provide a convenient mechanism for quickly defining an ideal lens element.  

However, if the circumstance arises where a lens module surface is desired to be included in an optimization, the user will find that there is no direct access to the parameters via the default variables.

The user-scripted variable can be used in this case to access any of the parameters of the lens module (and can be used more generally to access any parameter of any geometry that doesn't have a default variable).

This article provides an example FRED file which demonstrates two user-scripted optimization variables that access the focal length and magnification parameters of a finite conjugate lens module. In this case, the optimization is setup to adjust the focal length and magnification of the lens module such that the diverging source is focused onto a static detector.

Example

Download the FRED file: lensModuleOptimization.frd

The lens module before optimization traces like so:

The scripted variables can be reviewed from the variables tab, right click on the first row and select the option to "Edit User-defined Script Variable"

The scripted variable itself is quite short in terms of definition, only needing to use the Get/Set commands to read from and write to the lens module and make this available to the g_var which represents the variable available to the optimizer.

The above example is for setting "fl" or the focal length parameter of the lens module. The other user-defined scripted variable is the same apart from equating g_var with the "mag" or magnification parameter instead.

The merit function aberration tab of the optimization definition seeks to use those variables to minimize the RMS spot size and maximize the total power on a static detector.

Following optimization the expected result is reached:

Summary

The user-scripted variable can be used to access any parameter of any part of the model that doesn't have a default variable and make that parameter available to the optimizer to improve the system performance.

Still need help? Contact Us Contact Us