This article explains how to calculate the sag of a diffractive optical element using a ZPL macro in OpticStudio.

**Authored By Serhat Hasan Aslan, ASELSAN**

## Downloads

## Introduction

The macro attached to this article calculates the sag and phase data of a rotationally symmetric kinoform (Binary 2 surface) lens surface. User inputs include the surface number and radial step size. Outputs include the zone number, zone radius, inner radius sag, outer radius sag, and step height for the diffractive optic. Profile frequency (in waves/mm) (which can be used as a manufacturing difficulty merit) is also calculated.

## Equations and definitions

The general form of the sag of a surface is calculated as follows^{1}:

where:

C = 1/R, R: Radius

*K * = conic constant

*ρ *= radial coordinate

*A*_{2,4,6,8…} = aspheric coefficients

*λ * = wavelength

*N* = refraction index of lens

*C*_{2,4,6,8…} = phase coefficients

Step height is given as:

Phase profile of a diffractive surface in radians is given as:

OpticStudio uses the normalized form of phase coefficients. The conversion of normalized form is given below, with *R* representing the normalized radius:

The typical diffractive profile is as follows:

## Inputs

To run the macro, download it and place it in your {Zemax}\Macros folder.

Open the system you want to analyze in OpticStudio and navigate to **The Programming Tab…Macro List…DoeSag.zpl**.

Once activated, the macro takes the surface number and radius iteration step size for sag calculations from the user, as shown below:

## Outputs

The macro outputs zone number, zone radius, inner radius sag, outer radius sag, step height, and profile frequency (waves/mm) as shown below:

This is followed by the calculated data for each radius incremented by the step size, as shown below:

The macro plots the phase, integer part of phase, and phase modulo 1 wave as shown below:

Finally, profile frequency in waves/mm is plotted and frequencies corresponding to zone radius are crossed as shown below:

## References

1. RIEDL, Max J., “Diamond-turned diffractive optical elements for the infrared: suggestions for specification standardization and manufacturing remarks”, SPIE Vol 2540 / 257

KA-01501

## Comments

Please sign in to leave a comment.