Skip to main content

I would like to update LDE parameters inside a tolerance script.

For example, I want to perform the tolerancing and compensator optimization under the simulated alignment conditions, and then change the object distance and curvature to the use case and then recompute the merit function. 

I don’t see any tolerance script commands that allow updates to the lens prescription.

Any advice is greatly appreciated!

-John

@John.Hygelund 

 

I’m not sure if this is possible right away in the tolerance script. Have you tried using a ZPL macro or a ZOS-API script? In ZPL, you have the keyword TOLERANCE that will perform a tolerancing based on a TOP (settings) file and save the result in a text file.

When you do your tolerancing in the user interface of OpticStudio, there’s a button Save at the bottom left of the tolerancing window. This will generate the TOP file to use with TOLERANCE. The TOP file should be saved in the correct folder (<data>\Configs), which should be the default when you press the Save button.

Then you can use ZPL to make modifications to the LDE between two TOLERANCE. In pseudo-code you could do:

surface_to_change = 2
new_thickness_value = 1.23

# Tolerancing before changes
TOLERANCE settings.TOP, results_before.txt

# Changes to LDE
SURP surface_to_change, THIC, new_thickness_value

# Tolerancing after changes
TOLERANCE settings.TOP, results_after.txt

I hope this makes sense.

Take care,


David


Hi @David.Nguyen ,

Thank you for the thoughts and the quick reply.

Here is what I ended up doing.

I did a standard tolerance analysis with the alignment configuration and produced a set of Monte Carlo files.

Using the API, I opened each MC file and changed the LDE to represent the use conditions and recomputed the merit function.

This got me what I need for now, but I think your approach of using the ‘TOLERANCE” function in the API/ZPL would be needed to if I wanted the sensitivities in the use condition.

 Here is a plot showing the yields for each field. The yellow lines come from the red results after changing the object conditions.

Thanks again for your help.

-John

 


You could define the thickness to be a compensator in the tolerance script, then load a merit function with CTVA operand set to your desired thickness and optimize. Load the initial merit function again at the end of the tolerance script.


You could define the thickness to be a compensator in the tolerance script, then load a merit function with CTVA operand set to your desired thickness and optimize. Load the initial merit function again at the end of the tolerance script.

Hi @Sean Turner ,

Thanks for the idea. I considered that but I also needed to change the material and assumed the material can’t be set as a compensator...


Oh I don’t see a way to change material within the tolerance script. I’m glad the API route seems to work though! 


Reply