Monday, July 29, 2013

Two small tricks exporting CAD model from Zemax

I have a sequential Zemax model with multiple prisms and coordinate breaks. When exporting CAD model for mechanical engineering use, the exporting process could not go correctly. After a couple of days of trying, the exporting was finally successful. The tricks I got are below:

1. Setting the tolerance level higher is the key for small prisms.
I found out that if the prism's size is smaller than 10 mm, this tolerance value needs be reduced.

2. If Zemax still fails to export correctly, try adjusting the thickness to a slightly smaller value. Sometimes the prism's front surface cannot reach the back surface because of a rounded thickness value and this will cause error when Zemax tries to combine the two surfaces to form a solid.
Above is an example of a 30o apex angle prism, I had to reduce the thickness from 1.73205 to 1.732 for a proper export.

Sunday, June 23, 2013

Gaussian to Flat-top

Zemax Knowledge Base gives a design method to convert Gaussian irradiance profile to flat top profile (see reference [1]).
This post (A) gives another analytic form and (B) examines the 1-D situation.

A.
If the input Gaussian profile has the 1/e2 radius of W, the output flat-top has the half-width of K, then the Zemax KB article gives:
        S = K [1-exp(-2X2/W2)]1/2                                              (1)
This is a ray mapping formula to get the output coordinate value S for every input coordinate X.

For Zemax, this formula can be written in another form. Let REP be the radius of the entrance pupil, then

X

W

 =  X/REP

W/REP
 = XNA1/2
(2)
where XN is the normalized coordinate and A is the system apodization factor. Eq(1) can therefore be written as
        S = K [1-exp(-2XN2A)]1/2                                              (3)
This formula is better suited for Zemax because both XN and A are the Zemax direct parameters. Using this formula, the macro file for generating merit function can be simplified.

B. How about 1-D?
Very often people need a 1-D flat-top, e.g., flat-top on X-axis and Gaussian on Y-axis. In this case, the irradiance integration is different.

For input Gaussian profile, the contained power in a 1-D variable slit is:
    Pi(X) = Ii  X
-X
exp(-2x2/Wx2)dx  +∞
-∞
exp(-2y2/Wy2)dy
(4)
where Ii is the peak irradiance, Wx and Wy are the 1/e2 beam radii. For output profile, the contained power in the 1-D variable slit is:
    Po(S) = Io  S
-S
dξ  +∞
-∞
exp(-2η2/Wη2)dη        (when S<=Wξ)
(5)
    Po(S) = Io2Wξ  +∞
-∞
exp(-2η2/Wη2)dη        (when S>Wξ)
(5)
where Io is the peak irradiance, Wξ is the half-width of the flat-top and Wη is the 1/e2 half-width of the Gaussian profile.

First, let Pi(X=∞) = Po(S=∞), the conservation of total power gives:

Io

Ii

 =  π1/2WxWy

21/22WξWη

(6)
To get the ray-mapping relation, let Pi(X) = Po(S) and plug in Eq.(6):
        S = Wξ erf (21/2X/Wx) = Wξ erf (21/2XNA1/2).                                              (7)
where erf is error function. So for 2D and 1D flat-top generation, the ray-mapping formula is different.

To write a macro for generating merit function for 1-D flat-top, one can use
       GETSYSTEMDATA 1
       Apodization = VEC1(2)
to read the apodization factor.

To caculate erf function, Zemax does not have it built-in. One can use an approximation from wikipedia [2].

References:
[1] http://kb-en.radiantzemax.com/Knowledgebase/How-to-Design-a-Gaussian-to-Top-Hat-Beam-Shaper
[2] http://en.wikipedia.org/wiki/Error_function

Tuesday, January 22, 2013

Gaussian Beam Size

A.
For circular fundamental mode Gaussian beam, irradiance (intensity) profile is
     I(r) = exp(-2r2)                                              (1)
Here r is scaled by w (1/e2 radius), i.e., when r=1, the irradiance drops to 1/e2=13.5% of the peak value.

1. D86 diameter
Assuming we measure power with a variable aperture whose diameter is ρ, the contained power is an integration of the irradiance:
    P(ρ) = ∫ ρ
0
exp(-2r2)rdr  ∫
0
dθ =  π

2
 [1-exp(-2ρ2)]
(2)
The total power is when ρ=∞: Ptot = P(ρ=∞) = π/2. Then
    P(ρ)/Ptot = 1-exp(-2ρ2)                                                                              (3)
The D86 diameter is when 86.5% of the total power is contained. From the above equation, D86 diameter is equal to the 1/e2 diameter because P(ρ=1)/Ptot = 1-1/e2 = 0.865.

2. D63 diameter
I see nowhere uses D63 diameter except one: the IEC Laser Safety Standard. The D63 diameter is when 63.2% of the total power is contained in a variable aperture. From Eq.(3), P(ρ=1/2)/Ptot = 0.632. So D63 diameter is 1/2=0.707 times the D86 diameter. From Eq.(1), I(1/2)=1/e. So D63 diameter is the width at 1/e intensity points.

3. Knife edge width
Now we measure power with a traveling knife edge along the x-axis, the transmitted power is an integration of the irradiance:
    P(a) = ∫  a
-∞
exp(-2x2)dx  +∞
-∞
exp(-2y2)dy =  π

4
 [1+erf(2 a)]
(4)
where erf is error function. The total power Ptot=P(∞)=π/2. So
    P(a)/Ptot = 1/2 [1+erf(2 a)]                                                         (5)
From Eq.(5), P(-0.5)/Ptot = 0.159 and P(0.5)/Ptot = 0.841. This means that the knife edge traveling distance between the 15.9% and 84.1% power levels is equal to the 1/e2 radius.
Alternatively, if one measures 10% - 90% power levels, the distance is equal to 1.281*1/e2 radius.

4. Full width or half width at half maximum
Let I(r) = exp(-2r2) = 0.5, we get ln(0.5) = -2r2, or r = (ln2)/2 = 0.5887. So when 1/e2 radius is 1, the half width at half maximum is 0.5887.

5. D4 sigma (2nd moment) diameter
This is the ISO standard (ISO 11146-1). For the fundamental Gaussian, this definition and the traditional 1/e2 definition are identical. This definition heavily weights the tails or outer wings of the intensity profile; so for non-ideal beams having side-lobes, the 2nd moment diameter can be substantially larger than their central lobe diameter. I will not go through the math detail here.

B.
For asymmetric 1-D Gaussian beam (Gaussian form at x, arbitrary form at y), irradiance (intensity) profile is
     I(x,y) = exp(-2x2) I(y)                                              (6)
Here x is scaled by wx (1/e2 half-width). I use "width" to replace "diameter" (and "half-width" to replace "radius") for non-circular beam.

1. D86 width
Instead of a circular aperture, a variable 1-D rectangular aperture is used here. Assuming a is the half-width of the aperture, the transmitted power is
    P(a) = ∫  a
-a
exp(-2x2)dx  +∞
-∞
I(y)dy =  π/2  erf(2 a) +∞
-∞
I(y)dy
(7)
Divided by total power Ptot=P(∞),
   P(a)/Ptot = erf(2 a)                                                        (8)
Solve for erf(2 a)=0.865, we get a=0.747. So for 1-D Gaussian beam, D86 width is 0.747 times the 1/e2 width.

2. D63 width
Using Eq.(8), solve for erf(2 a)=0.632, we get a=0.450. So for 1-D Gaussian beam, D63 width is 0.45 times the 1/e2 width. Also for 1-D Gaussian beam, D63 width is 0.45/0.707=0.636 times smaller than that of the 2-D circular Gaussian beam.

3. Knife edge width
From Eq.(4), since the knife edge scan is a 1-D scan, the knife edge width is the same for 1-D and 2-D Gaussian.

4. FWHM
FWHM is an "intensity point relative to peak" type of width, it has nothing to do with contained power, so it is the same for 1-D and 2-D beams, i.e., it is still 0.5887 times the 1/e2 width.

5. Second-moment width
2nd-moment width is inherently defined for separate x and y, so it is the same for 1-D and 2-D beams.

Summary:
Use this table to convert between different Gaussian beam sizes:
Circular 2D Gaussian 1D Gaussian
1/e2 half-width 1 1
D86 half-width 1 0.747
1/e half-width 0.707 0.707
D63 half-width 0.707 0.45
Knife edge width
15.9%-84.1% clip
1 1
Knife edge width
10%-90% clip
1.281 1.281
HWHM 0.5887 0.5887
Note: for ideal fundamental Gaussian form only.

References:
[1] User Manual, ModeMaster PC - M2 beam propagation analyzer. Coherent inc.
[2] A.E.Siegman, "How to Measure Laser Beam Quality". PDF copy available online.