UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

Design of an in-situ ellipsometer Kleinschmidt, Alfred 1993

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Item Metadata

Download

Media
831-ubc_1993_fall_kleinschmidt_alfred.pdf [ 6.13MB ]
Metadata
JSON: 831-1.0074512.json
JSON-LD: 831-1.0074512-ld.json
RDF/XML (Pretty): 831-1.0074512-rdf.xml
RDF/JSON: 831-1.0074512-rdf.json
Turtle: 831-1.0074512-turtle.txt
N-Triples: 831-1.0074512-rdf-ntriples.txt
Original Record: 831-1.0074512-source.json
Full Text
831-1.0074512-fulltext.txt
Citation
831-1.0074512.ris

Full Text

DESIGN OF AN IN-SITU ELLIPSOMETER by ALFRED KLEINSCHMIDT B.A.Sc, The University of British Columbia, 1986 A THESIS SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF APPLIED SCIENCE in THE FACULTY OF GRADUATE STUDIES (Department of Engineering Physics)  We accept this thesis as conforming to the required standard  THE UNIVERSITY OF BRITISH COLUMBIA August 1993 © Alfred Kleinschmidt, 1993  In presenting this thesis in partial fulfilment of the requirements for an advanced degree at the University of British Columbia, I agree that the Library shall make it freely available for reference and study. I further agree that permission for extensive copying of this thesis for scholarly purposes may be granted by the head of my department or by his or her representatives. It is understood that copying or publication of this thesis for financial gain shall not be allowed without my written permission.  (Signature)  Department of^../1  mee4,1  N/Si c S  The University of British Columbia Vancouver, Canada  Date  DE-6 (2/88)  ^/e,„4er /Y  1  /9i3  ABSTRACT  Ellipsometry is a nondestructive analysis technique for studying surfaces, interfaces and thin films. The fabrication of multilayered structures, which can consist of several hundred layers, by sputter deposition of two materials having different refractive indices requires careful control of the individual layer thicknesses. In-situ monitoring of the deposition process is clearly the optimal way to achieve a high quality film and layer structure. An in-situ ellipsometer can be mounted on a deposition chamber and, through view ports, make a measurement of the complex reflection coefficient of the sample inside during the deposition process. Through an appropriate mathematical model, the thickness of the deposited layer can be determined from the ellipsometric data. This thesis presents an account of the design, construction and operation of an in-situ, rotating compensator ellipsometer. The completed prototype achieved a precision and repeatability of better than ± 1 A when measuring a Si02 layer on a silicon substrate. Thicknesses obtained from measurements corrected for the birefringence of the vacuum port windows agreed with accepted values to within a monolayer for thin (< 1000 A) layers of Si02 on silicon, and to within 3 monolayers for samples up to 2200  A thick.  ii  TABLE OF CONTENTS Abstract Table of Contents List of Tables List of Figures^  vi  Acknowledgements^  ix  Chapter 1  In-situ Ellipsometry 1.1 Introduction Overview of Instrumentation 1.2 Literature 1.3  1 1 3 7  Chapter 2  Theory of Ellipsometry 2.1 Theory of Polarized Light 2.2 Complex Reflectance Ratio Measurement of the Polarization State 2.3 of the Reflected Light 2.4 Jones Calculus  8 8 13 15  Description of the Instrument 3.1 Overview of the System 3.2 Description of the Hardware 3.2.1^The Source Arm 3.2.2^The Detector Arm 3.3 Description of the Electronics 3.3.1^The I/O Interface Board 3.3.2 The ADC Trigger Board 3.3.3^The Detector Interface Board 3.3.4^The Shaft Encoder Interface Board 3.3.5^The Shutter Interface Board 3.3.6^The Motor Interface Board 3.4 Description of the Software 3.4.1^Labmast.pas 3.4.2^EDA_Gath.pas 3.4.3^EDA_Dsp.pas and EDA FFT.pas 3.4.4^EDA Dis.pas 3.4.5^EDAIAlign.pas  21 21 21 24 26 27 28 28 29 30  Chapter 3  19  31 31 32 32 32 33 34 34  3.4.6 EDA_Set.pas^35 3.4.7 EDA_Meas.pas^36 3.4.8 EDA_Coef.pas and^37 EDA_Bug. pas 3.4.9 Shutter.pas and ADCrun.pas^37 3.5^Critical Design Criteria^ 38 Chapter 4 Alignment, Calibration and Measurement^42 4.1^Introduction^ 42 4.2 Optics and Beam Alignment^43 4.3^Rotational Alignment of the Optics^44 4.4 Calibration for Gain and Phase^47 4.5 Compensator Alignment and Calibration 51 4.6 Checking Alignment and the Stokes Vector 52 4.7 Correction for the Vacuum Port Windows 53 4.8^Calibration of the Angle of Incidence^55 Chapter 5 Instrument Performance ^ 57 5.1^Introduction^ 57 5.2 Speed, Precision and Accuracy^58 5.3^Measurement of Reflectivity ^62 Correction Factors Chapter 6 Conclusion^  65  References^  67  Appendix A Construction Drawings and Circuit Schematics ^68 Appendix B Part Specifications ^  117  Appendix C Software Source Codes^  123  iv  LIST OF TABLES Page  Table^  5.1 Magnitude of the first six harmonics of the rotation frequency. 59 5.2 Amplifier correction factors and compensator defect parameters. 60 5.3 Values of 3p/861 for various sample reflectivities. 62 5.4^Reflectivity and angle of incidence correction coefficients. ^62 5.5 Comparison of the corrected ACE and reference measurements. 63 B1^Glan Thompson polarizer.^  118  B2^Quartz port windows.^  118  B3 Compensator^  119  B4^Labmaster data acquisition board.^  119  B5^Photodetector amplifier gain selection.^  120  B6^Photodiode.^  121  B7^Shaft encoder.^  121  B8^Bistable shutter.^  121  B9^A.C. synchronous motor.^  122  Cl^Location in memory of DMA data.^  191  C2^Array storage locations of Fourier coefficients. ^ 192 C3^Error messages.^  V  193  LIST OF FIGURES Page  Figure  1.1  Rotating element polarimeters.  6  2.1  Shapes and orientations of the polarization ellipse for various values of E.  10  2.2  Characterization of the polarization ellipse in terms of the azimuthal angle e and the ellipticity E.  10  2.3  The p-s coordinate system as defined by the sample surface and the plane of incidence.  14  3.1  Functional block diagram of a rotating compensator ellipsometer.  22  3.2  Ellipsometer and its attachment to the sputtering chamber.  23  3.3  Source arm assembly.  24  3.4  Detector arm assembly.  27  5.1  Graph showing the variation of Airr with tjr/ir for 100 increments in the Si02 layer thickness.  A1.1  Adjustable table for sample.  69  A1.2  Vacuum feedthrough for sample stage adjustment.  70  A1.3  Extension tube.  71  A2.1  Laser mount assembly.  72  A2.2  Laser bulkhead.  73  A2.3  Shutter and aperture mount.  74  A2.4  Aperture rod for laser mount.  75  A2.5  Steering mirror mount.  76  A2.6  Steering mirror.  77 vi  A  64  Page  Figure A2.7  Laser holder.  78  A2.8  Laser mount covers - top and bottom.  79  A2.9  Laser mount covers - front and back.  80  A3.1  Analyzer (polarizer) assembly.  81  A3.2  Polarizer drum assembly.  82  A3.3  Bulkheads for rotating compensator, polarizer, and analyzer.  83  A3.4  Worm gear bulkhead and drum dial mount for polarizer.  84  A3.5  Bulkheads for compensator, polarizer, and analyzer.  85  A3.6  Housing for polarizer.  86  A3.7  Housing for analyzer.  87  A4.1  NW 25 ISO-KF window port.  88  A4.2  Locking nut for window port.  89  A5.1  Compensator assembly.  90  A5.2  Holder for compensator and threaded insert.  91  A5.3  Compensator drum assembly.  92  A5.4  Gear bushing.  93  A5.5  Bulkhead for rotating compensator.  94  A5.6  Male threaded bulkhead for compensator.  95  A5.7  Compensator bulkhead (motor mount).  96  A5.8  Aperture for compensator.  97  A5.9  Compensator cover - front and back.  98  vii  Figure^  Page  A5.10 Compensator cover - top and bottom. ^  99  A6.1 Detector housing.^  100  A6.2 Threaded bulkhead for detector.^  101  A7^Ellipsometer bus.^  102  A8^10 interface card.^  103  A9.1 ADC trigger interface board.^  104  A9.2 ADC trigger synchronization. ^  105  A10.1 Detector interface card. ^  106  A10.2 Photodetector amplifier circuit.^  107  A10.3 Photodetector amplifier - circuit board layout.^ 108 All Encoder interface board. ^  109  Al2.1 Shutter interface board. ^  110  Al2.2 Bistable shutter controller - schematic 1.^  111  Al2.3 Bistable shutter controller - schematic 2.^  112  Al2.4 Bistable shutter controller - circuit board layout. ^113 A13.1 Motor interface board.^  114  A13.2 60 Hz motor drive generator - schematic. ^  115  Al 4 Artwork for card cage. ^  116  ACKNOWLEDGEMENTS  First, I would like to extend my appreciation to my research supervisor, R.R. Parsons, for his continual support and encouragement throughout the course of my thesis. It is also a pleasure to acknowledge the help I have received from Norman Osborne, whose advice in programming and electronic assembly often averted what would otherwise have been many long, frustrating hours; and Glenn Clarke, who was never too busy with his own thesis to give much needed enlightenment into the mysteries of ellipsometry and sputter deposition. I would also like to thank Samir Aouadi, whose presence in the lab made my academic sojourn enjoyable. The ellipsometer would never have progressed past the design stage were it not for the professional assistance of Beat Meyer, Manfred Heinrich and Philip Akers in the Physics department machine shop, and Stan Knotek, Ivan Tomecek, Tom Felton and Domenic Di Tomaso in the electronics shop. Finally, I would like to acknowledge the financial assistance of NSERC and the University of British Columbia during the course of this research.  ix  CHAPTER 1 IN-SITU ELLIPSOMETRY  1.1 Introduction The fabrication of optical multilayers for narrow bandpass optical filters, mirrors and improved anti-reflection coatings requires a method of monitoring layer growth and quality during the deposition process. The multilayered structure consists of two or more materials having significantly different indices of refraction whose individual thicknesses depend upon the spectral region the device will be used in. Devices used at short wavelengths, for example in the X-ray band, will have closer tolerances on the uniformity of their layers than similar coatings designed for use in the infrared band. Improvements to the repeatability of the multilayered structure result in an improvement in the characteristics of the device. The most reliable and direct method for achieving the required tolerances on thickness and uniformity is to make in-situ measurements of the layer thickness during the deposition process. Such a measurement should naturally be unobtrusive, nondestructive and occur in real-time. An ellipsometer meets the above criteria and can be used to determine the optical properties of the currently grown layer. The instrument is mounted on the outside of the deposition chamber and an optical probe beam, typically from a laser, passes through a view port, is reflected from the sample in  1  the chamber, and passes through an exit viewport to a receiver. The basis of ellipsometry is the measurement of the sample complex reflection coefficient p which characterizes the change in polarization of the beam upon reflection from a dielectric or conducting sample. Because only relative changes in polarization states are measured, no knowledge of the absolute incident or reflected intensities of the beam is required. Through an appropriate mathematical model of the sample parameters, the thickness and characteristics of the deposited layer, including its purity, homogeneity and density can be determined. Continuous measurement of the reflection coefficient during deposition allows precise control of the layer thickness to within one atomic layer. This thesis describes the design, construction and operation of a rotating compensator type in-situ ellipsometer (RCE). The remainder of this chapter gives an overview of the various ellipsometer configurations available and discusses the rationale for choosing the rotating compensator design. Chapter 2 describes the theory of polarized light in terms of the Stokes parameters and defines the complex reflectance ratio. The measurement of the polarization state of the reflected light by the RCE along with a discussion of the effects of the compensator imperfections are also given. In Chapter 3, a complete description of the instrument design, including the hardware, electronics and software is given and critical design criteria are identified and addressed. Chapter 4 deals with the operation of the ellipsometer and describes how it is aligned and calibrated. Various methods for checking proper operation are identified and the equations leading to a correction  2  for errors introduced by the vacuum port windows as well as for a calibration of the angle of incidence are developed. Finally, in Chapter 5, the results of measurements of samples consisting of various thicknesses of S102 on a silicon substrate are used to assess the precision, accuracy and repeatability of the ellipsometer.  1.2 Overview of Instrumentation  An ellipsometer can be classified as being either a nulling or a photometric type. A nulling instrument adjusts the azimuth angle of a polarizer and analyzer until the transmitted beam is extinguished whereas a photometric device determines the polarization state from analysis of the modulated light intensity transmitted through a continuously rotating compensator or analyzer. Both systems have several important advantages and disadvantages and the choice between systems constitutes a trade off between considerations of speed and accuracy. The nulling device is insensitive to the light source and background intensity fluctuations, polarizer and analyzer imperfections and photodetector non-linearities. Its theoretical sensitivity is limited only by the photodetector dark current and shot noise. An important disadvantage of the nulling ellipsometer which is overcome by the photometric device, is the relatively long data acquisition times required to make a single measurement. Even with automated nulling devices incorporating stepping motors to adjust the polarizer and analyzer angles, the acquisition speed  3  is in general not fast enough for applications requiring in-situ monitoring. The resolution and accuracy of the analyzer and polarizer settings required by a nulling device, which are on the order of 0.010, increases the requirements for mechanical precision, vibration immunity and accuracy of azimuth measurements over those of a photometric instrument. Because of the speed requirements and reduced sensitivity to vibration, photometric devices are generally favoured for in-situ applications. These devices modulate the polarization of either the incident or reflected beam by mechanical rotation of an analyzer or compensator plate, or by using an electro-optical element such as a Faraday cell. The output beam has a modulated intensity comprised of the harmonics of the modulation frequency. Fourier analysis characterizes the polarization state in terms of the Stokes parameters, from which the reflection coefficient of the sample is obtained. The maximum achievable sampling rate is determined by the modulation rate which, in the case of Faraday cells, can be 100 kHz or more. The absolute azimuthal position of the rotating element need not be known to the same accuracy as for a nulling device (0.1° is sufficient) since increased accuracy is achieved by sampling several hundred or even thousand times per rotation thereby reducing the effect of random noise. The photometric design has several disadvantages. More care is required in the calibration of the optical system as imperfections in the optics introduce systematic errors into the measurement. The measurements are more sensitive to light source fluctuations and to the stability of the modulation frequency (as  4  compared to those obtained from a nulling device), non-linearities in the response of the photodetector generate harmonics of the modulation frequency which can distort the signal and, finally, the phase shift and attenuation of the signal through the analog photodetector circuitry, though easily corrected for, must remain stable over time and temperature. Response times as low as 10 ps are achievable through the use of electrooptic modulators which rotate the polarized state of the probe beam in response to an applied voltage. The lack of moving parts simplifies the mechanical design; however, data analysis is complicated by the fact that the modulated intensities depend on Bessel functions of the sinusoidal voltage waveform. Also, since no shaft encoder or timing pulses are available, synchronization of the sampling rate to the modulator is more difficult than in a rotating element design; requiring more sophisticated, temperature compensated electronics. If longer measurement times, on the order of hundreds of milliseconds, are sufficient for the in-situ application, then modulation by mechanical rotation of the analyzer or compensator is the method of choice for an in-situ instrument. Several possible systems are illustrated in Fig. 1.1. Of these the rotating analyzer (RA) is mechanically the simplest but is unable to characterize completely the polarization state of the light and is therefore not able to determine the sign of the complex reflection coefficient. The simplest configuration able to determine fully p is the RCFA. Increasingly complex designs such as the RCA and RCAFA are self-calibrating in that they are able to determine simultaneously and separately the  5  characteristics of the compensator as well as the value of p. LASER  A^DETECTOR  C^A  I.^S  .-----,,  -  -  a) ROTATING ANALYSER CPA)  7  ...-----..  \  \  -  -  bp ROTATING ANALYZER , FIXED ANALYSER CRAFA)  x x  r-----..  -  ^f^/  -  C) ROTATING COMPENSATOR + FIXED ANALYSER CRCFA)  7  _  .----,..  \  d) ROTATING COMPENSATOR AND ANALYZER CRCA)  _  -  \  7  ep ROTATING COMPENSATOR AND ANALYZER + FIXED ANALYZER CRCAFA)  Fig. 1.1:  ^  Rotating element polarimeters.1 Where P = Polarizer, S = Sample, C = Compensator, A = Analyzer.  The rotating compensator design (RCFA or simply "RCE" for rotating compensator ellipsometer) was chosen as the ellipsometer for the in-situ application because it is the simplest configuration that is able to determine unambiguously the reflection coefficient. Unlike a rotating analyzer instrument, the precision of an RCE is independent of the polarization state, and therefore p can be measured accurately over its entire range of phase angle (0 to 27r). Measurements of p with a rotating analyzer instrument become increasingly 6  inaccurate as the phase approaches 0 or Tr. This property of the RCE is important in real time, in-situ studies where the phase angle periodically becomes 0 (or Tr) as a layer of material is deposited.  1.3 Literature  The standard text in the field is Ellipsometry and Polarized Light by Azzam and Bashara2 which covers the experimental and theoretical aspects of ellipsometry. An excellent book detailing the design criteria and giving an error analysis of both the nulling and the rotating analyzer ellipsometers is Ellipsometry for Industrial Applications by K. Riedling.3 In addition, a number of papers  published in the SPIE Selected Papers on Ellipsometry  4  give a treatment of first  order error corrections for non-ideal optics and detector non-linearities and report on the achieved performance of various ellipsometer configurations.  7  CHAPTER 2 THEORY OF ELLIPSOMETRY  2.1 Theory of Polarized Light The following outlines the theory behind the development of the ellipsometric equations for the rotating compensator ellipsometer. The reader is referred to Optics by Hecht and Zajac5 and Ellipsometry and Polarized Light by Azzam and Bashara2 for a more complete treatment of the theory of polarized light and the Jones calculus. The electric field of a light wave propagating in the z direction can be represented by two transverse, orthogonal field components Ex and Ey having relative phase 6:  Ex(z,t) -  I. EoxeAkz  - 6) t)  Ey(z,t) - pEoyeRkz - øt.  8)  where T, j are unit vectors in the x and y directions respectively; E„, E0y are the magnitudes of the field components in the x and y directions; k is the wave number, and (,) is the angular frequency. The equation of the electric field E propagating in the z direction is just the sum of these two components:  8  0 E (1Eox + jE0yei8).eiuc2 - .  ^  (2.2)  The polarization state x of this electric field is dependent upon the relative amplitude and phase of the two components and can be expressed as:  X  Eoy Eox  e  (2.3)  j8  The tip of the electric field vector E will in general trace out an ellipse whose shape is determined by the value of the phase constant 6 and the relative magnitudes of E„ and Ew. Linearly and circularly polarized light are two special cases of elliptically polarized light. If 6 is an integer multiple of  :LIT,  the wave is said to be  linearly polarized; if the E„ and Ew are equal in magnitude but differ in phase by Tr/2, then the light is said to be circularly polarized. Various forms the polarization ellipse may take are illustrated in Fig. 2.1. Its shape and orientation can be specified by two parameters: the azimuth  e of the  major axis with respect to the positive x-axis (Fig. 2.2); and the ellipticity  defined  E  by the ratio of length of the semi-minor axis to the semi-major axis of the ellipse:  (2.4)  9  Fig. 2.1:^Shapes and orientations of the polarization ellipse for various values of E. Here, E. leads Ey by e.5  Fig. 2.2:^Characterization of the polarization ellipse in terms of the azimuthal angle 0 and the ellipticity E.  10  The sign of  E  determines the handedness of the polarization. The light is defined  to be right-hand polarized (E < 0) if the electric field vector rotates clockwise when looking into the source. The azimuth e is positive when measured counterclockwise from a reference plane looking into the source and is limited to the range -7r/2  e < Tr/2. The polarization state of the electric field can be  expressed in terms of  E  and e as:  X  tan 0 + flan e 1 ptan 5 .tan e  (2.5)  -  An electromagnetic wave whose orthogonal field components have a constant amplitude and phase relationship between them (i.e. the field components are mutually coherent) can be described as being completely polarized. Unpolarized light, on the other hand, does not exhibit this coherency since its polarization state changes randomly and rapidly compared to the measurement time. In general, a light beam is only partially polarized when the orthogonal field components are a mixture of coherent and incoherent light and its degree of polarization can vary from being completely polarized to completely unpolarized. The total polarization state can be expressed by four Stokes parameters which are the time averages of the electric field components E. and Ey and are defined as:  11  (2.6a)  S0 1  Si =  < E02x> - < E02y>  (2.6b)  <Eo2x> + <E02y>  S2  < 2 EoxEoycos 8 >  =  <E02x>  4-  0^<2 EoxEoysin 8 > < E02x> + < E02y>  .73  -  (2.6c)  <E02?  ^  (2.6d)  The relative phase 6 as well as E„ and Ew are time dependent and < > represents the time average. S0 is the total intensity and Si, S2 and S3 represent, respectively, the degree of horizontally/vertically polarized light, (Tr/4)/(-7/14) linearly polarized light, and left-hand/right-hand circularly polarized light.6 For completely unpolarized light S1 =  S2 = S3 =  0 while for completely polarized light  S02 = Si2 + S22 + S32. The Stokes parameters can be expressed in terms of the ellipticity and azimuth of the polarization ellipse by the equations:7  12  (2.7a)  so - 1  (2.7b) S.1 - cos(20)•cos(2e)  (2.7c) S2  -  Sin(20)•COS(2E)  (2.7d) 53 - sin(2e)  2.2 Complex Reflectance Ratio  The complex reflectance ratio p of a sample is defined in terms of a coordinate system whose axes are aligned to the sample surface and the plane of incidence of the light beam (Fig. 2.3). The two orthogonal electric field components can then be defined as Ep, lying in the plane of incidence, and Es, lying in the plane of the sample surface. Linearly polarized light oriented along either of these axes is reflected or transmitted without a change in its polarization state.  13  Fig. 2.3:  ^  The p-s coordinate system as defined by the sample surface and the plane of incidence.  The complex reflectance ratio with respect to the p- and s-axes is defined as . 6 .  p  -  rp/ rs = (EprIE)I(E,srl Es) = XIXr  ^  (2.8)  where superscripts i and r denote the incident and reflected quantities respectively. Since rp and rs are in general not equal, the Ep and E, components are reflected with different amplitude attenuations and phase shifts, resulting in a changed polarization state. If the input polarization xi is known and xr can be measured, then the 14  characteristic p for the surface at a given angle of incidence can be determined. Traditionally, p is written in the terms of the ellipsometric angles xir and A as:  p(iii,A) =  Tan(*).01°  ^(2.9)  where Tan(*) is the relative amplitude attenuation and A is the relative phase shift between the incident and reflected polarization states.  2.3 Measurement of the Polarization State of the Reflected Light  The light intensity at the photodetector 1(t) consists of a constant term as well as a second and fourth harmonic of the compensator rotation frequency wc. The exact form of the intensity for an ideal RCE to within a multiplicative constant is:7  At) = (1 +a2cos2coct+b2sin2coct+a4cos4coct+b4sin4coct )  ^(2.10)  Fourier analysis can be used to extract the Fourier coefficients a2 .. b4 from the signal, which are related to the polarization parameters (e,€) and the angle A of the analyzer transmission axis with respect to the p-axis by:8  15  a2  2 •sin2e .sin 2A 2 + cos2e•cos2(0-A)  (2.11a)  b2  2.sin2e.cos2A 2 + cos2e.cos2(0 - A)  (2.11b)  aA --  cos2e.cos2(0 +A) 2 + cos2e.cos2(0 -A)  (2.11c)  cos2e .sin 2 (0 +A) 2 + cos2e•cos2(0-A)  (2.11d)  -^  b4 -  From these expressions, it can be seen that linearly polarized light (E = 0) produces a fourth harmonic variation while circularly polarized light (E = ± Tr/4) produces a second harmonic variation where the handedness of the polarization can be determined by the signs of the coefficients a2 and b2. The above relationships hold for an ideal compensator. A compensator is made of linearly birefringent material and functions as follows. An electromagnetic wave linearly polarized and propagating in a direction perpendicular to the optic axis of the compensator will experience a refractive index n and transmittance Tan(ir,) whose value depends upon the orientation of the polarization vector with respect to the optic axis. If the wave is polarized in a direction parallel to the optic axis, the wave will propagate at a speed c/ne where c is the speed of light in a vacuum and ne is known as the extraordinary refractive index of the medium. If, however, the wave is polarized in a direction orthogonal to the optic axis, it will propagate at a speed of c/n, where n, is the ordinary refractive index. When an  16  electric field vector is composed of both polarization components, propagation through the compensator will introduce a relative phase retardation A, between the two components of:  Ac  2nd .(no ne) A -  (2.12)  where d is the thickness of the compensator and 1 is the wavelength of the electric field. An ideal compensator has a relative phase retardation of n12 and a relative transmittance Tan(iir,) = 1 at the wavelength of interest. In general, however, the compensator will not be ideal and three defect parameters (q, r, s) must be introduced to correct for the non-ideal gr, and A, of the compensator:8  q - 1 + sin2ipc•cosAc  (2.13a)  r - sin 21pc-sin Ac  (2.13b)  s = cos2tpc  (2.13c)  The rotating compensator can be placed before the sample, thereby modulating the polarization state of the incident light, or after the sample. The method of analysis in either case is similar, however it is conceptually simpler to keep the input polarization fixed while modulating the polarization of the reflected beam. For the compensator placed in the reflected beam, with the analyzer angle set to zero, the Stokes parameters can be expressed in terms of the normalized Fourier coefficients as:7 17  Si  S2  S3  -^  -  2.a4/[(2-q)- q.a4]  (2.14a)  2.b4/1(2-q)- q.a41  (2.14b)  [b2.(2 q) 2.s.b4] -  -  -  r.[(2 q) q.41] -  (2.14c)  -  The polarization parameters (19, €) are related to the Stokes parameters by:7 S3  tan2e = .‘i 4+ s22  cos20 -  1  (2.15a)  Si  (2.15b)  Si2 + SI  S2  sin 20 \iSi2+ 4  (2.15c)  Eqn. 2.15a illustrates the ability of the rotating compensator ellipsometer to  distinguish the sign of E from a measurement of  S3  and therefore determine the  handedness of the reflected polarization. Eqns. 2.15b and 2.15c provide a determination of 0 from either the sine or the cosine term. When  e approaches 0  or ± Tr/2, the experimental uncertainty becomes excessive if e is determined from the cosine term. A similar case holds if approaches ±Tr/4. By finding  e is evaluated from the sine term as it  e from the larger of I sin 201 and Icos 2611, the  experimental uncertainty becomes independent of the value of a The signs of  18  Eqns. 2.15b and 2.15c are used to determine the proper quadrant for 2e and, consequently, the value and sign of e.  2.4 Jones Calculus The Jones matrix describes the overall effect of a non-depolarizing optical system on an incident, monochromatic plane wave. Such a wave can be described by the vector: (2.16)  A 2x2 transformation matrix T (Eqn. 2.17) relating the output electric field vector to the input electric field vector is the Jones matrix of the optical system and its elements  Tij  are in general complex quantities. (T11 T12)  (2.17)  T21 T22  A cascade of several optical systems can be combined into a single equivalent system  Ttotm,  simply by multiplying their Jones matrices together: Ttotai - TN • TNA^  (2.18)  where T1 is the Jones matrix of the first system into which the incident light beam enters; TN corresponds to the last system out of which the beam exits. Finally, it is often convenient to express the optical system in terms of how it changes the polarization state of the incident beam. There exists a functional relationship known as the Polarization Transfer Function (Eqn. 2.19) of the optical 19  system which is a bilinear transform mapping the input polarization state xi to the output polarization state x,. The coefficients T the transform are the elements in the corresponding Jones matrix.  Xo  T22X1 + T21 112X, + T11  20  (2.19)  CHAPTER 3 DESCRIPTION OF THE INSTRUMENT  3.1 Overview of the System The description of the in-situ ellipsometer can be divided into three broad categories: the mechanical hardware and optics, the electronics, and the computer software. Figure 3.1 illustrates the inter-relation of the major components of the system. Subsequent sections in this chapter deal with each of these categories in more detail. Module assemblies are illustrated in the accompanying figures; detailed construction drawings are in Appendix A and, when referred to, these figures are prefixed by the appendix letter. Manufacturers specifications are included in Appendix B and the program source codes are in Appendix C.  3.2 Description of the Hardware The ellipsometer hardware consists of a source and a detector arm clamped onto the NW25 vacuum ports of a sputtering chamber as shown in Fig. 3.2. Both arms are modular in design and an attempt was made to standardize the configuration of each of the modules to reduce the design complexity and machining time and to increase the serviceability. Each of the modules making up the arm assembly is based on a cylindrical geometry, has a standardized thread and is completely interchangeable. Various ellipsometric configurations such as  21  DETECTOR  HeNle LASER  ANALYZER ROTATING COMPENSATOR  SHUTTER  POLARIZER ENTRANCE AND EXIT WINDOWS  MOTOR AND SHAFT ENCODER  SAMPLE AND ADJUSTABLE BASE  MOTOR CONTROLLER  ELECTRONICS INTERFACE  IBM PC WITH DATA ACQUISITION CARD  LASER POWER SUPPLY  71  to C A; Chl l'9  M  --7 "C0 53  o 3 CD  (Ss E DU): Pa  P-3  tv ta  m-  3 CD =  Ei 5,CD U)  7:3  C (7)-,. m  Co  0 7  3  CY CD --%  the sample-compensator, compensator-sample, and nulling (rotating compensator removed) are therefore all realizable with this design. An adjustable sample holder (Figs. A1.1, A1.2) mounted on the back wall of the chamber allows the reflected laser beam to be aligned parallel to the optic axis of the detector arm. The tilt and elevation adjustment is via three vacuum feed-through micrometer screws accessible at the back of the chamber.  3.2.1 The Source Arm  The source arm (Fig. 3.3) generates a beam of collimated and linearly  Figure 3.3: Source arm assembly. 24  polarized light of known and adjustable azimuth and is comprised of a 5 mW HeNe laser followed by a rotatable polarizer. The laser mount assembly (Figs. A2.1 A2.9) aligns the laser approximately antiparallel to the optic axis and incorporates two mirrors to turn the beam by 1800. Both a space savings and a method of alignment are realized with this geometry since the beam can be aligned to the optic axis by adjusting the small steering mirror. A pinhole aperture having a diameter equal to the gaussian width of the beam can be manually rotated into the beam path to aid in the beam alignment. Turning the aperture rod (Fig. A2.4) by 900 rotates the pinhole out of the beam path during a measurement. A bistable electronic shutter blocks off the beam after a measurement cycle in order to meet safety considerations and to allow for a dark cycle measurement of the ambient light associated with the plasma discharge in the chamber. The polarizer module (Figs. A3.1 - A3.7) consists of a high quality Glan-Thompson prism polarizer having an anti-reflectivity coating and an extinction ratio of 10-6 (Appendix B1) mounted inside a drum assembly. A worm gear assembly and vernier drum dial readout permits repeatable adjustments to ± 0.05°. The polarizer screws onto the vacuum port adapter (Figs. A4.1 - A4.2) which attaches onto a standard NW25 vacuum port flange. The vacuum seal is made by sandwiching a disc of BK7 glass (Appendix B2) between two 0-ring seals. In order to minimize the stress-induced birefringence in the windows, the six bolts clamping the window around its perimeter must be tightened evenly and only until glass to metal contact has been made.  25  3.2.2 The Detector Arm  The detector arm (Fig. 3.4) consists of a rotating compensator followed by an analyzer and photodetector. The rotating compensator (Figs. A5.1 - A5.10) is the most complex module of the entire ellipsometer. A compensator (Appendix B3) is captured in a drum assembly similar to that used in the polarizer module except that an adjustable holder for aligning the optical axis of the compensator to its axis of rotation is inserted into the drum. One end of the drum shaft holds an optical shaft encoder for synchronization of the data acquisition system; the other holds a 104 tooth gear meshed to a 144 tooth gear on the shaft of a 30 Hz ac hysteresis, synchronous motor. Slots rather than holes were used on the motor mount bulkhead in order to accommodate a variety of motors and gear ratios. An alignment aperture similar to that in the laser mount module is incorporated to aid in the alignment of the reflected beam. The analyzer module is identical to the polarizer except that the adjustment knob and vernier scale are on the opposite side in order to permit adjustment from the front of the sputtering chamber. The detector module (Figs. A6.1 - A6.2) screws into the analyzer and houses the photodiode and its associated electronics. A narrow band filter matched to the HeNe laser frequency placed in front of the photodiode cuts out stray ambient light.  26  TOTAL LENGTH = 30" PHOTODETECTOR MODULE  _...„,- ANALYZER MODULE  ROTAT I NO COMPENSATOR MODULE NW25 PORT ADAPTER  Figure 3.4: Detector arm assembly.  3.3 Description of the Electronics  The ellipsometer is controlled by an IBM compatible PC through a Labmaster DMA data acquisition and I/O interface board. Important specifications shown in Appendix B4 include its data sampling rate (40 kHz), 12 bit resolution of the ADC, 24 lines of buffered I/O and five high speed timer-counters. To shield the ADC properly from the electrically noisy environment of the PC, it has been housed in a shielded chassis external to the PC and connected to it via a 50 conductor ribbon cable. 27  The measurement time of the ellipsometer is limited by the maximum sampling rate of the Labmaster: sampling 512 times per cycle allows a maximum rotation speed of 78 Hz. Selecting a compensator rotation speed of 41.54 Hz and sampling 512 times per cycle requires a sampling rate of 21.27 Kbytes per second which is too high for polling operation of the ADC and therefore requires direct transfer of the data to memory (Direct Memory Access (DMA)). The interface electronics are contained on six euroboards occupying part of a Schroff card cage and are interconnected via a common bus (Fig. A7). The function of these boards is to synchronize the data acquisition and provide an interface between the Labmaster digital control signs and the ellipsometer.  3.3.1 The I/O Interface Board  The I/O interface board (Fig. A8) buffers the 24 lines of digital I/O from the Labmaster. The present design only defines 16 of these: AO - A7: outputs from the Labmaster; BO - B3: outputs; CO - C3: inputs.  3.3.2 The ADC Trigger Board  The ADC trigger interface board (Fig. A9.1) synchronizes the data transfer to the shaft encoder pulses and the Trigger Enable command from the Labmaster. The timing diagram (Fig. A9.2) illustrates the synchronization sequence. To begin a measurement cycle, the Labmaster first resets the flip-flop (Q1) through the lines Enable Trigger 2 and 3, then enables its trigger by setting Enable Trigger 1 high.  28  The shaft encoder index pulses (IL) generate interrupts by toggling Counter 2 and, after Q1 has been enabled, will set the flip-flop and enable Counter 1 (the ADC trigger) to be clocked by the incremental shaft encoder pulses connected to  Source 1. Counter 1 divides the 1024 incremental encoder pulses to set the number of data points per cycle to between 2 and 512. The start of the data acquisition therefore always occurs at the same point in the cycle. The In Process bit is also set high by this first enabled trigger pulse. If In Process is high, the interrupt service routine will read the value in the hold  register of Counter 3 which contains the number of ADC conversions completed and check for missed counts indicating a possible synchronization problem. Counter 4 is used as a diagnostic signal synchronized to the ADC start pulse. The output of the index pulse is opto-coupled to a BNC connector on the face plate of the shaft encoder interface board and is also available as a diagnostic signal.  3.3.3 The Detector Interface Board  This board (Fig. A10.1) passes the buffered Labmaster A3-A6 address lines to the detector gain select inputs to select one of 16 possible gains from 1 to 13.44 (Appendix B5). The 12 bit resolution of the ADC necessitates some consideration in the laying out of the signal paths (to avoid ground loops) and shielding in order to achieve the rated performance. The ADC, run in the unipolar configuration, requires that noise be suppressed to below 1.2 mV (±- 1/2 bit). In order to meet  29  this criteria, the photodetector amplifier is mounted in the module containing the photodetector (Appendix B6) and the output is connected with a coaxial cable to the interlace board where it is further amplified and inverted before it is connected to the ADC input. Neither the module housing nor the card cage ground is connected to the detector ground. The power (±15 V) and ground for the detector and inverting amplifier is supplied by the Labmaster. All gain select lines are optocoupled to the detector, further avoiding ground loop problems and separating the analog ground from the noisier Labmaster digital ground. The photodetector amplifier (Figs. A10.2 - A10.3) has a 3 dB gain rolloff at 720 Hz shaped by a four pole Bessel low pass filter which, because of its linear phase characteristics, maintains a constant, linear relationship between the phases of the second and fourth harmonics. The temperature stability of the amplifier is important because changes in the cutoff frequency will directly influence the magnitude and phase of the photodetector signal and for this reason precision, low temperature coefficient capacitors and resistors are used.  3.3.4 The Shaft Encoder Interface Board  The shaft encoder interlace board (Fig. All) connects the shaft encoder (Appendix B7) to the ellipsometer system bus. The index pulse from the trigger interlace board is passed along the bus to a BNC connector on this board where it is available as a diagnostic pulse. The BNC ground is isolated from the card cage and connected directly to the BNC shield. Power (+5 V) and ground for the  30  shaft encoder are supplied by the Labmaster.  3.3.5 The Shutter Interface Board  The shutter interface board (Figs. Al2.1 - Al2.5) controls the bistable electronic shutter (Appendix B8). Two I/O lines from the Labmaster passed along the bus control the opening and closing of the shutter. Power is supplied from the card cage. The transition time of the shutter at +15V is 5 ms, which is less than the compensator rotation period of 24 ms.  3.3.6 The Motor Interface Board  The motor interface board (Fig. A13.1) connects two Labmaster I/O lines passed through the bus directly to the motor controller situated in a separate enclosure (Fig. A13.2). The motor can be turned on or off and its speed switched between 900 and 1800 rpm by toggling the appropriate control bit. The motor itself is an ac synchronous hysteresis type (Appendix B9) driven by 90 V rms. Variations in motor speed will result in changes in the magnitudes and phase shifts of the Fourier coefficients as the signal is passed through the photodetector amplifier. The required stability in the drive frequency of better than 100 ppm was achieved by implementing a quartz locked oscillator circuit.  31  3.4 Description of the Software  Extensive software routines were written in the Turbo Pascal environment to align, calibrate, and run the ellipsometer. In addition, several utility programs were included to aid in the alignment of the laser, adjustment of the sample stage, diagnosis of harmonic noise generation, and verification of the calibration and alignment. Source codes are given in Appendix C.  3.4.1 Labmast.pas  This unit contains the routines for configuring the Labmaster I/O ports, counters, and DMA controller. Upon startup of a program, the unit initializes the Labmaster ADCs, counters and I/O ports and generates a global reset of the board. Subroutines in this unit interface the functions defined in the Labpac manual) to Turbo Pascal. These functions are implemented by filling the required  registers with user defined values or constants predefined in the header file labhead.btp. Execution of the subroutine is done by generating a software  interrupt using an interrupt vector defined in labhead.btp.  3.4.2 EDA_Gath.pas  This unit contains the software to configure the Labmaster DMA controller, synchronize it to the shaft encoder pulses, and acquire data for a given number of compensator revolutions. It also contains routines to control the laser shutter, motor speed and detector gain. A subroutine to normalize the Fourier transformed  32  data and average these over the number of cycles taken is also included. Table Cl (Appendix C) illustrates how the photodetector data is stored in memory.  3.4.3 EDA_Dsp.pas and EDA_FFT.pas  All data processing routines are contained in EDA_Dsp.pas. Several routines, such as those to average the time domain data and check for errors in the data are not normally required in this implementation of the ellipsometer and are included here as auxiliary subroutines. Since only the normalized second and fourth Fourier harmonics are required, a full Fourier transform of the data is not necessary. It is therefore more efficient to implement a Discrete Fourier Transform (DFT) at the second and fourth harmonics rather than a full Fast Fourier Transform (FFT). The function DSP_FOURIER_Coef calculates the DFT of any data cycle at any harmonic desired and stores the coefficients in an array (Table C2). Functions to calculate the ellipsometric angles ii,, A and the Stokes parameters from the Fourier coefficients are also included in this unit. EDA _FFT.pas is an auxiliary unit which contains an implementation of a full FFT which may occasionally be useful for the analysis of parasitic harmonics in the data.  33  3.4.4 EDA_Dis.pas  All procedures to initialize the graphics or text display are included in this unit. Procedures to set up axes and plot either the time domain or the frequency domain data are available.  3.4.5 EDA_Align.pas  This is one of the three main programs and is used to align the analyzer to the p-axis and the polarizer to the s-axis of the sample. A detailed explanation of the alignment algorithm is given in Chapter 4 and is summarized here. Three alignment iterations are performed during which the operator is prompted to set the analyzer or polarizer to specified angles or enter their vernier drum dial readings on the keyboard. The final alignment of the analyzer is made by fitting a quadratic to the squared magnitude of the fourth harmonic for 20 data points taken at 0.5° increments and centred approximately around the maximum. From these values, the angle corresponding to the maximum magnitude is calculated by the program Ang_fit.C. The execution of this Turbo C program is done from within EDA Align through the Pascal Exec command. The data points are passed in the text file Align.dat and the analyzer angle and goodness of fit coefficient are returned in the text file Align.fit. A poor fit results in a warning message displayed on the screen. The polarizer and analyzer alignment angles are written to the ASCII file Align.par for use in the calibration (EDA_Set.pas) and measurement  (EDA_Meas.pas) routines.  34  3.4.6 EDA_Set.pas  The second of the three main programs measures the corrections for the photodetector gain rolloff and shaft encoder trigger phase with respect to the paxis for both the second and the fourth harmonics. The analyzer must be aligned to the p-axis before these corrections can be made and the operator is prompted to adjust the polarizer. The theoretical details of the correction procedure can be found in Section 4.4. The correction occurs in two stages. First, the normalized magnitude of the second and fourth harmonics are corrected for the gain rolloff of the photodetector amplifier. With the polarizer aligned to the s-axis, a correction to the second harmonic is made by running the motor at half speed; a correction to the fourth is made at full speed. The second stage adjusts for the trigger phase of the shaft encoder and for the relative phase shift of the photodetector amplifier. The trigger phase correction algorithm shifts through the data one increment at a time to find the phase correction to within one sampling interval after which an analytic correction term is measured for both the second and the fourth harmonics with the motor running at half and at full speed respectively. However, this only establishes the correction for the second harmonic to within -± ir and a repositioning of the polarizer to the s-axis is necessary to establish this value exactly. The correction values are written to the file Cal_Data.dat for use in the programs that measure the second and fourth harmonics (EDA_Bug.pas) and the  35  sample reflectivity (EDA_Meas.pas).  3.4.7 EDA_Meas.pas This program collects data and, using the alignment and correction parameters, calculates the reflectivity of the sample. The program prompts the user for the size of the sample to average, the time interval between measurements, and the polarizer angle used. The real and imaginary parts of p, the values of Tan(*) and A as well as the Stokes parameters are displayed. In order to reduce the error in p associated with certain values of the Stokes parameters, the program determines p from the lesser of S, and S2• (The reader is referred to Section 2.3 for a discussion of the underlying theory.) In addition, the program gives an estimate of the error in A by calculating the difference between the values found from these two parameters and, if this difference is excessive, displays a warning on the screen. Several additional error checking algorithms have been implemented in this and the previous two programs. These are summarized in Table C3 (Appendix C) and include monitoring of the signal level, DMA initialization, ADC synchronization to the shaft encoder pulses, and Stokes parameters. In order to prevent a 'divide by zero' operation in the arithmetic functions due to a low light intensity level, an error handling routine displays a "Low light /eve/" warning message and aborts the program. The standard exit procedure for all programs is to turn off the motor and the laser shutter and to restore old interrupt vectors.  36  3.4.8 EDA_Coef.pas and EDA_Bug.pas  These two routines are available to test and debug the system.  EDA _Coef.pas calculates and displays the uncorrected magnitudes of the first six normalized Fourier coefficients. It is intended to be used as an aid in determining the size of parasitic harmonics and their influence on the calculation of the sample reflectivity. EDA_Bug.pas displays the corrected values of the real and imaginary parts, as well as the magnitudes and phases, of the second and fourth harmonics and is intended to verify proper alignment and calibration of the instrument. The data for all cycles acquired is graphically displayed before the program is terminated by the operator.  3.4.9 Shutter.pas and ADCrun.pas  These short programs can be used during operator alignment of the sample to the optical axis of the ellipsometer. Shutter.pas simply allows direct control of the laser shutter from the keyboard while ADCrun.pas polls the ADC and displays the resultant byte to the screen. Alignment of the sample stage can therefore be accomplished by adjusting the sample stage and laser mirror until a maximum reading is obtained.  37  3.5 Critical Design Criteria  The in-situ ellipsometer is designed to measure sputter deposited layers to monolayer accuracy in real time during the deposition process. This requires a precision in the measurement of p to 5 x 10-3. In order to achieve this precision, special consideration must be given to the design of several key parts of the system. Immunity of the system to vibrations and electromagnetic interference (emi), the rotation stability of the compensator and the stability of the light source are the most important design criteria and each will be considered separately in the following paragraphs. An in-situ ellipsometer is necessarily situated in an environment not normally suitable for precision measurements. Roughing pumps can transmit vibrations to the ellipsometer arms and sample stage, evacuation causes flexing of the chamber walls and misalignment of the optics, and the ion source emits emi which can couple noise to unprotected photodetector electronics. The suppression of the effects of emi has been dealt with in a previous section in this chapter and will not be repeated here. Suppression of vibrations caused by a roughing pump is best done at the source by connecting the pump to the vacuum system with a bellows adapter which will attenuate the large amplitude, low frequency pump vibrations. The small, higher frequency vibrations only become a problem if the laser beam has been improperly aligned and has been vignetted by parts of the system. Vibrations will then change the amount of vignetting and alter the amount of light reaching the photodetector resulting in high frequency noise superimposed on the  38  ellipsometric signal. The evacuation of the chamber and its effect on the alignment of the ellipsometer and the changes to the angle of incidence is a relatively repeatable phenomenon. Nevertheless, verification of this repeatability must be made periodically with a calibrated sample to allow for an eventual recalibration of the angle of incidence in the evacuated chamber. The gear ratio of the compensator must be carefully chosen to minimize mechanical vibrations and to avoid a superposition of any 60 Hz noise or harmonics thereof from the supply lines onto either the second or fourth harmonics of the ellipsometer signal.' The rotating compensator module was designed to permit flexibility in the choice of motors and gear ratios for a more heuristic approach to this problem. A ratio of 1.385 set by a 144 tooth gear on the motor shaft driving a 104 tooth gear on the compensator was found to give the fastest and smoothest rotation possible for this motor. An computer analysis of the effect of 30 and 60 Hz harmonics as well as gear induced harmonics at the frequencies shown in Eqn. 3.1 was made: f  -  hm• fm• ( hGR • GR — 1)  f G2 -• hm• fm• (hole- GR + 1)  where fG1 and fG2 are the harmonics of the motor frequency induced by gear imperfections, GR is the gear ratio, fm is the motor frequency, and hm and hgr are integers representing multiples of the motor frequency and gear ratio respectively.  39  It was found that for the gear ratio of 104:144, all harmonics of these frequencies up to the ninth were cancelled by averaging over nine data cycles. Another source of harmonic generation is the orbiting of the shaft encoder. If the shaft encoder disk is not perfectly flat, or if it not properly mounted on the compensator drum shaft, orbiting of the shaft encoder will introduce a frequency modulated signal into the data which will be another source of parasitic harmonics. This effect can be minimized by careful assembly of the shaft encoder and by averaging over an even number of signal periods. 3 Since only the second and fourth harmonics are of interest the second criterion is automatically satisfied if the data is analyzed over one complete compensator revolution. The motor speed and photodetector characteristics must also be constant over the period of time the in-situ measurements are being made. Changes in motor speed will introduce changes in phase shift and magnitude into the harmonics due to the characteristics of the photodetector amplifier and it is therefore important to stabilize the motor speed and detector amplifier as described in the preceding sections of this chapter. The requirements on the stability of the light source pose a problem if they are to be met by using a standard, unpolarized and unstabilized HeNe laser. Since only normalized magnitudes are required, slow changes in intensity, such as a dc level drift of less than 1 part in 4096 (1 bit change over the ADC resolution of 4096) during one compensator revolution are acceptable. However if, as is typically the case, several cycles are averaged to find the reflectivity, the dc drift,  40  while close to zero over one cycle, may appreciably effect the normalization when data from several cycles are averaged. The solution is to Fourier transform the data from each measurement cycle, normalize with respect to its dc coefficient and average the normalized coefficients over the data set. In order to maintain a high signal to noise ratio as the laser beam intensity drifts, some gain control of the signal is necessary. One of sixteen logarithmic photodetector gain levels can be selected by software which monitors the peak value of the photodetector signal and adjusts the gain in 20% increments as required. The ADC also features four programmable gain steps from 1 to 8 for a combined dynamic range of 40 dB over which the signal can be adjusted to within 20% of its saturation value. If the signal falls outside of this range, a warning message is sent to the PC screen. An unstabilized HeNe is prone to occasional mode hopping during which the emitted intensity will change by 5% in a sudden jump. The intensity changes at the output of the polarizer are much larger however, and the polarized intensity can change by as much as 100% during a mode jump. This is due to the fact that the randomly polarized laser beam is actually partially polarized and its polarization state changes as the laser jumps from one mode to the next. The frequency of these jumps decreases as the laser reaches a stable operating temperature and, after two hours, may occur only every 30 minutes. In order to reduce the number of corrupted measurements due to mode hopping, the laser must therefore be warmed up for at least two hours prior to making any measurements.  41  CHAPTER 4 ALIGNMENT, CALIBRATION AND MEASUREMENT  4.1 Introduction The alignment and calibration of the ellipsometer encompasses several steps. After mounting both arms of the ellipsometer on the vacuum chamber, the laser and sample must be properly adjusted such that the laser beam passes through the center of all the optics and the optic axis of the compensator must be aligned perpendicular to its axis of rotation. Following this, the analyzer and polarizer azimuths must be properly oriented with respect to the p-axis of the system. Once aligned, the photodetector amplifier characteristics and shaft encoder trigger phase are measured and used as correction factors in the measurement of the Fourier coefficients. Finally, measurement of several reference samples of silicon and silicon oxide with known reflectivities yield correction factors for the change in p due to the stress induced birefringence in the vacuum port windows and calibrate the angle of incidence of the laser beam. In addition to the above procedure, which should be repeated prior to every measurement, the non-ideality of the compensator must be measured. Three compensator defect parameters are measured with the ellipsometer arms connected together in a straight through configuration and are used in Eqns. 2.14 to calculate the actual Stokes parameters from the Fourier coefficients. These  42  parameters depend only on the characteristics of the compensator and the wavelength of light used; they need be measured only once.  4.2 Optics and Beam Alignment  The cylindrical design of the ellipsometer arms guarantees that the optical axes of the analyzer and polarizer lie along the mechanical axes of their respective arms, however the axial alignment of the compensator requires special consideration since misalignment of the compensator axis can result in a modulation of its transmissibility due to variations of the surface reflectivity with the angle of incidence as the compensator rotates. The alignment of the compensator to its mechanical axis of rotation is made on a optical bench. Three set screws arranged symmetrically around the circumference of the drum assembly allow for angular adjustment of the compensator holder inside (Fig. A5.1). The holder is adjusted until the projection on a screen of a laser beam reflected off the compensator face no longer traces out a circle when the compensator is rotated.6 Once the adjustment has been made, the set screws are fixed in place by epoxy. Due to the small apertures of the analyzer and polarizer (0.125" diameter), centering of the laser beam on the optical axis is important in order to avoid vignetting and internal reflections. As stated in Section 3.5, ambient vibrations will alter the amount of vignetting and superimpose noise onto the ellipsometric signal. The alignment procedure begins with the incident laser beam. By adjusting  43  the steering mirror (Fig. A2.1) on the laser mount module until the beam passes through the alignment aperture and out the center of the vacuum port window, the beam can be adjusted to be collinear to the optical axis of the source arm. Alignment of the reflected beam to the detector arm is made by adjusting the sample stage until the back reflection from the compensator face coincides with the incident beam spot on the sample. This alignment must usually be done iteratively by first tilting, then raising or lowering the sample stage, since coincidence of the incident and reflected beam spots on the sample is no guarantee that the beam is centered on the photodetector. The program ADCrun.pas can be used to read the photodetector output while raising or lowering  the sample until the maximum is found.  4.3 Rotational Alignment of the Optics  The alignment of the analyzer and polarizer to the sample p-axis is done in three iterations and is based on the sensitivities of the second and fourth harmonics to the rotation of either component. This procedure requires a metallic sample. Linearly polarized light whose plane of polarization lies in either the p- or the s-plane will then have its polarization state preserved upon reflectance and generate only a fourth harmonic of the compensator frequency. (This is in fact only true for an ideal compensator and, in practice, the second harmonic is a small, non-zero value related to the compensator defect parameters. A further discussion of the influence of a non-ideal compensator is found in Section 4.5.)  44  From Eqns. 2.11a and 2.11b, where 0-A is given by the angle between the transmission axes of the polarizer and analyzer, it can be seen that adjustment of the polarizer to either the p- or s-axis will minimize the magnitude of the second harmonic for any position of the analyzer (since the ellipticity  E of  the reflected light  is zero on these axes). From 2.11c and 2.11d, it is also evident that subsequent alignment of the analyzer to one of these axes will either maximize or minimize the magnitude of the fourth harmonic depending on whether e-A = 0 or Tr/2: coincident or orthogonal alignment of the analyzer and polarizer transmission axes respectively. The alignment procedure aligns to the orthogonal position for two reasons. The relative magnitude of the random error with respect to the fourth harmonic is minimized (since the fourth harmonic reaches a maximum in this orientation) and, secondly, the magnitude of the second harmonic in this orientation is independent of the compensator parameters and should equal zero. The initial alignment is accomplished by first adjusting the polarizer to the approximate minimum in the second harmonic, followed by adjusting the analyzer to the approximate maximum in the fourth harmonic. Because the minimum is sharp, a second alignment of the polarizer to better than ± 0.05° is possible simply by searching for it. The maximum of the fourth harmonic is much broader and therefore a least squares fitting routine (Ang_fit.c) is used during the second and final analyzer alignment to find the angle corresponding to the p-axis from a set of 20 data points taken around the maximum.  45  The equations for p(iir,A) (Eqns. 2.8, 2.11, 2.14 and 2.15) assume an analyzer alignment to the p-axis. The Fourier coefficients a4 and b4 give no indication, however, to which axis the alignment algorithm has oriented the analyzer. By inserting a polarizer, whose extinction axis orientation is known, into the polarized beam incident on the sample, the orientation of the analyzer can be determined and related to approximate vernier drum dial readings on the analyzer module. A subroutine in the software alignment procedure checks whether the angles the operator has entered are in the proper quadrant and prompts the operator to rotate both the analyzer and polarizer by 90° prior to the final alignment if the analyzer has not been aligned to the p-axis. With the vacuum port windows in place, the beam incident on the sample is slightly elliptically polarized and the alignment of the polarizer and analyzer are correlated to some degree. Following the second and final alignment of the analyzer, a final readjustment of the polarizer is therefore required. To summarize, the rotational alignment of the optics requires a first, rough alignment of the polarizer to either the s- or the p-axis, followed by a rough alignment of the analyzer. A rotation of both components by 900 may be required if the analyzer has been aligned to the s-axis prior to a second, fine adjustment of the polarizer and analyzer. Due to stress birefringence in the windows, a final readjustment of the polarizer is required.  46  4.4 Calibration for Gain and Phase  After the analyzer and polarizer have been aligned to the sample p- and saxes respectively, the correction values for the relative amplitude attenuation and phase shift for the second and fourth harmonics must be determined. The photodetector amplifier incorporates a low pass Bessel filter whose attenuation and phase shift are frequency dependent. The second and fourth harmonics are therefore attenuated and phase shifted by different amounts relative to the dc component of the signal resulting in an erroneous measurement of the polarization state if the filter characteristics are not taken into account. If^b4' represent the measured coefficients and if 1 /a1 and (pi are the relative attenuation and phase shift of the ith harmonic (i = 2, 4) respectively, then the actual coefficients^b4 from Eqn. 2.11 become:6 ai^ai (^.cos  bi = ai •  4•„: + bli•sincki  (JD/2: •cos.i  )  -^)  In order to find the correction factors, it is necessary to introduce several equations by Hauge and Dill8 relating the actual Fourier coefficients to the analyzer and polarizer angles (A and P) and the ellipsometric angles:  47  -2r ( v tanA ) sin2A + 2s (cos2A + p.) a2 _  (4.2a)  _ 2r ( v tam& ) cos2A + 2s (sin2A + v) 2 + q(vsin2A + itcos2A)  (4.2b)  2 + q- ( v sin2A + pcos2A)  b2  a4 _ ( 2 -q) ( vcos2A - v sin2A)  (4.2c)  _ ( 2 -q) ( p,sin2A + vcos2A) 2 + q( v sin2A + licos2A)  (4.2d)  2 + q-(v sin2A + gcos2A)  b4  Where q, r and s are the compensator defect parameters to be discussed in Section 4.5, and ti and v are defined as:  - cos2P - cos2 ilr 1 - cos2P•cos24r  (4.3a)  V _ sin2 P•sin2111.cos A 1 - cos2P•cos2iIr  (4.3b)  P.  If the analyzer and polarizer have been aligned as described, then (p., v) = (-1,  0) and measurement of the magnitude of the fourth harmonic yields  a4 directly: a4  1  ^  (4.4a)  Vai2 4. bi2  since, from Eqns. 4.2:  V a: + b: - 1 48  (4.4b)  A problem unique to the rotating compensator ellipsometer is that both the second and the fourth harmonics must be corrected and that, for a polarizer orientated to either of the p- or s-axes of the system, the second harmonic is essentially zero making a determination of the associated correction values impossible. In order to circumvent this problem, a dual speed motor controller was implemented and the correction for the second harmonic is measured by running the motor at half its nominal speed and measuring the fourth harmonic. The fourth harmonic will have the same frequency at the compensator frequency 63c/2 as the second harmonic at wc. Since the amplitude attenuation is dependent only on the frequency of the signal and not on the harmonic number, a2 can be measured directly in exactly the same way as a4 when the compensator is rotated at half speed. The phase shift of the data is caused by both the relative phase shift of the detector amplifier's constant delay filter and by the angular orientation of the shaft encoder's index pulse to the sample p-axis (the trigger phase). Both effects are dealt with separately. The trigger phase is corrected by shifting forward through the data array thereby adjusting the starting point of the Fourier analysis by an index offset value C_ Shift. However, this can only determine the phase to within one encoder increment pulse, equivalent to ± 3.00 in the fourth harmonic, and an analog phase correction  CP4  must be calculated from Eqn. 4.1 b by setting b4 = 0.  The analog phase correction of the second harmonic 02 is determined by  49  measuring 04 when the compensator is rotated at coj2. Then: 4)4 ( co c/ 2 ) 432 ( we) - ^ 2  (4.5)  when the compensator is rotated at nominal speed (6),). Examination of the fourth harmonic only determines the phase correction cp2 to within Tr. Examination of Eqn. 4.2a shows that a2 should be positive for a positive s parameter and P = 0 if the analyzer has been properly aligned (A = 0) and the phase properly adjusted. The sign of a2 can therefore be used to determine cp2 completely. However, since a2 depends upon A and P, its positive value is not guaranteed if the analyzer or polarizer is misaligned by more than ± 0.2°. As results will later show, however, the alignment precision is better than this. The calibration routine is then as follows. After the analyzer has been aligned to the p- and the polarizer to the s-axis, the relative amplitude attenuation of the photodetector is measured at the second and fourth harmonics by running the motor at full and at half speed respectively. Thereafter, the trigger phase of the shaft encoder is evaluated by calculating the phase of the fourth harmonic after shifting forward through the data one increment at a time. Once the phase has crossed through zero and a4 is positive, 04 is measured and stored along with the  C-Shift parameter. The motor is then run at half speed and cp2 is measured. In order to determine if the calibration has set the second harmonic in its proper quadrant, the operator is prompted to align the polarizer to the p-axis (P = 0). If  50  a2 is negative, cp 2 is increased by Tr. The C-Shift value as well as (a2, a4, 192, 04) are stored in an ASCII file 'Cal Data.dar for use in the measurement program EDA Meas.pas where;, b2, a4, b4 are corrected using Eqns. 4.1.  4.5 Compensator Alignment and Calibration  If the ellipsometer arms are connected together in a straight through (PCA) configuration with the transmission axis of the polarizer set at an angle ± 7r/2 to that of the analyzer, then linearly polarized light (E = 0) of azimuth O = A + Tr/2 is incident on the compensator producing a fourth harmonic variation in the detector signal. In this configuration, the sample parameters (74r, A) become Tr/4 and 0 respectively. The magnitudes of the harmonics (from Eqns. 4.2 and 4.3) then reduce to:  a2YaZ2 +^  b,  2,91/2cos2 (A-fl + 2 2 + qcos2 (A- P)  (4.6a)  - q 2 + qcos2 (A- P)  (4.6b)  , 2^ 2 ^2 (X 4 *Vaut4 ' 4 ^  Parallel alignment of the transmission axes of the analyzer and polarizer will generate linearly polarized light of azimuth 0 relative to the analyzer (A-P = 0) and result in a minimum in the magnitude of the fourth harmonic. The compensator q- and s-parameters can then be calculated from Eqns. 4.6 directly. The compensator r-parameter can be found from q, s and Eqns. 2.13: r = 1/1-s2- (q-1)2  51  (4.7)  The parameters q, r, s in the preceding equations are independent of the relative phases of the harmonics and can therefore be measured before any phase correction is made.  4.6 Checking Alignment and the Stokes Vector  There are several methods to check the quality of the alignment and calibration. The most obvious one is a subsequent measurement of the magnitude and phase of the second and fourth harmonics. A proper calibration will adjust the magnitude and phase correction terms to give a fourth order magnitude of one and a phase of zero when the analyzer is aligned to the p-axis and the polarizer to the s-axis. However, checking only that a4 = 1.0000 and b4 = 0.0000 when P = A + 90° is not a sufficient check of the proper alignment of either the analyzer or the polarizer since the calibration routine will adjust the phase and magnitude of these coefficients to these values regardless of the orientation of the optics. There is however an alternate method of verifying the proper calibration of all the relevant coefficients through a measurement of the first Stokes parameter S. Eqns. 2.11a-d show the relationship between the analyzer and polarizer angles and the Fourier coefficients. These coefficients are related to the Stokes parameters by Eqns. 2.14a-c. The measurement of the magnitude of the Stokes Vector (So) gives an indication of the accuracy of the alignment and calibration since misalignment of the analyzer or improper calibration results in an error in the  52  Stokes parameters and a value of So which differs from one and is a function of the polarizer angle.  4.7 Correction for the Vacuum Port Windows  The stress induced birefringence in the vacuum port windows will alter the value of the measured reflectivity by perturbing the polarization state of the incident and reflected light beams. This perturbation can be minimized by a judicious choice of glass material and by proper mounting (Fig. A4.1). The residual birefringence then results in only a small perturbation of the polarization state which can be handled by a first order correction of the reflectivity. An ideal window is represented in the Jones matrix formulism by a 2x2 identity matrix. The birefringence introduces a small perturbation into the matrix representation of the window T, which can be represented as: ai.2^ a 21^1+ 22  (4.8)  where the au are in general complex and have an absolute value much less than one. If the Jones matrix of the sample of reflectivity ps is given by:  S  ips  01  (4.9)  [0 1j  the optical system, whose reflectivity ps' is measured, can be considered to be comprised of the entrance window, the sample and the exit window: SI - Twout'S.Tifin  53  ^  (4.10)  ^  ^a  Multiplying the matrices and retaining only first order terms yields:  3^ / ••  [Ps ( 1 + an/ + aosi)  Psa112 4- "012  1+  474121+ Psa021  1  (4.11)  ai22+ a022  where the subscripts i and o distinguish between the input and the output window parameters respectively. The associated bilinear transform mapping the input polarization to the output is given by: (1-Fa122+a022).X.9ii^(aizi^Psa021)  XSio  (Psa112+a012)  •Xei  4-  Ps (1+  (4.12)  aill+ aoll)  where the input polarization xs,i is just that output from the polarizer: (4.13)  xsii TanP^  Solving Eqn. 4.12 for ps, expanding and retaining terms to first order results in a quadratic correction in terms of the measured reflectivity /35' (= Xs,/ X5'0): ^  Ps  -  a +  13.P's^Y'P's2  (4.14a)  where: ^ -  (4.14b)  -4012*Xsi  - 1  -  a111^a011^ei22^a022^  Y^aozz/Xsi and where a, p and  y  a121/Xsi (  ^  4.14c)  (4.14d)  are complex. If xsi is kept large (P^Tr/4), the quadratic  term can be neglected and Eqn. 4.14a becomes a first order correction of the 54  ^  sample reflectivity ps in terms of the measured reflectivity ps'.  4.8 Calibration of the Angle of Incidence  The angle of incidence of the laser to the sample 00 is not known from the mechanical drawings to the required accuracy of -± 0.05° if absolute ellipsometric measurements are to be made with the in-situ ellipsometer. This angle cannot, to the accuracy required, be measured directly and must therefore be calibrated. In order to calibrate this angle, a fresh silicon substrate, whose reflectivity as a function of angle of incidence is known, is mounted in the chamber. Since evacuation of the chamber will change the alignment of the ellipsometer arms, this measurement must be done under vacuum. Neglecting the effect of the windows for the moment, the relationship between the actual and the measured reflectivity is given (to first order) by: ^_st ^8Ps(00) .4603 Ps - Ns^  ao  (4.15)  where:^190 is the approximate angle of incidence of the in-situ ellipsometer. aps(00)/a0 is calculated from the sample model. Ae is the correction to the angle of incidence. The linear correction for the windows can be incorporated into the above expression and the resultant equation split into its real and imaginary parts to give:  55  Psr  (00) - az 4- Pr*Plsr - 131*Pisi +  Psi (00) - cci + P2 'Plsr - Pr*Pisi +  aPsz(°°) ae  •AO  aPs. (o0)  .A0  ae  where the subscripts r and i denote the real and imaginary parts respectively. If the samples are chosen such that the imaginary component of their reflectivity varies only weakly with the angle of incidence, then the differential term in Eqn. 4.16b can be set to zero. Three samples having different reflectivities can then be used to solve for the coefficients a,  p and AO in a system of equations  described by the matrix in Eqn. 4.17. The correction AO need be calculated only once and is used to calibrate the angle of incidence.  1 0 fYsir - A's.b. 0 1 P'sii Pir 1 0 rYs2r -Al22 0 1 P21 P's2r 1 0 P's3r — P's3.1  a P slr  ae 0  a P s2r  ae 0  a P s3r  ae  56  PsIr  az Pr  Psii XI.  Ps2r  Pi  P521  40_  P sir  (4. 1 7)  CHAPTER 5 INSTRUMENT PERFORMANCE  5.1 Introduction  The primary performance criteria for the in-situ ellipsometer are precision and measurement speed. Absolute accuracy is important when controlling an etch process end point w , but for the sputter deposition of single and multilayered structures, it is only necessary to measure the change in reflectivity the sample has undergone during the deposition process. If the ellipsometer has the required precision and sampling rate, the deposition thickness can be controlled to within tight tolerances. Equally important in this case are the tolerances on the linearity of the ellipsometer and its stability over time. This chapter describes the performance of the in-situ ellipsometer in terms of the above criteria. First, the effect of spurious harmonics on the precision of the Fourier coefficients is examined. Next, the alignment and calibration procedures are examined and an evaluation of their accuracy and repeatability is made. Finally, the precision and long term repeatability of the ellipsometric parameters Tan(*) and A are measured. The accuracy of the ellipsometer is influenced by the angle of incidence of the laser probe beam, the birefringence of the vacuum port windows, and alignment of the analyzer and polarizer. The first problem is examined by  57  analyzing the repeatability of the probe beam alignment; the latter two by a first order correction of the sample reflectivity. Finally, in order to verify the accuracy of the ellipsometer, samples of various thicknesses of silicon oxide on silicon are measured, corrected and compared to reference measurements made on a high precision, spectroscopic ellipsometer. 6  5.2 Speed, Precision and Accuracy  The sampling time depends naturally on the number of data cycles being averaged. (One data cycle is equivalent to one full rotation of the compensator and includes 512 data points.) For the present selection of gears, the compensator has a rotation period of 24 ms. The data cycle, Fourier analysis, and calculation of reflectivity requires 130 ms and represents the lowest sampling period possible with this device. To achieve a precision in thickness of better than one atomic layer (one monolayer), several data cycles must be averaged to filter out random noise, gear and 60 Hz induced harmonics (Eqns. 3.1). For the gear ratio used, averaging over nine data cycles will suppress any induced harmonics and, consequently, will increase the sample period to 1.2 seconds. In order to verify that the spurious harmonics have indeed been suppressed to an acceptable level, the analyzer was aligned to the sample p-axis and the polarizer to the s-axis. The magnitudes of the first six harmonics averaged over nine data cycles were measured and the results are shown in Table 5.1. The  58  magnitude of the second harmonic should ideally be zero and any non-zero value measured can be considered to be due to a parasitic harmonic. The magnitude of any parasitic fourth harmonic is considered to be of the same magnitude as the average of the third and fifth. Table 5.1: Magnitude of the first six parasitic harmonics of the rotation frequency.  Harmonic  1  2  3  4  5  6  Magnitude  0.0030  0.0014  0.0015  0.0016  0.0017  0.0002  A practical limit to the size of these harmonics would be 0.01. Offset errors of this magnitude introduced by parasitic components into the second and fourth harmonics can be handled by a first order correction of ps. The other parasitic harmonics, if they are larger than this limit, will in general have no effect on the measurement but may cast doubt on the reliability of the ellipsometric data. The precision of the reflectivity measurements is dependent upon the precision and repeatability of the alignment and calibration procedures. Repeated realignment of the analyzer and polarizer established that the aligned settings are repeatable to .± 0.05° which is the resolution limit of the vernier drum dials. The precision with which the amplitude and phase correction terms a and ci) (Eqns. 4.1) can be measured depends on the repeatability of the alignment and the long term stability of the compensator motor speed and detector electronics. All correction terms have been measured to a high degree of precision as shown in Table 5.2. The value of s;64 will vary depending on the orientation of the ellipsometer arms. The compensator defect parameters have been included here for completeness. 59  Table 5.2: Amplifier Correction Factors and Compensator Defect Parameters.  Parameter  Value  Error  a2  0.997  ± 0.001  a4  0.9826  ± 0.0003  02  -0.1260  ± 0.0002  04  04  ± 0.0005  a  1.140  ± 0.001  r  0.9901  ± 0.0005  s  0.0052  ± 0.0005  The accuracy of the alignment and calibration is determined by a measurement of the first Stokes parameter So. Solution of Eqns. 4.2 and 2.14 for a silicon substrate shows that a misalignment of the analyzer by ± 0.05° from the p-axis results in a deviation of So by 0.002 over the range of polarizer angles from 0 to 900. With proper alignment, So has been measured to be 1.0000 ± 0.0005 over the entire range of polarizer angles from 0 to 360° indicating near perfect alignment. Since the ellipsometer will be making measurements of a sample under vacuum, it is important to know the stability of the device under these conditions. The precision of the ellipsometer was measured with a silicon sample in the evacuated sputtering chamber. Several measurements, each one averaged over 16 data cycles, were made over a period of 30 seconds and from this the uncertainty was calculated to be ± 0.00005 in Tan(*) and ± 0.0004 in A. No drift in the measured values over a time period of 25 minutes was observed. Measurements of a silicon sample taken over several days were used to 60  evaluate their repeatability. Silicon was the sample of choice because the native oxide surface layer is relatively stable over time. After each measurement, the ellipsometer arms were remounted, the chamber evacuated and the alignment and calibration repeated. The repeatability of the reflectivity measurements was determined to be ± 0.0007 in Tan(*) and ± 0.0006 in A. The stress induced birefringence in the windows was found to be primarily due to stress introduced by the clamping of the windows on the vacuum port adapter (Fig. A4.1) and was found to vary by an order of magnitude depending on the clamping pressure used. In order to minimize the correction factor required to calibrate for the windows, the six clamping screws were tighten only until the 0-ring was fully compressed and glass to metal contact was made. The induced birefringence resulted in a change in Tan(*) of -0.004 and in A of 0.004. Evacuation of the chamber changes the value of the measured reflectivity due to two effects. One is the change in the stress birefringence in the windows due to the pressure difference across them. The second is the change in the angle of incidence due to flexing of the vacuum chamber walls. The observed change of 0.27° should correspond to a change in the measured reflectivity of Si of -0.007 in Tan(*) and 0.003 in A (as calculated from  apme from Table 5.3).  Measurements made on silicon showed a change in these parameters of -0.006 and 0.01 respectively indicating that the change was due almost entirely to the change in the angle of incidence and that the additional stress induced by the pressure on the port windows had little effect.  61  5.3 Measurement of Reflectivity Correction Factors  A clean silicon sample as well as four samples of silicon oxide of various thicknesses were prepared and measured on the reference ellipsometer. Based on an appropriate model, the reflectivity at 68.2° incidence for each sample was calculated. Three samples, silicon with a layer of native oxide, and two samples of silicon having a layer of sputter deposited silicon oxide were mounted in the sputtering chamber and measured under vacuum. The solution of Eqn. 4.17, after substitution of the appropriate values of ap, /ae derived from the models (Table 5.3), yields the correction coefficients (Table 5.4). Table 5.3: Values of  ap/ae for various sample reflectivities. aPr /30  api /ae  Sample S020: Silicon Substrate  0.0270  -0.0036  A of Si02 Sample S022: 847 .± 3 A of Si02  0.0293  -0.0028  0.0442  0.0016  Sample Type  Sample S021: 269 ± 2  Table 5.4: Reflectivity and Angle of Incidence Correction Coefficients  Coefficient  Value  a  -0.0082 -i 0.0146  ig  0.9267 -i 0.0141  AO  -0.0123  Two more samples of silicon oxide were measured and Eqn. 4.14a was used to correct the measured reflectivity of all five samples (after setting y = 0 for a first order correction). Results were compared to the reference measurements at the calibrated angle of 68.2123° and are summarized below. 62  Table 5.5: Comparison of Corrected RCE Values to the Reference  Measurements. SAMPLE S20:  Silicon Substrate  A Si02 S22: 847 ± 3 A SiO2 S024: 1837 ± 5 A Si02 2200 ± 6 A Si02 S23: S21:  269 -± 2  REFERENCE (at 68.2123°)  RCE VALUE  ERROR  -0.2369 -i 0.0252  -0.2341 -i 0.0243  0.0028 +i 0.0009  -0.1931 -i 0.2394  -0.1939 -i 0.2461  -0.0008 -i 0.0067  0.0290 -i 0.6770  0.0275 -i 0.6779  -0.0015 -i 0.0009  0.0505 +i 0.8357  0.0351 +i 0.8369  -0.0154 +i 0.0012  -0.0533 +i 0.4942  -0.0551 +1 0.4680  -0.0018 -i 0.0262  The samples are arranged in order of increasing oxide layer thickness. Since the silicon, the oxide sample S022 and the real part of the reflectivity of S023 were used to find the correction coefficients, their agreement with the reference measurements are expected to be quite good. As a check, the reflectivity of S021 was corrected and resulted in excellent agreement with the reference. Measurements of S023 and S024 made under vacuum changed with time, indicating that some amount of outgassing through the oxide was occurring and this may explain the relatively large error between the corrected and the reference data. A second explanation may be that any variation of deposition rates over the material surface becomes noticeable over the longer deposition times required for the thicker oxides. In terms of actual thickness values, a change in reflectivity of 10-3 is approximately equivalent to a change of one Angstrom in the oxide thickness. If an atomic layer is on the order of 4  A thick, the error associated with the thinner  oxide samples is less than -± 1 atomic layer. For the thicker oxides, this increases  63  to ± 3 atomic layers. Plots of the variation of  ijr and  A with oxide thickness are shown in Fig. 5.1  for both the modelled and the RCE data. The data points represented by circles denote the calculated reflectivity of a layer of Si02 on silicon. Points are plotted for 100 A increments in the oxide layer thickness. The open triangles denote the RCE data.  Fig. 5.1:^Graph showing the variation of Aftr with itir/IT for 100 the Si02 thickness.  64  A increments in  CHAPTER 6 CONCLUSION  The objectives that were stipulated in the introduction have been achieved. An in-situ, rotating compensator ellipsometer capable of making measurements in real time and achieving monolayer accuracy was developed. The rotating compensator configuration was chosen because it has several advantages over the simpler, rotating analyzer design: (1) improved accuracy when IcosA I approaches 1, (2) measurement of all of the Stokes parameters yielding an unambiguous determination of the polarization state, and (3) no errors due to a polarization sensitive detector. This thesis entailed the development of an in-situ ellipsometer from its conception, through assembly and integration of the optics, electronics and software, to final alignment, calibration and testing. The design of the RCE was based on a modular, cylindrical geometry where the various modules could be screwed together to implement various device configurations. The signal acquisition and processing algorithms developed reduced the effects of the laser instability, shaft encoder orbiting and gear induced parasitic harmonics. The software included routines for aligning and calibrating the instrument as well as a flexible measurement routine where the operator is prompted to enter the sample average, time interval between measurements, and the polarizer angle used.  65  The stress induced birefringence of the vacuum port windows could not be entirely eliminated even after careful assembly, and a first order correction to the measured reflectivity was required in order to achieve close agreement to the reference measurements. In addition, the angle of incidence of the ellipsometer mounted on the sputtering chamber could not be directly measured to the accuracy required. From measurements of three reference samples having known reflectivities, the angle of incidence as well as the coefficients for the first order correction were calculated. Several measurements of silicon oxide layers were corrected using these coefficients and compared to their reference values. Results were within a monolayer of their accepted values for all but the thicker oxides where spatial variation of the deposition rate and outgassing in the evacuated sputtering chamber may have contributed to the measurement error. The precision and accuracy of the RCE developed equals that achieved by other (not necessarily in-situ) instruments described in the literature. Reisinger" suggests that a realistic value of the absolute accuracy of measurements made on thin (<200 A) films of Si02 on Si is slightly above 1 A due primarily to errors in the sample model. Achievable levels of precision of such measurements are quoted to be 0.06  A with a long term reproducibilty of 0.5 A.  Recalling the results in  Section 5.2, the RCE developed here achieved a precision of ± 0.0004 in A, corresponding to a resolution in thickness of ± 0.07 reproducibilty of ± 0.1  A. 66  A  and a long term  REFERENCES 1^P.S. Hauge, Surf. Sci. 96, 1-3, p.108, (1980) in Selected Papers on Ellipsometry, (SPIE Optical Engineering Press, Bellingham, 1991), p.337. 2^R.M.A. Azzam and N.M. Bashara, Ellipsometry and Polarized Light, (North-Holland, Amsterdam, 1977). 3^K. Riedling, Ellipsometry for Industrial Applications, (Springer Verlag, New York, 1988). 4^R.M.A. Azzam, Ed., Selected Papers on Ellipsometty, (SPIE Optical Engineering Press, Bellingham, 1991). 5^E. Hecht and A. Zajac, Optics, (Addison-Wesley, 1976). 6^B.T. Sullivan, Spectroscopic Ellipsometry of Palladium Thin Films, PhD Thesis, (The University of British Columbia, 1987). 7^P.S. Hauge, Surf. Sci. 56, p.148, (1976). 8^P.S. Hauge and F.H. Dill, Optical Communications 14, 4, p.431, (1975). 9^Scientific Solutions Inc., LabPac Manual, Solon, Ohio (1985). 10^S.A. Henck, J. Vac. Sci. Technol. A 10, 4, p.934, (1992). 11^H. Reisinger, Solid-State Electronics, 35, 3, p.333, (1992).  67  APPENDIX A  CONSTRUCTION DRAWINGS AND CIRCUIT SCHEMATICS  68  ^  BASE PLATE - 3/8" STAINLESS STEEL  SAMPLE PLATE -  3/ 8" ALUM I N I UM  DIA 5/19, DIA 5/9 C.S. 1/4 DEEP (CS. FOR WASHER) 2.5^ 3 HOLES: LOCATION AS PEP BASE PLATE.  I.  5.5  DIA 3/4, 1/8 DEEP FROM OTHER SIDE 1/4-20, 5 HOLES  I NOTE; DIMENSIONS OF BASE PLATE AND SAMPLE PLATE ARE THE SAME.  EXPANDED VERTICAL SCALE  -  SECTION A- A  SCREW POSTS MAKE THREE  -STAINLESS STEEL  DIA 0.375 .0.000 -0.003  3/8-24, 4.0 LONG  ^TOLERANCES:  ^z 1- typ washer 4.0  welded on as handle  6.3 POLISH SHAFT FOR SMOOTH., SLIDING  .XXX^+/ - 0.005 .XX = +/ - 0.01 drill and tap 10-24 hole .X = +/- 0.1 approx. 1/2" deep In end X/Y^TYP. (UNLESS OTHERWISE STATED)  WASHERS C8X)  ADJUSTABLE TABLE FOR SAMPLE  0.0. 0.50 I.D. 0.20 THICKNESS = 0.07 July 26, 1993^A. KLEINSCHMIDT  FIT IN PART: MICFEED.DWG FILE: SAMBSE_T.DWG  WIDTH (3.324) AND R (1.562)  SECTION A-A  TO FIT INSIDE OD 3 1/2" ALUMINIUM TUBE 1/4  DIA 5/8, 0.4 DEEP  6-32, 112" DEEP  B HOLES AS PER DETAIL.  R = 1.6E2, BOTH ENDS  3.324  8-32 ON 1.50 B.O.  3 HOLES EVENLY SPACED.  DIA 0.40, 3 POSTS  DETAIL SHOWING  POSITIONS OF B-32 HOLES  4. A 1/4  TOLERANCES: .XXX = ./- 0.005 .XX^+/- 0.02 .X = •/- 0.05 X/Y = TYP. (UNLESS OTHERWISE STATED)  REQUIRE -I PIECE ALUM IN I UM  STEERING MIRROR MOUNT APRIL 5, 1993^A. KLEINSCHMIDT FILE: LASHO2_T.DWG  TOP COVER  3 1/2" 0.D., 3.32 I.D. ALUMINIUM TUBE CUT IN HALF CS FOR 8-32 FLAT HEAD 2 HOLES DIA 3/8 SEMICIRCULAR  4.06  BOTTOM COVER  - 1.95  0.20  //1S 75.0  31/2 0.D., 3.32 I.D. ALUMINIUM TUBE CUT IN HALF CS FOR 6-32 FLAT HEAD 13 HOLES  30  TOLERANCES: .XXX =^0.005 .Xx =^0.02  QUANTITY = 1 OF EACH  LASER MOUNT COVERS  .X^.1- 0.1  X/Y TYP. CUNLES5 OTHERWISE STATED)  APRIL 5, 1993^A. KLEINSCHMIDT FILE: LASCVl_T.DWG  A A -  0.313 4-40, 3/8 DEEP 2 HOLES ON 1.811 B.C. CHOLE5 REQUIRED IN ONE PIECE ONLY)  - 3/B  PRESS FIT TO BEARINGS TYPE: ABS-A1-84  1" DRILL^--^DIA 1.1250^DIA 3.3200  Li ^  75.0^90.0 CA)  B-32, 1/2 DEEP 4 HOLES  A  TEILINIANCR5! .XXXX^0.0005  .XXX +1- 0.005  .xx^0.01 .X^0.1 WY TYP.  CENTER BEARING PRECISELY IN 00 3 1/2/^ ALUMINIUM TUBE  BULKHEADS REQUIRE 5 PIECES (ALUMINIUM)^POLARIZER  FOR ROTATING COMPENSATOR AND ANALYZER  (LNLE*3 OTHERWISE STATED)  APRIL 2, 1993^ A. KLEINSCHMIDT FILE: CMPHDl_T.DWG  WORM GEAR BULKHEAD FOR ROLARIZER  0.67 0.484 .■••• SLIDING FIT TO WORM tKCS—A4-3 A4-  FOR 6-32 SET SCREW  SECTION A — A  DIA 0.250, FOR SLIDING FIT TO SHAFT FOR WORM GEAR. SEE NOTE.  1.188  WA 2 1/8 75.0  NOTE; MAKE WORM SHAFT FOR KCS—A4-3 WORM. MI"T '32.a LONG SEE AL KLEINSCHMIDT OR GLENN CLARK FOR WORM.  DIA 3.32, TO FIT INTO OD 3 112", ID 3.32 TYR ALUMINIUM TUBE 8-32, 1/2 DEEP 3 HOLES  0.50  VERNIER DRUM DIAL MOUNT  4-40, 2 HOLES  SECTION 9-B 0.25  3/18 SLOT WIDTH = 318 R = 3/16 75.0^Br:  L  DIA 3.32 TO FIT INTO 00 3 112, ID. 3.32 TYR. ALUMINIUM TUBE e-32, 1/2 DEEP 3 HOLES  T0LEPANCE3: .XXx^0.005 .xx^.t- 0.01 .x^0.05 TYP. (UNLESS OTHERWISE STATED)  REQUIRE 2 OF EACH ALUMINIUM  V4 1/ 8  WORM GEAR BULKHEAD AND DRUM DIAL MOUNT FOR POLARIZER APRIL 3, 1993  FILE: POLHEll_T.DWG  A. KLEINSCHMIOT  ^ ^ ^  3/9 DRILLED FROM TOP  3/6 DRILLED FROM SIDE  CS. FOR 8-32 FLAT HEAD 2 HOLES 0.67  TOP HALF  2  0. 6  1  4  o  0.6  2.62^ 2.40^  S. FOR 8-32 FLAT HEAD 10 HOLES  BOTTOM HALF  7.0  ^TOLERANCES:  .XK(^0.005 .XX^0.02  [UNLESS OTHERWISE STATED]  3 1/2" ALUMINIUM TUBE CUT IN HALF (WALL THICKNESS APPROX. 0.09)  QUANTITY - 1 PIECE  HOUSING FOR ANALYZER APRIL 5, 1993^A. KLEINSCHMIDT FILE: POLCV2_T.DWG  A  ^  WINDOW DIMENSIONS ARE: 01A 1.00 +/- 0.01 THICKNESS = 0.20 +/- 0.01  A  -  FLANGE DIMENSIONS ARE FOR AN NW 25 ISO-KF FLANGE  6-32, 1/2 DEEP 6 HOLES ON 1.32 B.C.  0' -15, 1.5 LONG TOL^.0.00/ -0.0  EQUALLY SPACED 15.0  7-CLEAR FOR 6-32, 7 6 HOLES ON 1.32 B.C.  - _  /  DIA 1.0 .0.0  A  EQUALLY SPACED  A/6^Ad  DIA 1.7 DIA 0.3 --  -  AdOr^ FOR 207 0-RING^I . D. = 0.546 +0 . 005^// / - 0.000 0.17.^0.916 +0.005 - 0.005 DEPTH = 0.106 +0.003 - 0.003  TOL ERAWE3^.X>O<^- 0.005 .)CK^- 0.01 . X^.7- 0.05  X/Y  -  QUANTITY - 2  STAINLESS STEEL  1/2 DRILL^0.89  1.03^1.57  Ail  0.12  5.0 7.5  NW 25 I SO- KF WINDOW PORT  'rye.  C UNL EMS OTHERS'? ISO 3TATEO)  1  0.1  MARCH 31, 1993^A. KLEINSCHMIDT FILE: PORT_T.DWG  TO LERkNGES^)0C(^- D.000 . >DC^41- 0.01 .^v./ - DOS  QUANTITY - 2  ALUMINIUM  LOCKING NUT FOR WINDOW PORT  X/Y TYP C UNI- 000 °THEM' I 30 STATED)  MARCH 31, 1993^ FILE: PNUT_T.DWG  A. KLEINSCHMIDT  COMPENSATOR BULKHEAD  REDUCTION GEARS MOTOR MOUNT  COMPENSATOR DRUM ASSEMBLY BULKHEAD SHAFT EN CODER  BULKHEAD - MALE  BULKHEAD FEMALE  MOTOR  SET SCREW  COMPENSATOR COVER (BOTTOM) COMPENSATOR COVER CBACK)  APERTURE SOCKET CLEFT)  COMPENSATOR ASSEMBLY  NOTE: REQUIRES BEARINGS AND GEARS AS DETAILED ON DRAWINGS FOR PRECISION FITTING  MAY 27, 1993^A. KLEINSCHMIDT FILE: COMPAS_T.DWG  TOLEPANCES: .XXX^0.005 .XX = +/ - 0.01 .X^+/-  0.05  X/Y^TYP.  (UNLESS OTHERWISE STATED)  QUANTITY = 1 BLACK NYLON OR SIMILAR  HOLDER FOR COMPENSATOR AND THREADED INSERT JUNE 4, 1992^A. KLEINSCHMIDT PILE: CHOLD_T.DWG  .XXXX = +/- 0.0005 TOLERANCES: .XXX .1- 0.005 .XX =^- 0.02 .X^0.05 XrY = TYP. (UNLESS OTHERWISE STATED)  REQUIRE 1 OF EACH BLACK NYLON OR SIMILAR  COMPENSATOR DRUM ASSEMBLY APRIL 5, 1993^A. KLEINSCHMIDT FILE: CDRUM_T.DWG  .XXXX ■ +/- 0.0005 TOLERANCES: .XXX ■ - 0.005 .XX^4./- 0.02 .1- 0.05 XlY = TYR. (UNLESS OTHERWISE STATED)  REQUIRE 4 ALUMINIUM  GEAR BUSHING APRIL 5, 1993^A. KLEINSCHMIDT FILE:CBUSH_T.DWG  ^  ^TOLERANCE3.  SECTION B-B 0.70CENTER BEARING PRECISELY IN OD. 3 1/2- ALUMINIUM TUIBE  0.35 -. 0.17  105.0  105.0  1.00 0 3.3200  1- DRILL  8-32, 1/2 DEEP 0.313  8 HOLES  SET IN MIDDLE OF EDGE  D 1.125 PRESS FIT TO BEARING TYPE: ABS-A1-81  .XXXX ^0.0005 .xxX -^5.005  REQUIRE 1 PIECE CALUMINIUM)  BULKHEAD FOR ROTAT I NG COMPENSATOR APRIL 2, 1993 FILE: CMPHD3_T.DWG  A. KLEINSCHMIDT  REQU I RE "I PIECE (ALUM I N I UM)  TOLERANCES:  .XXX = ,/- 0.005  MALE THREADED BULKHEAD FOR COMPENSATOR  .XX = 4-1- 0.01 .X = ,/- 0.1  APRIL 2, 1993^  X/Y = TYP. (UNLESS OTHERWISE STATED)  FILE: BLKHDl_T.DWG  A. KLEINSCHMIDT  IULCKAM,.;  ,I.....^........ .xx - ..,t-^0.01 .x =^,./- 0.05  REQUIRE 1 PIECE (ALUMINIUM)  i^^^ =  X/T am TYP.  CUNLESS OTHERWISE STATED)  I  APRIL 2, 1993^A. KLEINSCHMIDT FILE: CMPI-1172_TADWG  TOLERANCES. .X>O< = •/- 0.005 XX = +/- 0.0-1 .X = +1- 0.05 X/Y = TYR. (UNLESS OTHERWISE STATED)  REQUIRE 1 OF EACH (ALUMINIUMD MOUNTED ONTO MOTOR MOUNT  APERTURE FOR COMPENSATOR APRIL 2, 1993^A. KLEINSCHMIDT FILE: APERTC_T.DWG  ^ ^  600.5 1/2" ALUMINIUM TUBE WALL THICKNESS APPROX. 1/8" TUBE CUT IN HALF  FRONT COVER  0.96 DIA 3/9  FOR ACCESS TO APERTURE ROD  BORED VERTICALLY (INTO PLANE OF PAPER) 5.6 1/4 1.23 0.1875.0  E0 0  BACK COVER 5 1/2" ALUMINIUM TUBE WALL THICKNESS APPROX. 1/8" TUBE CUT IN HALF  75.0 CS FOR 8-32 9 HOLES IN SACK COVER  2 HOLES IN FRONT COVER  TOLERANCES .XXX . 41— 0.005 .XX =^0.02 =^0.1 XeY TYP. [UNLESS OTHERWISE STATED)  QUANTITY^"I OF EACH  COMPENSATOR COVER - FRONT & BACK  - FROM OD. 5 1/2" ALUMINIUM TUBE APRIL 2, 1993^ FILE: OMPCV2_T.DWG  A. KLEINSCHMIDT  TOLERANCES: .XXX = +1- 0.005 .XX = +/- 0.02 .X = +/- 0.1 X/Y = TYP. (UNLESS OTHERWISE STATED)  ONE OF EACH  COMPENSATOR COVER — TOP ge BOTTOM  ALUM I N I UM APRIL 2, 1993^ FILE: CMPCVl_T.DWG  A. KLEINSCHMIDT  TOLERANCES: .XXX ■^0.005  .XX = +/- 0.02  QUANTITY^1 OF EACH  DETECTOR HOUSING  .X ■ +/- 0.1  X/Y = TYR. (UNLESS OTHERWISE STATED)  APRIL 6, 1993^A. KLEINSCHMIDT FILE: DETCV_T.DWG  TOLERANCES: .XXX A,- 0.005 .XX^+/- 0.01  QUANTITY = "I OF EACH  THREADED BULKHEAD FOR DETECTOR  .X^./- 0.05  X/Y ■ TYP. (UNLESS OTHERWISE STATED)  APRIL 6, 1993 FILE: DETHD_T.DWG  A. KLEINSCHMIDT  P I NS 4a - 29a ARE SIGNAL CND.  ELL I PSOMETER BUS MARCH 30, 1993^ A. KLEINSCHMIDT FILE; EBUS_T.DWG  CO L  By •B!A  -a 0 01  41 V 2227  "^  Lama nem  GAIN SELECT  6l III  2000  6.2  022 KOO  161,  r, A31*  as'As  a CO,  14I5  16^C1/1  A4  6.4  044,  CIO  G. 6.8  IS48  1008  4114  Two polo nor^490A0 Ho • .1.0 170.1.918 • 2032 Hz  Two polo liktd Ho • .2.0 I/O .1.241 b. 115$ H2  C.  ET:  is• OUTPUT  DI  Time Response:^Foul WO Besse! B.244at phase) DeIay To . 466 uSoc F 348 • 720 Hz UR: 41.14  UBC PHYSICS - LAB PHOTOOETECTOR AMPLFIER oKIT I^I I 920231.SCH  72 -I R35 1-  I 4 R26 1- -{ R29 F c9  I C1  COMD INPUT o -{ RI  F  ^  CM  U1  U2 (  0^0  U4  U3  -1  .■•■•  ••■■•■  •74-C -{ R3 4-  3  1 DA 1 -{ R4 1-  -{ R25 1-{ R24 F  LIII  -1 R28 F -{ R27 1-  -1 R31 1-{ R30 1-  -1 R34 11,133  -  ^  CM  N./  v4t-  -1 R23 F -{ R22 1-  •■••■■  -1 P154-  obUTPUT o COM oJ1-2 @@oJ1-1 o.11-6 Cs  -L  0-)  -I R9 F  4 R14 1-{ R13 1-  L1) 1.11  tiLl  -( R18 1-  LIU  LIFI  Uri  -{ Fin 1-  VR1  UBC PHYSICS - ELECTRONICS LAB DESIGN BY: TITLE:  T. Felton  DRAWN BY:  PHOTODETECTOR AMPLIFIER REFERENCE DESIGNATOR  T. Felton DRAWING NO:  920231 .PCB  7632  "^OnoCtot Leg  741ICT02  7.000  U20  v  070  ^CD ct o st ote  7.1.C102  01106132  LI5A  • 3.1  t  7.10702  V.W  4+35  74KTO2  11".1112° 24“CTI32 — Ca vt  •  7.C102  v 7  74mCln3 7..01123  1011 0346^40?^05,1  I CI inI CI ;., c;.7  UBC PHYSICS - ELECTRONICS LAB om 02/7/2^Ismettr 1^ot 2 tam  BISTABLE SHUTTER CONTROL  620 •5V  4c7 +— C4 —46. I.331,04r^0.00 350  V V +30Y DC  470 03  04  110127  TO127  114 363  >>  J1-101  OPC)011  III CLOSED'S  02 000442  *13^  470  06 110122  05 TIP;,, 470  UBC PHYSICS - ELECTRONICS LAB ROTC: 12/7/10 TITLES  I smcm 2^Or 2  B1STABLE SHUTTER CONTROL  %CV  •■■■•  93  1  Fig. Al2.4: Bistable shutter controller - circuit board layout.  113  (12  111  soot  31107  3 .3573.83  02 ^NW—  Ul U2  n)  HOE  .L--Us0•ZI.. -1  U1  tOtort  01  03  VIA  OTAL-OSC  ZU 2,  cUt  CT) 0  VII cut —17 A  U7C  0  7411C4010  CD40533  CLOt011  as,  _IL_  1131^  119  Roc3,0  U7A  .38  ni  R25 1073  R20  / rzat44  0 A22'  CD  —1—CI RIO^---vOII 3732 Poly  330K 423  CD  330  ON/OFF 0  07 2R •  02^ R234 •3 8  (r) 0  012 38112 KIS  -  —s  D0  U(O  Qr0 "  024 100  30Hz/60Hz  ^—L  ^0 o^1.71011 0040538 . 017  (5  (t<  C0408311 U78  74 ocTI 1  7ANcl,  330  RS  Ds  115TV.12-  cLssg;  3  ÷-  ; -----__41.---v032 W.-Poly  g4  U4A  CI4 , 1E-0  I^moo CI  ow.? 00/1808  3OOK "rem ston  029  • 5ot  IRS  3 si)  Cl?^C S^CIS^037^CII^CIS vl^ul^vl  C3  CAPACITOR ^0 ROOT ovorr fOXMOM  ^0 torvoR  - 418110  PIM  UBC PHYSICS — ELECTRONICS LAB  034  dm,  IRS w -sr  13-01-03^ I onto t^OP  60Hz MOTOR DRIVE GENERATOR  Digital  DiOlt0.1  Dlgltgl  r.,s0  0 cm-5.3  (40- ON)  ADC TRIG.  10 INTERFACE  DETECTOR  FUSE : 2 Arrp  INTERFACE  ENCODER INTERFACE  Olfgtlal  3- ENG  n°  MOTOR  SHUTTER  03NTROL  CONTROL  0  ANALOG  SPEED  IN  OUT  OA I N  ONIALT  SELECT  ENCCOlift  -de  J10 CPU  FOYER  J CPU  ANALCG OJT  ANALOG OUT  ARTWORK FOR CARD CAGE  MARCH 91, 1993 FILE: ARTWORK.DWG  OUT  SKITTER OUT  A. KLEINSCHMIDT  APPENDIX B COMPONENT SPECIFICATIONS  Bl: Glan-Thompson polarizer.  B2:  Quartz port windows.  B3:  Compensator.  B4:  Labmaster data acquisition board.  B5:  Photodetector amplifier: gain selection.  B6:  Photodiode.  B7:  Shaft encoder.  B8:  Shutter.  B9:  A.C. synchronous hysteresis motor.  117  TABLE Bl: Glan-Thompson Polarizer.  Source:^Karl Lambrecht Corp. 4204 N. Lincoln Ave., Chicago, III., 60618 613-472-5442 Part Number:^MGT 3E8-BB Price:^$715.- U.S. Description:^High quality polarizer made from Schlieren-free material having an extinction ratio of 10-6 and a transmission of over 95% in the visible range. A broad band anti-reflectivity coating of Magnesium Fluoride applied to both surfaces reduces reflection losses to 4% in the spectral range of 400 - 1000 nm. Dimensions are 0.750 x 1.125" with a clear aperture of 0.35".  Table B2: Quartz Port Windows.  Source:^Karl Lambrecht Corp. Part Number:^BK7 Glass Window Cost:^$185.- U.S. Description:^Glass Window made of BK7 Quartz exhibiting very low residual stress birefringence. A broad band anti-reflectivity coating applied to both surfaces gives less than 4% reflection losses in the spectral range 400 - 1000 nm. Dimensions are 25.4 mm (Diameter) x 5.0 mm. thick.  118  Table B3: Compensator.  Source:^Karl Lambrecht Corp. Part Number:^WPUM4 - 25 - BB Cost:^$265.- U.S. Description:^Mica quarter-wave plate giving a quarter wave retardation at the HeNe wavelength of 632 nm with a broad band anti-reflectivity coating applied to both surfaces to reduce reflection losses to less than 4% in the spectral range of 400 - 1000 nm. Mounted dimensions are 1.5" (Diameter) x 0.375" thick. Table B4: Labmaster Data Acquisition Board.  Source:^Scientific Solutions Ltd. 6225 Cochran Road, Solon, Ohio, 44139 (216) 349-4030 Part Number:^811986 Cost:^$1600.Description:^- 12 bit ADC external to computer. - ND sampling to 40 kHz. - DMA capability. - Software programmable gain. - 24 lines of configurable, digital I/O. - Five high speed, 16 bit counter/timers. - Hardware interrupts from multiple sources.  119  Table B5: Photodetector Amplifier Gain Selection GAIN  GS3  GS2  GS1  GS0  1  0  0  0  0  1.19  0  0  0  1  1.41  0  0  1  0  1.68  0  0  1  1  2  0  1  0  0  2.38  0  1  0  1  2.82  0  1  1  0  3.36  0  1  1  1  4  1  0  0  0  4.76  1  0  0  1  5.64  1  0  1  0  6.72  1  0  1  1  8  1  1  0  0  9.52  1  1  0  1  11.28  1  1  1  0  13.44  1  1  1  1  120  Table B6: Photodiode.  Source:^Hamamatsu Corp. 2444 Moorpark Ave., Suite 312, San Jose, Calif., 951 28 408-292-8603 Part Number:^S2386 - 44K Cost:^$13.81 U.S. Description:^Photodiode sensitive in the spectral range 320 - 1100 nm having a spectral sensitivity of 0.43 NW at the HeNe wavelength of 632 nm and a NEP (Noise Equivalent Power) of 1.8 x 10-15 W/Hz1/2. Housed in a TO-5 case.  Table B7: Shaft Encoder.  Source:^Hamilton Avnet Inc. Part Number:^Hewlett Packard HEDS-6010 J09 Cost:^$120.Description:^Three channel 1024 increment shaft encoder. The two incremental channels are in quadrature.^The third channel is an index pulse.  Table B8: Bistable Shutter.  Source:^Newport Instruments Canada Corp. 2650 Meadowvale Blvd., Unit 3, Mississauga, Ont., L5N 6M5, (416) 567-0390 Part Number:^846 HP Cost:^$438.Description:^Bistable shutter requires a positive 5 - 30 V pulse to open, a negative pulse to close. Transition times depend on the pulse voltage ( 3ms at 30 V). Input resistance is 13 Ohms.  121  Table B9: A.C. Synchronous Motor.  Source:^TRW Globe Motors Inc. Dayton, Ohio Part Number:^139A252 Cost:^$200.- U.S. Description:^An A.C. synchronous, hysteresis motor delivering 2 oz.• in. of torque at 1,800 rpm. Requires 115 VAC, 60Hz, 40 Watts. Requires a 2 RF phasing capacitor.  122  APPENDIX C SOFTWARE SOURCE CODE  Source Code:^LabHead.btp^Page:^124  LabMast.pas^125 EDA Gath.pas^131 EDA_Dsp. pas^140 EDA_FFT.pas^154 EDA_Dis.pas^158 EDA_Alig n. pas^164 Ang_Fit.c^  171  EDA_Set. pas^173 EDA Meas.pas^179 EDA_Coef. pas^183 EDA_Bug . pas^185 Shutter. pas^ 188 ADCrun. pas^ 189 Tables:^Cl: Storage of DMA data^191  C2:  Storage of Fourier Data^192  C3:  Error Messages^193  123  (**************************** ** ******************************* ** ************************ * LabHead.btp * * Turbo-Pascal header file for LabPac 3.02  *** ********************** ************ ********************** ************ ***************1 const RESET=6400; INTCLR=6401; INTSET=6402; BCD=6403; BIN =6404; AIINIT=6405; DINIT=6406; AOINIT=6407; SWINIT=6408; TIINIT=6409; AIRAW=6410; DIRAW=6411; AORAW=6412;^DORAW=6413;^TIRAW=6414; AIMAX=6415; DIMAX=6416; AOMAX=6417; DOMAX=6418; ^TILH=6419; AISWST=6420;^DISWST=6421;^AOSWST=6422;^DOSWST=6423; TIST=6424; AISTAT=6425; DISTAT=6426; AOSTAT=6427; ^DOSTAT=6428;^TISTAT=6429; AISWAB=6430;^DISWAB=6431;^AOSWAB=6432;^DOSWAB=6433; TIAB=6434; LCREATE=6435;^LOPEN=6436; LREAD=6437; LWRITE=6438;^LCLOSE=6439; AIHDW=6440; DIHDW=6441; DOHDW=6442;^DOCLR=6443; DOSET=6444; AISC=6445; DISC=6446; AORSWST=6447; ^DORSWST=6448;^AIDMA=6449; DMASTAT=6450;^TIHDW=6451; BINRD=6452; BINWR=6453; ALLOC=6454; SCRAW=6459; ACCESS=6455;^FREE=6456; AIFLUSH=6457; ^ AIRSWST=6460;^DIRSWST=6461;^SETTIME=6462;^GETTIME=6463; SETALARM=6464; AIGAIN=6465; LABPAC=$66; MAX_Al =256; MAX_DI =15; MAX_A0=32; PARAM=$8001;^RANGE=$8002; F1LERR=$8005; DMAERR=$8006;^T1MERR=$8007;  MAX_DO=15; MAX_TI=12; OVERRUN=$8003;^TABLE=$8004; EMMERR=$8008;  {$ifdef MASTER} DTOA=$710; ATOD=$714; TIMER =$718; {$endif}  P10=$71 F;  {$ifdef TENDER} DTOA=$334; ATOD=$330; TIMER =$338; {$endif}  P10=$33F;  {$ifdef DAD10} DA= $730;^DIO=$73B; {Sena} {Sifdef BB} $BB0=210;^$BB1=214;^$BB2=218; {$endif}  $BB3=21C;  124  f********** ***** ************ ****** *********** ****** ************ ***** ************ ***** *** * FILE: LabMast.pas^ * * LABMASTERCONTROLLER : A unit which accesses the Labpac software ^* * controlling the LabMaster board^ * **#######################################################** ^ * * AUTHOR^: Norman Osborne/ Al Kleinschmidt ^ * * WRITTEN^: 12/FEB/90 ^ * * Update^: 15/Nov/91 ^ * * Last Update : 23/Jan/93  **** ****** ********* ****** ********* ****** ********* ****** ******** ****** ********* ****** ****1 unit LabMast; INTERFACE CONST Ai_Chan_Max = 15; { actual numbers are +1 because arrays start at zero } Ao_Chan_Max = 9; { actual numbers are +1 because arrays start at zero } { error messages } LPC_ERRILLEGAL_CHANNEL = -1000; LPC_BAD_PARAMETERS = -1001; { some equipment name constants } LPC_BYTE_A = 0; { Bytes A & B are output bytes } LPC_BYTE_B = 1; LPC _ BYTE _C = 0; { Byte C is an input byte } TYPE BIT_TYPE = 0..7; Data_Ptr = "AIDMAData; AIDMA_Data = Array[0 _10000] of integer; FUNCTION LPC_GainSet(Ch_Num,Gain_Num: integer): integer; FUNCTION LPC_DMA Jun(Store_Data:Data_Ptr; Sample_num:integer) : integer; FUNCTION LPC_TI_CountTo( TimerChannel,Count,Source:integer) : integer; FUNCTION LPC_TI_Special(TimerChannel, Count, ModelongInt) : integer; IMPLEMENTATION USES dos,CRT; {$define MASTER} {$i cAlabpac\labhead.btp} CONST LabPac_Timer_Interrupt =1; LabPac_Timer =2; TYPE IntegerType = integer; IntegerP = "IntegerType;  125  VAR AL Channel : array [0..Ai_Chan_Max] of integer; AL Input : array [0..Ai_Chan_Max] of integer; Ao_Channel : array [0..Ao_Chan_Max] of integer; Ao_Output : array [0..Ao_Chan_Max] of integer; Digital_Port_A : Byte; Digital_Port_B : Byte; Digital_Port_C : Byte; SystemType : Byte; ErrCode : Integer; ExitOld^: pointer; Gain^: array [0 _15] of integer; f**************************************************************************************** * LabPacInit : initialize the LabPac software **########################################################** * Global : Gain ****************************************************************************************1 PROCEDURE LabPacInit; { initialize various sections of the LabPac software } VAR Regs^: Registers; Channel,i : integer; BEGIN {RESET LabPac} Regs.ax := RESET;^{ see labpac manual pg8-17 for details} intr(LABPAC,Regs); {initialize gain array} FOR i := 0 to 15 DO Gain[i] := 3; {initialize Labpac analog input} Regs.ax := AIINIT;^{ defined in labhead.pas} Regs.bx := ATOD;^{ defined in tender.pas } Regs.cx := 16;^{ for lab tender board see labpac manual pg 8-5} Regs.dx := 1; Regs.ds := Seg(Gain[0]);^{Set up gain array segment and offset addresss} Regs.si := Ofs(Gain[0]);^{Note the lab tender board cannot use this} intr(LABPAC,Regs); {initialize Labpac analog output} Regs.ax := AOINIT;^{ defined in labhead.pas} Regs.bx := DTOA;^{ defined in tender.pas } Regs.cx := 16;^{ for labmaster board} intr(LABPAC,Regs); {initialize Labpac digital output). { defined in labhead.pas} Regs.ax := DINIT; { defined in tender.pas } Regs.bx := PIO; { for lab master board see labpac manual pg 10-64} Regs.cx := 9; { port a=strobed in, port b = out,port c = out ==> 9 intr(LABPAC,Regs); {initialize Labpac Timer} { defined in labhead.pas} Regs.ax := TIINIT; { defined in tender.pas } Regs.bx := TIMER; { for lab tender board see labpac manual pg 8-13)-  126  intr(LABPAC,Regs); {initialize Channel Arrays for Labpac} { these arrays allow labpac to redirect which channel it is currently looking at (eg Chn 1 go be assigned to look at physical channel 5 Ao_Channel[1] := 5) I am not using any redirection but just assigning a linear sequence of numbers} (*FOR Channel := 0 TO Ao_Chan_Max DO Begin Ao_Channel[Channel] := Channel; Ao_Output [Channel] := 0; {this probably should be a read file of default values} End; { Warning There is a bug in the labpac software which remaps the physical Channels into the array wrongly ie Physical Channel 1 goes into array position 0, 2 to 1, 3 to 2, etc, finally 0 to Ao_Chan_Max. The read function that LPC provides unmaps the channels but only for this software version Labpac Software #3.01 and if the following initialization is followed -- so be careful if you change anything Further experience indicates the bug disappears if the computer is run in run turbo mode some how the faster bus speed seems to correct bug?} FOR Channel := 0 TO Ai_Chan_Max DO Ai_Channel[Channel] := Channel;*) Digital_Port_A := 170; Digital_Port_B := 85; END; f**************************************************************************************** * LabPacStop : reset and stop the LabPac software and hardware * ****************************************************************************************1 PROCEDURE LabPacStop; { shutdown LabPac } VAR Regs : Registers; BEGIN {stop interrupt sweeps} Regs.ax := SWINIT; Regs.bx := LabPac_Timer_Interrupt; Regs.cx := 1;^{ disengage interrupts } intr(LABPAC,Regs); {RESET LabPac} Regs.ax := RESET;^{ see labpac manual pg8-17 for details} intr(LABPAC,Regs); END;  127  {**************************************************************************************** * * LPC GainSet : set the LabPac gain ^ *******—*********************************************************************************} FUNCTION LPC_GainSet(Ch_Num,Gain_Num: integer): integer; VAR Rags: Registers; BEGIN IF (Gain_Num <= 3) AND (Gain_Num >= 0) THEN BEGIN Regs.ax := AIGAIN; Regs.bx := Ch_Num;^{channel whose gain is to be set} Regs.cx := 128+Gain_Num;^{Gain to set channel} intr(LABPAC,regs); LPC_GainSet := Regs.ax; END ELSE LPC_GainSet := LPC_BAD_PARAMETERS; END;  {** *** ******* *** ******* *** ******* *** ******* *** ******* *** ******* *** ******* *** ****** *** *** * LPC _ DMA run : read ADC and input via DMA to array in memory. ************—****************************************************************************} FUNCTION LPC_Dma_run(Store_Data:Data_Ptr; Sample_Num:integer) : integer; VAR Regs : Registers; BEGIN IF (Sample_Num <= 10000) THEN begin Regs.ax := AIDMA; Regs.bx := 0; {first channel to be read} Regs.cx := Sample_Num; {number of times to sweep channels} Regs.dx := 1; {number of channels to be read} Regs.ds := Seg(Store_Data^ [0]) , {pointer to starting address for data} Regs.si := Ofs(Store_Data ^ [0]); intr(LABPAC,regs); LPC_Dma_run := Regs.ax; {Returns error code after completion} end ELSE LPC Dma run := LPC BAD PARAMETERS; END;  -  -  -  _  128  f**************************************************************************************** * LPC TI CountTo : Starts a timer in count mode ^  *  **********-******************************************************************************1 FUNCTION LPC_ TI _CountTo(TimerChannel,Count,Source:integer) : integer; VAR Regs : REGISTERS; BEGIN IF (( TimerChannel >= 0 )AND ( TimerChannel <= 6) AND ( Source >= 0) AND ( Source <= 239) ) THEN Begin Regs.ax := TIST; ^ Regs.bx := TimerChannel; {Timer to be programmed} ^ Regs.cx := Source; {Source of timer clock pulses} ^ Regs.dx := Count; {Number of pulses before counter toggles} intr(LABPAC,Regs); LPC_TI_CountTo := Regs.ax;^{Error code returned} End ELSE LPC_TI_CountTo := LPC _ BAD _PARAMETERS; END;  f*************************************************************************************** * LPC TI Special : Starts a timer in a special hardware mode * *******-***-*****************************************************************************1 FUNCTION LPC_TI_Special(TimerChannel,Count,Mode:LongInt): integer; VAR Regs : REGISTERS; BEGIN IF (( TimerChannel >= 0 )AND ( TimerChannel <= 6) )THEN Begin Regs.ax := TIHDW; Regs.bx := TimerChannel; {Timer to be programmed} Regs.cx := Mode; {Special command byte} Regs.dx := Count; {Seed count programmed to load register} Regs.si := Count; {Seed count programmed to hold register} intr(LABPAC,Regs); LPC_TI_Special:= Regs.ax {Error code returned} End ELSE LPC_TI_Special := LPC BAD PARAMETERS; END; -  -  129  /**************************************************************************************** * LabPacEnd : is called as an exit procedure of the unit ****************************************************************************************1 {$F-F} PROCEDURE LabPacEnd; BEGIN LabPacStop; ExitProc := ExitOld;^{ re-install old Exit procedure } END; {$F-} {** Starting code of the unit **} PROCEDURE RequestSystemType; VAR IsProceedOk : Boolean; InChar^: Char; BEGIN Repeat IsProceedOk := TRUE; GotoXY(1,1); Write('Please Specify which Printronix system this is? (1 or 2)'); InChar := ReadKey; Val(InChar,SystemType,ErrCode); IF (ErrCode = 0) AND ( (SystemType = 1) OR (SystemType = 2) ) THEN ELSE Begin IsProceedOk := FALSE; Sound(1000); GotoXY(1,1); Write('^Error Illegal Input Parameter 11111111 Delay (3000); NoSound; End; Until IsProceed0k; END; BEGIN ExitOld := ExitProc;^{ mark address of Exit procedure } ExitProc := @LabPacEnd;^{ define LabPacEnd as Exit procedure } (* IF ParamCount <>0 THEN Begin Val(ParamStr(1),SystemType,ErrCode); IF (ErrCode = 0) AND ( (SystemType = 1) OR (SystemType = 2) ) THEN ELSE RequestSystemType; End ELSE RequestSystemType; LabPacInit; END.  130  (**************************************************************************************** * * FILE: EDA Gath.pas^ * * WRITTEN 5Y: A. Kleinschmidt^ * ON: March 5, 1993^ * **#######################################################** * UNIT WITH ROUTINES TO SETUP COUNTERS AND DMA FOR DATA ACQUISITION; ^* * TURN THE LASER SHUTTER ON OR OFF AND ADJUST THE PHOTODETECTOR GAIN. * * *  **** ********** ****** ********** ***** ********** ***** ********** ***** ********** ***** *******1 UNIT EDA_Gath; INTERFACE USES crt,dos, LabMast, EDA_dsp, EDA_dis; CONST BASE Data_Num PI PORT_A PORT_B PORT_C Port_Con_Word PORT JO_CON  = 1808; = 512; = 3.141593; = BASE+12; = BASE+13; = BASE+14; = $81; = BASE+15;  VAR GATH_Gain_Err^: integer; TYPE GainPtr = ^Ellip_Gain; Ellip_Gain = RECORD LM : integer; Det : integer; END;  {Base address of LabMaster DMA} {Number of samples per revolution} {LabMaster output port A address} {LabMaster output port B address} {LabMaster input port C address} {Control word sent to LabMaster 8255} {LabMaster I/O control port address}  {Error flag to signal gain saturation}  {LabMaster gain control number} {Photodetector gain control number}  HarmIndex^= (zero,second,fourth);^{Harmonics index number} Speed_Index^= (hi,lo);^{Motor speed index number} PROCEDURE GATH_Check_Offset(Store_Data:Data_Ptr; Data_Num:integer); PROCEDURE GATH_Dark_exit; PROCEDURE GATH_GainSet(Data:Data_Ptr; Gain_Num:GainPtr; Inc_Num,Rev_Num:integer); PROCEDURE GATH_HARMONICS(Coetinteger; DMA_Data:Data_Ptr; Inc_Num,Rev_Num,C_Shift:integer); PROCEDURE GATH LASER OFF; PROCEDURE GATH LASER ON; PROCEDURE GATH MOTOF-1 OFF; PROCEDURE GATH MOTOR ON(Speed_Sel:Speed_Index); FUNCTION GATH_DIa(DMATIData:Data_Ptr; Gain_Num:GainPtr; Inc_Num,Rev_Num:integer; Speed_Select:Speed_Index): string; FUNCTION GATH_Det_GainSet(Old_Gain, Max_Val:integer): integer;  131  IMPLEMENTATION {$define MASTER} {$i cAlabpac\labhead.btp} CONST Coder_Counter = 1; Com2Int = $08; Disable_Trigger = $02; Done_Counter = 3; Enable_Trigger = $07; Int_Ack = $20; Intgen_Counter = 2; IRQ3 = $08; Mode^= $C3E9; OCW1^= $21; OCW2^= $20; Shutter_Off^= $02; Shutter_On^= $01; Shutter_Wait = $FC;  {Shaft encoder divide down counter} {Com port 2 interrupt vector address} {disable index latch} {counts DONE counts from ADC} {enable index latch: A2:CLR A1:PRE AO:/FF_EN} {Interrupt acknowledge} {generates interrupt from Index_Pulse} {interrupt request #3 used} {Sets Done counter Hold reg to be read} {interrupt command register} {interrupt acknowledge register} {turn laser shutter off mask} {turn laser shutter on mask} {laser shutter wait state mask}  VAR ^ : integer;^{Number of data cycles to measure} Cycle_Num ^ Done : array [0 ..18] of integer;^{Reads number of conversions from Done_Counter} ^ : pointer;^{Saves old exit procedure pointer} ExitOld ^ i : integer; ^ In_Process : integer;^{set after first interrupt} ^ Int_Index : integer;^{increments after each interrupt serviced} ^ OldVector : Pointer;^{Saves old interrupt vector} ^ Regs : Registers;  (**************************************************************************************** ^ * * PROCEDURE GATH_Check_Offset ^ * * Checks if offset of photodetector is adjusted properly. Considered ^ * * set too low if less than 12.5% of all values are ones (with the laser ^ * * turned off). ****************************************************************************************) PROCEDURE GATH_Check_Offset(Store_Data:Data_Ptr; Data_Numinteger); VAR i, ones, twos : integer; BEGIN ones := 0; twos := 0; FOR i := 0 to Data_Num-1 DO BEGIN IF (Store_Data^ [i] > = 2) THEN inc(twos); IF (Store_Data^ [i] = 1) THEN inc(ones); END;  132  IF (twos <> 0) THEN writeln('Detector Offset set too high...'); IF (ones < (Data_Num div 8)) THEN writeln('Detector Offset set too low...'); END;  (**************************************************************************************1 PROCEDURE GATH_Dark_exit; BEGIN DIS_Write_Text('Signal Level too low. Press any Key to exit...', MargX,Command_LineY); WHILE (NOT Keypressed) DO END; (**************************************************************************************** * * GATH GainSet: Set LabMaster and Photodetector Gain ^ ********—********************************************************************************) * * * * *  Data^: Photodetector data^ * Gain_Num.Det : Record part containing the photodetector gain number ^ * * Gain_Num.LM : Record part containing the LabMaster gain number^ * Inc_Num^: Number of data bytes per revolution^ * Rev_Num^: Number of revolutions data acquired for^  ***************************************************************************************1  PROCEDURE GATH_GainSet(Data:Data_Ptr; Gain_Num:GainPtr; Inc_Num,Rev_Num:integer); CONST LoSignal_Limit = 10; VAR LM_Gain : integer; Det_Gain : integer; Old_Gain : integer; Max_Val : integer; BEGIN GATH_Gain_Err := 0; {SAVE OLD GAIN VALUES AND FIND THE MAX. VALUE OF THE SIGNAL} LM_Gain := Gain_Num^.LM; Old_Gain := Gain_num".Det; Max_Val := DSP_Data_Max(Data,Inc_Num,Rev_Num-1); {ADJUST THE DETECTOR GAIN} Det_Gain := GATH_Det_GainSet(Old_Gain, Max_Val); {ADJUST THE LABMASTER GAIN AS REQUIRED OR OUTPUT ERROR CODE} IF (Max_Val < LoSignal_Limit) THEN GATH_Gain_Err := -2; CASE GATH_Gain_Err OF -1: IF (LM_Gain <3) THEN BEGIN inc(LM_Gain); Det_Gain := 0 END ELSE BEGIN G0T0XY(MargX,Status_LineY+1); ClrEOL;  133  writeln('Signal too low'); GATH_Gain_Err := -2; END; 0: ClrEOL; 1: IF (LM_Gain > 0) THEN BEGIN dec(LM_Gain); Det_Gain := 15 END ELSE BEGIN GoToXY(MargX,Status_LineY+1); ClrEOL; writeln('Signal too high'); GATH_Gain_Err := -2; END; END; Gain_Num".LM := LM_Gain; Gain_Num".Det := Det_Gain; END;  (******** ******** ************** ******** ************** ******** *************** ******** ****** * * GATH_HARMONICS: Calculates average of the DFT data sets^ **#######################################################** * * C_Shift^: Number of samples to shift to adjust for trigger phase ^ * The Fourier coefficient desired^ Coef^: * * Photodetector data^ DMA_Data^: * * Number of data bytes per revolution^ * Inc_Num^: * ^ Number of revolutions data acquired for * Rev_Num^:  ****************************************************************************************) PROCEDURE GATH_HARMONICS(Coetinteger; DMA_Data:Data_Ptr; Inc_Num,Rev_Num,C_Shiftinteger); VAR integer; BEGIN {FIND NORMALIZATION (COEFO) OF EACH DATA CYCLE AND NORMALIZE EACH CYCLE} FOR j := 0 to Rev_Num-1 DO BEGIN DSP FOURIER_CoefO(DMA_Data, Inc_Num, j); DSP FOURIER_Coef(DMA_Data,Inc_Num,j,C_Shift,Coef,Fourier_Coef A[j,0]); END; DSP_FOURIER_Av(Inc_Num,Rev_Num,Coef); END;  134  (***************************************************************************************) PROCEDURE GATH _ LASER _OFF;^{Turns laser shutter off} BEGIN port[PORT_ B] := port[PORT_B] AND Shutter Wait; port[PORT_ B] := port[PORT_B] OR Shutter Off; delay (30); port[PORT_B] := port[PORT_B] AND Shutter Wait; END;  (**************************************************************************************1  ^ PROCEDURE GATH_LASER_ON; {Turns laser shutter on} BEGIN port[PORT_B] := port[PORT_B] AND Shutter Wait; port[PORT_B] := port[PORT_B] OR Shutter On; delay (30) port[PORT_B] := port[PORT_B] AND Shutter_WaiL; END;  (***************************************************************************************) PROCEDURE GATH_^_ MOTOR OFF; {Turns Motor off} BEGIN port[PORT_B] := port[PORT_B] AND (NOT $04); END; (*************************************************************************************** * Turns Motor on at hi or low speed * ***************************************************************************************) PROCEDURE GATH_MOTOR _ON(Speed_Sel:Speed_Index); VAR temp : word; speed : integer; BEGIN speed := (8*ord(Speed_Sel)) AND $08; temp := (port[PORT_B] OR 4) AND $F7; port[PORT_B] := temp OR Speed; delay (3000); END;  135  (**************************************************************************************** * * GATH_Data: Interrupt driven routine used to collect ellipsometer data ^ **#######################################################** * * USES: PROCEDURE EnableInterrupts^ * INTERRUPT Int_Read_Counters^ * * PROCEDURE ADC_DMA_exit^ * * * DMA_Data : Pointer to data array^ * ^ * Gain_Num : Record containing LabMaster and photodetector gain values * * Inc_Num^: Number of data bytes per revolution^ * ^ Number of revolutions data acquired for * Rev_Num^: * * Speed_Select : Motor speed^ ****************************************************************************************) PROCEDURE EnableInterrupts; BEGIN INLINE($FB); END;  (**************************************************************************************1 PROCEDURE Int_Read_Counters(Flags,CS,IP,AX,BX,CX,DX,SI,DI,DS,ES,BP : Word); INTERRUPT; BEGIN EnableInterrupts; port[BASE+9] := $F0 OR Intgen_Counter; {steps Intgen_Counter to reset high} In_Process := ($01 AND port[PORT_C]); ^{check if Index trigger enabled} IF (In_Process = 1) AND (Int_Index < Cycle_Num) THEN BEGIN {READ DONE_COUNTER DIRECTLY TO SAVE TIME} Regs.ax := TIRAW; Regs.bx := Done_Counter; intr(LABPAC, Regs); Done[Int_Index] := Regs.ax; inc(Int_Index); END; port[OCW2] := Int_Ack; port[BASE+7] := 0; END;  (**************************************************************************************1 PROCEDURE ADC_DMA_exit(Gain_Set:integer); BEGIN port[OCW1] := port[OCW1] OR IRQ3; ^{disable interrupt} SetIntVec(Com2Int,OldVector); port[PORT_A] := Disable_Trigger OR 8*Gain_Set; {disable trigger} {resets Counters} port[BASE+9] := $FF;^ END;  136  (* *** ******************** *** ******************* **** ******************* *** **************1 FUNCTION GATH Data(DMA_Data:Data Ptr; Gain_Num:GainPtr; Inc_Num,Rev_Num:integer; ed_Select:Speed_ln-dex): string; §pe CONST ADC Con_Word^= $94;^{Word to ADC control port} DMA-Time_Err^= 'DMA OR TIMER SETUP ERROR'; No_frror^='^'., Synch_Err^= 'SYNCHRONIZATION ERROR'; VAR Count^: integer;^{Coder counter divide value} Sample_Num^: integer;^{Total number of values to be acquired} Start_DMA^: integer;^{DMA error code} Start_Timer_1^: integer;^{Counter error codes} Start_Timer_2^: integer; Start_Timer_3^: integer; BEGIN {INITIALIZE VARIABLES} GATH_Data := No_Error; Count := 1024 div Inc_Num;^{Coder counter divide value} Cycle_Num := Rev_Num;^{Make variable local to unit} Sample_Num := Cycle_Num * Inc_Num; ^{number of samples taken} Int_Index := 0; port[PORT_A] := Disable_trigger OR 8*Gain_Num^.Det; {SAVE OLD INTERRUPT VECTOR AND WRITE IN NEW ONE} GetIntVec(Com2Int,OldVector); SetIntVec(Com2Int,@Int_Read_Counters); {SET UP SHAFT ENCODER DIVIDE COUNTER} Start_Timer_1 := LPC_TI_CountTo(Coder_Counter,Count,1); port[BASE+9] := $F0 OR Coder_Counter; {steps Coder_Counter to reset low} {SETUP DMA TRANSFER COUNTER} Start Timer_2 := LPC_TI_Special(Done_Counter, 0, Mode); {DONE jumper connected to SRC3} {RUN DMA} Start_DMA := LPC_Dma_run(DMA_Data,Sample_Num); {ENABLE COUNTER INTERRUPT GENERATION} Start_Timer_3 := LPC_TI_CountTo(Intgen_Counter, 2, 2); port[BASE+9] := $E0 OR Intgen_Counter; {steps Intgen_Counter to reset low} {UNMASK INTERRUPTS} port[OCW1] := port[OCW1] AND (NOT IRQ3); port[BASE+4] := (ADC_Con_Word+Gain_Num^ .LM); {ENABLE INDEX PULSE TRIGGER} port[PORT_A] := Enable_Trigger OR 8*Gain_Num^.Det; {WAIT FOR Cycle_Num CYCLES AND DISABLE INTERRUPTS} WHILE (Int_Index < Cycle_Num) AND (not keypressed) DO delay(1); ADC_ DMA_ Exit(Gain_Num'N.Det);  137  {TEST FOR PROPER COUNTER VALUE - LAST CYCLE NOT CHECKED} FOR i := 0 to Cycle_Num-2 DO IF (((abs(Done[i]-(i4-1)*Inc_Num) > 3) AND (Speed_Select = hi)) OR ((abs(Done[i]-(i+1)*Inc_Num) > 2) AND (Speed_Select = lo))) THEN GATH_Data := Synch_Err; {CHECK IF DMA COMPLETE} IF (Done[Cycle_Num-1] < Sample_Num) THEN GATH_Data := Synch_Err; {RETURN ERROR CODES} IF (Start_DMA <> 0) OR (Start_Timer_1 <> 0) OR (Start_Timer_2 <> 0) OR (Start_Timer_3 <> 0) THEN GATH_Data := DMA_Time_Err; END;  (**************************************************************************************** * GATH Det GainSet: Set Photodetector Gain^  *  **####### ################################################**  * * Max_Val^: Maximum value of photodetector data^ * * Old_Gain^: Old photodetector gain value^ ****************************************************************************************) FUNCTION GATH_Det_GainSet(Old_Gain, Max_Valinteger): integer; VAR ADC_Limit^: real; 1,Set_Gain^: integer; BEGIN Set_Gain := Old_Gain; ADC_Limit := 4095; {LOWER GAIN TO BELOW 97% OF FULL SCALE OR RETURN ERROR CODES} IF (Max_Val > 0.97*4095) THEN CASE Old_Gain OF 0 : BEGIN GoToXY(MargX,Status_LineY+1); writeln('Signal Strength too high. Peak Amplitude = ',Max_Val); GATH_Gain_Err := 1; END; 1..15: BEGIN dec(Set_Gain); GoToXY(MargX,Status_LineY+1); ClrEOL; END; END;  138  {RAISE GAIN ABOVE 84% OF FULL SCALE OR RETURN ERROR CODES} FOR i := 0 to 15 DO BEGIN ADC Limit := 0.84*ADC Limit; IF (Max _Val < ADC Limi) N THE CASE-Set Gain dF 15^:-BEG IN GoToXY(MargX,Status_LineY+1); ClrEOL; writeln('Signal Strength too low. Peak Amplitude = ',Max_Val); GATH_Gain_Err := -1; END ELSE BEGIN inc(Set_Gain); GoToXY(MargX,Status_LineY+1); ClrEOL; END; END; {IF} END; {FOR} IF (Set_Gain <> Old Gain) THEN BEGIN G0T0XY(MargX,Status_LineY+2); ClrEOL; writeln('Gain Set to: ', Set_Gain,"); delay (500); END; GATH_Det_GainSet := Set_Gain; END;  (********************k***************************************************************1 {$F1-} PROCEDURE GATH_exit; BEGIN GATH_LASER_OFF; GATH_MOTOR_OFF; SetIntVec(Com2Int,OldVector); ExitProc := ExitOld; END; {$F-}  {re-install old Exit procedure}  (******************** ************ ***** ******************************************** **1 BEGIN ^ ExitOld := ExitProc; {mark address of Exit procedure} ^ ExitProc := @GATH_Exit; {define GATH_Exit as Exit procedure} END.  139  (**************************************************************************************1 (* FILE: EDA_Dsp.pas (* WRITTEN BY: A. Kleinschnnidt^ (* ON: May 18, 1993^  *) *) *)  1 ^ 1 ^ UNIT WITH ROUTINES FOR DATA AVERAGING, FOURIER ANALYSIS AND ^ (* DATA NORMALIZATION. ALSO INCLUDES TRIGONOMETRIC FUNCTIONS AND ^1 (* FUNCTIONS TO CALCULATE RHO FROM THE NORMALIZED FOURIER COEFFICIENTS. *)  (**************************************************************************************1 UNIT EDA_dsp; INTERFACE USES dos,crt,graph,LabMast,EDA_dis; TYPE Pcomplex = ^Complex; PStoke = ^Stoke; Complex = RECORD r^: real; {real part of complex number} real; {imaginary part} END; Stoke^= RECORD sl^: real; {Stokes parameter Sl} s2^: real; {Stokes parameter S2} s3^: real; {Stokes parameter S3} sO^: real; {Magnitude of Stokes Vector} END; Window^= RECORD : Complex; al 1 f al 2wp : Complex; al 2w : Complex; a21wp : Complex; a2lw : Complex; : Complex; a22f END; VAR Fourier_Coef A^: array [0 ..18,0 ..9] of double; Fourier_Coef-B^: array [0 ..18,0 ..9] of double; PROCEDURE DSP_CHI(Chi:Pcomplex; Az,E11:real); PROCEDURE DSP_Data_Average(Store_Data: Data_Ptr;Inc_Num,Cycle_Num: integer); PROCEDURE DSP_Data Error(Store_Data: Data_Ptr;Inc_Num,Cycle_Num,E_Tol: integer); PROCEDURE DSP_ FOUiiI ER_Av(Inc_Num,Cycle_Num,Coef_Num: integer); PROCEDURE DSP_FOURIER_Coef(Store_Data: Data_Ptr; Inc_Num,Cycle_Num,Shift_Num,k: integer; Norm: real); PROCEDURE DSP_FOURIER_CoefO(Store_Data: Data_Ptr;Inc_Num,Cycle_Num: integer); PROCEDURE DSP_FOURIER_Init(Inc_Num: integer); PROCEDURE DSP _ MAG _ PHASE _COR(Gain_Adj,Phase_Cor: real; Cycle_Num ,Coef_N urn: integer);  140  PROCEDURE DSP_Sign_Rho(VAR costerm:real; VAR sinterm: real); PROCEDURE DSP_STOKES(Stoke_Vec:PStoke; Q,R,S,B2_Coef,A4_Coef,B4_Coef: real); PROCEDURE DSP_WINDOW_COR(Chi_out,Rho:Pcomplex); FUNCTION ARCCOS(Arg:double): double; FUNCTION ARCSIN(Arg:double): double; FUNCTION DSP_AZ(StokeVec:PStoke): real; FUNCTION DSP_COS_DEL(Q:real; Cycle_Num:integer): real; FUNCTION DSP_SIN_DEL(Q,R,S:real; Cycle_Num:integer): real; FUNCTION DSP_Data_Max(Store_Data:Data_Ptr;Inc_Num,Cycle_Num: integer): integer; FUNCTION DSP_Data_Min(Store_Data:Data_Ptr;Inc_Num,Cycle_Num: integer): integer; FUNCTION DSP_Delta(Reflect:Pcomplex): real; FUNCTION DSP_ELL(StokeVec:PStoke): real; FUNCTION DSP_FOURIER_Mag(A_Coef,B_Coef: real): real; FUNCTION DSP_Miu(Q: real; Cycle_Num: integer): real; FUNCTION DSP_Nu(Q: real; Cycle_Num: integer): real; FUNCTION TAN(Angle:real):real; FUNCTION DSP_TAN_PSI(Q: real; Cycle_Num: integer): real; IMPLEMENTATION VAR Cos_Array^: array[0..9,0..512] of single; Sin_Array^: array[0..9,0..512] of single; ExitOld^: pointer; WinCor^: Window;^{Window correction factors}  f********* *********** *************** ********** ************** *********** ************** **** * DSP_CHI : Calculates the Polarization from the ellipticity and azimuth ^ * * * * * USES: Ell: Ellipticity^ * Az : Azimuth^ * * * RETURNS: Real and imaginary values of the polarization in the ^ * * location defined by the pointer Chi. ^ ****************************************************************************************1 PROCEDURE DSP_ CHI(Chi:Pcomplex; Az,E11:real); VAR denom : real; BEGIN denom := 1.0 + sqr(tan(Az)*tan(E11)); Chi^ s := tan(Az)*(1.0 - sqr(tan(E11)))/denom; Chi ^ .i := tan(EII)*(1.0 + sqr(tan(Az)))/denom; END;  141  •  f**************************************************************************************** * DSP_^_^ Data Average : Average (Inc _^ Num) Data Values (Store Data) over ^ * (Store_Data) * (Cycle_Num) cycles. Stores results in data array starting at ^ * * Store Data[Cycle_Num*Inc Num]^ ********-*********************-***********************************************************1 PROCEDURE DSP_Data_Average(Store_Data:Data_Ptr; Inc_Num,Cycle_Num:integer); VAR i,j,Sum_Val^:integer; BEGIN FOR i := 0 to Inc_Num-1 DO BEGIN Sum_Val := 0; FOR j := 0 to Cycle_Num-1 DO Sum_Val := Sum_Val + Store_Data^[i+j*Inc_Num]; Store_Data ^ D+Cycle_Num*Inc_Num] := Sum_Val div Cycle_Num; END; END;  f**************************************************************************************** * * DSP_Data_Error : Find the numbers of times the (Inc_Num) data points * * of a cycle deviates by more than (E_Tol) from the average for all * * (Cycle_Num) cycles. ****************************************************************************************1 PROCEDURE DSP_Data_Error(Store_Data:Data_Ptr; Inc_Num,Cycle_Num,E_Tainteger); VAR i,j^: integer; Data_Err^: integer; Err_Total : integer; BEGIN FOR j := 0 to Cycle_Num DO BEGIN Err_Total := 0; FOR i := 0 to Inc Num-1 DO BEGIN Data_Err := Store_Data ^[i+Cycle_Num*Inc_Num] - Store_Data ^ [i+j*Inc_Numj; IF (ABS(Data_Err) > E_Tol) THEN inc(Err_Total); END; {FOR} writeln('Number of errors greater than +/-',E_Tol,' for cycle: ', j, ' = ', Err_Total); END; END;  142  f****************************** ******************** ************************************** * FOURIER Av : Averages the Fourier Coefficient (Coef_Num) * DSP_^_^ * * for each sample interval (Inc_Num) over the total number of * * cycles (Cycle_Num). ****************************************************************************************} PROCEDURE DSP_FOURIER_Av(Inc_Num,Cycle_Num,Coef Num:integer); VAR i,j^: integer; Sum_A : double; Sum_B : double; BEGIN Sum_A := 0; Sum_B := 0; FOR i := 0 to Cycle_Num-1 DO BEGIN Sum_A := Sum_A + Fourier_Coef A[I,Coef Num]; Sum_B := Sum_B + Fourier_Coef_B[i,Coef_Num]; END; Fourier_Coef_A[Cycle_Num,Coef_Num] := Sum_A/Cycle_Num; Fourier_Coef B[Cycle_Num,Coef Num] := Sum_B/Cycle_Num; END;  f**************************************************************************************** * * * * * * * * * *  DSP _ FOURIER_ Coef : Calculate the normalized fourier coefficients Global: Fourier_Coef A[0 ..Rev_Num,0..9] Global: Fourier_Coef B[0 ..Rev_Num,0..9] Global to unit: Cos_Array[9,512], Sin_Array[9,512] Store_Data: Time domain data. Inc_Num: number of data samples per revolution Cycle_Num: number of revolutions sampled Shift_Num: starting position in the data set for the fourier analysis Norm: normalization coefficient - usually the dc value calculated prior k := integer between 0 and 9 representing the coefficient desired  ******************************** ************************************************* *******1 PROCEDURE DSP _FOURIER_Coef(Store_Data:Data_Ptr; Inc_Num,Cycle_Num,Shift_Num,kinteger; Norm:real); VAR n,ni^: integer; Coef^: integer; Acc_Var^: single; BEGIN { CALCULATE COSINE COEFF } Acc_Var := 0; FOR ni := 0 to Inc_Num-1 DO BEGIN n := (ni+Shift_Num) MOD (Inc Num); Acc_Var := Acc_Var + Store_Data 'N [n+Cycle_Num*Inc_NumrCos_Array[k,ni]; END;  143  Fourier_Coef_A[Cycle_Num,k] := 2*Acc_Var/Norm; IF (k = 0) THEN Fourier_Coef A[Cycle_Num,k] := 0.5*Acc_Var/Norm; { CALCULATE SINE COEFF } Acc_Var := 0; FOR ni := 0 to Inc_Num-1 DO BEGIN n := (ni+Shift_Num) MOD (Inc_Num); Acc_Var := Acc_Var + Store_Data"[n+Cycle_Num*Inc_Num] *Sin_Array[k,ni]; END; Fourier_Coef B[Cycle_Num,k] := 2*Acc_Var/Norm; IF (k = 0) THEN Fourier_Coef B[Cycle_Num,k] := 0.5*Acc_Var/Norm; END;  f*************************************************************************************** * DSP FOURIER _ _Coef0 : Calculates the DC fourier coefficient  *  * *  * Global: Fourier_Coef_A[0 ..Rev_Num,0..9] * Global: Fourier_Coef_B[0 ..Rev_Num,0..9] * Global to unit: Cos_Array[9,512], Sin_Array[9,512] * Store_Data: Time domain data. * Inc_Num: number of data samples per revolution * Cycle_Num: number of revolutions sampled  * * * * * *  ****************************************************************************************1 PROCEDURE DSP _FOURIER_CoefO(Store_Data:Data_Ptr; Inc_Num,Cycle_Num:integer); VAR n^ : integer; Acc_Var1^ : single; BEGIN Acc_Var1 := 0; FOR n := 0 to Inc_Num-1 DO BEGIN Acc_Var1 := Acc_Var1 + Store_Data^ [n+Cycle_Num*Inc_Num]; END; Fourier_Coef A[Cycle_Num,0] := Acc_Var1; END;  144  f**** ****** ******** ***** ******** ***** ******** ***** ******** ***** ******* ****** ******* ***** * * DSP_FOURIER_Init : Initialize the Cosine and Sine arrays for the * Fourier transform * Global to unit : Cos_Array[9,512], Sin_Array[9,512] * Inc Num: number of data samples per revolution *****;**********************************************************************************1 PROCEDURE DSP_FOURIER_Init(Inc_Num:integer); VAR : integer; : integer; Angle^: single; BEGIN FOR k := 0 to 9 DO BEGIN FOR n := 0 to Inc_Num-1 DO BEGIN Angle := 2*Pl*n*k/Inc_Num; Cos_Array[k,n] := Cos(Angle); Sin_Array[k,n] := Sin(Angle); END; END; END;  f * *********** * ********** * ********** * ********** * ********** * ********* * ********** * ********** * DSP_MAG_PHASE_COR: Correct for the gain rolloff and phase shift * of the electronics * Gain_Adj: Gain correction for amplifier * Phase_Cor: Phase correction for the amplifier * Cycle_Num: number of revolutions sampled * Coef_Num: the Fourier coefficient corrected for ****************************************************************************************1 PROCEDURE DSP_MAG_PHASE_COR(Gain_Adj,Phase_Correal; Cycle_Num,Coef_Num:integer); VAR Temp_A, Temp_B : double; BEGIN Temp_A := (Fourier_Coef A[Cycle_Num,Coef Num] *COS(Phase_Cor) + Fourier_Coef B[Cycle_Num,Coef Num] *SIN(Phase_Cor))/Gain_Adj; Temp_B := (Fourier_Coef_B[Cycle_Num,Coef Num] *COS(Phase_Cor) - Fourier_Coef A[Cycle_Num,Coef NumrSIN(Phase_Cor))/Gain_Adj; Fourier_Coef A[Cycle_Num,Coef Num] := Temp_A; Fourier_Coef B[Cycle_Num,Coef_Num] := Temp_B; END;  145  f**************************************************************************************** * DSP_Sign_Rho: Calculates Rho from the lesser of Cos(delta) or * Sin(delta) and sets Rho in the proper quadrant * costerm: real part of Rho * sinterm: imaginary part of Rho  ***************************************************************************1  PROCEDURE DSP_Sign_Rho(VAR costerm:real; VAR sinterm: real); BEGIN IF (abs(costerm) < abs(sinterm)) THEN BEGIN G0T0XY(MargX,Data_LineY+4); write(' (Calculating from Cosine Term)'); IF (sinterm <0) THEN sinterm := -SIN(ARCCOS(costerm)) ELSE sinterm := SIN(ARCCOS(costerm)) END ELSE BEGIN G0T0XY(MargX,Data_LineY+4); write(' (Calculating from Sine Term)'); IF (costerm < 0) THEN costerm := -COS(ARCSIN(sinterm)) ELSE costerm := COS(ARCSIN(sinterm)); END; END;  {**************************************************************************************** * DSP_STOKES: Calculates the normalized Stokes parameters from the * Fourier coefficients. * USES: Q,R,S: Compensator parameters B2,A4,B4: Fourier Coef. • * RETURNS: Stoke Vector values at pointer location in PStoke  **************************************** ************************************************ } PROCEDURE DSP_STOKES(Stoke_Vec:PStoke; Q,R,S,B2_Coef,A4_Coef,B4_Coef:real); VAR temp : real; BEGIN temp := (2.0-Q) - Q*A4_Coef; Stoke_Vec^ .s1 := 2.0*A4_Coef/temp; Stoke_Vec ^ .s2 := 2.0*B4_Coef/temp; Stoke_Vec^ .s3 := -(B2_Coef*(2.0-Q) - 2.0*s*B4_Coef)/(R*temp); Stoke_Vec".s0 := sqrt(sqr(2.0*A4_Coef) + sqr(2.0*B4_Coef) + sqq(B2_Coef*(2.0-Q) - 2.0*s*B4_Coef)/R))/temp; END;  146  f******** *************** ************ ************** *********** ************** ************ ** * DSP WINDOW COR: Corrects for the stress induced window birefringence * USES: Chi out: Pointer to value of measured output polarization. • Window_Par: Window parameters - local to unit. * RETURNS: Rho: The corrected value of the reflectivity.  ** ************ *********** ************ *********** *********** *********** *********** *******1 PROCEDURE DSP_WINDOW_COR(Chi_out,Rho:Pcomplex); VAR a,b,c,d : real;^{temporary variables} denom^: real; BEGIN a := 1.0 + WinCor.a12wps*Chiout^.r - WinCor.a12wp.i*Chiout".i + WinCor.a21w.r + WinCor.a22f.r; b := WinCor.a12wp.i*Chi_out^.r + WinCor.a12wps*Chi_out^.i; c := (WinCor.a12w.r + WinCor.a11f.r + 1.0)*Chi_out .r - (WinCor.a12w.i + WinCor.a11f.i)*Chiout ^ - WinCor.a21wp.r; d := (WinCor.a12w.r + WinCor.a11f.r + 1.0)*Chi_out^.i + (WinCor.a12w.i + WinCor.a1 1 f.i)*Chiout .r - WinCor.a21wp.i; denom := sqr(c) + sqr(d); Rho ^ .r := (a*c + b*d)/denom; Rho ^ := (b*c + a*d)/denom; END;  f ********** ****** ********** ****** ********** ***** ********** ***** *********** ***** *********1 FUNCTION ARCCOS(Arg:double): double; VAR RESULT : double; BEGIN Arg := Round(1000*Arg)/1000; ^{avoids roundoff error} IF (Abs(Arg) > 1.0) THEN BEGIN DIS_Write_Text('DSP Overflow Error in Cosine Term',MargX,Status_LineY+3); Arg := 1; END ELSE BEGIN G0ToXY(MargX,Status_LineY+3); ClrEOL; END; IF (Arg = 0) THEN RESULT := PI/2 ELSE RESULT := ARCTAN(SQRT(1-SQR(Arg))/Abs(Arg)); IF (Arg < 0 ) THEN RESULT := PI - RESULT; ARCCOS := RESULT; END;  147  f***************************************************************************************1 FUNCTION ARCSIN(Arg:double): double; BEGIN Arg := Round(1000*Arg)/1000; ^{avoids roundoff error} IF (Abs(Arg) > 1.0) THEN BEGIN DIS_Write_Text('DSP Overflow Error in Sine Term',MargX,Status_LineY+3); Arg := 1; END ELSE BEGIN G0T0XY(MargX,Status_LineY+3); ClrEOL; END; IF (Round(1E6*(1-ABS(Arg))) = 0) THEN ARCSIN := P1/2 ELSE ARCSIN := ARCTAN(Arg/SQRT(1-SQR(Arg))); END;  f*************************************************************************************** * DSP_AZ : Calculates the Azimuth of the polarization ellipse from * the Stokes parameters. * USES: Stokes parameters S2, Si.  ****************************************************************************************1 FUNCTION DSP_AZ(StokeVec:PStoke): real; VAR az_from_cos : real; az_from_sin : real; Cos_2ell : real; TEMP_AZ : real; BEGIN Cos_2e11 := sqrt(sqr(StokeVec^ .s1)+sqr(StokeVec".s2)); {CHECK AND TRAP FOR CIRCULARLY POLARIZED LIGHT} IF (Cos_2e11 = 0) THEN BEGIN G0T0XY(MargX,Data_LineY+5); write('Light is Circularly Polarized !'); DSP_AZ := 0.0; exit; END ELSE BEGIN G0T0XY(MargX,Data_LineY+5); ClrEOL; END; {CALCULATE THE AZIMUTH FROM THE LARGER OF Si OR 52} IF (abs(StokeVec ^ .s1) > abs(StokeVec^ .s2)) THEN BEGIN G0T0XY(MargX,Data_LineY+4); write(' (Calculating Azimuth Angle from Si Parameter)'); TEMP AZ := ARCCOS(abs(StokeVec^.s1)/Cos_2e11); END ELSE BEGIN G0T0XY(MargX,Data_LineY+4);  148  write('(Calculating Azimuth Angle from S2 Parameter)); TEMP_AZ := ARCSIN(abs(StokeVec".s2)/Cos_2e11); END; {FIND PROPER QUADRANT OF AZIMUTH ANGLE} IF ((StokeVec^.s1 > 0) AND (StokeVec".s2 > 0)) THEN DSP_AZ := 0.5*TEMP_AZ; IF ((StokeVec^.s1 > 0) AND (StokeVec^.s2 < 0)) THEN DSP_AZ := -0.5*TEMP_AZ; IF ((StokeVec^.s1 <0) AND (StokeVec^.s2 > 0)) THEN DSP_AZ := 0.5*(PI-TEMP_AZ); IF ((StokeVec".s1 <0) AND (StokeVec".s2 < 0)) THEN DSP_AZ := -0.5*(PI-TEMP_AZ); END;  {**************************************************************************************** * * DSP_ COS_ DEL: Calculates the COS(DELTA) of the sample *  * * * USES: DSP_ Miu^ * * Q: Compensator parameter^ * * Cycle Num: number of revolutions sampled ^ ********—********************************************************************************} FUNCTION DSP_COS_DEL(Q:real; Cycle_Num:integer): real; VAR temp^: real; Miu^: real; BEGIN Miu := DSP_Miu(Q,Cycle_Num); temp := (2-Q)*SQRT(1-SQR(Miu)); DSP _ COS _DEL := (2+Miu*Q)*Fourier_Coef_B[Cycle_Num,4]/temp; END;  f**************************** ********************************** ************************** * DSP_SIN_DEL: Calculates SIN(DELTA) from the second Fourier Coef * * USES: DSP_ Miu * Q,R,S: Compensator parameters * Cycle_Num: number of revolutions sampled  ******* ******************************************** *************************************1 FUNCTION DSP _ SIN _DEL(Q,R,S:real; Cycle_Num:integer): real; VAR PSI_par^: real; Miu^: real; BEGIN Miu := DSP_Miu(Q,Cycle_Num); PSI_par := (2+Q*Miu)/(R*SQRT(1-SQR(Miu))); DSP_SIN_DEL := PSI_par*(0.5*Fourier_Coef_B[Cycle_Num,2] - S*Fourier_Coef B[Cycle_Num,4]/(2-Q)); END;  149  f**************************************************************************************** * * * * Store_Data: Time domain data. * * Inc_Num: number of data samples per revolution * * Cycle_Num: number of revolutions sampled ****************************************************************************************1 * DSP_Data_Max : Find the Maximum Value of the Data *  FUNCTION DSP_Data_Max(Store_Data:Data_Ptr; Inc_Num,Cycle_Num:integer): integer; VAR integer; Max_Val^: integer; BEGIN Max_Val := 0; FOR i := 0 to Inc_Num-1 DO IF (Store_Data^[i+Cycle_Num*Inc_Num] > Max_Val) THEN Max_Val := Store_Data^ [i+Cycle_Num*Inc_Num]; DSP_Data_Max := Max_Val; END;  f****************************************************************************************  * * DSP Data _^_Min : Find the Minimum Value of the Data * * * * Store_Data: Time domain data. * * Inc_Num: number of data samples per revolution * * Cycle_Num: number of revolutions sampled ****************************************************************************************1 FUNCTION DSP_Data_Min(Store_Data:Data_Ptr; Inc_Num,Cycle_Num:integer): integer; VAR integer; Min_Val^: integer; BEGIN Min_Val := 4095; FOR i := 0 to Inc_Num-1 DO IF (Store_Data" [i+Cycle_Num*Inc_Num] < Mm Val) THEN Min_Val := Store_Data^[i+Cycle_Num*Inc_Num]; DSP_Data_Min := Min_Val; END;  150  {**************************************************************************************** * DSP _Delta: Calculates the Phase of the reflectivity ^  *  *^  *  * USES: Reflect^  *  ****************************************************************************************} FUNCTION DSP_Delta(Reflect:PComplex): real; VAR temp^: real; BEGIN temp := Arctan(Reflect" .i/Reflect^ .r); IF ((Reflect ^ s < 0) AND (Reflect " .i > 0)) THEN temp := PI + temp; IF ((Reflect ^ s < 0) AND (Reflect ^ .i < 0)) THEN temp := -PI + temp; DSP_Delta := temp; END;  f* ********** ** ********** *** ********** *** ********* *** ********* *** ********* *** ********* *** * * DSP_ELL : Calculates the Ellipticity of the polarization ellipse from * the Stokes parameters. ^ ^ * ^ * USES: Stokes parameters Si, S2, S3  ^  * * * *  **** ****** ****** ****** ******* ****** ****** ****** ****** ****** ****** ***** ******* ***** ******1 FUNCTION DSP_ELL(StokeVec:PStoke): real; VAR Cos_2e11:^real; BEGIN Cos_2ell := sqrt(sqr(StokeVec ^ .s1)+sqr(StokeVec^ .s2)); {CHECK AND TRAP FOR CIRCULARLY POLARIZED LIGHT} IF (Cos_2ell = 0) THEN BEGIN G0T0XY(MargX,Data_LineY+5); write('Light is Circularly Polarized 1); DSP_ELL := (StokeVec ^ .s3/abs(StokeVec".s3)) * PI/4.0; exit; END ELSE BEGIN G0T0XY(MargX,Data_LineY+5); ClrEOL; END; DSP_ ELL := 0.5*ArcTan(StokeVec ^ .s3/sqrt(sqr(StokeVec" .s1)+sqr(StokeVec ^ .s2))); END;  151  f** ************** *** *************** *** ************* *** ************** *** ************* *** ** * * * * A_ Coef: Fourier Cosine coef. ^ * * B Coef: Fourier Sine coef.^ ****-************************************************************************************1 * DSP_FOURIER_Mag: Find the Magnitude of the normalized coefficient ^ *  FUNCTION DSP_FOURIER_Mag(A_Coef,B_Coef: real): real; BEGIN DSP_FOURIER_Mag := sqrt(sqr(A_Coef)+sqr(B_Coef)); END;  f***** **** ************ **** *********** *** *********** **** *********** *** *********** **** ***** * * * * Q: Compensator parameter^ * * Cycle_Num: number of revolutions sampled.^ ****************************************************************************************1 * DSP_ Miu: Calculate MIU^ *  FUNCTION DSP_Miu(Q:real; Cycle_Num:integer): real; BEGIN DSP_Miu := Fourier_Coef A[Cycle Num,4]/ (1-0.5*Q*(1 +Fourier_Coef -A[Cycle_Num,4])); END;  f** ********* *** ********* **** ******** *** ********* *** ******** **** ******** *** ********* *** *** ^ * * DSP_Nu: Calculate NU of the sample *  *  * * USES: DSP_Miu^ * * Q: Compensator parameter^ * * Cycle_Num: number of revolutions sampled^ ****************************************************************************************1 FUNCTION DSP_Nu(Q:real; Cycle_Num:integer): real; BEGIN DSP_Nu := (2+DSP_Miu(Q,Cycle_Num)*Q)*Fourier_Coef_B[Cycle_Num,4]/(2-Q); END;  f***************************************************************************************1 FUNCTION TAN(Angle:real):real; BEGIN IF (COS(Angle) = 0) THEN BEGIN TAN := (SIN(Angle)/abs(SIN(Angle))) * PI/2.0; exit; END; TAN := SIN(Angle)/COS(Angle); END;  152  f**************************************************************************************** * * * * USES: DSP_ Miu^ * * Q: Compensator parameter^ * * Cycle Num: number of revolutions sampled.^ ********—********************************************************************************} * DSP TAN PSI: Calculate the TAN(PSI) of sample ^ * —^  FUNCTION DSP _ TAN _PSI(Q: real; Cycle_Num: integer): real; VAR Miu^: real; BEGIN Miu := DSP_Miu(Q,Cycle_Num); DSP_TAN_PSI := SQRT((1+Miu)/(1-Miu)); END;  (**************************************************************************************1 {$F-1-} PROCEDURE DSP_exit; BEGIN ExitProc := ExitOld; END; {$F-}  {re-install old Exit procedure}  (***************************************************************************************) BEGIN {FILL IN WINDOW PARAMETERS: [a11f,a12w',a12w,a21w',a21w,a22f]} WinCor.a11f.r := 0.0; WinCor.a11f.i := 0.0; WinCor.a12wp.r := 0.0; WinCor.a12wp.i := 0.0; WinCor.a12w.r := 0.0; WinCor.a12w.i := 0.0; WinCor.a21wp.r := 0.0; WinCor.a21wp.i := 0.0; WinCor.a21w.r := 0.0; WinCor.a21w.i := 0.0; WinCor.a22f.r := 0.00; WinCor.a22f.i := 0.0; ExitOld := ExitProc;^{mark address of Exit procedure} ExitProc := @DSP_Exit; ^{define DSP_Exit as Exit procedure} END.  153  (********.*****.************************************************************************) ^ FILE: EDA_FFT.pas (* WRITTEN BY: A. Kleinschmidt (* ON: May 18, 1993 (* ^ AUXILLIARY UNIT WITH ROUTINES CALCULATING THE FFT OF THE DATA, (* NORMALIZING AND AVERAGING THE COEFFICIENTS.  (**************************************************************************************1 UNIT EDA_fft; INTERFACE USES dos, crt, graph, LabMast; VAR ^ FFT_Imag : array[0 ..9, 0..512] of real; ^ : array[0 ..9, 0..512] of real; FFT_Real PROCEDURE EDA_FFT_Coef(Store_Data: Data_Ptr;Data_Num,Cycle_Num,Power_of_2: integer); PROCEDURE EDA_FFT_Norm(Data_Num,Cycle_Num: integer); PROCEDURE EDA_ FFT_ Av10(Data_Num,Cycle_Num: integer); IMPLEMENTATION  {**************************************************************************************** * EDA_FFT_Coef : Calculate the FFT coefficients * Based on algorithm in "the FFT", E. Oran Brigham, pp. 165 * * * * *  Global:FFT_Real[0..512], FFT_Imag[0..512] Store_Data: Time domain data. Data_Num: number of data samples per revolution Cycle_Num: number of revolutions sampled Power_of_2: Power of two of the Data_Num  ****************************************************************************************1 PROCEDURE EDA_FFT_Coef(Store_Data:Data_Ptr; Data_Num,Cycle_Num,Power_of 2:integer); VAR index^: integer; : integer; : integer; : integer; : integer; Offset^: integer; Inc_Num2^: integer; Power_of 2n^: integer; : real; : real; : real; Arg^: real; TReal^: real; TImag^: real;  154  function FFT_Power(Mantissa, Exponent: real) : integer; begin FFT_Power := Round(EXP(LN(Mantissa)*Exponent)); end; function FFT_BitRev(J: integer) : integer; var index^: integer; J1^: integer; J2^: integer; T^: integer; begin J1 := J; T := 0; FOR index := 1 to Power_of 2 DO BEGIN J2 := J1 DIV 2; T := 1*2 + (J1-2*J2); J1 := J2; END; FFT_BitRev := T; end; BEGIN Offset := Cycle_Num*Data_Num; {INITIALIZE AIDMA_Datalmag ARRAY} FOR index := 0 to Data Num-1 DO BEGIN FFT_Real[Cycle_Num,index] := Store_Data^[Offset+index] div 8; FFT_Imag[Cycle_Num,index] := 0; END; {BEGIN FFT ALGORITHM} Inc_Num2 := Data_Num DIV 2; Power_of_2n := Power_of 2 -1; K := 0; FOR L := 1 TO Power_of_2 DO BEGIN WHILE (K < Data_Num-1) DO BEGIN FOR I := Ito Inc_Num2 DO BEGIN P := FFT_BitRev(K div FFT_Power(2, Power_of_2n)); Arg := 2*Pl*P/Data_Num; C := cos(Arg); S := sin(Arg); TReal := FFT_Real[Cycle_Num,K+Inc_Num2] * C + FFT_Imag[Cycle_Num,K+Inc_Num2] * S; TImag := - FFT_Real[Cycle_Num,K+Inc_Num2] * S + FFT_Imag[Cycle_Num,K+Inc_Num2] * C; FFT_Real[Cycle_Num,K+Inc_Num2] := FFT_Real[Cycle_Num,K] - TReal; 155  FFT_Imag[Cycle_Num,K+Inc_Num2] := FFT_Imag[Cycle_Num,K] - TImag; FFT_Real[Cycle_Num,K] := FFT_Real[Cycle_Num,K] + TReal; FFT_Imag[Cycle_Num,K] := FFT_Imag[Cycle_Num,K] + Tlmag; inc(K); END; {FOR} K := K + Inc_Num2; END; {WHILE} K := 0; dec(Power_of 2n); Inc_Num2 := Inc_Num2 div 2; END; {FOR} FOR K := 0 to Data_Num-1 DO BEGIN I := FFT_BitRev(K); IF (I>K) THEN BEGIN TReal := FFT_Real[Cycle_Num,K]; Tlmag := FFT_Imag[Cycle_Num,K]; FF1_Real[Cycle_Num,K1 := FFT_Real[Cycle_Num,I]; FFT_Imag[Cycle_Num,K] := FFT_Imag[Cycle_Num,I]; FFT_Real[Cycle_Num,I] := TReal; FFT_Imag[Cycle_Num,I] := Tlmag; END; {IF} END; {FOR} END;  {********************************************************* ******************************* * EDA_FFT_Norm : Normalize the coefficients for each cycle. * Data_Num: number of data samples per revolution * Cycle_Num: number of revolutions sampled ****************************************************************************************} PROCEDURE EDA_FFT_Norm(Data_Num,Cycle_Numinteger); VAR : integer; dc_val^: real; BEGIN dc_val := SQRT(SQR(FFT_Real[Cycle_Num,0]) + SQR(FFT_Imag[Cycle_Num,0])); FOR i := 0 to Data_Num-1 DO BEGIN FFT_Real[Cycle_Num,i] := FFT_Real[Cycle_Num,i]/dc_val; FFT_Imag[Cycle_Num,i] := FFT_Imag[Cycle_Num,i]/dc_val; END; END;  156  f**************************************************************************************** * * * * * Data_Num: number of data samples per revolution ^ * * Cycle_Num: number of revolutions sampled ^ ****************************************************************************************1 * EDA_ FFT_ Av10 : Averages the first 10 FFT Coefficients ^ * over the sample number^ *  PROCEDURE EDA_FFT_Av10(Data_Num,Cycle_Num:integer); VAR i,j^: integer; Sum_Real : real; Sum_Imag : real; BEGIN FOR j := 0 to 9 DO BEGIN Sum_Real := 0; Sum_Imag := 0; FOR i := 0 to Cycle_Num-1 DO BEGIN Sum_Real := Sum_Real + FFT_Real[i,jj; Sum_Imag := Sum_Imag + FFT_Imag[i,j]; END; FFT_Real[Cycle_Num,j] := Sum_Real/Cycle_Num; FFT_Imag[Cycle_Num,j] := Sum_Imag/Cycle_Num; END; END;  f* **** ****** ***** ****** ***** ***** ***** ****** **** ****** **** ****** **** ****** ***** ***** ****1 END.  157  (**** ****** ******** ****** ******** ****** ******** ****** ******** ****** ******** ***** ******** 1 (* FILE: EDA_Dis.pas (* WRITTEN BY: A. Kleinschmidt (* ON: May 18, 1993  r  (* UNIT WITH ROUTINES FOR GRAPHICAL DISPLAY OF THE DATA AND DISPLAY OF (* TEXT STRINGS IN VARIOUS LOCATIONS WHEN IN TEXT MODE Ck^  I 1 1 1 1 1  UNIT EDA_dis; INTERFACE USES dos, crt, graph, LabMast; CONST BackColor Command_LineY Data_LineY KeyCon_LineY MargX Title_LineY Status_LineY WriteColor  . 3; . 5; = 15; = 25; . 5; = 2; . 9; . 8;  {Background Color in Text mode is Cyan} {Offset for display of command prompt} {Offset for display of Data} {Offset for display of Key commands} {Right Margin Offset} {Offset for display of titles} {Offset for display of status text} {Text Color is DarkGrey}  PROCEDURE DIS_Graph_Data(Store_Data: Data_Ptr; I nc_Num, Cycle,Shift_Nu m ,Vert_Offset, Scale: integer; Color: word); PROCEDURE DIS_Graph_Freq(Store_Data: Data_PtnInc_Num, Cycle: integer; Color: word); PROCEDURE DIS_Graph_Setup_Freq; PROCEDURE DIS_Graph_Setup_Time; PROCEDURE DIS_Init_Text; PROCEDURE DIS_Print_Reflectivity(Mag,Angle,real_part,imag_partreal); PROCEDURE DIS_Write_Text(TextString:string; XPosition,YPosition:integer);  158  IMPLEMENTATION VAR ExitOld^: pointer;^{Saves old exit procedure pointer}  f* ******** ****** ********* ***** ********* ***** ******** ***** ********* ***** ******** ***** ***** * * * * *  DIS_Graph_Data: Graph Data (Store_Data) of a particular^ compensator revolution (Cycle), characterized by (Inc_Num) samples ^ per cycle. (Shift_Num) is the offset in samples needed to achieve ^ zero phase shift at the output of the ADC. (Vert_Off,Scale,Color) ^ are graphing parameters.^  * * * * *  **** *** ********** *** ********** *** ********** *** ********* *** ********** *** ********* *** *****1 PROCEDURE^DIS_Graph_Data(Store_Data:Data_Ptr; Inc_Num,Cycle,Shift_Num,Vert_Offset,Scale:integer; Color:word); VAR i,ip^: integer; tbase^: integer;^{graphing parameters} BEGIN i := 0; ip := 0; {DRAW GRAPH} SetColor(Color); SetLineStyle(DashedLn,O,NormWidth); Line(0,^(GetMaxY div 2)-(0-Vert_Offset) div Scale, GetMaxX, (GetMaxY div 2)-(0-Vert_Offset) div Scale); SetColor(2); Line(0,^(GetMaxY div 2)-(4095-Vert_Offset) div Scale, GetMaxX, (GetMaxY div 2)-(4095-Vert Offset) div Scale); SetColor(Color); SetLineStyle(SolidLn,O,NormWidth); tbase := 1; Putpixel(0, (GetMaxY div 2)-(Store_Data^ [i+Shift_Num+Cycle*Inc_Num]-Vert_Offset) div Scale,Color); FOR ip:= 0 to Inc_Num-2 DO BEGIN i := (ip+Shift_Num) MOD (Inc_Num-1); Line(tbase*1*ip, (GetMaxY div 2)-(Store_Data^ [i+Cycle*Inc_Num]-Vert_Offset) div Scale, tbase*1*(ip+1), (GetMaxY div 2)-(Store_Data" [1+1+Cycle*Inc_Num]-Vert_Offset) div Scale); END; END;  159  f****** ***** ************** ***** ************* ***** ************* ***** ************* ***** **** * * * * *  DIS_Graph_Freq: Graph FFT Data (Store_Data) of a particular compensator revolution (Cycle), characterized by (Inc_Num) samples per cycle. (Shift_Num) is the offset in samples needed to achieve zero phase shift at the output of the ADC. (Color) is a graphing parameters.  ** ******** ******* ********* ****** ********* ****** ******** ******* ******** ******* ******** ***1 PROCEDURE DIS_Graph_Freq(Store_Data:Data_Ptr; Inc_Num,Cycle:integer; Color:word); VAR : integer; tbase^: integer;^{graphing parameters} Vert_Offset : integer; BEGIN i := 0; Vert_Offset := 4*480 div 5; {DRAW GRAPH} SetColor(Color); SetLineStyle(SolidLn,O,NormWidth); tbase := 10; Putpixel(0, Vert_Offset-Store_Data^ [i+Cycle*Inc_Num] div 15,Color); FOR i := 0 to (Inc_Num div 2) - 2 DO BEGIN Line(tbase*5*i, Vert_Offset-Store_Data^ [i+Cycle*Inc_Nurnj div 15, tbase*5*(i+1), Vert_Offset-Store_Data^ [i+1+Cycle*Inc_Nurn] div 15); END; END;  {**************************************************************************************** DIS_Graph Setup_Freq : Setup Graph for frequency domain plot *************—***************************************************************************} PROCEDURE DIS_ Graph_Setup_Freq; VAR ^ GraphDriver : integer; ^ GraphMode : integer; ^ Color, BKColor : word; ^ XMax, YMax : integer; BEGIN {INITIALIZE GRAPHICS} CIrScr; GraphDriver := Detect; DetectGraph(GraphDriver, GraphMode); InitGraph(GraphDriver, GraphMode, 'CATP60\BG1'); CASE GraphDriver OF -1: writeln('NO GRAPHICS DEVICE DETECTED'); -3: writeln('DRIVER FILE NOT FOUND'); -4 : writeln('INVALID DRIVER LOADED'); -5: writeln('INSUFFICIENT MEMORY'); END; {CASE} ^ BkColor := 7; {Background color is light grey} SetBkColor(BkColor); 160  {DRAW OUTLINE OF GRAPH} Xmax := GetMaxX; Ymax := GetMaxY; Color := 2; {Outline and axes color is green} SetColor(Color); SetlineStyle(SolidLn,O,ThickWidth); {DRAW GRAPH BOX AND AXES} Rectangle(0,0,Xmax,Ymax); Line(0,4*YMax div 5,XMax,4*YMax div 5); END;  f**************************************************************************************** * DIS_Graph_Setup_Time : Setup Graph for time domain plots * ***** *************** ********* ************** ******** ************** ********* ************* *1 PROCEDURE DIS_Graph_Setup_Time; VAR integer; GraphDriver^: integer; GraphMode^: integer; Color, BKColor^: word; XMax, YMax^: integer; BEGIN {INITIALIZE GRAPHICS} CIrScr; GraphDriver := Detect; DetectGraph(GraphDriver, GraphMode); InitGraph(GraphDriver, GraphMode, 'CATP\BGI'); CASE GraphDriver OF -1: writeln('NO GRAPHICS DEVICE DETECTED'); -3: writeln('DRIVER FILE NOT FOUND'); -4 : writeln('INVALID DRIVER LOADED'); -5: writeln('INSUFFICIENT MEMORY'); END; {CASE} BkColor := 7;^ {Background color is light grey} SetBkColor(BkColor); {DRAW OUTLINE OF GRAPH} Xmax := GetMaxX; Ymax := GetMaxY; Color := 2;^ {Outline and axes color is green} SetColor(Color); SetlineStyle(SolidLn,O,ThickWidth); {DRAW GRAPH BOX} Rectangle(0,0,Xmax,Ymax); {DRAW HORIZONTAL AXIS} SetlineStyle(SolidLn,O,NormWidth); Line(0, Ymax div 2, Xmax, Ymax div 2); end;  161  {**************************************************************************************** * DIS 'nit Text: Initialize Text mode: Set background and text color^  *  ******-****-******************************************************************************} PROCEDURE DIS_Init_Text; BEGIN TextBackground(BackColor); clrscr; TextColor(WriteColor); END; f**************************************************************************************** * DIS Print Reflectivity: Write Tan(Psi) (Mag) and Rho (parts) to screen ^ * ******-*****-*****************************************************************************1 PROCEDURE DIS_Print_Reflectivity(Mag,Angle,real_part,imag_partreal); BEGIN DIS_Write_TexteTan('+Chr(232)+') = ',MargX,Data_LineY); GoToXY(WhereX+1,WhereY); writeln(Mag:8:6); DIS_Write_Text(Chr(127) +' = ',MargX+22,Data_LineY); G oToXY(WhereX + 1 ,Wh ereY) ; writeln(Angle:8:6); DIS_Write_Text(Chr(244)+' = ',MargX,Data_LineY+2); IF (imag_part < 0) THEN write(real_part:8:6,' -I ',abs(imag_part):8:6) ELSE write(real_part:8:6,' +i ',abs(imag_part):8:6); END;  f************************* ******************************************* ******************** * * DIS_ Write_ Text: Write TextString to screen at^ * position XPosition,YPosition ^ * ******************************************************** * *******************************1 PROCEDURE DIS_Write_Text(TextString:string; XPosition,YPosition:integer); BEGIN GoToXY(XPosition,YPosition); write(TextString); END;  162  f************************* ************ *************************** *********** ************1 {$F+} PROCEDURE DIS_exit; BEGIN TextBackground(0); TextColor(7); clrscr; ExitProc := ExitOld; END; {$F-}  {clrscr and set to black}  {re-install old Exit procedure}  f**************** **** ********************* **** ********************* **** *****************1 BEGIN ^ ExitOld := ExitProc; {mark address of Exit procedure} ^ ExitProc := @DIS_Exit; {define DIS_Exit as Exit procedure} END.  163  (***** ********* ******* ********* ******* ******** ******* ******** ******* ******** ******* ******  * * FILE: EDA_Align.pas^ * * WRITTEN BY: A. Kleinschmidt ^ * * ON: March 5, 1993^ * * * * PROGRAM TO ALIGN THE ANALYZER TO THE P-AXIS ^ * * AND THE POLARIZER TO THE S-AXIS^ ****************************************************************************************) PROGRAM EDA_Alig; USES crt, dos, graph, LabMast, EDA_Gath, EDA_dsp, EDA_dis; {$M 48384,32768,32768} CONST Angle_Data_Max = 20;^{Maximum number of samples for curve fit} TYPE ArrayPt = ^StoreArray; StoreArray = Array [0..Angle_Data_Max] of real; VAR Angle^: ArrayPt;^{Array of Analyzer angles} Answer^: char;^{Keyboard character input} DataFile^: text;^{File for analyzer angles to be fitted} DMA_Data^: Data_Ptr;^{Address of DMA Data} Gain_Num^: GainPtr;^{Detector and LabMaster gain values} Get_Data^: string;^{Error code} IsExit^: Boolean;^{Exit flag} MAG^: ArrayPtr;^{Magnitude of Fourier coefficient} Rev_Num^: integer;^{Number of revolutions to measure}  (**************************************************************************************** * * * * * * * *  Procedure prompts for the analyzer to be turned to the angle displayed. After a key has been pressed indicating that the angle has been set, the magnitude of the 4th Fourier coefficient measured at this time is saved and stored in DataFile along with the angle value. After Angle_Data_Max values have been taken or if ('e','E') has been pressed the procedure terminates.^ ^ Angle_at_Max : Estimate of best Analyzer setting ^ Harm^: Number of the Fourier Coefficient  * * * ****************************************************************************************) PROCEDURE Angle_Array(Angle_at_Max:real; Harm:integer); VAR integer; BEGIN writeln(DataFile,Angle_Data_Max:8); DIS_Write_Text('# ANGLE MAG',MargX,Data_LineY); i := 0; IsExit := FALSE; 164  ^  REPEAT Angle [i] := (Angle_at_Max - 5) + 0.51; DIS_Write_Text('TURN TO ANGLE: ',MargX,Command_LineY+2); GoToXY(WhereX,WhereY); write(Angle^ [i]:8:1); DIS_Write_Text('Press Any Key When Ready...',MargX,Command_LineY+3); WHILE (NOT Keypressed) DO BEGIN Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,hi); DIS_Write_Text(Get_Data,MargX,Status_LineY); {ADJUST GAIN} GATH_GainSet(DMA_Data,Gain_Num,Data_Num,Rev_Num); IF (GATH_Gain_Err = -2) THEN BEGIN GATH_Dark_Exit; exit; END; GATH_HARMONICS(Harm,DMA_Data,Data_Num,Rev_Num,0); MAG^ [i] := DSP_FOURIER_Mag(FOURIER_Coef_A[Rev_Num,Harm], FOURIER_Coef B[Rev_Num,Harm]); MAG^ [i] := sqr(MAG^ [i]); G0T0XY(MargX,Data_LineY+1+(i MOD 8)); ClrEOL; write(i+1:0,",Angle " [11:4:1,",MAG " [i]:8:4); END; {WHILE} Answer := ReadKey; IF (Answer IN re','El) THEN IsExit := TRUE; {WRITE SQUARED MAGNITUDE OF NORMALIZED FOURIER COEFFICIENT TO FILE} writeln(DataFile,Angle" [i]:8:1,",MAG ^ [i]:8:4); inc(i); UNTIL (IsExit OR (i = Angle_Data_Max)); END;  (********************************* ** ********************************** ** ***************** * Procedure to find either the maximum or the minimum absolute value of * the harmonic desired. The search for the maximum is used to find the * starting point for the more accurate adjustment of the analyzer angle. * Also used to find the minimum for the adjustment of the polarizer angle. * Max_Min : True - find minimum value. False - find maximum value. * Harm^: either second or^fourth. ***************************************************************************************1 PROCEDURE Find_Max_Min(Max_Min:Boolean; Harm:integer); VAR MAG_of_Harm^: real; Rough_Max_Min^: real; BEGIN Rough_Max_Min := Ord(Max_Min); IF (NOT Max_Min) THEN DIS_Write_Text(' MAG(4)^Maximum',MargX,Data_LineY) ELSE DIS_Write_Text(' MAG(2)^Minimum',MargX,Data_LineY); REPEAT Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,hi); DIS_Write_Text(Get_Data,MargX,Status_LineY); {ADJUST GAIN} GATH_GainSet(DMA_Data,Gain_Num,Data_Num,Rev_Num); IF (GATH_Gain_Err = -2) THEN BEGIN GATH_Dark_Exit; exit; END; 165  GATH HARMONICS(Harm,DMA Data,Data Num,Rev Num,0); MA6_ Harm of _ := DSP _ -FOURIER- Mag(F5URIER _ Coef A[Rev _ Nurn , Harm], n FOURIER_Coef_B[Rev_Num,Har:1-]); IF ((MAG_of Harm > Rough_Max_Min) AND NOT Max_Min) THEN Rough_Max_Min := MAG_of_Harm; IF ((MAG_of Harm < Rough_Max_Min) AND Max_Min) THEN Rough_Max_Min := MAG_of Harm; {PRINT MAGNITUDE OF NORMALIZED FOURIER COEFFICIENT} GoToXY(MargX,Data_LineY+1); write(MAG_of Harm:8:4,",Rough_Max_Min:8:4); UNTIL KeyPressed; END;  (**************************************************************************************** * * * * * * * * *  Procedure to rotate the analyzer and polarizer to the proper quadrant: The analyzer should lie on the P-axis. Problem here is that there is absolutely no way to distinguish between analyzer alignment to the P- or S-axes by examining the data. For this instrument - the P_Axis lies in the 2nd or fourth quadrant for both the polarizer and analyzer. Gross rotational misalignment of these modules or vernier scales will void these values. A : Analyzer angle. P : Polarizer angle.  (**************************************************************************************1  PROCEDURE Rotate_so_Anal_on_P(VAR A:real; VAR P:real); VAR Arad^: real; FlushKey^: char; BEGIN Arad := Pl*A/180; IF (SIN(Arad)*COS(Arad) > 0) THEN BEGIN IF ((A+90) > 359.9) THEN A := A - 270 ELSE A := A + 90; IF ((P+90) > 359.9) THEN P := P - 270 ELSE P := P + 90; DIS_Write_Text('ROTATE ANALYZER TO: ',MargX,Command_LineY); GoToXY(WhereX,WhereY); write(A:8:1); DIS_Write_Text('ROTATE POLARIZER TO: ',MargX,Command_LineY+1); GoToXY(WhereX,WhereY); write(P:8:1); DIS_Write_Text('Press any Key when Ready...',MargX,Command_LineY+ 2) ; WHILE (NOT KeyPressed) DO; FlushKey := ReadKey; CIrScr; END; END;  166  (**************************************************************************************** * Function to prompt the operator to enter an angle value: either the * analyzer or the polarizer angle, depending on the operation in which * this function is used. * IsLoop_Done : Flag to signal angle entry complete * IsLoop_Exit : Flag to abort program. Set by either 'e' or 'E'  ****************************************************** * ********************************1 FUNCTION Input_Angle(VAR IsLoop_Done:Boolean; VAR IsLoop_Exit:Boolean): real; VAR St_Err^: integer; Text_Value : string[6]; Value^: real; FlushKey^: char; BEGIN G0T0XY(MargX,Command_LineY+3); ClrEOL; Sound (200) delay(150); NoSound; IsLoop_Done := FALSE; IsLoop_Exit := FALSE; FlushKey := ReadKey; REPEAT G0T0XY(MargX,Command_LineY+2); ClrEOL; DIS_Write_Text('INPUT ANGLE: ',MargX,Command_LineY+3); Readln(Text_Value); Val(Text_Value,Value,St_Err); IF (Text_Value[1] IN ['e','E']) THEN ISLoop_Exit := TRUE; UNTIL (((Value >= 0) AND (Value < 360) AND (St_Err = 0)) OR IsLoop_Exit); IsLoop_Done := TRUE; Input_Angle := Value; END;  167  (**************************************************************************************** *^ MAIN PROGRAM * ****************************************************************************************) CONST Max^= FALSE; Min^= TRUE; VAR Anal_Angle_to^: real;^{Angle to set analyzer to} Coef^: array [1..4] of real; {Returned by fitting program} FitFile^: text;^{File in which Coef are returned} Harm^: integer;^{Number of the harmonic: second or fourth} integer; IsDone^: Boolean;^{Flag to signal end of a loop} Line^: string[80]; ParameterFile^: FILE of real; {Stores aligned analyzer and polarizer angles} Pol_Angle_to^: real;^{Angle to set polarizer to} St_Err^: integer;^{String to numerical value conversion error code} BEGIN {INITIALIZE DATA FILE AND MESSAGES} DIS_Init_Text; DIS_Write_Text('ALIGNMENT ROUTINE FOR INSITU ELLIPSOMETER.',MargX+15,Title_LineY); DIS_Write_Text(Initializing. Please Wait...',MargX,Command_LineY); Assign(DataFile,'C:Align.dat'); Assign(FitFile,'C:Align.fit'); Assign(ParameterFile,'C:Align.par'); Rewrite(DataFile); {INITIALIZE VARIABLES} Angle := NEW(ArrayPtr); MAG := NEW(ArrayPtr); DMA_Data := NEW(Data_Ptr); Gain_Num := NEW(GainPtr); DSP_FOURIER_Init(Data_Num); Rev_Num := 3; {INITIALIZE LABMASTER PORTS: A=OUT; B=OUT; C=IN} port[PORTIO_CON] := Port_Con_Word; GATH_LASER_ON; GATH_MOTOR_ON(hi); {SET INITIAL GAIN - WILL BE ADJUSTED DURING DATA COLLECTED} Gain_Num^.Det:= 0; Gain_Num'N.LM := 0; {ADJUST LABMASTER GAIN OR EXIT IF GAINSET ERROR} REPEAT Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,hi); DIS_Write_Text(Get_Data,MargX,Status_LineY); GATH_GainSet(DMA_Data,Gain_Num,Data_Num,Rev_Num); UNTIL ((GATH_Gain_Err = 0) OR (abs(GATH_Gain_Err) = 2));  168  {STEP 1: DO COARSE ALIGNMENT OF POLARIZER - LOOK FOR MINIMUM IN SECOND HARMONIC} clrscr; DIS_Write_Text('COARSE ALIGNMENT OF Polarizer',MargX+15,Title_LineY); DIS_Write_Text('SET Polarizer FOR MINIMUM IN SECOND HARMONIC',MargX,Command_LineY); DIS_Write_Text('Press any key to capture data...',MargX,Keycon_LineY); Find_Max_Min(Min,2); IF (GATH_Gain_Err = -2) THEN exit; DIS_Write_Text('ENTER Polarizer ANGLE:',MargX,Command_LineY+1); DIS_Write_Text('Press "E" to EXIT... ^',MargX,Keycon_LineY); REPEAT Pol_Angle_to := Input_Angle(IsDone,IsExit); IF IsExit THEN exit; UNTIL IsDone; CIrScr; {STEP 2: DO COARSE ALIGNMENT OF ANALYZER - LOOK FOR MAXIMUM IN FOURTH} DIS_Write_Text('COARSE ALIGNMENT OF ANALYZER',MargX+15,Title_LineY); DIS_Write_Text('SET ANALYZER FOR MAXIMUM IN FOURTH HARMONIC',MargX,Command_LineY); DIS_Write_Text('SET Polarizer TO ANGLE: ',MargX,Command_LineY+1); GoToXY(WhereX,WhereY); write(Pol_Angle_to:8:1); DIS_Write_Text('Press any key to capture data...',MargX,Keycon_LineY); Find_Max_Min(Max,4); IF (GATH_Gain_Err = -2) THEN exit; DIS_Write_Text('ENTER ANALYZER ANGLE:',MargX,Command_LineY+2); DIS_Write_Text('Press "E" to EXIT... ^',MargX,Keycon_LineY); REPEAT Anal_Angle_to := Input_Angle(IsDone,IsExit); IF IsExit THEN exit; UNTIL IsDone; CIrScr; {STEP 3: CHECK TO SEE WHETHER ANALYZER IS ORIENTED TO S- OR P-AXIS} {IF TO S-AXIS THEN ROTATE A AND P BY +/-90 DEGREES} Rotate_so_Anal_on_P(Anal_Angle_to,Pol_Angle_to); {STEP 4: DO FINE ADJUSTMENT OF Polarizer - LOOK FOR MINIMUM IN SECOND} {PRINCIPLE: MAG 4th varies approximately linearly with A near its maximum. MAG 2nd is very sensitive to changes in P - varying linearly to a minimum close to zero} Rev_Num := 9; DIS_Write_Text('FINE ALIGNMENT OF Polarizer,MargX+15,Title_LineY); DIS_Write_Text(SET ANALYZER TO ANGLE: ',MargX,Command_LineY); GoToXY(WhereX,WhereY); write(Anal_Angle_to:8:1); DIS_Write_Text('TURN Polarizer SLOWLY ABOUT SET ANGLE - SET FOR MINIMUM IN SECOND', MargX,Command_LineY+1); DIS_Write_Text('Press any key to capture data...',MargX,Keycon_LineY); Find_Max_Min(Min,2); IF (GATH_Gain_Err = -2) THEN exit; DIS_Write_Text('ENTER Polarizer ANGLE:',MargX,Command_LineY+2); DIS_Write_Text('Press "E" to EXIT... ^',MargX,Keycon_LineY);  169  REPEAT Pol_Angle to := Input_Angle(IsDone,IsExit); IF IsExit THEN exit; UNTIL IsDone; CIrScr; {STEP 5: FINE ADJUSTMENT OF ANALYZER USING QUADRATIC FIT ROUTINE} DIS Write Text('FINE ALIGNMENT OF ANALYZER',MargX+15,Title LineY); DIS—Write—TexteSET Polarizer TO ANGLE: ',MargX,Command_Line■r); nhere foXY( X,WhereY); write(Pol_Angle_to:8:1); Go DIS Write_Text('Press "E" to EXIT...^',MargX,Keycon_LineY); Array(Anal Angle_to,4); Angle_ IF IsExit THEN exit; IF (GATH Gain_Err = -2) THEN exit; close(DatiF ile); {RUN C PROGRAM TO QUADRATIC FIT COEFFICIENTS AND RETURN ERROR CODE, GOODNESS OF FIT AND ALIGNED ANALYZER ANGLE} Exec('c:\kle\proto1\Ang_Fit.exe ','Ang_Fit '); CIrScr; DOSERROR := DosExitCode; IF ((DOSERROR <> 0) AND (DOSERROR <> 32)) THEN BEGIN DIS_Writelext('DOS Error: ',MargX,Status_LineY); GoToXY(WhereX,WhereY); write(DOSERROR); END; Reset(FitFile); FOR i := 1 to 2 DO BEGIN Readln(FitFile,Line); Val(Line,Coef[i],St_Err); END; {CHECK FOR GOODNESS OF FIT} IF (Coef[1] <0.4) THEN BEGIN DIS_Write_Text('Poor Fit. Press Any Key to Continue.',MargX,Status_LineY+1); Answer := ReadKey; END ELSE Anal_Angle_to := Coef[2]; close(FitFile); CIrScr; {STEP 6: DO FINAL ADJUSTMENT OF Polarizer - LOOK FOR MINIMUM IN SECOND} Rev_Num := 9; DIS_Write_Text('FINE ALIGNMENT OF Polarizer,MargX+15,Title_LineY); DIS_Write_Text('SET ANALYZER TO ANGLE: ',MargX,Command_LineY); GoToXY(VVhereX,WhereY); write(Anal_Angle_to:8:1); DIS_Write_Text('TURN Polarizer SLOWLY ABOUT SET ANGLE - SET FOR MINIMUM IN SECOND', MargX,Command_LineY+1); DIS_Write_Text('Press any key to capture data...',MargX,Keycon_LineY); Find_Max_Min(Min,2); IF (GATH_Gain_Err = -2) THEN exit; DIS_Write_Text('ENTER Polarizer ANGLE:',MargX,Command_LineY+2); 170  DIS_Write_Text('Press "E" to EXIT...^',MargX,Keycon_LineY); REPEAT Pol_Angle_to := Input_Angle(IsDone,IsExit); IF IsExit THEN exit; UNTIL IsDone; CIrScr; DIS_Write_Text('ALIGNMENT COMPLETED',MargX+15,Title_LineY); rewrite(ParameterFile); write(ParameterFile,Anal_Angle_to,Pol_Angle_to); close(ParameterFile); Dispose(Angle); Dispose(MAG); Dispose(DMA_Data); Dispose(Gain_Num); delay (500); END. /*#######################################################*/ *1 /* FILE: ANG_FIT.0 *1 /* A. Kleinschmidt *1 /*^18.1.93 */ /* */ /* A PROGRAM, ACCESSED BY "EDA_ALIGN.PAS", WHICH READS THE ANGLE AND *1 /* MAGNITUDE DATA TO DETERMINE THE QUADRATIC FIT COEFFICIENTS */ /* AND GOODNESS OF FIT. THIS, ALONG WITH THE CALCULATED ANGLE AT */ /* WHICH THE DATA IS AN EXTREMA IS WRITTEN TO A FILE: "ALIGN.FIT" *1 /* WHICH IS USED BY THE CALLING PROGRAM "EDA_ALIGN.PAS". /*#######################################################*/ #include <stdio.h> #include <math.h> #include <malloc.h> #include <C:\TC\RECIPES\svdfit.c> #include <C:\TC\RECIPES\svdcmp.c> #include <CATC\RECIPES\svbksb.c> #include <CATC\RECIPES\svdvar.c> #include <C:\TC\RECIPES\gammq.c> #include <CATC\RECIPES\gcf.c> #include <C:\TC\RECIPES\gser.c> #include <CATC\RECIPES\gammln.c> #include <C:\TC\nrutil.c> void funcs(float x,float *afunc,int order_a) { int^i; afunc[1] = 1; for (1=2; i<=order_a; i++) afunc[i] = afunc[i-1]*x; 1  171  main() 1 int^i, ndata, ma; char^line[80]; float^X[21], Y[21], SD[21]; float^PI; float^A[21], **U, **V, **CVM, W[21], *chisq, Vnu, Q; FILE^*filename1, *filename2; PI = 3.141593; cIrscr(); ma = 3; /* FIT TO A QUADRATIC MODEL (ma = 4 FOR CUBIC) */ filename1 = fopen("C:align.dat", "rt"); filename2 = fopen("C:align.fit", "wt"); /* READ IN SAMPLE SIZE */ fgets(line, 80, filename1); sscanf(line, "%d\n",&ndata); /* READ IN DATA FROM PROCESSED DATA FILE TO X,Y,SD ARRAYS */ for (i=1; i<=ndata; i++) { SD[i] = 1; fgets(line, 80, filename1); sscanf(line, "%f %f\n", &X[i], &Y[i]); } fclose(filename1); U = matrix(1,ndata,1,ma); V = matrix(1,ma,1,ma); CVM = matrix(1,ma,1,ma); for (1=1; i<=ndata; i++) X[i] *= PI/180.0; /* LEAST SQUARES FIT */ svdfit(X,Y,SD,ndata,A,ma,U,V,W,chisq,funcs); /* EVALUATE PROBABILITY Q */ Vnu = (ndata-ma)/2; Q = gammq(Vnu, *chisq/2); fprintf(filename2"10.61\n",Q); /* PRINT OUT ANGLE AT MAXIMUM */ A[1] = -0.5*A[2]/A[3]; A[1] *= 180.0/PI; fprintf(filename2"10.61\n", A[1]); fclose(filename2); clrscr(); }  (****************** ********************** ************************************ ************ * * * * * *  FILE: EDA_Set.pas WRITTEN BY: A. Kleinschmidt ON: March 5, 1993 PROGRAM TO CALIBRATE FOR THE AMPLIFIER GAIN AND PHASE ROLLOFF AND THE SHAFT ENCODER TRIGGER PHASE  ******** ******************************* *************** ****************************** ****) PROGRAM EDA_Set; {$M 64384,32768,32768} USES crt, dos, graph, LabMast, EDA_Gath, EDA_dsp, EDA_dis; CONST ^ ^ Mag_Tol_crossed = 0.975; {Minimum value for Mag(4) when A & P crossed} ^ ^ Mag_Tol_aligned = 0.280; {Maximum value for Mag(4) when A & P aligned} ^ ^ Zero_Tol = 0.0010; {Zero tolerance for Fourier B(2) Coef} VAR Anal_Angle_to Answer C_Shift C_Shift_store DataFile DMA_Data Exit_Key Gain_Cor Gain_Num Get_Data Harmonics i Last_Fourier_B MAG Motor_Speed Old_Gain ParameterFile PHASE Phase_Cor Pol_Angle_to PrintDevice Rev_Num temp  : real;^{Analyzer angle setting} : char;^{Keyboard character input} : integer;^{Trigger phase correction} : array [second „fourth] of integer; : FILE of real; {Stores calibration coefficients} : Data_Ptr;^{Address of DMA Data} : Boolean; : array [second..fourth] of real; {Calibrated Gain correction} : GainPtr;^{Detector and LabMaster gain values} : string;^{Error code} : Harm_Index; {Fourier Coefficient number} : integer; : real;^{Previous value of B4} : array [second..fourth] of real; : Speed_Index; : integer;^{Previous value of Detector gain} : FILE of real; {Contains Analyzer and polarizer settings} : array [second..fourth] of real; : array [second..fourth] of real; {Calibrated Phase correction} : real;^{Polarizer angle setting} : text; : integer;^{Number of revolutions to measure} : real;^{Temporary storage variable}  173  (**************************************************************************************** * * * *  Measures the number of samples to offset until the shaft encoder trigger phase becomes less than one incremental bit. The subroutine does this by checking for a change in sign of the imaginary part of the 4th coefficient and a positive real part.  ***************************************************************************************1  PROCEDURE Measure_C_Shift(VAR Exit_Flag:Boolean); BEGIN Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,Motor_Speed); DIS_Write_Text(Get_Data,MargX,Status_LineY); {ADJUST GAIN} GATH_GainSet(DMA_Data,Gain_Num,Data_Num,Rev_Num); IF (GATH_Gain_Err = -2) THEN BEGIN GATH_Dark_Exit; exit; END; REPEAT IF KeyPressed THEN Exit_Flag := TRUE; Last_Fourier_B := FOURIER_Coef B[Rev_Num,4]; {CALCULATES THE FOURIER COEFFICIENTS} GATH_HARMONICS(4,DMA_Data,Data_Num,Rev_Num,C_Shift); MAG[fourth] := DSP_FOURIER_Mag(FOURIER_Coef_A[Rev_Num,4], FOURIER_Coef_B[Rev_Nurn,4]); PHASE[fourth] := ARCTAN(FOURIER_Coef B[Rev_Num,4]/FOURIER_Coef A[Rev_Num,4]); Inc(C_Shift); G0T0XY(MargX,Data_LineY+2); write(PHASE[fourth]:8:4,",C_Shift-1,' IF (MAG[fourth] < Mag_Tol_crossed) THEN BEGIN DIS_Write_Text('Calibration Error. Redoing. (Any key to exit)', MargX,Status_LineY-1); dec(C_Shift) END ELSE BEGIN G0T0XY(MargX,Status_LineY-1); ClrEOL; END; UNTIL WFOURIER_Coef_B[Rev_Num,4]*Last_Fourier_B) < 0) AND (FOURIER_Coef A[Rev_Num,4] <0) AND (MAG[fourth] > Mag_Tol_crossed) OR (Exit_Flag = TRUE)); dec(C_Shift); END;  (************************************* *** ********************************************** ** * MAIN PROGRAM  ***************************************************************************************1 BEGIN {INITIALIZE DATA FILE AND MESSAGES} DIS_Init_Text; DIS_Write_Text('CALIBRATION ROUTINE FOR INSITU ELLIPSOMETER.',MargX+15,Title_LineY); DIS_Write_Text(Initializing. Please Wait...',MargX,Command_LineY); Assign(PrintDevice,'LPT1'); Rewrite(PrintDevice); Assign(DataFile;C:cal_data.dat'); Rewrite(DataFile); Assign(ParameterFile,'C:align.par'); 174  Reset(ParameterFile); {INITIALIZE VARIABLES} read(ParameterFile,Anal_Angle_to); read(ParameterFile,Pol_Angle_to); writeln(PrintDevice,'P-Axis at Analyzer Angle = ',Anal_Angle_to:8:2); writeln(PrintDevice,'S-Axis at Polarizer Angle = ',Pol_Angle_to:8:2); close(ParameterFile); DMA_Data := NEW(Data_Ptr); Gain_Num := NEW(GainPtr); DSP_FOURIER_Init(Data_Num); {WARNING - FIRST CYCLE HAS FREQUENT GLITCH!} Rev_Num := 9; {INITIALIZE LABMASTER PORTS: A=OUT; B=OUT; C=IN} port[PORTIO_CON] := Port_Con_Word; DIS_Write_Text('ALIGN ANALYZER TO: ',MargX,Command_LineY); GoToXY(WhereX,WhereY); writeln(Anal_Angle_to:8:2); DIS_Write_Text('ALIGN POLARIZER TO: ',MargX,Command_LineY+1); GoToXY(WhereX,WhereY); writeln(Pol_Angle_to:8:2); DIS_Write_Text('Press any Key when ready...',MargX,Command_LineY+3); Answer := ReadKey; Motor_Speed := lo; GATH_MOTOR_ON(Motor_Speed); GATH_LASER_ON; {SET INITIAL GAIN - WILL BE ADJUSTED DURING DATA COLLECTED} Gain_Num".Det:= 0; Gain_Num ^ .LM := 0; {ADJUST LABMASTER GAIN OR EXIT IF GAINSET ERROR} REPEAT Old_Gain := Gain_Num".Det; Get_Data := GATH_Data(DMA_Data,Gain_Num,DataNum,Rev_Num,Motor_Speed); DIS_Write_Text(Get_Data,MargX,Status_LineY); GATH_GainSet(DMA_Data,Gain_Num,Data_Num,Rev_Num); UNTIL ((GATH_Gain_Err = 0) OR (abs(GATH_Gain_Err) = 2) OR (abs(Gain_Num^.Det-Old_Gain) = 0)); {BEGIN CALIBRATION PROCEDURE - CALIBRATE GAIN FOR 2nd and 4th HARMONICS} {ANALYZER SET TO P-AXIS; POLARIZER SET TO S-AXIS} clrscr; DIS_Write_Text('CALIBRATION FOR GAIN COEFFICIENTS',MargX+15,Title_LineY); C_Shift := 0; FOR Harmonics := second to fourth DO BEGIN REPEAT IF KeyPressed THEN Exit; Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,Motor_Speed); DIS_Write_Text(Get_Data,MargX,Status_LineY); {ADJUST GAIN} GATH_GainSet(DMA_Data,Gain_Num,Data_Num,Rev_Num); IF (GATH_Gain_Err = -2) THEN BEGIN GATH_Dark_Exit; exit; END; GATH _HARMONICS(4,DMA_Data,Data_Num,Rev_Num,C_Shift); 175  MAG[Harmonics] := DSP_FOURIER_Mag(FOURIER_Coef A[Rev_Num,4], FOURIER_Coef B[Rev_Num,4]); IF (MAG[Harmonics] < Mag_Tol_crossed) THEN DIS_Write_Text('Calibration Error. Redoing. (Any key to exit)', MargX,Status_LineY-1) ELSE BEGIN G0ToXY(MargX,Status_LineY-1); ClrEOL; END; UNTIL (MAG[Harmonics] > Mag_Tol_crossed); {CALCULATE AND PRINT OUT GAIN COEFFICIENTS} Gain_Cor[Harmonics] := MAG[Harmonics]; Motor_Speed := hi; GATH_MOTOR_ON(Motor_Speed); END; {FOR} writeln(PrintDevice,'Gain Correction for 2nd Harmonic = ',Gain_Cor[second]:8:4); writeln(PrintDevice,'Gain Correction for 4th Harmonic = ',Gain_Cor[fourth]:8:4); write(DataFile,Gain_Cor[second]); write(DataFile,Gain_Cor[fourth]); {BEGIN PHASE CALIBRATION PROCEDURE} {CALIBRATE PHASE FOR 2ND AND 4TH HARMONICS FOR DATA_NUM = 512} clrscr; DIS_Write_Text('CALIBRATION FOR TRIGGER SHIFT AND PHASE COEFFICIENTS', MargX+15,Title_LineY); DIS_Write_Text('Press Any Key to EXIT',MargX+17,KeyCon_LineY); delay(1000); C_Shift := 0; writeln(PrintDevice,'Calibrating for ',Data_Num,' Measurements per Cycle'); DIS_Write_Text('Calibrating for Harmonic: ',MargX,Data_LineY); GoToXY(WhereX,Data_LineY); write(4:2,'. Please Wait.'); DIS_Write_Text('Phase (rad) Trigger Shift',MargX,Data_LineY+1); FOURIER_Coef B[Rev_Num,4] := 0; Exit_Key := FALSE; Measure_C_Shift(Exit_Key); IF (Exit_Key) THEN Exit; Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,Motor_Speed); DIS_Write_Text(Get_Data,MargX,Status_LineY); GATH_HARMONICS(4,DMA_Data,Data_Num,Rev_Num,C_Shift); PHASE[fourth] := ARCTAN(FOURIER_Coef B[Rev_Num,4]/FOURIER_Coef_A[Rev_Nurri,4]); writeln(PrintDevice,'Trigger Shift and Phase Correction for 4th Harmonic = ',C_Shift:8,' ',PHASE[fourth]:8:4); {CALIBRATE FOR RELATIVE PHASE SHIFT OF SECOND HARMONIC} CIrScr; DIS_Write_Text('Calibrating for Harmonic: ',MargX,Data_LineY); GoToXY(WhereX,Data_LineY); write(2:2,'. Please Wait.'); GATH_MOTOR_ON(10); Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,Motor_Speed); DIS_Write_Text(Get_Data,MargX,Status_LineY); GATH_HARMONICS(4,DMA_Data,Data_Num,Rev_Num,C_Shift); PHASE[second] := 0.5*ARCTAN(FOURIER_Coef B[Rev_Num,4]/FOURIER_Coef A[Rev_Num,4]); {CHECK IF PHASE OF SECOND HARMONIC IS IN THE PROPER QUADRANT BY ROTATING} {P BY -90. A2 SHOULD THEN BE NEGATIVE} GATH_MOTOR_ON(hi); delay(1000); 176  DIS_Write_Text('ALIGN Polarizer TO: ',MargX,Command_LineY+1); GoToXY(WhereX,WhereY); writeln((P0l_Angle_to-90.0):8:2); GoToXY(1,KeyCon_LineY); CLrEOL; DIS_Write_Text('Press any Key when ready...',MargX,Command_LineY+3); Answer := ReadKey; {ADJUST LABMASTER GAIN OR EXIT IF GAINSET ERROR} REPEAT Old_Gain := Gain_Num^.Det; Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,Motor_Speed); DIS_Write_Text(Get_Data,MargX,Status_LineY); GATH_GainSet(DMA_Data,Gain_Num,Data_Num,Rev_Num); UNTIL (((GATH_Gain_Err = 0) AND (abs(Gain_Num .Det-Old_Gain) = 0)) OR (abs(GATH_Gain_Err) = 2)); Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,Motor_Speed); DIS_Write_Text(Get_Data,MargX,Status_LineY); GATH_HARMONICS(2,DMA_Data,Data_Num,Rev_Num,C_Shift); DSP_MAG_PHASE_COR(Gain_cor[second],PHASE[second] ,Rev_Num,2); {ADJUST PHASE OF SECOND BY PI IF IN THE WRONG QUADRANT} IF (FOURIER_Coef_A[Rev_Num,2] <0) THEN BEGIN PHASE[second] := PHASE[second] + PI; DIS_Write_Text(Adjusting Phase of Second Harmonic by PI',MargX,Data_LineY+1); END; writeln(PrintDevice,'Trigger Shift and Phase Correction for 2nd Harmonic = ',C_Shift:8,' ',PHASE[second]:8:4); {SAVE C_SHIFT COEFFICIENT ALONG WITH ANALOG PHASE CORRECTIONS} DIS_Write_Text('Calibration data is written to Binary DataFile', MargX, Status_LineY); DIS_Write_Text('called: "C:Cal_Data.dat"',MargX, Status_LineY+1); temp := 1.0*C_Shift; write(DataFile,temp); write(DataFile,PHASE[second]); write(DataFile,temp); write(DataFile,PHASE[fourth]); delay (2500); {CHECK CALIBRATION BY ADJUSTING DATA BY CALIBRATION {COEFFICIENTS AND DISPLAYING THE RESULTS} CIrScr; DIS_Write_Text('CHECKING CALIBRATION',MargX+15,Title_LineY); DIS_Write_Text(' A2^B2^MAG2^PHASE2^A4^B4^MAG4^PHASE4', 1,Data_LineY); DIS_Write_Text('Press Any Key to EXIT',MargX+17,KeyCon_LineY); Reset(DataFile); {READ IN CALIBRATION COEFFICIENTS} read(DataFile,Gain_Cor[secondj); read(DataFile,Gain_Cor[fourth]); FOR Harmonics := second to fourth DO BEGIN read(DataFile,temp); C_Shift_store[Harmonics] := Round(temp); 177  read(DataFile,Phase_cor[Harmonics]); END; WHILE NOT KeyPressed DO BEGIN IF KeyPressed THEN Exit; Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,Motor_Speed); DIS_Write_Tod(Get_Data,MargX,Status_LineY); {ADJUST GAIN} GATH_GainSet(DMA_Data,Gain_Num,Data_Num,Rev_Num); IF (GATH_Gain_Err = -2) THEN BEGIN GATH_Dark_Exit; exit; END; {CALCULATE THE FOURIER COEFFICIENTS} GATH_HARMONICS(2,DMA_Data,Data_Num,Rev_Num,C_Shift_store[second]); GATH_HARMONICS(4,DMA_Data,Data_Num,Rev_Num,C_Shift_store[fourth]); DSP_MAG_PHASE_COR(Gain_cor[second],Phase_cor[second] ,Rev_Num,2); DSP_MAG_PHASE_COR(Gain_cor[fourth],Phase_cor[fourth],Rev_Num,4); MAG[second] := DSP_FOURIER_Mag(FOURIER_Coef_A[Rev_Num,21, FOURIER_Coef_B[Rev_Num,2]); PHASE[second]:= ARCTAN(FOURIER_Coef B[Rev_Num,2]/FOURIER_Coef_A[Rev_Num,2]); MAG[fourth] := DSP_FOURIER_Mag(FOURIER_Coef_A[Rev_Num,4], FOURIER_Coef_B[Rev_Num,4]); PHASE[fourth] := ARCTAN(FOURIER_Coef B[Rev_Num,4]/FOURIER_Coef_A[Rev_Num,4]); {PRINT NORMALIZED 2ND AND 4TH FOURIER COEFFICIENTS} G0T0XY(1,Data_LineY+1); write(Fourier_Coef A[Rev_Num,2]:8:4,", Fourier_Coef_B[Rev_Num,2]:8:4,", MAG[second]:8:5,", PHASE[second]:8:5,", Fourier_Coef_A[Rev_Num,4]:8:4,' ', Fourier_Coef B[Rev_Num,4]:8:4,' ', MAG[fourth]:8:5,", PHASE[fourth]:8:5); delay (300); END; {WHILE} Answer := ReadKey; {DISPLAY THE DETECTOR DATA FOR THE REV_NUM CYCLES} DIS_Graph_Setup_Time; FOR i := 1 to Rev_Num-1 DO DIS_Graph_Data(DMA_Data,Data_Num,i,C_Shift_store[fourth] ,2050,10,i+1); Answer := ReadKey; Closegraph; Dispose(DMA_Data); Dispose(Gain_Num); close(DataFile); close(PrintDevice); END.  178  (********************* ************** *************************** ************** ************ * * * * * *  FILE: EDA_Meas.pas WRITTEN BY: A. Kleinschmidt ON: June 22, 1993 MAIN PROGRAM TO ACQUIRE THE PHOTODETECTOR DATA AND CALCULATE THE COMPLEX REFLECTIVITY OF THE SAMPLE (RHO) FROM THE STOKES PARAMETERS.  ***************************************************************************************1 PROGRAM EDA_Meas; USES crt, dos, graph, LabMast, EDA_Gath, EDA_dsp, EDA_dis; CONST Q = 1.1400; R = 0.9901; S = 0.0052; Rev_Num_Limits = [1..16]; VAR Anal_Angle_to ANGLE ERROR Answer ControlKey COS_DELTA C_ Shift _store DataFile DELTA DMA_Data ExitOld Gain_Cor Gain_Num Get_Data i,j LM_Gain Motor_Speed ParameterFile Present_Gain Phase_Cor Pol_Angle_to Pol_Set_to PrintDevice Rev_Num Rho SIN_DELTA St_Err Stoke_Vector TAN PSI temp T_samp Xi Xo  {Compensator parameters} {Maximum number of cycles allowed}  : real;^{Analyzer angle setting} : real;^{Calculated error between Cos and Sin(Delta)} : string[5];^{Keyboard character string input} : char;^{Keyboard character input} : real; : array [1..2] of integer;^{Correction for trigger phase} : FILE of real; {Contains calibration coefficients} : real;^{Phase of the reflectivity} : Data_Ptr;^{address of DMA Data} : pointer;^{Old exit procedure} : array [1..2] of real; {Calibrated Phase correction} : GainPtr;^{Detector and LabMaster gain values} : string;^{Error code} : integer; : integer;^{LabMaster gain value} : Speed_Index; : FILE of real; {Contains Analyzer and polarizer angle settings} : integer; : array [1 ..2] of real; {Calibrated Phase correction} : real;^{Polarizer angle setting for s-axis} : real;^{Polarizer setting wrt p-axis} : text; : integer;^{Number of revolutions to measure} : Pcomplex;^{Complex reflectivity} : real; : integer;^{Val procedure error code} : PStoke;^{Stoke parameter Vector} : real; : real;^{Temporary storage variable} : integer;^{Sampling time interval} : real;^{Input polarization state} : Pcomplex;^{Output polarization state}  179  f********************************** ********* ********************************************* * MAIN PROGRAM  ********** ***************** ************************ **************** *********************1 BEGIN {INITIALIZE DATA FILE AND MESSAGES} DIS_Init_Text; DIS_Write_Text('MEASUREMENT ROUTINE FOR INSITU ELLIPSOMETER.',MargX+15,Title_LineY); DIS_Write_Text(Initializing. Please Wait...',MargX,Command_LineY); Assign(PrintDevice,'LPT1'); Assign(DataFile,'C:cal_data.dat'); Assign(ParameterFile,'C:align.par'); Rewrite(PrintDevice); Reset(DataFile); Reset(ParameterFile); {INITIALIZE LABMASTER PORTS: A=OUT; B=OUT; C=IN} port[PORT JO_CON] := Port_Con_Word; {INITIALIZE VARIABLES} DMA_Data := NEW(Data_Ptr); Gain_Num := NEW(GainPtr); RHO := NEW(Pcomplex); Xo := NEW(Pcomplex); Stoke_Vector := NEW(PStoke); DSP_FOURIER_Init(Data_Num); {READ IN CALIBRATION COEFFICIENTS AND ALIGNMENT ANGLES} read(ParameterFile,Anal_Angle_to); read(ParameterFile,Pol_Angle_to); read(DataFile,Gain_Cor[1]); read(DataFile,Gain_Cor[2]); FOR i := 1 to 2 DO BEGIN read(DataFile,temp); C_Shift_store[i] := Round(temp); read(DataFile,Phase_cor[i]); END; close(DataFile); close(ParameterFile); {INPUT MEASUREMENT PARAMETERS} DIS_Write_Text('INPUT NUMBER OF CYCLES TO AVERAGE (1-16): ', MargX,Command_LineY); REPEAT Readln(Answer); Val(Answer,Rev_Num,St_Err); UNTIL ((Rev_Num IN Rev_Num_Limits) AND (St_Err = 0)); DIS_Write_Text('INPUT SAMPLING INTERVAL IN ms (0 - 10sec): ',MargX,Command_LineY+1); REPEAT Readln(Answer); Val(Answer,T_samp,St_Err); UNTIL ((T_samp >= 0) AND (T_samp <= 10000) AND (St Err = 0)); DIS_Write_Text('INPUT POLARIZER ANGLE (WRT P-AXIS) BETWEEN 0 AND 90: ',MargX,Command_LineY+2); REPEAT 180  Readln(Answer); Val(Answer,Pol_Set_to,St_Err); UNTIL ((Pol_Set_to > 0) AND (Pol_Set_to < 90) AND (St_Err = 0)); {CALCULATE INPUT POLARIZATION} Xi := tan(3.141593*Pol_Set_to/180.0); DIS_Write_Text('ALIGN ANALYZER TO: ',MargX,Command_LineY+4); GoToXY(WhereX,WhereY); writeln(Anal_Angle_to:8:2); DIS_Write_Text('ALIGN POLARIZER TO: ',MargX,Command_LineY+5); GoToXY(WhereX,WhereY); writeln((Pol_Angle_to-90.0+Pol_Set_to):8:2); writeln(PrintDevice,'Polarizer Angle wit P-Axis: ',Pol_Set_to:8:1); DIS_Write_Text('Press any Key when Ready...',MargX,Command_LineY+ 7) ; Answer := ReadKey; cIrscr; Motor_Speed := hi; GATH_MOTOR_ON(Motor_Speed); GATH_LASER_ON; {SET INITIAL GAIN - WILL BE ADJUSTED DURING DATA COLLECTED} Gain_Num^.Det:= 0; Gain_Num ^ .LM := 0; {ADJUST LABMASTER GAIN OR EXIT IF GAINSET ERROR} REPEAT Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,Motor_Speed); DIS_Write_Text(Get_Data,MargX,Status_LineY); GATH_GainSet(DMA_Data,Gain_Num,Data_Num,Rev_Num); UNTIL ((GATH_Gain_Err = 0) OR (abs(GATH_Gain_Err) = 2)); {SAMPLE DATA} clrscr; DIS_Write_Text('Press "P" to PRINT Reflectivity. Press "E" to EXIT',MargX,KeyCon_LineY); DIS_Write_Text('TAKING MEASUREMENTS',MargX+20,TiTle_LineY); DIS Write_TextCSTOKES VECTOR',MargX+35,Data_LineY+1); DIS:Write_Text('SO^Si^S2^S3',MargX+35,Data_LineY+2); {CONTINUE TO TAKE MEASUREMENTS UNTIL A KEY IS PRESSED} REPEAT Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,Motor_Speed); DIS_Write_Text(Get_Data,MargX,Status_LineY); {ADJUST GAIN} GATH_GainSet(DMA_Data,Gain_Num,Data_Num,Rev_Num); IF (GATH_Gain_Err = -2) THEN BEGIN GATH_Dark_Exit; exit; END; {CALCULATE THE FOURIER COEFFICIENTS} GATH_HARMONICS(2,DMA_Data,Data_Num,Rev_Num,C_Shift_store[11); GATH_HARMONICS(4,DMA_Data,Data_Num,Rev_Num,C_Shift_store[2]); DSP_MAG_PHASE_COR(Gain_cor[1],Phase_cor[1],Rev_Num,2); DSP_MAG_PHASE_COR(Gain_cor[2],Phase_cor[2],Rev_Num,4); {FIND THE STOKES PARAMETERS} DSP_ STOKES(Stoke_Vector,Q,R,S,Fourier_Coef B[Rev_Num,2], Fourier_Coef A[Rev_Num,4], Fourier_ Coef_ B[Rev_Num,4]); {CALCULATE THE OUTPUT POLARIZATION AND CORRECT FOR THE WINDOWS} DSP_CHI(Xo,DSP_AZ(Stoke_Vector),DSP_ELL(Stoke_Vector));  DSP WINDOW COR(Xo,RHO); 181  RHO".r := Xi*Xo".r/(sqr(Xo .r) + sqr(Xo^.i)); RHO" .i := -Xi*Xo^.i/(sqr(Xo^.r) + sqr(Xo^.i)); TAN_PSI := sqrt(sqr(RHO^.r)+sqr(RHO^.i)); DELTA := DSP_Delta(RHO); DIS_Print_Reflectivity(TAN_PSI,DELTA,RHO^.r,RHO^.i); {DISPLAY STOKES PARAMETERS} G0T0XY(MargX+33, Data_LineY+3); write(Stoke_Vector".s0:8:4,Stoke_Vector^.s1:10:4,Stoke_Vector^.s2:10:4, Stoke_Vector'N s3:10:4); {CHECK THAT THE STOKES VECTOR NORMALIZES TO ONE} IF (abs(Stoke_Vector".s0-1.0) > 0.01) THEN BEGIN GoToXY(MargX, Data_LineY+8); write('ERROR IN STOKES VECTOR!'); END ELSE BEGIN GoToXY(MargX, Data_LineY+8); ClrEOL; END; delay(t_samp); ControlKey := 'x';^{Reset control Key} IF (KeyPressed) THEN ControlKey := ReadKey; IF (ControlKey IN ['p','P']) THEN writeln(PrintDevice,'Tan(Psi) = ', TAN_PSI:8:6,' 'Delta = ', DELTA:8:6,", 'Rho = ', RHO^.r:8:6, ' + I', RHO .i:8:6); UNTIL (ControlKey IN ['e' ,'E']); {DISPLAY THE DETECTOR DATA FOR THE REV_NUM CYCLES} DIS_Graph_Setup_Time; FOR i := 0 to Rev_Num-1 DO DIS_Graph_Data(DMA_Data,Data_Num,i,C_Shift_store[2],2050,10,1+1); Answer := ReadKey; Closegraph; Dispose(DMA_Data); Dispose(Gain_Num); Dispose(RHO); Dispose(Xo); Dispose(Stoke_Vector); close(PrintDevice); END. 'N  .  (**************************************************************************************** * * * * * * *  FILE: EDA_Coef.pas WRITTEN BY: A. Kleinschmidt ON: March 5, 1993 UTILITY PROGRAM TO DISPLAY THE MAGNITUDE OF THE FIRST SIX NORMALIZED FOURIER COEFFICIENTS. MAGNITUDE IS NOT CORRECTED FOR AMPLIFIER ROLLOFF.  ****************************************************************************************) PROGRAM EDA_Coef; USES crt, dos, graph, LabMast, EDA_Gath, EDA_dsp, EDA_dis; VAR Answer^: char;^{Keyboard character input} DMA_Data^: Data_Ptr;^{address of DMA Data} Gain_Num^: GainPtr;^{Detector and LabMaster gain values} Get_Data^: string;^{Error code} integer; MAG^: array [1..7] of real; Max_Val^: integer; Motor_Speed^: Speed_Index; PrintDevice^: text; Rev_Num^: integer;^{Number of revolutions to measure} BEGIN {INITIALIZE DATA FILE AND MESSAGES} DIS_Init_Text; DIS_Write_Text(DISPLAYS FIRST SIX FOURIER COEFFICIENTS FOR INSITU ELLIPSOMETER.' ,MargX,Title_LineY); DIS_Write_Text('lnitializing. Please Wait...',MargX,Command_LineY); Assign(PrintDevice,'LPT1'); Rewrite(PrintDevice); {INITIALIZE VARIABLES} DMA_Data := NEW(Data_Ptr); Gain_Num := NEW(GainPtr); DSP_FOURIER_Init(Data_Num); Rev_Num := 9; {INITIALIZE LABMASTER PORTS: A=OUT; B=OUT; C=IN} port[PORTIO_CON] := Port_Con_Word; Motor_Speed := hi; GATH_MOTOR_ON(MotorSpeed); GATH_LASER_ON; {SET INITIAL GAIN - WILL BE ADJUSTED DURING DATA COLLECTED} Gain_Num^.Det:= 0; Gain_Num".LM := 0; {ADJUST LABMASTER GAIN OR EXIT IF GAINSET ERROR} REPEAT Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,Motor_Speed); DIS_Write_Text(Get_Data,MargX,Status_LineY); GATH_GainSet(DMA_Data,Gain_Num,Data_Num,Rev_Num); UNTIL ((GATH_Gain_Err = 0) OR (abs(GATH_Gain_Err) = 2)); 183  clrscr; DIS_Write_Text(' Magi^Mag2^Mag3^Mag4^Mag5^Mag6', 1,Data_LineY); {ACQUIRE DATA AND CALCULATE THE MAGNITUDES OF THE} {FOURIER COEFFICIENTS UNTIL A KEY IS PRESSED} WHILE NOT KeyPressed DO BEGIN IF KeyPressed THEN Exit; Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,Motor_Speed); DIS_Write_Text(Get_Data,MargX,Status_LineY); {ADJUST GAIN} GATH_GainSet(DMA_Data,Gain_Num,Data_Num,Rev_Num); IF (GATH_Gain_Err = -2) THEN BEGIN GATH_Dark_Exit; exit; END; FOR i := 1 to 6 DO BEGIN GATH_HARMONICS(1,DMA_Data,Data_Num,Rev_Num,0); MAG[i] := DSP_FOURIER_Mag(FOURIER_Coef_A[Rev_Num,i], FOURIER_Coef B[Rev_Nurn,i]); END; GoToXY(1,Data_LineY+1); write(MAG[1]:8:5,",MAG[2]:8:5,",MAG[3]:8:5,", MAG[4]:8:5,",MAG[5]:8:5,",MAG[6]:8:5); END; {WHILE} writeln(PrintDevice,MAG[1]:8:5,",MAG[2]:8:5,",MAG[3]:8:5,", MAG[4]:8:5,",MAG[5]:8:5,",MAG[6]:8:5); Answer := ReadKey; {DISPLAY THE TIME DOMAIN DATA FOR THE REV_NUM NUMBER OF CYCLES} DIS_Graph_Setup_Time; FOR i := 0 to Rev_Num-1 DO DIS_Graph_Data(DMA_Data,Data_Num,i3O,2050,10,1+1); Answer := ReadKey; Closegraph; Dispose(DMA_Data); Dispose(Gain_Num); END.  184  (* ************** ** ************** ** ************* ** ************** * ************** * ********** * FILE: EDA Bug.pas * WRITTEN eY: A. Kleinschmidt * ON: March 5, 1993 * * * *  UTILITY PROGRAM TO DISPLAY THE REAL AND IMAGINARY PARTS AS WELL AS THE MAGNITUDE AND PHASE OF THE SECOND AND FOURTH NORMALIZED FOURIER COEFFICIENTS. THESE HAVE BEEN CORRECTED FOR AMPLIFIER GAIN ROLLOFF AND PHASE SHIFT.  *** ***** ********* ****** ******** ***** ********* ***** ******** ***** ******** ****** ******** **1 PROGRAM EDA_Bug; USES crt, dos, graph, LabMast, EDA_Gath, EDA_dsp, EDA_dis; VAR Answer C_ Shift _store DataFile DMA_Data Gain_Cor Gain_Num Get_Data Harmonics MAG Motor_Speed PHASE Phase_Cor PrintDevice Rev_Num temp  : char; {Keyboard character input} : array [second „fourth] of integer; {Trigger phase correction} : FILE of real; : Data_Ptr; {Address of DMA Data} : array [second „fourth] of real; {Calibrated gain correction} : GainPtr; {Detector and LabMaster gain values} : string; {Error code} : Harm_Index; {Index of Fourier coefficients} : integer; : array [second. .fourth] of real; : Speed_Index; : array [second. .fourth] of real; : array [second. .fourth] of real; {Calibrated Phase correction} : text; : integer; {Number of revolutions to measure} : real; {Temporary storage variable}  BEGIN {INITIALIZE DATA FILE AND MESSAGES} DIS_Init_Text; DIS_Write_Text('DEBUGGING ROUTINE FOR INSITU ELLIPSOMETER.',MargX+15,Title_LineY); DIS_Write_Text('Initializing. Please Wait...',MargX,Command_LineY); Assign(DataFile,'C:cal_data.dat'); Reset(DataFile); Assign(PrintDevice,'LPT1'); Rewrite(PrintDevice); {INITIALIZE VARIABLES} DMA_Data := NEW(Data_Ptr); Gain_Num := NEW(GainPtr); DSP_FOURIER_Init(Data_Num); {FIRST DATA CYCLE OFTEN CORRUPTED BY GLITCH} Rev_Num := 9; {INITIALIZE LABMASTER PORTS: A=OUT; B=OUT; C=IN} port[PORTIO_CON] := Port_Con_Word; Motor_Speed := hi; GATH_MOTOR_ON(Motor_Speed); GATH LASER_^, ON. 185  {SET INITIAL GAIN - WILL BE ADJUSTED DURING DATA COLLECTED} Gain_Num^.Det:= 0; Gain_Num^.LM := 0; {ADJUST LABMASTER GAIN OR EXIT IF GAINSET ERROR} REPEAT Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,Motor_Speed); DIS_Write_Text(Get_Data,MargX,Status_LineY); GATH_GainSet(DMA_Data, Gain_Num, Data_Num,Rev_Num); UNTIL ((GATH_Gain_Err = 0) OR (abs(GATH_Gain_Err) = 2)); {CHECK CALIBRATION BY ADJUSTING DATA BY CALIBRATION COEFFICIENTS} cIrscr; DIS_Write_Text('CHECKING CALIBRATION',MargX+15,Title_LineY); DIS_Write_Text(' A2^B2^MAG2^PHASE2^A4^B4^MAG4^PHASE4', 1,Data_LineY); {READ IN CALIBRATION COEFFICIENTS} read(DataFile,Gain_Cor[second]); read(DataFile,Gain_Cor[fourth]); FOR Harmonics := second to fourth DO BEGIN read(DataFile,temp); C Shift store[Harmonics] := Round(temp); re-ad(D;taFile,Phase_cor[Harmonics]); END; {DISPLAY CORRECTED COEFFICIENTS REPEATEDLY UNTIL A KEY IS PRESSED} WHILE NOT KeyPressed DO BEGIN IF KeyPressed THEN Exit; Get_Data := GATH_Data(DMA_Data,Gain_Num,Data_Num,Rev_Num,Motor_Speed); DIS_Write_Text(Get_Data,MargX,Status_LineY); {ADJUST GAIN} GATH_GainSet(DMA_Data, Gain_Num, Data_Num,Rev_Num); IF (GATH_Gain_Err = -2) THEN BEGIN GATH_Dark_Exit; exit; END; {CALCULATE FOURIER COEFFICIENTS AND CORRECT} GATH_HARMONICS(2,DMA_Data,Data_Num,Rev_Num,C_Shift_store[second]); GATH_HARMONICS(4,DMA_Data,Data_Num,Rev_Num,C_Shift_store[fourth]); DSP MAG PHASE COR(Gain_cor[second],Phase_cor[second] ,Rev_Num,2); DSP MAG PHASE_COR(Gain_cor[fourth],Phase_cor[fourth],Rev_Num,4); M-A-G[s;cond] := DSP_FOURIER_Mag(FOURIER_Coef_A[Rev_Num,2], FOURIER_Coef B[Rev_Num,2]); PHASE[second]:= ARCTAN(FOURIER_Coef B[Rev_Num,2]/FOURIER_Coef_A[Rev_Num,2]); MAG[fourth] := DSP_FOURIER_Mag(FOURIER_Coef_A[Rev_Num,4], FOURIER_Coef B[Rev_Num,4]); PHASE[fourth] := ARCTAN(FOURIER_Coef_B[Rev_Num,4]/FOURIER_C0ef_A[Rev_Num,4]); {PRINT NORMALIZED 2ND AND 4TH FOURIER COEFFICIENTS} G0ToXY(1,Data_LineY+1); write(Fourier_Coef A[Rev_Num,2]:8:4,", Fourier Coef B[Rev Num 2]:8:4 ' , MAG[second]:8:5, ', PHASE[second]:8:5,", Fourier_Coef A[Rev_Num,4]:8:4,", Fourier_Coef B[Rev_Num,4]:8:4,", MAG[fourth]:8:5,", 186  PHASE[fourth]:8:5); delay(300); END; {WHILE} writeln(PrintDevice, Fourier_Coef A[Rev_Num,2]:8:4,' ', Fourier_Coef B[Rev_Num,2]:8:4,' ', MAG[second]:8:5,", PHASE[second]:8:59", Fourier_Coef A[Rev_Num,4]:8:4,' Fourier_Coef B[Rev_Num,4]:8:4,' ', MAG[fourth]:8:5,", PHASE[fourth]:8:5); Answer := ReadKey; {DISPLAY DETECTOR DATA FOR REV_NUM CYCLES} DIS_Graph_Setup_Time; FOR i := 0 to Rev_Num-1 DO DIS_Graph_Data(DMA_Data,Data_Num,i,C_Shift_store[fourth],2050,10,i+1); Answer := ReadKey; Closegraph; Dispose(DMA_Data); Dispose(Gain_Num); close(DataFile); END. i,  (************************************ *** ************************************** *** *******) (* FILE: Shutter.pas (* WRITTEN BY: A. Kleinschmidt (* ON: May 18, 1993 (* UTILITY PROGRAM TO CONTROL THE BISTABLE ELECTRONIC SHUTTER (* FOR THE LASER  r  (**************************************************************************************1 PROGRAM shutter; USES crt, dos, labmast; {$define MASTER} {$i cAlabpac\labhead.btp} CONST BASE^= 1808;^{base address of LabMaster DMA} PORT_A^= BASE+12; {LabMaster output port A address} PORT_B^= BASE+13; {LabMaster output port B address} PORT_C^= BASE+14; {LabMaster input port C address} PORTIO_CON^= BASE+15; {LabMaster I/O control port address} Port_Con_Word^= $81;^{control word sent to LabMaster 8255} Shutter_On^= $01;^{Control word to open shutter} Shutter_Off^= $02;^{Control word to close shutter} Shutter_Wait^= $00;^{Required as wait state} VAR integer; Key_to_Go^: char; BEGIN clrscr; writeln('UTILITY PROGRAM TO OPEN AND CLOSE SHUTTER'); writeln('Press "o" to Open Shutter; "c" to Close Shutter); writeln('Press "x" to Exit'); {INITIALIZE LABMASTER PORTS: A=OUT; B=OUT} port[PORTIO_CON] := Port_Con_Word; port[PORT_B] := Shutter Wait; Key_to_Go := ReadKey; WHILE (Key_to_Go <> 'x') DO BEGIN IF (Key_to_Go = 'o') THEN BEGIN port[PORT_BI := Shutter On; delay (20); port[PORT_B] := Shutter Wait; G0ToXY(1,WhereY); write('Shutter Open '); END; IF (Key_to_Go = 'c') THEN BEGIN port[PORT_B] := Shutter Off; 188  delay (20); port[PORT_B] := Shutter Wait; G0T0XY(1,WhereY); write('Shutter Closed'); END; Key_to_Go := ReadKey; END; END.  (* ******************* *** ****************** *** ****************** *** ****************** *** *) (* FILE: Adcrun.pas (* WRITTEN BY: A. Kleinschmidt (* ON: May 27, 1993 r (* UTILITY PROGRAM TO READ THE PHOTODETECTOR  (** *************** ***** ************** **** *************** **** ************** ***** ********1 PROGRAM adcrun; USES crt, labmast, EDA_dis; {$define MASTER} {$i cAlabpac\labhead.btp} CONST BASE^= 1808;^{base address of LabMaster DMA} Coder_Counter^= 1;^{LabMaster counter number} Disable_Trigger^= $02;^{disable index latch} Enable_Trigger^= $07;^{enable index latch: A2:CLR A1:PRE A0:/FF_EN} Gain_Limits^= [0..15];^{Photodetector gain limits} LM_Gain_Limits^= [0..3];^{LabMaster Gain limits} Motor_Off^= $00;^{Control word to turn motor off} PORT_A^= BASE+12; {LabMaster output port A address} PORT_ B^= BASE+13; {LabMaster output port B address} PORT_C^= BASE+14; {LabMaster input port C address} Port_do n_Word^= $81;^{control word sent to LabMaster 8255} PORT JO_CON^= BASE+15; {LabMaster I/O control port address} Shutter_Off^= $02;^{Control word to close shutter} Shutter_On^= $01;^{Control word to open shutter} Shutter_Wait^= $00;^{Required as wait state} VAR Answer^: string[5];^{Keyboard character string input} data^: integer; datal,datah^: integer;^{Low and high bytes of data} Gain^: integer;^{Photodetector gain number (0..15)} integer; LM_Gain^: integer;^{LabMaster gain number (0..3)} ready^: integer; St_Err^: integer;^{Val procedure error code} Text_Start^: integer;^{Stores X value of cursor position} time^: real;^{can be used as the x-coord in a plot}  189  BEGIN {INITIALIZE LABMASTER PORTS, SET GAIN AND OPEN SHUTTER} DIS_InText; DIS_Write_Text('LABMASTER ADC OUTPUT',MargX+25,Title_LineY); REPEAT ClrEOL; DIS_Write_Text('ENTER LABMASTER GAIN: ',MargX,Command_LineY); Readln(Answer); Val(Answer,LM_Gain,St_Err); UNTIL ((LM_Gain IN LM_Gain_Limits) AND (St_Err=0)); REPEAT ClrEOL; DIS_Write_Text('ENTER PHOTODETECTOR GAIN: ',MargX,Command_LineY+1); ReadIn(Answer); Val(Answer,Gain,St_Err); UNTIL ((Gain IN Gain_Limits) AND (St_Err=0)); port[PORT JO_CON] := Port_Con_Word; port[PORT_A] := 8*Gain; port[PORT_B] := Shutter Wait; port[PORT_B] := Shutter On; delay (30); port[PORT_B] := Shutter Wait OR Motor Off; port[BASE+4] := 128 + LM_Gain;^{initialize ADC} port[BASE+5] := 0;^ {convert channel 1} ready := 0; time := 0; {CONTINUOUSLY DISPLAY TIME AND ADC VALUE UNTIL KEY IS PRESSED} DIS_Write_Text('ADC OUTPUT: ',MargX,Data_LineY); Text_Start := WhereX; WHILE (NOT keypressed) DO begin port[BASE+6] := 0; while ready < 128 do begin ready := port[BASE+4]; if keypressed then ready := 128; end; datal := port[BASE+5] and 255; datah := port[BASE-F6] and 15; data := (256*datah) + datal; time := time + 1; GoToXY(Text_Start,Data_LineY); clrEOL; write (data); delay (300); end; {CLOSE SHUTTER AND EXIT} port[PORT_B] := Shutter Off OR Motor Off; delay (30); port[PORT_B] := Shutter Wait; END.  190  Table Cl: Location in Memory of DMA Data. Memory Address  Base Address +^0  Revolution Number  0  Data Number  Data[0]  1  Data[1]  2  Data[2]  3  Data[3]  Data_Num -^1 Data_Num  Data[Data_Num - 1] 1  Data[Data_Num]  Data_ Num +^1 Data_ Num +^2 • Data_Num*Rev_Num + 0  Data[Data Num + 1] .' .'  Data[Data Num + 2]  Rev Num  Data Num*(Rev Num+1)-1  Data[Data_Num*Rev Num+0]  Data[Data Num* (Rev_qum+1)-1]  191  Table C2: Array Storage Locations of Fourier Coefficients FOURIER COEFFICIENT NUMBER 0 R E V 0 L U T I 0 N N U M  1  2  3  0 1 2 3 4 . •  REV NUM  192  4  5  6  7  8  9  Table C3: Error Messages ERROR MESSAGE  CAUSE  PROGRAM USED IN  Calibration Error  EDA_Set  Analyzer or Polarizer misaligned. Possible electrical noise.  DOS ERROR  EDA_Align  External program Ang_fit.c did not execute properly.  DMA OR TIMER SETUP ERROR  EDA_GATH  Setup of DMA controller or timers did not occur properly.  ERROR IN STOKESVECTOR  EDA_Meas  Stokes Vector does not normalize to one.  Light Level too Low  EDA_GATH  Something blocking the laser or laser beam is misaligned.  Poor Fit  EDA_Align  External program Ang_Fit.c unable to fit the data adequately.  Synchronization Error  EDA GATH  ADC did not convert the proper number of data values during the revolution.  193  

Cite

Citation Scheme:

        

Citations by CSL (citeproc-js)

Usage Statistics

Share

Embed

Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                        
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            src="{[{embed.src}]}"
                            data-item="{[{embed.item}]}"
                            data-collection="{[{embed.collection}]}"
                            data-metadata="{[{embed.showMetadata}]}"
                            data-width="{[{embed.width}]}"
                            async >
                            </script>
                            </div>
                        
                    
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:
http://iiif.library.ubc.ca/presentation/dsp.831.1-0074512/manifest

Comment

Related Items