Skip to main content
Question

Control of back reflections during design process

  • December 9, 2024
  • 5 replies
  • 167 views

bdoc
  • Monochrome
  • 1 reply

Hello,

I have some questions about back reflections analysis. To check a lens design for potentially dangerous back reflections I use the ghost analysis tool. However, after changing the lens design, I have to do this again and again. Is there a quicker way to check for back reflections during the design process, for example by using NSC?

The only way I found so far, is to use “split NSC rays” in the 3D layout. However, I still cannot control the distance of the back reflection to the lens surfaces.

Is it possible to define a minimum distance of the back reflection to each lens surface by using an operator? I’m only interested in single bounce reflections, double bounce can be neglected.

 

Thanks in advance!

 

Best Regards,

Ben

 

 

5 replies

  • Infrared
  • 10 replies
  • April 9, 2025

Hi,

I have a similar problem. I would like to optimize the system by avoiding back focusing on the previous lenses (focusing due to single-bounce reflections). Unfortunately, the operands available in the merit function allow controlling the focusing from double reflections, not from single reflections. Doing the study in non-sequential mode is not a solution, because it is necessary to control the reflections during the sequential optimization. Any suggestions?

Thanks!


Jeff.Wilde
Luminary
Forum|alt.badge.img+3
  • Luminary
  • 498 replies
  • April 17, 2025

I faced this issue previously and ended up writing my own User Defined Operand.  It wasn’t particularly difficult.  I started with the example file CppUserOperandApplication.cpp located in the following directory:

\Documents\Zemax\ZOS-API Projects\CppUserOperandApplication\

Then I added the following code at the designated location to create a copy of the system and make it double pass at any surface from which I wanted to consider a reflection:

// Add your custom code here...

// Read the operand arguments (Note: we aren't using arguments 2-4)
int surf = (int)TheApplication->OperandArgument1;

// create system copy for ghost analysis
IOpticalSystemPtr TheSystemCopy = TheSystem->CopySystem();

// reflect system at surf
TheSystemCopy->LDE->RunTool_MakeDoublePass(surf);

// get single-bounce ghost results
// PARY -- paraxial ray y-height 
int last_surf = (int)TheSystemCopy->LDE->NumberOfSurfaces - 1;
double ym = TheSystemCopy->MFE->GetOperandValue(MeritOperandType_PARY, last_surf, 1, 0, 0, 0, 1, 0, 0);
operandResults[0] = ym;

After making the double-pass system, you can call whatever standard merit function operands you like to evaluate ray properties or system quantities of interest.

I compiled the code using Microsoft Visual Studio.  The Ansys version of Zemax requires 64-bit.  This KB article was helpful: How to create a User Operand using ZOS-API

Regards,

Jeff


  • Infrared
  • 11 replies
  • April 18, 2025

Hi Jeff,

Thanks for the sharing by using  UDOC operand. Have you tried with ZPLM operand and compared it with UDOC?  because I found in many testing cases, ZPLM is more stable and with better compatibility. Maybe 

also has a running speed superiority than UDOC?

 

Best regards,

Deyang 


Jeff.Wilde
Luminary
Forum|alt.badge.img+3
  • Luminary
  • 498 replies
  • April 18, 2025

Hi ​@yu.deyang,

I don’t think the ZPL provides a way to generate a double-pass system for ghost reflection analysis, but please let me know if you think there is some way to do this.  

When using my UDOC I had no problems with stability.  Typically, compiled code executes very fast, so a well-written UDOC should run efficiently.  I didn’t have any issues with speed, so I didn’t bother to benchmark the execution time.

I agree, though, that for simple user operands the ZPLM approach is easier to implement.

Regards,

Jeff


  • Infrared
  • 11 replies
  • April 18, 2025

Hi Jeff,

Thanks for the clarification.  My concern on stability and compatibility  issue when using UDOC comes from that  I saw many users in this forum who had updated or changed OpticStudio to more newer version or back, then their API code doesn’t work any more. There are many possible reasons could cause such compatibility issue. Compared to ZPL,  there is seems no big compatibility issue for ZPL.

That give me an impression that ZPL is more robust  and with no worries on compatability although it has weak data processing capability than API.

It seems make double pass function isn’t implemented in ZPL. The UDOC and API is the most elegant  way I think for this case. Again, I appreciate the clarification. Thanks Jeff.

 

Best regards,

Deyang

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings