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 ELLIPSOMETERbyALFRED KLEINSCHMIDTB.A.Sc, The University of British Columbia, 1986A THESIS SUBMITTED IN PARTIAL FULFILMENT OFTHE REQUIREMENTS FOR THE DEGREE OFMASTER OF APPLIED SCIENCEinTHE FACULTY OF GRADUATE STUDIES(Department of Engineering Physics)We accept this thesis as conformingto the required standardTHE UNIVERSITY OF BRITISH COLUMBIAAugust 1993© Alfred Kleinschmidt, 1993In presenting this thesis in partial fulfilment of the requirements for an advanceddegree at the University of British Columbia, I agree that the Library shall make itfreely available for reference and study. I further agree that permission for extensivecopying of this thesis for scholarly purposes may be granted by the head of mydepartment or by his or her representatives. It is understood that copying orpublication of this thesis for financial gain shall not be allowed without my writtenpermission.(Signature)Department of^../1 mee4,1 N/Si c S The University of British ColumbiaVancouver, CanadaDate ^/e,„4er /Y /9i31DE-6 (2/88)ABSTRACTEllipsometry is a nondestructive analysis technique for studying surfaces,interfaces and thin films. The fabrication of multilayered structures, which canconsist of several hundred layers, by sputter deposition of two materials havingdifferent refractive indices requires careful control of the individual layerthicknesses. In-situ monitoring of the deposition process is clearly the optimalway to achieve a high quality film and layer structure. An in-situ ellipsometer canbe mounted on a deposition chamber and, through view ports, make ameasurement of the complex reflection coefficient of the sample inside during thedeposition process. Through an appropriate mathematical model, the thicknessof the deposited layer can be determined from the ellipsometric data.This thesis presents an account of the design, construction and operationof an in-situ, rotating compensator ellipsometer. The completed prototypeachieved a precision and repeatability of better than ± 1 A when measuring a Si02layer on a silicon substrate. Thicknesses obtained from measurements correctedfor the birefringence of the vacuum port windows agreed with accepted values towithin a monolayer for thin (< 1000 A) layers of Si02 on silicon, and to within 3monolayers for samples up to 2200 A thick.iiTABLE OF CONTENTSAbstractTable of ContentsList of TablesList of Figures^ viAcknowledgements ixChapter 1 In-situ Ellipsometry 11.1 Introduction 11.2 Overview of Instrumentation 31.3 Literature 7Chapter 2 Theory of Ellipsometry 82.1 Theory of Polarized Light 82.2 Complex Reflectance Ratio 132.3 Measurement of the Polarization Stateof the Reflected Light152.4 Jones Calculus 19Chapter 3 Description of the Instrument 213.1 Overview of the System 213.2 Description of the Hardware 213.2.1^The Source Arm 243.2.2^The Detector Arm 263.3 Description of the Electronics 273.3.1^The I/O Interface Board 283.3.2 The ADC Trigger Board 283.3.3^The Detector Interface Board 293.3.4^The Shaft Encoder Interface 30Board3.3.5^The Shutter Interface Board 313.3.6^The Motor Interface Board 313.4 Description of the Software 323.4.1^Labmast.pas 323.4.2^EDA_Gath.pas 323.4.3^EDA_Dsp.pas and 33EDA FFT.pas3.4.4^EDA Dis.pas 343.4.5^EDAIAlign.pas 343.4.6 EDA_Set.pas^353.4.7 EDA_Meas.pas 363.4.8 EDA_Coef.pas and^37EDA_Bug. pas3.4.9 Shutter.pas and ADCrun.pas^373.5^Critical Design Criteria^ 38Chapter 4 Alignment, Calibration and Measurement 424.1^Introduction^ 424.2 Optics and Beam Alignment^434.3^Rotational Alignment of the Optics^444.4 Calibration for Gain and Phase 474.5 Compensator Alignment and Calibration 514.6 Checking Alignment and the Stokes Vector 524.7 Correction for the Vacuum Port Windows 534.8^Calibration of the Angle of Incidence^55Chapter 5 Instrument Performance^ 575.1^Introduction 575.2 Speed, Precision and Accuracy^585.3^Measurement of Reflectivity 62Correction FactorsChapter 6 Conclusion^ 65References^ 67Appendix A Construction Drawings and Circuit Schematics^68Appendix B Part Specifications^ 117Appendix C Software Source Codes 123ivLIST OF TABLESTable^ Page5.1 Magnitude of the first six harmonics of the rotation frequency. 595.2 Amplifier correction factors and compensator defect parameters. 605.3 Values of 3p/861 for various sample reflectivities. 625.4^Reflectivity and angle of incidence correction coefficients.^625.5 Comparison of the corrected ACE and reference measurements. 63B1^Glan Thompson polarizer.^ 118B2^Quartz port windows. 118B3 Compensator^ 119B4^Labmaster data acquisition board.^ 119B5^Photodetector amplifier gain selection. 120B6^Photodiode.^ 121B7^Shaft encoder. 121B8^Bistable shutter.^ 121B9^A.C. synchronous motor.^ 122Cl^Location in memory of DMA data.^ 191C2^Array storage locations of Fourier coefficients.^ 192C3^Error messages.^ 193VLIST OF FIGURESFigure Page1.1 Rotating element polarimeters. 62.1 Shapes and orientations of the polarization ellipse for variousvalues of E.102.2 Characterization of the polarization ellipse in terms of theazimuthal angle e and the ellipticity E.102.3 The p-s coordinate system as defined by the sample surfaceand the plane of incidence.143.1 Functional block diagram of a rotating compensatorellipsometer.223.2 Ellipsometer and its attachment to the sputtering chamber. 233.3 Source arm assembly. 243.4 Detector arm assembly. 275.1 Graph showing the variation of Airr with tjr/ir for 100 Aincrements in the Si02 layer thickness.64A1.1 Adjustable table for sample. 69A1.2 Vacuum feedthrough for sample stage adjustment. 70A1.3 Extension tube. 71A2.1 Laser mount assembly. 72A2.2 Laser bulkhead. 73A2.3 Shutter and aperture mount. 74A2.4 Aperture rod for laser mount. 75A2.5 Steering mirror mount. 76A2.6 Steering mirror. 77viFigure PageA2.7 Laser holder. 78A2.8 Laser mount covers - top and bottom. 79A2.9 Laser mount covers - front and back. 80A3.1 Analyzer (polarizer) assembly. 81A3.2 Polarizer drum assembly. 82A3.3 Bulkheads for rotating compensator, polarizer, and analyzer. 83A3.4 Worm gear bulkhead and drum dial mount for polarizer. 84A3.5 Bulkheads for compensator, polarizer, and analyzer. 85A3.6 Housing for polarizer. 86A3.7 Housing for analyzer. 87A4.1 NW 25 ISO-KF window port. 88A4.2 Locking nut for window port. 89A5.1 Compensator assembly. 90A5.2 Holder for compensator and threaded insert. 91A5.3 Compensator drum assembly. 92A5.4 Gear bushing. 93A5.5 Bulkhead for rotating compensator. 94A5.6 Male threaded bulkhead for compensator. 95A5.7 Compensator bulkhead (motor mount). 96A5.8 Aperture for compensator. 97A5.9 Compensator cover - front and back. 98viiFigure^ PageA5.10 Compensator cover - top and bottom.^ 99A6.1 Detector housing.^ 100A6.2 Threaded bulkhead for detector.^ 101A7^Ellipsometer bus.^ 102A8^10 interface card. 103A9.1 ADC trigger interface board.^ 104A9.2 ADC trigger synchronization. 105A10.1 Detector interface card.^ 106A10.2 Photodetector amplifier circuit.^ 107A10.3 Photodetector amplifier - circuit board layout.^ 108All Encoder interface board.^ 109Al2.1 Shutter interface board. 110Al2.2 Bistable shutter controller - schematic 1.^ 111Al2.3 Bistable shutter controller - schematic 2. 112Al2.4 Bistable shutter controller - circuit board layout.^113A13.1 Motor interface board.^ 114A13.2 60 Hz motor drive generator - schematic.^ 115Al 4 Artwork for card cage.^ 116ACKNOWLEDGEMENTSFirst, I would like to extend my appreciation to my research supervisor,R.R. Parsons, for his continual support and encouragement throughout the courseof my thesis. It is also a pleasure to acknowledge the help I have received fromNorman Osborne, whose advice in programming and electronic assembly oftenaverted what would otherwise have been many long, frustrating hours; andGlenn Clarke, who was never too busy with his own thesis to give much neededenlightenment into the mysteries of ellipsometry and sputter deposition. I wouldalso like to thank Samir Aouadi, whose presence in the lab made my academicsojourn enjoyable.The ellipsometer would never have progressed past the design stage wereit not for the professional assistance of Beat Meyer, Manfred Heinrich andPhilip 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 andthe University of British Columbia during the course of this research.ixCHAPTER 1IN-SITU ELLIPSOMETRY1.1 IntroductionThe fabrication of optical multilayers for narrow bandpass optical filters,mirrors and improved anti-reflection coatings requires a method of monitoring layergrowth and quality during the deposition process. The multilayered structureconsists of two or more materials having significantly different indices of refractionwhose individual thicknesses depend upon the spectral region the device will beused in. Devices used at short wavelengths, for example in the X-ray band, willhave closer tolerances on the uniformity of their layers than similar coatingsdesigned for use in the infrared band.Improvements to the repeatability of the multilayered structure result in animprovement in the characteristics of the device. The most reliable and directmethod for achieving the required tolerances on thickness and uniformity is tomake in-situ measurements of the layer thickness during the deposition process.Such a measurement should naturally be unobtrusive, nondestructive and occurin real-time. An ellipsometer meets the above criteria and can be used todetermine the optical properties of the currently grown layer. The instrument ismounted 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 in1the chamber, and passes through an exit viewport to a receiver.The basis of ellipsometry is the measurement of the sample complexreflection coefficient p which characterizes the change in polarization of the beamupon reflection from a dielectric or conducting sample. Because only relativechanges in polarization states are measured, no knowledge of the absoluteincident or reflected intensities of the beam is required. Through an appropriatemathematical model of the sample parameters, the thickness and characteristicsof the deposited layer, including its purity, homogeneity and density can bedetermined. Continuous measurement of the reflection coefficient duringdeposition allows precise control of the layer thickness to within one atomic layer.This thesis describes the design, construction and operation of a rotatingcompensator type in-situ ellipsometer (RCE). The remainder of this chapter givesan overview of the various ellipsometer configurations available and discusses therationale for choosing the rotating compensator design. Chapter 2 describes thetheory of polarized light in terms of the Stokes parameters and defines the complexreflectance ratio. The measurement of the polarization state of the reflected lightby the RCE along with a discussion of the effects of the compensator imperfectionsare also given. In Chapter 3, a complete description of the instrument design,including the hardware, electronics and software is given and critical design criteriaare identified and addressed. Chapter 4 deals with the operation of theellipsometer and describes how it is aligned and calibrated. Various methods forchecking proper operation are identified and the equations leading to a correction2for errors introduced by the vacuum port windows as well as for a calibration of theangle of incidence are developed. Finally, in Chapter 5, the results ofmeasurements of samples consisting of various thicknesses of S102 on a siliconsubstrate are used to assess the precision, accuracy and repeatability of theellipsometer.1.2 Overview of InstrumentationAn ellipsometer can be classified as being either a nulling or a photometrictype. A nulling instrument adjusts the azimuth angle of a polarizer and analyzeruntil the transmitted beam is extinguished whereas a photometric devicedetermines the polarization state from analysis of the modulated light intensitytransmitted through a continuously rotating compensator or analyzer.Both systems have several important advantages and disadvantages and thechoice between systems constitutes a trade off between considerations of speedand accuracy. The nulling device is insensitive to the light source and backgroundintensity fluctuations, polarizer and analyzer imperfections and photodetectornon-linearities. Its theoretical sensitivity is limited only by the photodetector darkcurrent and shot noise.An important disadvantage of the nulling ellipsometer which is overcome bythe photometric device, is the relatively long data acquisition times required tomake a single measurement. Even with automated nulling devices incorporatingstepping motors to adjust the polarizer and analyzer angles, the acquisition speed3is in general not fast enough for applications requiring in-situ monitoring. Theresolution and accuracy of the analyzer and polarizer settings required by a nullingdevice, which are on the order of 0.010, increases the requirements for mechanicalprecision, vibration immunity and accuracy of azimuth measurements over thoseof a photometric instrument.Because of the speed requirements and reduced sensitivity to vibration,photometric devices are generally favoured for in-situ applications. These devicesmodulate the polarization of either the incident or reflected beam by mechanicalrotation of an analyzer or compensator plate, or by using an electro-optical elementsuch as a Faraday cell. The output beam has a modulated intensity comprised ofthe harmonics of the modulation frequency. Fourier analysis characterizes thepolarization state in terms of the Stokes parameters, from which the reflectioncoefficient of the sample is obtained. The maximum achievable sampling rate isdetermined by the modulation rate which, in the case of Faraday cells, can be100 kHz or more. The absolute azimuthal position of the rotating element need notbe known to the same accuracy as for a nulling device (0.1° is sufficient) sinceincreased accuracy is achieved by sampling several hundred or even thousandtimes per rotation thereby reducing the effect of random noise.The photometric design has several disadvantages. More care is requiredin the calibration of the optical system as imperfections in the optics introducesystematic errors into the measurement. The measurements are more sensitiveto light source fluctuations and to the stability of the modulation frequency (as4compared to those obtained from a nulling device), non-linearities in the responseof the photodetector generate harmonics of the modulation frequency which candistort the signal and, finally, the phase shift and attenuation of the signal throughthe analog photodetector circuitry, though easily corrected for, must remain stableover time and temperature.Response times as low as 10 ps are achievable through the use of electro-optic modulators which rotate the polarized state of the probe beam in responseto an applied voltage. The lack of moving parts simplifies the mechanical design;however, data analysis is complicated by the fact that the modulated intensitiesdepend on Bessel functions of the sinusoidal voltage waveform. Also, since noshaft encoder or timing pulses are available, synchronization of the sampling rateto the modulator is more difficult than in a rotating element design; requiring moresophisticated, temperature compensated electronics.If longer measurement times, on the order of hundreds of milliseconds, aresufficient for the in-situ application, then modulation by mechanical rotation of theanalyzer or compensator is the method of choice for an in-situ instrument. Severalpossible systems are illustrated in Fig. 1.1. Of these the rotating analyzer (RA) ismechanically the simplest but is unable to characterize completely the polarizationstate of the light and is therefore not able to determine the sign of the complexreflection coefficient. The simplest configuration able to determine fully p is theRCFA. Increasingly complex designs such as the RCA and RCAFA areself-calibrating in that they are able to determine simultaneously and separately the5LASER I.^S- -...-----..\\ - -x -r-----..- ^f^/7_ \x7\-C^A.-----,,A^DETECTORa) ROTATING ANALYSER CPA)7bp ROTATING ANALYZER , FIXED ANALYSER CRAFA)C) ROTATING COMPENSATOR + FIXED ANALYSER CRCFA).----,..d) ROTATING COMPENSATOR AND ANALYZER CRCA)_ep ROTATING COMPENSATOR AND ANALYZER + FIXED ANALYZER CRCAFA)characteristics of the compensator as well as the value of p.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 rotatingcompensator ellipsometer) was chosen as the ellipsometer for the in-situapplication because it is the simplest configuration that is able to determineunambiguously the reflection coefficient. Unlike a rotating analyzer instrument, theprecision of an RCE is independent of the polarization state, and therefore p canbe measured accurately over its entire range of phase angle (0 to 27r).Measurements of p with a rotating analyzer instrument become increasingly6inaccurate as the phase approaches 0 or Tr. This property of the RCE is importantin real time, in-situ studies where the phase angle periodically becomes 0 (or Tr)as a layer of material is deposited.1.3 LiteratureThe standard text in the field is Ellipsometry and Polarized Light by Azzamand Bashara2 which covers the experimental and theoretical aspects ofellipsometry. An excellent book detailing the design criteria and giving an erroranalysis of both the nulling and the rotating analyzer ellipsometers is Ellipsometryfor Industrial Applications by K. Riedling.3 In addition, a number of paperspublished in the SPIE Selected Papers on Ellipsometry 4 give a treatment of firstorder error corrections for non-ideal optics and detector non-linearities and reporton the achieved performance of various ellipsometer configurations.7CHAPTER 2THEORY OF ELLIPSOMETRY2.1 Theory of Polarized LightThe following outlines the theory behind the development of theellipsometric equations for the rotating compensator ellipsometer. The reader isreferred to Optics by Hecht and Zajac5 and Ellipsometry and Polarized Light byAzzam and Bashara2 for a more complete treatment of the theory of polarized lightand the Jones calculus.The electric field of a light wave propagating in the z direction can berepresented by two transverse, orthogonal field components Ex and Ey havingrelative 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 themagnitudes of the field components in the x and y directions; k is the wavenumber, and (,) is the angular frequency. The equation of the electric field Epropagating in the z direction is just the sum of these two components:8E (1Eox + jE0yei8).eiuc2 - . 0^ (2.2)The polarization state x of this electric field is dependent upon the relativeamplitude and phase of the two components and can be expressed as:Eoy j8X Eox e(2.3)The tip of the electric field vector E will in general trace out an ellipse whose shapeis determined by the value of the phase constant 6 and the relative magnitudes ofE„ and Ew. Linearly and circularly polarized light are two special cases ofelliptically polarized light. If 6 is an integer multiple of :LIT, the wave is said to belinearly polarized; if the E„ and Ew are equal in magnitude but differ in phase byTr/2, then the light is said to be circularly polarized.Various forms the polarization ellipse may take are illustrated in Fig. 2.1. Itsshape and orientation can be specified by two parameters: the azimuth e of themajor axis with respect to the positive x-axis (Fig. 2.2); and the ellipticity E definedby the ratio of length of the semi-minor axis to the semi-major axis of the ellipse:(2.4)9Fig. 2.1:^Shapes and orientations of the polarization ellipse for various valuesof E. Here, E. leads Ey by e.5Fig. 2.2:^Characterization of the polarization ellipse in terms of the azimuthalangle 0 and the ellipticity E.10The sign of E determines the handedness of the polarization. The light is definedto be right-hand polarized (E < 0) if the electric field vector rotates clockwise whenlooking into the source. The azimuth e is positive when measuredcounterclockwise from a reference plane looking into the source and is limited tothe range -7r/2 e < Tr/2. The polarization state of the electric field can beexpressed in terms of E and e as:tan 0 + flan e X 1 - ptan 5 .tan e(2.5)An electromagnetic wave whose orthogonal field components have aconstant amplitude and phase relationship between them (i.e. the field componentsare mutually coherent) can be described as being completely polarized.Unpolarized light, on the other hand, does not exhibit this coherency since itspolarization state changes randomly and rapidly compared to the measurementtime. In general, a light beam is only partially polarized when the orthogonal fieldcomponents are a mixture of coherent and incoherent light and its degree ofpolarization can vary from being completely polarized to completely unpolarized.The total polarization state can be expressed by four Stokes parameterswhich are the time averages of the electric field components E. and Ey and aredefined as:11S0 1< E02x> - < E02y>=<Eo2x> + <E02y>(2.6a)(2.6b)SiS2 =< 2 EoxEoycos 8 >(2.6c) <E02x> 4- <E02?0^<2 EoxEoysin 8 >.73 -  ^ (2.6d)< E02x> + < E02y>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) linearlypolarized light, and left-hand/right-hand circularly polarized light.6 For completelyunpolarized light S1 = S2 = S3 = 0 while for completely polarized lightS02 = Si2 + S22 + S32. The Stokes parameters can be expressed in terms of theellipticity and azimuth of the polarization ellipse by the equations:712so - 1(2.7a)(2.7b)S.1 - cos(20)•cos(2e)(2.7c)S2 - Sin(20)•COS(2E)(2.7d)53 - sin(2e)2.2 Complex Reflectance RatioThe complex reflectance ratio p of a sample is defined in terms of acoordinate system whose axes are aligned to the sample surface and the plane ofincidence of the light beam (Fig. 2.3). The two orthogonal electric fieldcomponents 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 alongeither of these axes is reflected or transmitted without a change in its polarizationstate.13Fig. 2.3:^The p-s coordinate system as defined by the sample surface and theplane 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 reflectedwith different amplitude attenuations and phase shifts, resulting in a changedpolarization state.If the input polarization xi is known and xr can be measured, then the14characteristic 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 shiftbetween the incident and reflected polarization states.2.3 Measurement of the Polarization State of the Reflected LightThe light intensity at the photodetector 1(t) consists of a constant term aswell 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 constantis:7At) = (1 +a2cos2coct+b2sin2coct+a4cos4coct+b4sin4coct )^(2.10)Fourier analysis can be used to extract the Fourier coefficients a2 .. b4 from thesignal, which are related to the polarization parameters (e,€) and the angle A of theanalyzer transmission axis with respect to the p-axis by:815(2.11a)(2.11b)(2.11c)(2.11d)2 •sin2e .sin 2A2 + cos2e•cos2(0-A)2.sin2e.cos2A2 + cos2e.cos2(0 - A)cos2e.cos2(0 +A) aA ---^ 2 + cos2e.cos2(0 -A)b4 -2 + cos2e•cos2(0-A)a2b2cos2e .sin 2 (0 +A)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 polarizationcan be determined by the signs of the coefficients a2 and b2.The above relationships hold for an ideal compensator. A compensator ismade of linearly birefringent material and functions as follows. An electromagneticwave linearly polarized and propagating in a direction perpendicular to the opticaxis of the compensator will experience a refractive index n and transmittanceTan(ir,) whose value depends upon the orientation of the polarization vector withrespect to the optic axis. If the wave is polarized in a direction parallel to the opticaxis, the wave will propagate at a speed c/ne where c is the speed of light in avacuum 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 willpropagate at a speed of c/n, where n, is the ordinary refractive index. When an16electric field vector is composed of both polarization components, propagationthrough the compensator will introduce a relative phase retardation A, between thetwo components of:Ac 2 n d .(no - ne)A(2.12)where d is the thickness of the compensator and 1 is the wavelength of the electricfield.An ideal compensator has a relative phase retardation of n12 and a relativetransmittance Tan(iir,) = 1 at the wavelength of interest. In general, however, thecompensator will not be ideal and three defect parameters (q, r, s) must beintroduced to correct for the non-ideal gr, and A, of the compensator:8q - 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, therebymodulating the polarization state of the incident light, or after the sample. Themethod of analysis in either case is similar, however it is conceptually simpler tokeep the input polarization fixed while modulating the polarization of the reflectedbeam. For the compensator placed in the reflected beam, with the analyzer angleset to zero, the Stokes parameters can be expressed in terms of the normalizedFourier coefficients as:717Sicos20 - 1 Si2 + SI (2.15b)Si -^2.a4/[(2-q)- q.a4] (2.14a)S2 - 2.b4/1(2-q)- q.a41 (2.14b)S3 -[b2.(2 - q) - 2.s.b4] (2.14c)r.[(2 - q) - q.41]The polarization parameters (19, €) are related to the Stokes parameters by:7S3tan2e =  .‘i 4+ s22(2.15a)S2sin 20 -  \iSi2+ 4(2.15c)Eqn. 2.15a illustrates the ability of the rotating compensator ellipsometer todistinguish the sign of E from a measurement of S3 and therefore determine thehandedness of the reflected polarization. Eqns. 2.15b and 2.15c provide adetermination of 0 from either the sine or the cosine term. When e approaches 0or ± Tr/2, the experimental uncertainty becomes excessive if e is determined fromthe cosine term. A similar case holds if e is evaluated from the sine term as itapproaches ±Tr/4. By finding e from the larger of I sin 201 and Icos 2611, theexperimental uncertainty becomes independent of the value of a The signs of18Eqns. 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 CalculusThe Jones matrix describes the overall effect of a non-depolarizing opticalsystem on an incident, monochromatic plane wave. Such a wave can bedescribed by the vector:(2.16)A 2x2 transformation matrix T (Eqn. 2.17) relating the output electric field vector tothe input electric field vector is the Jones matrix of the optical system and itselements Tij are in general complex quantities.(T11 T12)T21 T22(2.17)A cascade of several optical systems can be combined into a singleequivalent 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 beamenters; 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 howit changes the polarization state of the incident beam. There exists a functionalrelationship known as the Polarization Transfer Function (Eqn. 2.19) of the optical19system which is a bilinear transform mapping the input polarization state xi to theoutput polarization state x,. The coefficients T the transform are the elementsin the corresponding Jones matrix.T22X1 + T21 Xo112X, + T11(2.19)20CHAPTER 3DESCRIPTION OF THE INSTRUMENT3.1 Overview of the SystemThe description of the in-situ ellipsometer can be divided into three broadcategories: the mechanical hardware and optics, the electronics, and the computersoftware. Figure 3.1 illustrates the inter-relation of the major components of thesystem. Subsequent sections in this chapter deal with each of these categoriesin more detail. Module assemblies are illustrated in the accompanying figures;detailed construction drawings are in Appendix A and, when referred to, thesefigures are prefixed by the appendix letter. Manufacturers specifications areincluded in Appendix B and the program source codes are in Appendix C.3.2 Description of the HardwareThe ellipsometer hardware consists of a source and a detector arm clampedonto the NW25 vacuum ports of a sputtering chamber as shown in Fig. 3.2. Botharms are modular in design and an attempt was made to standardize theconfiguration of each of the modules to reduce the design complexity andmachining time and to increase the serviceability. Each of the modules making upthe arm assembly is based on a cylindrical geometry, has a standardized threadand is completely interchangeable. Various ellipsometric configurations such as21DETECTOR HeNle LASERIBM PC WITH DATA ACQUISITION CARDELECTRONICS INTERFACESAMPLE ANDADJUSTABLE BASEMOTOR CONTROLLERANALYZERROTATINGCOMPENSATORSHUTTERPOLARIZERENTRANCE ANDEXIT WINDOWSMOTOR ANDSHAFT ENCODERLASER POWERSUPPLY71toCA;Chll'9M--7"C-0 53o3CD(SsED-U):PaP-3m-3CD=Ei5,-CDU)7:3C(7)-,.mCo073CYCD--%tvtathe sample-compensator, compensator-sample, and nulling (rotating compensatorremoved) are therefore all realizable with this design.An adjustable sample holder (Figs. A1.1, A1.2) mounted on the back wallof the chamber allows the reflected laser beam to be aligned parallel to the opticaxis of the detector arm. The tilt and elevation adjustment is via three vacuumfeed-through micrometer screws accessible at the back of the chamber.3.2.1 The Source ArmThe source arm (Fig. 3.3) generates a beam of collimated and linearlyFigure 3.3: Source arm assembly.24polarized light of known and adjustable azimuth and is comprised of a 5 mW HeNelaser followed by a rotatable polarizer. The laser mount assembly (Figs. A2.1 -A2.9) aligns the laser approximately antiparallel to the optic axis and incorporatestwo mirrors to turn the beam by 1800. Both a space savings and a method ofalignment are realized with this geometry since the beam can be aligned to theoptic axis by adjusting the small steering mirror. A pinhole aperture having adiameter equal to the gaussian width of the beam can be manually rotated into thebeam path to aid in the beam alignment. Turning the aperture rod (Fig. A2.4) by900 rotates the pinhole out of the beam path during a measurement. A bistableelectronic shutter blocks off the beam after a measurement cycle in order to meetsafety considerations and to allow for a dark cycle measurement of the ambientlight associated with the plasma discharge in the chamber.The polarizer module (Figs. A3.1 - A3.7) consists of a high qualityGlan-Thompson prism polarizer having an anti-reflectivity coating and an extinctionratio of 10-6 (Appendix B1) mounted inside a drum assembly. A worm gearassembly and vernier drum dial readout permits repeatable adjustments to ± 0.05°.The polarizer screws onto the vacuum port adapter (Figs. A4.1 - A4.2) whichattaches onto a standard NW25 vacuum port flange. The vacuum seal is made bysandwiching a disc of BK7 glass (Appendix B2) between two 0-ring seals. Inorder to minimize the stress-induced birefringence in the windows, the six boltsclamping the window around its perimeter must be tightened evenly and only untilglass to metal contact has been made.253.2.2 The Detector ArmThe detector arm (Fig. 3.4) consists of a rotating compensator followed byan analyzer and photodetector. The rotating compensator (Figs. A5.1 - A5.10) isthe most complex module of the entire ellipsometer. A compensator(Appendix B3) is captured in a drum assembly similar to that used in the polarizermodule except that an adjustable holder for aligning the optical axis of thecompensator to its axis of rotation is inserted into the drum. One end of the drumshaft holds an optical shaft encoder for synchronization of the data acquisitionsystem; the other holds a 104 tooth gear meshed to a 144 tooth gear on the shaftof a 30 Hz ac hysteresis, synchronous motor. Slots rather than holes were usedon the motor mount bulkhead in order to accommodate a variety of motors andgear ratios. An alignment aperture similar to that in the laser mount module isincorporated to aid in the alignment of the reflected beam.The analyzer module is identical to the polarizer except that the adjustmentknob and vernier scale are on the opposite side in order to permit adjustment fromthe front of the sputtering chamber.The detector module (Figs. A6.1 - A6.2) screws into the analyzer and housesthe photodiode and its associated electronics. A narrow band filter matched to theHeNe laser frequency placed in front of the photodiode cuts out stray ambientlight.26ANALYZER MODULE_...„,-ROTAT I NO COMPENSATORMODULENW25 PORT ADAPTERTOTAL LENGTH = 30"PHOTODETECTORMODULEFigure 3.4: Detector arm assembly.3.3 Description of the ElectronicsThe ellipsometer is controlled by an IBM compatible PC through aLabmaster DMA data acquisition and I/O interface board. Important specificationsshown in Appendix B4 include its data sampling rate (40 kHz), 12 bit resolution ofthe ADC, 24 lines of buffered I/O and five high speed timer-counters. To shield theADC properly from the electrically noisy environment of the PC, it has beenhoused in a shielded chassis external to the PC and connected to it via a 50conductor ribbon cable.27The measurement time of the ellipsometer is limited by the maximumsampling rate of the Labmaster: sampling 512 times per cycle allows a maximumrotation speed of 78 Hz. Selecting a compensator rotation speed of 41.54 Hz andsampling 512 times per cycle requires a sampling rate of 21.27 Kbytes per secondwhich is too high for polling operation of the ADC and therefore requires directtransfer of the data to memory (Direct Memory Access (DMA)).The interface electronics are contained on six euroboards occupying partof a Schroff card cage and are interconnected via a common bus (Fig. A7). Thefunction of these boards is to synchronize the data acquisition and provide aninterface between the Labmaster digital control signs and the ellipsometer.3.3.1 The I/O Interface BoardThe I/O interface board (Fig. A8) buffers the 24 lines of digital I/O from theLabmaster. The present design only defines 16 of these: AO - A7: outputs fromthe Labmaster; BO - B3: outputs; CO - C3: inputs.3.3.2 The ADC Trigger BoardThe ADC trigger interface board (Fig. A9.1) synchronizes the data transferto the shaft encoder pulses and the Trigger Enable command from the Labmaster.The timing diagram (Fig. A9.2) illustrates the synchronization sequence. To begina measurement cycle, the Labmaster first resets the flip-flop (Q1) through the linesEnable Trigger 2 and 3, then enables its trigger by setting Enable Trigger 1 high.28The 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 ADCtrigger) to be clocked by the incremental shaft encoder pulses connected toSource 1. Counter 1 divides the 1024 incremental encoder pulses to set thenumber of data points per cycle to between 2 and 512. The start of the dataacquisition therefore always occurs at the same point in the cycle.The In Process bit is also set high by this first enabled trigger pulse. IfIn Process is high, the interrupt service routine will read the value in the holdregister of Counter 3 which contains the number of ADC conversions completedand check for missed counts indicating a possible synchronization problem.Counter 4 is used as a diagnostic signal synchronized to the ADC start pulse. Theoutput of the index pulse is opto-coupled to a BNC connector on the face plate ofthe shaft encoder interface board and is also available as a diagnostic signal.3.3.3 The Detector Interface BoardThis board (Fig. A10.1) passes the buffered Labmaster A3-A6 address linesto 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 thelaying out of the signal paths (to avoid ground loops) and shielding in order toachieve 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 meet29this criteria, the photodetector amplifier is mounted in the module containing thephotodetector (Appendix B6) and the output is connected with a coaxial cable tothe interlace board where it is further amplified and inverted before it is connectedto the ADC input. Neither the module housing nor the card cage ground isconnected to the detector ground. The power (±15 V) and ground for the detectorand inverting amplifier is supplied by the Labmaster. All gain select lines are opto-coupled to the detector, further avoiding ground loop problems and separating theanalog ground from the noisier Labmaster digital ground.The photodetector amplifier (Figs. A10.2 - A10.3) has a 3 dB gain rolloff at720 Hz shaped by a four pole Bessel low pass filter which, because of its linearphase characteristics, maintains a constant, linear relationship between the phasesof the second and fourth harmonics. The temperature stability of the amplifier isimportant because changes in the cutoff frequency will directly influence themagnitude and phase of the photodetector signal and for this reason precision, lowtemperature coefficient capacitors and resistors are used.3.3.4 The Shaft Encoder Interface BoardThe shaft encoder interlace board (Fig. All) connects the shaft encoder(Appendix B7) to the ellipsometer system bus. The index pulse from the triggerinterlace board is passed along the bus to a BNC connector on this board whereit is available as a diagnostic pulse. The BNC ground is isolated from the cardcage and connected directly to the BNC shield. Power (+5 V) and ground for the30shaft encoder are supplied by the Labmaster.3.3.5 The Shutter Interface BoardThe shutter interface board (Figs. Al2.1 - Al2.5) controls the bistableelectronic shutter (Appendix B8). Two I/O lines from the Labmaster passed alongthe bus control the opening and closing of the shutter. Power is supplied from thecard cage. The transition time of the shutter at +15V is 5 ms, which is less thanthe compensator rotation period of 24 ms.3.3.6 The Motor Interface BoardThe motor interface board (Fig. A13.1) connects two Labmaster I/O linespassed through the bus directly to the motor controller situated in a separateenclosure (Fig. A13.2). The motor can be turned on or off and its speed switchedbetween 900 and 1800 rpm by toggling the appropriate control bit. The motoritself 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 shiftsof the Fourier coefficients as the signal is passed through the photodetectoramplifier. The required stability in the drive frequency of better than 100 ppm wasachieved by implementing a quartz locked oscillator circuit.313.4 Description of the SoftwareExtensive software routines were written in the Turbo Pascal environment toalign, calibrate, and run the ellipsometer. In addition, several utility programs wereincluded to aid in the alignment of the laser, adjustment of the sample stage,diagnosis of harmonic noise generation, and verification of the calibration andalignment. Source codes are given in Appendix C.3.4.1 Labmast.pasThis unit contains the routines for configuring the Labmaster I/O ports,counters, and DMA controller. Upon startup of a program, the unit initializes theLabmaster ADCs, counters and I/O ports and generates a global reset of theboard. Subroutines in this unit interface the functions defined in the Labpacmanual) to Turbo Pascal. These functions are implemented by filling the requiredregisters with user defined values or constants predefined in the header filelabhead.btp. Execution of the subroutine is done by generating a softwareinterrupt using an interrupt vector defined in labhead.btp.3.4.2 EDA_Gath.pasThis unit contains the software to configure the Labmaster DMA controller,synchronize it to the shaft encoder pulses, and acquire data for a given numberof compensator revolutions. It also contains routines to control the laser shutter,motor speed and detector gain. A subroutine to normalize the Fourier transformed32data 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.pasAll data processing routines are contained in EDA_Dsp.pas. Severalroutines, such as those to average the time domain data and check for errors inthe data are not normally required in this implementation of the ellipsometer andare included here as auxiliary subroutines. Since only the normalized second andfourth Fourier harmonics are required, a full Fourier transform of the data is notnecessary. 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 atany harmonic desired and stores the coefficients in an array (Table C2). Functionsto calculate the ellipsometric angles ii,, A and the Stokes parameters from theFourier coefficients are also included in this unit.EDA _FFT.pas is an auxiliary unit which contains an implementation of a fullFFT which may occasionally be useful for the analysis of parasitic harmonics in thedata.333.4.4 EDA_Dis.pasAll procedures to initialize the graphics or text display are included in thisunit. Procedures to set up axes and plot either the time domain or the frequencydomain data are available.3.4.5 EDA_Align.pasThis is one of the three main programs and is used to align the analyzer tothe p-axis and the polarizer to the s-axis of the sample. A detailed explanation ofthe alignment algorithm is given in Chapter 4 and is summarized here. Threealignment iterations are performed during which the operator is prompted to setthe analyzer or polarizer to specified angles or enter their vernier drum dialreadings on the keyboard. The final alignment of the analyzer is made by fittinga quadratic to the squared magnitude of the fourth harmonic for 20 data pointstaken at 0.5° increments and centred approximately around the maximum. Fromthese values, the angle corresponding to the maximum magnitude is calculated bythe program Ang_fit.C. The execution of this Turbo C program is done from withinEDA Align through the Pascal Exec command. The data points are passed in thetext file Align.dat and the analyzer angle and goodness of fit coefficient arereturned in the text file Align.fit. A poor fit results in a warning message displayedon the screen. The polarizer and analyzer alignment angles are written to theASCII file Align.par for use in the calibration (EDA_Set.pas) and measurement(EDA_Meas.pas) routines.343.4.6 EDA_Set.pasThe second of the three main programs measures the corrections for thephotodetector gain rolloff and shaft encoder trigger phase with respect to the p-axis for both the second and the fourth harmonics. The analyzer must be alignedto the p-axis before these corrections can be made and the operator is promptedto adjust the polarizer. The theoretical details of the correction procedure can befound in Section 4.4.The correction occurs in two stages. First, the normalized magnitude of thesecond and fourth harmonics are corrected for the gain rolloff of the photodetectoramplifier. With the polarizer aligned to the s-axis, a correction to the secondharmonic is made by running the motor at half speed; a correction to the fourthis made at full speed.The second stage adjusts for the trigger phase of the shaft encoder and forthe relative phase shift of the photodetector amplifier. The trigger phase correctionalgorithm shifts through the data one increment at a time to find the phasecorrection to within one sampling interval after which an analytic correction termis measured for both the second and the fourth harmonics with the motor runningat half and at full speed respectively. However, this only establishes the correctionfor the second harmonic to within -± ir and a repositioning of the polarizer to thes-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 the35sample reflectivity (EDA_Meas.pas).3.4.7 EDA_Meas.pasThis program collects data and, using the alignment and correctionparameters, calculates the reflectivity of the sample. The program prompts theuser for the size of the sample to average, the time interval betweenmeasurements, 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 Stokesparameters, the program determines p from the lesser of S, and S2• (The readeris referred to Section 2.3 for a discussion of the underlying theory.) In addition, theprogram gives an estimate of the error in A by calculating the difference betweenthe 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 thisand the previous two programs. These are summarized in Table C3 (Appendix C)and include monitoring of the signal level, DMA initialization, ADC synchronizationto the shaft encoder pulses, and Stokes parameters. In order to prevent a 'divideby zero' operation in the arithmetic functions due to a low light intensity level, anerror handling routine displays a "Low light /eve/" warning message and aborts theprogram. The standard exit procedure for all programs is to turn off the motor andthe laser shutter and to restore old interrupt vectors.363.4.8 EDA_Coef.pas and EDA_Bug.pasThese two routines are available to test and debug the system.EDA _Coef.pas calculates and displays the uncorrected magnitudes of the first sixnormalized Fourier coefficients. It is intended to be used as an aid in determiningthe size of parasitic harmonics and their influence on the calculation of the samplereflectivity. EDA_Bug.pas displays the corrected values of the real and imaginaryparts, as well as the magnitudes and phases, of the second and fourth harmonicsand is intended to verify proper alignment and calibration of the instrument. Thedata for all cycles acquired is graphically displayed before the program isterminated by the operator.3.4.9 Shutter.pas and ADCrun.pasThese short programs can be used during operator alignment of the sampleto the optical axis of the ellipsometer. Shutter.pas simply allows direct control ofthe laser shutter from the keyboard while ADCrun.pas polls the ADC and displaysthe resultant byte to the screen. Alignment of the sample stage can therefore beaccomplished by adjusting the sample stage and laser mirror until a maximumreading is obtained.373.5 Critical Design CriteriaThe in-situ ellipsometer is designed to measure sputter deposited layers tomonolayer accuracy in real time during the deposition process. This requires aprecision 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 thesystem. Immunity of the system to vibrations and electromagnetic interference(emi), the rotation stability of the compensator and the stability of the light sourceare the most important design criteria and each will be considered separately inthe following paragraphs.An in-situ ellipsometer is necessarily situated in an environment not normallysuitable for precision measurements. Roughing pumps can transmit vibrations tothe ellipsometer arms and sample stage, evacuation causes flexing of the chamberwalls and misalignment of the optics, and the ion source emits emi which cancouple noise to unprotected photodetector electronics. The suppression of theeffects of emi has been dealt with in a previous section in this chapter and will notbe repeated here. Suppression of vibrations caused by a roughing pump is bestdone at the source by connecting the pump to the vacuum system with a bellowsadapter which will attenuate the large amplitude, low frequency pump vibrations.The small, higher frequency vibrations only become a problem if the laser beamhas 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 lightreaching the photodetector resulting in high frequency noise superimposed on the38ellipsometric signal.The evacuation of the chamber and its effect on the alignment of theellipsometer and the changes to the angle of incidence is a relatively repeatablephenomenon. Nevertheless, verification of this repeatability must be madeperiodically with a calibrated sample to allow for an eventual recalibration of theangle of incidence in the evacuated chamber.The gear ratio of the compensator must be carefully chosen to minimizemechanical vibrations and to avoid a superposition of any 60 Hz noise orharmonics thereof from the supply lines onto either the second or fourth harmonicsof the ellipsometer signal.' The rotating compensator module was designed topermit flexibility in the choice of motors and gear ratios for a more heuristicapproach to this problem. A ratio of 1.385 set by a 144 tooth gear on the motorshaft driving a 104 tooth gear on the compensator was found to give the fastestand smoothest rotation possible for this motor.An computer analysis of the effect of 30 and 60 Hz harmonics as well asgear 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 gearimperfections, GR is the gear ratio, fm is the motor frequency, and hm and hgr areintegers representing multiples of the motor frequency and gear ratio respectively.39It was found that for the gear ratio of 104:144, all harmonics of these frequenciesup 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 thecompensator drum shaft, orbiting of the shaft encoder will introduce a frequencymodulated 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 byaveraging over an even number of signal periods. 3 Since only the second andfourth harmonics are of interest the second criterion is automatically satisfied if thedata is analyzed over one complete compensator revolution.The motor speed and photodetector characteristics must also be constantover the period of time the in-situ measurements are being made. Changes inmotor speed will introduce changes in phase shift and magnitude into theharmonics due to the characteristics of the photodetector amplifier and it istherefore important to stabilize the motor speed and detector amplifier asdescribed in the preceding sections of this chapter.The requirements on the stability of the light source pose a problem if theyare to be met by using a standard, unpolarized and unstabilized HeNe laser.Since only normalized magnitudes are required, slow changes in intensity, suchas a dc level drift of less than 1 part in 4096 (1 bit change over the ADC resolutionof 4096) during one compensator revolution are acceptable. However if, as istypically the case, several cycles are averaged to find the reflectivity, the dc drift,40while close to zero over one cycle, may appreciably effect the normalization whendata from several cycles are averaged. The solution is to Fourier transform thedata from each measurement cycle, normalize with respect to its dc coefficient andaverage the normalized coefficients over the data set.In order to maintain a high signal to noise ratio as the laser beam intensitydrifts, some gain control of the signal is necessary. One of sixteen logarithmicphotodetector gain levels can be selected by software which monitors the peakvalue of the photodetector signal and adjusts the gain in 20% increments asrequired. The ADC also features four programmable gain steps from 1 to 8 for acombined dynamic range of 40 dB over which the signal can be adjusted to within20% of its saturation value. If the signal falls outside of this range, a warningmessage is sent to the PC screen.An unstabilized HeNe is prone to occasional mode hopping during whichthe emitted intensity will change by 5% in a sudden jump. The intensity changesat the output of the polarizer are much larger however, and the polarized intensitycan change by as much as 100% during a mode jump. This is due to the fact thatthe randomly polarized laser beam is actually partially polarized and its polarizationstate changes as the laser jumps from one mode to the next. The frequency ofthese 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 numberof corrupted measurements due to mode hopping, the laser must therefore bewarmed up for at least two hours prior to making any measurements.41CHAPTER 4ALIGNMENT, CALIBRATION AND MEASUREMENT4.1 IntroductionThe alignment and calibration of the ellipsometer encompasses severalsteps. After mounting both arms of the ellipsometer on the vacuum chamber, thelaser and sample must be properly adjusted such that the laser beam passesthrough the center of all the optics and the optic axis of the compensator must bealigned perpendicular to its axis of rotation. Following this, the analyzer andpolarizer azimuths must be properly oriented with respect to the p-axis of thesystem. Once aligned, the photodetector amplifier characteristics and shaftencoder trigger phase are measured and used as correction factors in themeasurement of the Fourier coefficients. Finally, measurement of several referencesamples of silicon and silicon oxide with known reflectivities yield correction factorsfor the change in p due to the stress induced birefringence in the vacuum portwindows and calibrate the angle of incidence of the laser beam.In addition to the above procedure, which should be repeated prior to everymeasurement, the non-ideality of the compensator must be measured. Threecompensator defect parameters are measured with the ellipsometer armsconnected together in a straight through configuration and are used in Eqns. 2.14to calculate the actual Stokes parameters from the Fourier coefficients. These42parameters depend only on the characteristics of the compensator and thewavelength of light used; they need be measured only once.4.2 Optics and Beam AlignmentThe cylindrical design of the ellipsometer arms guarantees that the opticalaxes of the analyzer and polarizer lie along the mechanical axes of their respectivearms, however the axial alignment of the compensator requires specialconsideration since misalignment of the compensator axis can result in amodulation of its transmissibility due to variations of the surface reflectivity with theangle of incidence as the compensator rotates.The alignment of the compensator to its mechanical axis of rotation is madeon a optical bench. Three set screws arranged symmetrically around thecircumference of the drum assembly allow for angular adjustment of thecompensator holder inside (Fig. A5.1). The holder is adjusted until the projectionon a screen of a laser beam reflected off the compensator face no longer tracesout a circle when the compensator is rotated.6 Once the adjustment has beenmade, 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 avoidvignetting and internal reflections. As stated in Section 3.5, ambient vibrations willalter the amount of vignetting and superimpose noise onto the ellipsometric signal.The alignment procedure begins with the incident laser beam. By adjusting43the steering mirror (Fig. A2.1) on the laser mount module until the beam passesthrough the alignment aperture and out the center of the vacuum port window, thebeam 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 thesample stage until the back reflection from the compensator face coincides withthe incident beam spot on the sample. This alignment must usually be doneiteratively by first tilting, then raising or lowering the sample stage, sincecoincidence of the incident and reflected beam spots on the sample is noguarantee that the beam is centered on the photodetector. The programADCrun.pas can be used to read the photodetector output while raising or loweringthe sample until the maximum is found.4.3 Rotational Alignment of the OpticsThe alignment of the analyzer and polarizer to the sample p-axis is done inthree iterations and is based on the sensitivities of the second and fourthharmonics to the rotation of either component. This procedure requires a metallicsample. Linearly polarized light whose plane of polarization lies in either the p- orthe s-plane will then have its polarization state preserved upon reflectance andgenerate only a fourth harmonic of the compensator frequency. (This is in factonly true for an ideal compensator and, in practice, the second harmonic is asmall, non-zero value related to the compensator defect parameters. A furtherdiscussion of the influence of a non-ideal compensator is found in Section 4.5.)44From Eqns. 2.11a and 2.11b, where 0-A is given by the angle between thetransmission axes of the polarizer and analyzer, it can be seen that adjustment ofthe polarizer to either the p- or s-axis will minimize the magnitude of the secondharmonic for any position of the analyzer (since the ellipticity E of the reflected lightis zero on these axes). From 2.11c and 2.11d, it is also evident that subsequentalignment of the analyzer to one of these axes will either maximize or minimize themagnitude of the fourth harmonic depending on whether e-A = 0 or Tr/2:coincident or orthogonal alignment of the analyzer and polarizer transmission axesrespectively.The alignment procedure aligns to the orthogonal position for two reasons.The relative magnitude of the random error with respect to the fourth harmonic isminimized (since the fourth harmonic reaches a maximum in this orientation) and,secondly, the magnitude of the second harmonic in this orientation is independentof the compensator parameters and should equal zero.The initial alignment is accomplished by first adjusting the polarizer to theapproximate minimum in the second harmonic, followed by adjusting the analyzerto the approximate maximum in the fourth harmonic. Because the minimum issharp, a second alignment of the polarizer to better than ± 0.05° is possible simplyby searching for it. The maximum of the fourth harmonic is much broader andtherefore a least squares fitting routine (Ang_fit.c) is used during the second andfinal analyzer alignment to find the angle corresponding to the p-axis from a set of20 data points taken around the maximum.45The equations for p(iir,A) (Eqns. 2.8, 2.11, 2.14 and 2.15) assume ananalyzer alignment to the p-axis. The Fourier coefficients a4 and b4 give noindication, however, to which axis the alignment algorithm has oriented theanalyzer. By inserting a polarizer, whose extinction axis orientation is known, intothe polarized beam incident on the sample, the orientation of the analyzer can bedetermined and related to approximate vernier drum dial readings on the analyzermodule. A subroutine in the software alignment procedure checks whether theangles the operator has entered are in the proper quadrant and prompts theoperator to rotate both the analyzer and polarizer by 90° prior to the final alignmentif the analyzer has not been aligned to the p-axis.With the vacuum port windows in place, the beam incident on the sampleis slightly elliptically polarized and the alignment of the polarizer and analyzer arecorrelated to some degree. Following the second and final alignment of theanalyzer, a final readjustment of the polarizer is therefore required.To summarize, the rotational alignment of the optics requires a first, roughalignment of the polarizer to either the s- or the p-axis, followed by a roughalignment of the analyzer. A rotation of both components by 900 may be requiredif the analyzer has been aligned to the s-axis prior to a second, fine adjustment ofthe polarizer and analyzer. Due to stress birefringence in the windows, a finalreadjustment of the polarizer is required.464.4 Calibration for Gain and PhaseAfter the analyzer and polarizer have been aligned to the sample p- and s-axes respectively, the correction values for the relative amplitude attenuation andphase shift for the second and fourth harmonics must be determined. Thephotodetector amplifier incorporates a low pass Bessel filter whose attenuation andphase shift are frequency dependent. The second and fourth harmonics aretherefore attenuated and phase shifted by different amounts relative to the dccomponent of the signal resulting in an erroneous measurement of the polarizationstate if the filter characteristics are not taken into account.If^b4' represent the measured coefficients and if 1 /a1 and (pi are therelative attenuation and phase shift of the ith harmonic (i = 2, 4) respectively, thenthe actual coefficients^b4 from Eqn. 2.11 become:6ai^ai (^.cos 4•„: + bli•sincki )bi = ai • (JD/2: •cos.i -^)In order to find the correction factors, it is necessary to introduce severalequations by Hauge and Dill8 relating the actual Fourier coefficients to the analyzerand polarizer angles (A and P) and the ellipsometric angles:47a2b2a4b4_ -2r ( v tanA ) sin2A + 2s (cos2A + p.) 2 + q- ( v sin2A + pcos2A)_  2r ( v tam& ) cos2A + 2s (sin2A + v) 2 + q(vsin2A + itcos2A)_  ( 2 -q) ( vcos2A - v sin2A) 2 + q-(v sin2A + gcos2A)_  ( 2 -q) ( p,sin2A + vcos2A) 2 + q( v sin2A + licos2A)(4.2a)(4.2b)(4.2c)(4.2d)Where q, r and s are the compensator defect parameters to be discussed inSection 4.5, and ti and v are defined as:P. - cos2P - cos2 ilr 1 - cos2P•cos24r(4.3a)V _ sin2 P•sin2111.cos A 1 - cos2P•cos2iIr(4.3b)If the analyzer and polarizer have been aligned as described, then(p., v) = (-1, 0) and measurement of the magnitude of the fourth harmonic yieldsa4 directly:1 ^ (4.4a)asince, from Eqns. 4.2:V a: + b: - 1 (4.4b)4 Vai2 4. bi248A problem unique to the rotating compensator ellipsometer is that both thesecond and the fourth harmonics must be corrected and that, for a polarizerorientated to either of the p- or s-axes of the system, the second harmonic isessentially zero making a determination of the associated correction valuesimpossible. In order to circumvent this problem, a dual speed motor controller wasimplemented and the correction for the second harmonic is measured by runningthe motor at half its nominal speed and measuring the fourth harmonic. The fourthharmonic will have the same frequency at the compensator frequency 63c/2 as thesecond harmonic at wc. Since the amplitude attenuation is dependent only on thefrequency of the signal and not on the harmonic number, a2 can be measureddirectly in exactly the same way as a4 when the compensator is rotated at halfspeed.The phase shift of the data is caused by both the relative phase shift of thedetector amplifier's constant delay filter and by the angular orientation of the shaftencoder's index pulse to the sample p-axis (the trigger phase). Both effects aredealt with separately. The trigger phase is corrected by shifting forward throughthe data array thereby adjusting the starting point of the Fourier analysis by anindex offset value C_ Shift. However, this can only determine the phase to withinone encoder increment pulse, equivalent to ± 3.00 in the fourth harmonic, and ananalog 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 by49measuring 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 cp2to within Tr. Examination of Eqn. 4.2a shows that a2 should be positive for apositive 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 todetermine cp2 completely. However, since a2 depends upon A and P, its positivevalue 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 thanthis.The calibration routine is then as follows. After the analyzer has beenaligned to the p- and the polarizer to the s-axis, the relative amplitude attenuationof the photodetector is measured at the second and fourth harmonics by runningthe motor at full and at half speed respectively. Thereafter, the trigger phase of theshaft encoder is evaluated by calculating the phase of the fourth harmonic aftershifting forward through the data one increment at a time. Once the phase hascrossed through zero and a4 is positive, 04 is measured and stored along with theC-Shift parameter. The motor is then run at half speed and cp2 is measured. Inorder to determine if the calibration has set the second harmonic in its properquadrant, the operator is prompted to align the polarizer to the p-axis (P = 0). If50a2 is negative, cp 2 is increased by Tr. The C-Shift value as well as (a2, a4, 192, 04) arestored in an ASCII file 'Cal Data.dar for use in the measurement programEDA Meas.pas where;, b2, a4, b4 are corrected using Eqns. 4.1.4.5 Compensator Alignment and CalibrationIf 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 azimuthO = A + Tr/2 is incident on the compensator producing a fourth harmonic variationin the detector signal. In this configuration, the sample parameters (74r, A) becomeTr/4 and 0 respectively. The magnitudes of the harmonics (from Eqns. 4.2 and 4.3)then reduce to:a2YaZ2 +^2,91/2cos2 (A-fl + 2 2 + qcos2 (A- P), 2^b, 2 ^2 - q (X 4 *Vaut4 ' 4^2 + qcos2 (A- P)(4.6a)(4.6b)Parallel alignment of the transmission axes of the analyzer and polarizer willgenerate linearly polarized light of azimuth 0 relative to the analyzer (A-P = 0) andresult in a minimum in the magnitude of the fourth harmonic. The compensatorq- and s-parameters can then be calculated from Eqns. 4.6 directly. Thecompensator r-parameter can be found from q, s and Eqns. 2.13:r = 1/1-s2- (q-1)2 (4.7)51The parameters q, r, s in the preceding equations are independent of the relativephases of the harmonics and can therefore be measured before any phasecorrection is made.4.6 Checking Alignment and the Stokes VectorThere are several methods to check the quality of the alignment andcalibration. The most obvious one is a subsequent measurement of the magnitudeand phase of the second and fourth harmonics. A proper calibration will adjust themagnitude and phase correction terms to give a fourth order magnitude of one anda phase of zero when the analyzer is aligned to the p-axis and the polarizer to thes-axis. However, checking only that a4 = 1.0000 and b4 = 0.0000 whenP = A + 90° is not a sufficient check of the proper alignment of either the analyzeror the polarizer since the calibration routine will adjust the phase and magnitudeof 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 therelevant coefficients through a measurement of the first Stokes parameter S.Eqns. 2.11a-d show the relationship between the analyzer and polarizer angles andthe Fourier coefficients. These coefficients are related to the Stokes parametersby 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 sincemisalignment of the analyzer or improper calibration results in an error in the52Stokes parameters and a value of So which differs from one and is a function of thepolarizer angle.4.7 Correction for the Vacuum Port WindowsThe stress induced birefringence in the vacuum port windows will alter thevalue of the measured reflectivity by perturbing the polarization state of the incidentand reflected light beams. This perturbation can be minimized by a judiciouschoice of glass material and by proper mounting (Fig. A4.1). The residualbirefringence then results in only a small perturbation of the polarization statewhich can be handled by a first order correction of the reflectivity.An ideal window is represented in the Jones matrix formulism by a 2x2identity matrix. The birefringence introduces a small perturbation into the matrixrepresentation of the window T, which can be represented as:ai.2^ (4.8)a21^1+ 22where the au are in general complex and have an absolute value much less thanone. If the Jones matrix of the sample of reflectivity ps is given by:S ips 01[0 1j(4.9)the optical system, whose reflectivity ps' is measured, can be considered to becomprised of the entrance window, the sample and the exit window:SI - Twout'S.Tifin^ (4.10)533^[Ps ( 1 + an/ + aosi)/ ••1Psa112 4- "0121+ ai22+ a022474121+ Psa021(4.11)Multiplying the matrices and retaining only first order terms yields:where the subscripts i and o distinguish between the input and the output windowparameters respectively.The associated bilinear transform mapping the input polarization to theoutput is given by:XSio(1-Fa122+a022).X.9ii^(aizi^Psa021) (Psa112+a012) •Xei 4- Ps (1+ aill+ aoll)(4.12)where the input polarization xs,i is just that output from the polarizer:^xsii TanP^ (4.13)Solving Eqn. 4.12 for ps, expanding and retaining terms to first order resultsin a quadratic correction in terms of the measured reflectivity /35' (= Xs,/ X5'0):Ps - a + 13.P's^Y'P's2^(4.14a)where:^a - -4012*Xsi^ (4.14b)- 1 - a111^a011^ei22^a022^ a121/Xsi (4.14c)Y^aozz/Xsi (4.14d)and where a, p and y are complex. If xsi is kept large (P^Tr/4), the quadraticterm can be neglected and Eqn. 4.14a becomes a first order correction of the54sample reflectivity ps in terms of the measured reflectivity ps'.4.8 Calibration of the Angle of IncidenceThe angle of incidence of the laser to the sample 00 is not known from themechanical drawings to the required accuracy of -± 0.05° if absolute ellipsometricmeasurements are to be made with the in-situ ellipsometer. This angle cannot, tothe accuracy required, be measured directly and must therefore be calibrated.In order to calibrate this angle, a fresh silicon substrate, whose reflectivityas a function of angle of incidence is known, is mounted in the chamber. Sinceevacuation of the chamber will change the alignment of the ellipsometer arms, thismeasurement must be done under vacuum. Neglecting the effect of the windowsfor the moment, the relationship between the actual and the measured reflectivityis 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 aboveexpression and the resultant equation split into its real and imaginary parts to give:55Psr (00) - az 4- Pr*Plsr - 131*Pisi + aPsz(°°) •AOaePsi (00) - cci + P2 'Plsr - Pr*Pisi + aPs. (o0)  .A0aewhere the subscripts r and i denote the real and imaginary parts respectively.If the samples are chosen such that the imaginary component of theirreflectivity varies only weakly with the angle of incidence, then the differential termin Eqn. 4.16b can be set to zero. Three samples having different reflectivities canthen be used to solve for the coefficients a, p and AO in a system of equationsdescribed by the matrix in Eqn. 4.17. The correction AO need be calculated onlyonce and is used to calibrate the angle of incidence. 1 0 fYsir - A's.b.0 1 P'sii Pir1 0 rYs2r -Al220 1 P21 P's2r1 0 P's3r — P's3.1a P slrae0a P s2rae0a P s3raeazPrPi40_XI.PsIrPsiiPs2rP521P sir(4. 1 7)56CHAPTER 5INSTRUMENT PERFORMANCE5.1 IntroductionThe primary performance criteria for the in-situ ellipsometer are precisionand measurement speed. Absolute accuracy is important when controlling an etchprocess end pointw, but for the sputter deposition of single and multilayeredstructures, it is only necessary to measure the change in reflectivity the sample hasundergone during the deposition process. If the ellipsometer has the requiredprecision and sampling rate, the deposition thickness can be controlled to withintight tolerances. Equally important in this case are the tolerances on the linearityof the ellipsometer and its stability over time.This chapter describes the performance of the in-situ ellipsometer in termsof the above criteria. First, the effect of spurious harmonics on the precision of theFourier coefficients is examined. Next, the alignment and calibration proceduresare examined and an evaluation of their accuracy and repeatability is made.Finally, the precision and long term repeatability of the ellipsometric parametersTan(*) and A are measured.The accuracy of the ellipsometer is influenced by the angle of incidence ofthe laser probe beam, the birefringence of the vacuum port windows, andalignment of the analyzer and polarizer. The first problem is examined by57analyzing the repeatability of the probe beam alignment; the latter two by a firstorder correction of the sample reflectivity.Finally, in order to verify the accuracy of the ellipsometer, samples of variousthicknesses of silicon oxide on silicon are measured, corrected and compared toreference measurements made on a high precision, spectroscopic ellipsometer. 65.2 Speed, Precision and AccuracyThe sampling time depends naturally on the number of data cycles beingaveraged. (One data cycle is equivalent to one full rotation of the compensatorand includes 512 data points.) For the present selection of gears, thecompensator has a rotation period of 24 ms. The data cycle, Fourier analysis, andcalculation of reflectivity requires 130 ms and represents the lowest samplingperiod possible with this device.To achieve a precision in thickness of better than one atomic layer (onemonolayer), several data cycles must be averaged to filter out random noise, gearand 60 Hz induced harmonics (Eqns. 3.1). For the gear ratio used, averaging overnine data cycles will suppress any induced harmonics and, consequently, willincrease the sample period to 1.2 seconds.In order to verify that the spurious harmonics have indeed been suppressedto an acceptable level, the analyzer was aligned to the sample p-axis and thepolarizer to the s-axis. The magnitudes of the first six harmonics averaged overnine data cycles were measured and the results are shown in Table 5.1. The58magnitude of the second harmonic should ideally be zero and any non-zero valuemeasured can be considered to be due to a parasitic harmonic. The magnitudeof any parasitic fourth harmonic is considered to be of the same magnitude as theaverage 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 6Magnitude 0.0030 0.0014 0.0015 0.0016 0.0017 0.0002A practical limit to the size of these harmonics would be 0.01. Offset errorsof this magnitude introduced by parasitic components into the second and fourthharmonics can be handled by a first order correction of ps. The other parasiticharmonics, if they are larger than this limit, will in general have no effect on themeasurement but may cast doubt on the reliability of the ellipsometric data.The precision of the reflectivity measurements is dependent upon theprecision and repeatability of the alignment and calibration procedures. Repeatedrealignment of the analyzer and polarizer established that the aligned settings arerepeatable to .± 0.05° which is the resolution limit of the vernier drum dials. Theprecision 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 termstability of the compensator motor speed and detector electronics. All correctionterms 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.59Table 5.2: Amplifier Correction Factors and Compensator Defect Parameters.Parameter Value Errora2 0.997 ± 0.001a4 0.9826 ± 0.000302 -0.1260 ± 0.000204 04 ± 0.0005a 1.140 ± 0.001r 0.9901 ± 0.0005s 0.0052 ± 0.0005The accuracy of the alignment and calibration is determined by ameasurement of the first Stokes parameter So. Solution of Eqns. 4.2 and 2.14 fora silicon substrate shows that a misalignment of the analyzer by ± 0.05° from thep-axis results in a deviation of So by 0.002 over the range of polarizer angles from0 to 900. With proper alignment, So has been measured to be 1.0000 ± 0.0005over the entire range of polarizer angles from 0 to 360° indicating near perfectalignment.Since the ellipsometer will be making measurements of a sample undervacuum, 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 theevacuated sputtering chamber. Several measurements, each one averaged over16 data cycles, were made over a period of 30 seconds and from this theuncertainty was calculated to be ± 0.00005 in Tan(*) and ± 0.0004 in A. No driftin the measured values over a time period of 25 minutes was observed.Measurements of a silicon sample taken over several days were used to60evaluate their repeatability. Silicon was the sample of choice because the nativeoxide surface layer is relatively stable over time. After each measurement, theellipsometer arms were remounted, the chamber evacuated and the alignment andcalibration repeated. The repeatability of the reflectivity measurements wasdetermined to be ± 0.0007 in Tan(*) and ± 0.0006 in A.The stress induced birefringence in the windows was found to be primarilydue to stress introduced by the clamping of the windows on the vacuum portadapter (Fig. A4.1) and was found to vary by an order of magnitude depending onthe clamping pressure used. In order to minimize the correction factor requiredto calibrate for the windows, the six clamping screws were tighten only until the0-ring was fully compressed and glass to metal contact was made. The inducedbirefringence 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 reflectivitydue to two effects. One is the change in the stress birefringence in the windowsdue to the pressure difference across them. The second is the change in theangle of incidence due to flexing of the vacuum chamber walls. The observedchange of 0.27° should correspond to a change in the measured reflectivity of Siof -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.006and 0.01 respectively indicating that the change was due almost entirely to thechange in the angle of incidence and that the additional stress induced by thepressure on the port windows had little effect.615.3 Measurement of Reflectivity Correction FactorsA clean silicon sample as well as four samples of silicon oxide of variousthicknesses were prepared and measured on the reference ellipsometer. Basedon an appropriate model, the reflectivity at 68.2° incidence for each sample wascalculated. Three samples, silicon with a layer of native oxide, and two samplesof silicon having a layer of sputter deposited silicon oxide were mounted in thesputtering chamber and measured under vacuum. The solution ofEqn. 4.17, after substitution of the appropriate values of ap, /ae derived from themodels (Table 5.3), yields the correction coefficients (Table 5.4).Table 5.3: Values of ap/ae for various sample reflectivities.Sample Type aPr /30 api /aeSample S020: Silicon Substrate 0.0270 -0.0036Sample S021: 269 ± 2 A of Si02 0.0293 -0.0028Sample S022: 847 .± 3 A of Si02 0.0442 0.0016Table 5.4: Reflectivity and Angle of Incidence Correction CoefficientsCoefficient Valuea -0.0082 -i 0.0146ig 0.9267 -i 0.0141AO -0.0123Two more samples of silicon oxide were measured and Eqn. 4.14a wasused to correct the measured reflectivity of all five samples (after setting y = 0for a first order correction). Results were compared to the referencemeasurements at the calibrated angle of 68.2123° and are summarized below.62Table 5.5: Comparison of Corrected RCE Values to the ReferenceMeasurements.SAMPLE REFERENCE(at 68.2123°)RCE VALUE ERRORS20: Silicon Substrate -0.2369 -i 0.0252 -0.2341 -i 0.0243 0.0028 +i 0.0009S21: 269 -± 2 A Si02 -0.1931 -i 0.2394 -0.1939 -i 0.2461 -0.0008 -i 0.0067S22: 847 ± 3 A SiO2 0.0290 -i 0.6770 0.0275 -i 0.6779 -0.0015 -i 0.0009S024: 1837 ± 5 A Si02 0.0505 +i 0.8357 0.0351 +i 0.8369 -0.0154 +i 0.0012S23: 2200 ± 6 A Si02 -0.0533 +i 0.4942 -0.0551 +1 0.4680 -0.0018 -i 0.0262The samples are arranged in order of increasing oxide layer thickness. Since thesilicon, the oxide sample S022 and the real part of the reflectivity of S023 wereused to find the correction coefficients, their agreement with the referencemeasurements are expected to be quite good. As a check, the reflectivity of S021was 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 andthis may explain the relatively large error between the corrected and the referencedata. A second explanation may be that any variation of deposition rates over thematerial surface becomes noticeable over the longer deposition times required forthe thicker oxides.In terms of actual thickness values, a change in reflectivity of 10-3 isapproximately equivalent to a change of one Angstrom in the oxide thickness. Ifan atomic layer is on the order of 4 A thick, the error associated with the thinneroxide samples is less than -± 1 atomic layer. For the thicker oxides, this increases63to ± 3 atomic layers.Plots of the variation of ijr and A with oxide thickness are shown in Fig. 5.1for both the modelled and the RCE data. The data points represented by circlesdenote the calculated reflectivity of a layer of Si02 on silicon. Points are plotted for100 A increments in the oxide layer thickness. The open triangles denote the RCEdata.Fig. 5.1:^Graph showing the variation of Aftr with itir/IT for 100 A increments inthe Si02 thickness.64CHAPTER 6CONCLUSIONThe objectives that were stipulated in the introduction have been achieved.An in-situ, rotating compensator ellipsometer capable of making measurements inreal time and achieving monolayer accuracy was developed. The rotatingcompensator configuration was chosen because it has several advantages over thesimpler, rotating analyzer design: (1) improved accuracy when IcosA Iapproaches 1, (2) measurement of all of the Stokes parameters yielding anunambiguous determination of the polarization state, and (3) no errors due to apolarization sensitive detector.This thesis entailed the development of an in-situ ellipsometer from itsconception, through assembly and integration of the optics, electronics andsoftware, to final alignment, calibration and testing. The design of the RCE wasbased on a modular, cylindrical geometry where the various modules could bescrewed together to implement various device configurations. The signalacquisition and processing algorithms developed reduced the effects of the laserinstability, shaft encoder orbiting and gear induced parasitic harmonics. Thesoftware included routines for aligning and calibrating the instrument as well as aflexible measurement routine where the operator is prompted to enter the sampleaverage, time interval between measurements, and the polarizer angle used.65The stress induced birefringence of the vacuum port windows could not beentirely eliminated even after careful assembly, and a first order correction to themeasured reflectivity was required in order to achieve close agreement to thereference measurements. In addition, the angle of incidence of the ellipsometermounted on the sputtering chamber could not be directly measured to theaccuracy required. From measurements of three reference samples having knownreflectivities, the angle of incidence as well as the coefficients for the first ordercorrection were calculated.Several measurements of silicon oxide layers were corrected using thesecoefficients and compared to their reference values. Results were within amonolayer of their accepted values for all but the thicker oxides where spatialvariation of the deposition rate and outgassing in the evacuated sputteringchamber may have contributed to the measurement error.The precision and accuracy of the RCE developed equals that achieved byother (not necessarily in-situ) instruments described in the literature. Reisinger"suggests that a realistic value of the absolute accuracy of measurements made onthin (<200 A) films of Si02 on Si is slightly above 1 A due primarily to errors in thesample model. Achievable levels of precision of such measurements are quotedto be 0.06 A with a long term reproducibilty of 0.5 A. Recalling the results inSection 5.2, the RCE developed here achieved a precision of ± 0.0004 in A,corresponding to a resolution in thickness of ± 0.07 A and a long termreproducibilty of ± 0.1 A.66REFERENCES1^P.S. Hauge, Surf. Sci. 96, 1-3, p.108, (1980) in Selected Papers onEllipsometry, (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 OpticalEngineering 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).67APPENDIX ACONSTRUCTION DRAWINGS ANDCIRCUIT SCHEMATICS68BASE PLATE - 3/8" STAINLESS STEELI NOTE; DIMENSIONS OF BASE PLATEAND SAMPLE PLATE ARE THE SAME.EXPANDED VERTICAL SCALE - SECTION A-A^TOLERANCES: .XXX^+/- 0.005.XX = +/ - 0.01.X = +/- 0.1^X/Y^TYP.(UNLESS OTHERWISE STATED)ADJUSTABLE TABLE FOR SAMPLEJuly 26, 1993^A. KLEINSCHMIDTFILE: SAMBSE_T.DWGSCREW POSTSMAKE THREE -STAINLESS STEEL3/8-24, 4.0 LONGDIA 0.375.0.000-0.003drill and tap 10-24 holeapprox. 1/2" deep In end^z1- typ washer4.0welded on as handle6.3POLISH SHAFT FORSMOOTH., SLIDINGFIT IN PART: MICFEED.DWGSAMPLE PLATE - 3/ 8" ALUM I N I UMI. 5.5DIA 5/19, DIA 5/9 C.S. 1/4 DEEP(CS. FOR WASHER)2.5^ 3 HOLES: LOCATION ASPEP BASE PLATE.DIA 3/4, 1/8 DEEP FROM OTHER SIDE1/4-20, 5 HOLESWASHERS C8X)0.0. 0.50I.D. 0.20THICKNESS = 0.07SECTION A-A WIDTH (3.324) AND R (1.562)TO FIT INSIDE OD 3 1/2"ALUMINIUM TUBE1/4DIA 5/8, 0.4 DEEP 3.324R = 1.6E2, BOTH ENDS6-32, 112" DEEPB HOLES AS PERDETAIL.8-32 ON 1.50 B.O.3 HOLES EVENLY SPACED.DIA 0.40, 3 POSTSDETAIL SHOWINGPOSITIONS OFB-32 HOLES1/44. AREQUIRE -I PIECEALUM IN I UMSTEERING MIRROR MOUNTX/Y = TYP.APRIL 5, 1993^A. KLEINSCHMIDT(UNLESS OTHERWISE STATED)FILE: LASHO2_T.DWGTOLERANCES: .XXX = ./- 0.005.XX^+/- 0.02.X = •/- 0.0530TOP COVER3 1/2" 0.D., 3.32 I.D. ALUMINIUM TUBECUT IN HALFCS FOR 8-32 FLAT HEAD2 HOLESDIA 3/8SEMICIRCULAR//1S75.0BOTTOM COVER0.204.06- 1.9531/2 0.D., 3.32 I.D. ALUMINIUM TUBECUT IN HALFCS FOR 6-32 FLAT HEAD13 HOLESTOLERANCES: .XXX =^0.005.Xx =^0.02.X^.1- 0.1X/Y TYP.CUNLES5 OTHERWISE STATED)QUANTITY = 1 OF EACHAPRIL 5, 1993^A. KLEINSCHMIDTFILE: LASCVl_T.DWGLASER MOUNT COVERS0.313- 3/BPRESS FIT TO BEARINGSTYPE: ABS-A1-84CA) A-AREQUIRE 5 PIECES(ALUMINIUM)^POLARIZER AND ANALYZERAPRIL 2, 1993^ A. KLEINSCHMIDTFILE: CMPHDl_T.DWGTEILINIANCR5! .XXXX^0.0005.XXX +1- 0.005.xx^0.01.X 0.1WY TYP.(LNLE*3 OTHERWISE STATED)BULKHEADS FOR ROTATING COMPENSATOR4-40, 3/8 DEEP2 HOLES ON 1.811 B.C.CHOLE5 REQUIRED INONE PIECE ONLY)1" DRILL^--^DIA 1.1250^DIA 3.3200Li^B-32, 1/2 DEEP4 HOLES75.0^90.0AALUMINIUM TUBECENTER BEARING/^PRECISELY IN 00 3 1/2-L V41/ 8FOR 6-32 SET SCREW SECTION A—A75.0WA 2 1/8 NOTE; MAKE WORM SHAFT FORKCS—A4-3 WORM. MI"T '32.a LONGSEE AL KLEINSCHMIDT OR GLENN CLARKFOR WORM.DIA 3.32, TO FIT INTOOD 3 112", ID 3.32 TYRALUMINIUM TUBE0.484 .■•••A4-SLIDING FIT TO WORMtKCS—A4-3WORM GEAR BULKHEADFOR ROLARIZERDIA 0.250, FOR SLIDING FITTO SHAFT FOR WORM GEAR.SEE NOTE.1.1880.678-32, 1/2 DEEP3 HOLES0.50VERNIER DRUM DIAL MOUNT4-40, 2 HOLESSECTION 9-B0.253/18SLOT WIDTH = 318R = 3/16DIA 3.32TO FIT INTO 00 3 112,ID. 3.32 TYR.ALUMINIUM TUBEe-32, 1/2 DEEP3 HOLES75.0^Br:T0LEPANCE3: .XXx^0.005.xx^.t- 0.01.x 0.05TYP.(UNLESS OTHERWISE STATED)REQUIRE 2 OF EACHALUMINIUMWORM GEAR BULKHEAD AND DRUMDIAL MOUNT FOR POLARIZERAPRIL 3, 1993FILE: POLHEll_T.DWGA. KLEINSCHMIOTTOP HALF0.6^2.62^ S. FOR 8-32 FLAT HEAD2.40 10 HOLESBOTTOM HALF7.0^TOLERANCES: .XK(^0.005.XX 0.02QUANTITY - 1 PIECE HOUSING FOR ANALYZER[UNLESS OTHERWISE STATED]3 1/2" ALUMINIUM TUBECUT IN HALF(WALL THICKNESS APPROX. 0.09) APRIL 5, 1993^A. KLEINSCHMIDTFILE: POLCV2_T.DWG3/9 DRILLED FROM TOP3/6 DRILLED FROM SIDECS. FOR 8-32 FLAT HEAD2 HOLES0.670. 6 124 oWINDOW DIMENSIONS ARE:01A 1.00 +/- 0.01THICKNESS = 0.20 +/- 0.0115.07-CLEAR FOR 6-32,6 HOLES ON1.32 B.C.EQUALLY SPACEDDIA 1.0 .0.0AA/6^AdAdOr^ Ail1.03^1.57- 1/2 DRILL^0.8916-32, 1/2 DEEP6 HOLESON 1.32 B.C.EQUALLY SPACEDFLANGE DIMENSIONS AREFOR AN NW 25 ISO-KF FLANGETOL^.0.00/ -0.0FOR 207 0-RING^-.I D.  = 0.546 +0 . 005^// /- 0.0000.17.^0.916 +0.005- 0.005DEPTH = 0.106 +0.003- 0.0030.15.00.127.5/- _ 0' -15, 1.5 LONGTOL ERAWE3^.X>O<^- 0.005.)CK^- 0.01. X^.7- 0.05X/Y - 'rye.C UNL EMS OTHERS'? ISO 3TATEO)QUANTITY - 2STAINLESS STEELNW 25 I SO- KF WINDOW  PORTMARCH 31, 1993^A. KLEINSCHMIDTFILE: PORT_T.DWGA^A- DIA 1.7 DIA 0.3 --QUANTITY - 2ALUMINIUMTO LERkNGES^)0C(^- D.000. >DC^41- 0.01.^v./ - DOSX/Y TYPC UNI-000 °THEM' I 30 STATED)LOCKING NUT FOR WINDOW PORTMARCH 31, 1993^ A. KLEINSCHMIDTFILE: PNUT_T.DWGMOTOR MOUNTCODERMOTORSET SCREWCOMPENSATORCOVER (BOTTOM)APERTURE SOCKET CLEFT)COMPENSATOR DRUMASSEMBLYBULKHEADSHAFT ENBULKHEADFEMALEBULKHEAD- MALECOMPENSATORCOVER CBACK)REDUCTION GEARSCOMPENSATOR BULKHEADCOMPENSATOR ASSEMBLYNOTE: REQUIRES BEARINGS AND GEARS ASDETAILED ON DRAWINGS FOR PRECISION FITTING MAY 27, 1993^A. KLEINSCHMIDTFILE: COMPAS_T.DWGTOLEPANCES: .XXX^0.005.XX = +/ - 0.01.X^+/- 0.05X/Y^TYP.(UNLESS OTHERWISE STATED)QUANTITY = 1BLACK NYLON OR SIMILARHOLDER FOR COMPENSATORAND THREADED INSERTJUNE 4, 1992^A. KLEINSCHMIDTPILE: CHOLD_T.DWG.XXXX = +/- 0.0005TOLERANCES: .XXX .1- 0.005.XX =^- 0.02.X^0.05XrY = TYP.(UNLESS OTHERWISE STATED)REQUIRE 1 OF EACHBLACK NYLON OR SIMILARCOMPENSATOR DRUM ASSEMBLYAPRIL 5, 1993^A. KLEINSCHMIDTFILE: CDRUM_T.DWG.XXXX ■ +/- 0.0005TOLERANCES: .XXX ■ - 0.005.XX^4./- 0.02.1- 0.05XlY = TYR.(UNLESS OTHERWISE STATED)REQUIRE 4ALUMINIUMGEAR BUSHINGAPRIL 5, 1993^A. KLEINSCHMIDTFILE:CBUSH_T.DWGSECTION B-BCENTER BEARING PRECISELYIN OD. 3 1/2- ALUMINIUM TUIBE0.70-0.35 -.0.17105.0105.01.000 3.3200 1- DRILL8-32, 1/2 DEEP8 HOLESSET IN MIDDLE OF EDGE0.313D 1.125PRESS FIT TO BEARINGTYPE: ABS-A1-81BULKHEAD FOR^TOLERANCE3. .XXXX^0.0005^.xxX -^5.005REQUIRE 1 PIECECALUMINIUM) ROTAT I NG COMPENSATORAPRIL 2, 1993FILE: CMPHD3_T.DWGA. KLEINSCHMIDTREQU I RE "I PIECE  (ALUM I N I UM) MALE THREADED BULKHEADFOR COMPENSATORTOLERANCES: .XXX = ,/- 0.005.XX = 4-1- 0.01.X = ,/- 0.1X/Y = TYP.(UNLESS OTHERWISE STATED)APRIL 2, 1993^ A. KLEINSCHMIDTFILE: BLKHDl_T.DWGIULCKAM,.; i^^^ =.xx - ,I.....^..........,t-^0.01 REQUIRE 1.x =^,./- 0.05IX/T am TYP.CUNLESS OTHERWISE STATED)PIECE (ALUMINIUM)APRIL 2, 1993^A. KLEINSCHMIDTFILE: CMPI-1172_TADWGTOLERANCES. .X>O< = •/- 0.005XX = +/- 0.0-1.X = +1- 0.05X/Y = TYR.(UNLESS OTHERWISE STATED)REQUIRE 1 OF EACH (ALUMINIUMDMOUNTED ONTO MOTOR MOUNTAPERTURE FOR COMPENSATORAPRIL 2, 1993^A. KLEINSCHMIDTFILE: APERTC_T.DWGBACK COVERFRONT COVER 600.5 1/2" ALUMINIUM TUBEWALL THICKNESS APPROX. 1/8"TUBE CUT IN HALF0.96DIA 3/9FOR ACCESS TOAPERTURE RODBORED VERTICALLY(INTO PLANE OF PAPER)75.0E0 05 1/2" ALUMINIUM TUBEWALL THICKNESS APPROX. 1/8"TUBE CUT IN HALF75.0CS FOR 8-329 HOLES IN SACK COVER2 HOLES IN FRONT COVERQUANTITY^"I OF EACH COMPENSATOR COVER - FRONT & BACK- FROM OD. 5 1/2" ALUMINIUM TUBETOLERANCES .XXX . 41— 0.005^.XX =^0.02= 0.1XeY TYP.[UNLESS OTHERWISE STATED)APRIL 2, 1993^ A. KLEINSCHMIDTFILE: OMPCV2_T.DWG5.61/41.230.18-TOLERANCES: .XXX = +1- 0.005.XX = +/- 0.02.X = +/- 0.1X/Y = TYP.(UNLESS OTHERWISE STATED)ONE OF EACHALUM I N I UMCOMPENSATOR COVER — TOP ge BOTTOMAPRIL 2, 1993^ A. KLEINSCHMIDTFILE: CMPCVl_T.DWGQUANTITY^1 OF EACHTOLERANCES: .XXX ■^0.005.XX = +/- 0.02.X ■ +/- 0.1X/Y = TYR.(UNLESS OTHERWISE STATED)DETECTOR HOUSINGAPRIL 6, 1993^A. KLEINSCHMIDTFILE: DETCV_T.DWGTOLERANCES: .XXX A,- 0.005.XX^+/- 0.01.X^./- 0.05X/Y ■ TYP.(UNLESS OTHERWISE STATED)QUANTITY = "I OF EACH THREADED BULKHEAD FOR DETECTORA. KLEINSCHMIDTAPRIL 6, 1993FILE: DETHD_T.DWGP I NS 4a - 29a ARE SIGNAL CND.ELL I PSOMETER BUSMARCH 30, 1993^ A. KLEINSCHMIDTFILE; EBUS_T.DWGCO LBy •B!A-a001Time Response:^Foul WO Besse! B.244at phase)DeIay To . 466 uSocF 348 • 720 HzUR: 41.14UBC PHYSICS - LAB161,r, A31*16^C1/141 V 2227"^ as'AsLamanem G.IS48 ET:1008 OUTPUTDIaCO,A4044,GAIN SELECT14I5CIOis•Two polo liktdHo • .2.0I/O .1.241b. 115$ H2PHOTOOETECTOR AMPLFIERoKIT I^I I 920231.SCHC.6lIII20006.2022KOO6.46.84114Two polo nor^490A0Ho • .1.0170.1.918• 2032 HzU1I 4 R26 1- -{ R29 F c9U2 (I C1COMDINPUT o -{ RI F••■■•■-{ R3 4-3 1 DA 1-{ R4 1--1.■•■•-CMCsDESIGN BY: T. Felton DRAWN BY: T. Felton•74-C -{ R25 1--{ R24 FLIII-1 R28 F-{ R27 1-N./v4t--1 R31 1--{ R30 1--1 P154--1 R23 F-{ R22 1-^•■••■■-1 R34 1-1,133 -L 0-) 1.11L )4 R14 1- tiLl-{ R13 1- -( R18 1-LIFI LIU-I R9 F-{ Fin 1- UriobUTPUTo COMoJ1-2@@oJ1-1o.11-6VR1UBC PHYSICS - ELECTRONICS LABTITLE:PHOTODETECTOR AMPLIFIERREFERENCE DESIGNATORDRAWING NO:920231 .PCB72 -I R35 1-0^0U4U3^CM74KTO27.107024+35V.W•"^OnoCtot741ICT02070 ^CD ctost oteI CI inI CI;., c;.711".1112°24“CTI32— CavtLeg7.0007.1.C10210110346^40?^05,1UBC PHYSICS - ELECTRONICS LABom 02/7/2^Ismettr 1^ot 2 tamBISTABLE SHUTTER CONTROL• 3.17632U20LI5At7v7.C10274mCln3v7..0112301106132III 02000442CLOSED'S620•5V4c7+— C4 —46. I.331-,04r^0.00350V V+30Y DCOPC)0110311012747004TO127114363>> J1-1011101220605*13^ TIP;,,470ROTC: 12/7/10 I smcm 2^Or 2UBC PHYSICS - ELECTRONICS LABTITLESB1STABLE SHUTTER CONTROL470%CV93 1•■■■•Fig. Al2.4: Bistable shutter controller - circuit board layout.1133 .3573.83UlU2sootHOE.L--Us0•ZI..-1 01 tOtortU1 ÷-03VIA ZU 2,OTAL-OSCcUtVIIDsU7C cut—17 ACLOt011 _IL_ 115TV.12- 74 ocTI 17411C4010 0 as,cLssg;Roc3,0 .38CD405337ANcl,30Hz/60HzR20024100R2510730330 rzat44A22'330K423ON/OFF330- KIS0R2343OOK012CI41E-0 ow.?,RIO^---vOII373207—1—CIPolyU4A38112 2R •02^I^mooCIg4 00/1808• 3 8029IRS• 5ot-srdm, 13-01-03^ I onto t^OP 60Hz MOTOR DRIVE GENERATORCAPACITOR^0 ROOT ovorr^0 torvoRUBC PHYSICS — ELECTRONICS LAB034IRSwCl?^C S^CIS^037^CII^CISvl ul vl"rem stonfOXMOM-418110 PIMC0408311U781113110702^NW—; -----__41.----W.--119/^0 o^1.71011017 0040538 .niU(OU7A^—LQr0 "v0321131^PolyRS(12n)CT)03(5(t<CDCD—s(r)0D-03si)C3MARCH 91, 1993 A. KLEINSCHMIDT10INTERFACE-deJ10CPUDiOlt0.1DigitalFUSE : 2 Arrpr.,s0(40- ON)ADC TRIG.JCPUDETECTORINTERFACEANALOGINOA I NSELECTFOYER ANALOGOUTn°SHUTTERCONTROLSKITTEROUT3- ENGMOTOR03NTROLSPEEDOUTOUTOlfgtlalDlgltgl0cm-5.3ENCODERINTERFACE0ONIALTENCCOliftANALCGOJTARTWORK FOR CARD CAGEFILE: ARTWORK.DWGAPPENDIX BCOMPONENT SPECIFICATIONSBl: 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.117TABLE Bl: Glan-Thompson Polarizer.Source:^Karl Lambrecht Corp.4204 N. Lincoln Ave., Chicago, III., 60618613-472-5442Part Number:^MGT 3E8-BBPrice:^$715.- U.S.Description:^High quality polarizer made from Schlieren-free materialhaving an extinction ratio of 10-6 and a transmission of over95% in the visible range. A broad band anti-reflectivitycoating of Magnesium Fluoride applied to both surfacesreduces reflection losses to 4% in the spectral range of400 - 1000 nm. Dimensions are 0.750 x 1.125" with a clearaperture of 0.35".Table B2: Quartz Port Windows.Source:^Karl Lambrecht Corp.Part Number:^BK7 Glass WindowCost:^$185.- U.S.Description:^Glass Window made of BK7 Quartz exhibiting very lowresidual stress birefringence. A broad band anti-reflectivitycoating 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.118Table B3: Compensator.Source:^Karl Lambrecht Corp.Part Number:^WPUM4 - 25 - BBCost:^$265.- U.S.Description:^Mica quarter-wave plate giving a quarter wave retardationat the HeNe wavelength of 632 nm with a broad bandanti-reflectivity coating applied to both surfaces to reducereflection losses to less than 4% in the spectral range of400 - 1000 nm. Mounted dimensionsare 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-4030Part Number:^811986Cost:^$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.119Table B5: Photodetector Amplifier Gain SelectionGAIN GS3 GS2 GS1 GS01 0 0 0 01.19 0 0 0 11.41 0 0 1 01.68 0 0 1 12 0 1 0 02.38 0 1 0 12.82 0 1 1 03.36 0 1 1 14 1 0 0 04.76 1 0 0 15.64 1 0 1 06.72 1 0 1 18 1 1 0 09.52 1 1 0 111.28 1 1 1 013.44 1 1 1 1120Table B6: Photodiode.Source:^Hamamatsu Corp.2444 Moorpark Ave., Suite 312, San Jose, Calif., 951 28408-292-8603Part Number:^S2386 - 44KCost:^$13.81 U.S.Description:^Photodiode sensitive in the spectral range 320 - 1100 nmhaving a spectral sensitivity of 0.43 NW at the HeNewavelength of 632 nm and a NEP (Noise EquivalentPower) 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 J09Cost:^$120.-Description:^Three channel 1024 increment shaft encoder. The twoincremental channels are in quadrature.^The thirdchannel is an index pulse.Table B8: Bistable Shutter.Source:^Newport Instruments Canada Corp.2650 Meadowvale Blvd., Unit 3, Mississauga, Ont.,L5N 6M5, (416) 567-0390Part Number:^846 HPCost:^$438.-Description:^Bistable shutter requires a positive 5 - 30 V pulse to open,a negative pulse to close. Transition times depend on thepulse voltage ( 3ms at 30 V). Input resistance is 13 Ohms.121Table B9: A.C. Synchronous Motor.Source:^TRW Globe Motors Inc.Dayton, OhioPart Number:^139A252Cost:^$200.- U.S.Description:^An A.C. synchronous, hysteresis motor delivering2 oz.• in. of torque at 1,800 rpm. Requires 115 VAC,60Hz, 40 Watts. Requires a 2 RF phasing capacitor.122APPENDIX CSOFTWARE SOURCE CODESource Code:^LabHead.btp^Page:^124LabMast.pas 125EDA Gath.pas^131EDA_Dsp. pas 140EDA_FFT.pas^154EDA_Dis.pas 158EDA_Alig n. pas^164Ang_Fit.c 171EDA_Set. pas^173EDA Meas.pas 179EDA_Coef. pas^183EDA_Bug . pas 185Shutter. pas^ 188ADCrun. pas 189Tables:^Cl: Storage of DMA data^191C2: Storage of Fourier Data^192C3: Error Messages^193123(**************************** ************************************************************ LabHead.btp** Turbo-Pascal header file for LabPac 3.02************************* *************************************************************1constRESET=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;ACCESS=6455;^FREE=6456; AIFLUSH=6457; SCRAW=6459;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;{$ifdef MASTER}DTOA=$710; ATOD=$714; TIMER =$718;{$endif}{$ifdef TENDER}DTOA=$334; ATOD=$330; TIMER =$338;{$endif}{$ifdef DAD10}DA= $730;^DIO=$73B;{Sena}{Sifdef BB}$BB0=210;^$BB1=214;^$BB2=218;{$endif}MAX_DO=15; MAX_TI=12;OVERRUN=$8003;^TABLE=$8004;EMMERR=$8008;P10=$71 F;P10=$33F;$BB3=21C;124f**************************************************************************************** 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 *****************************************************************************************1unit LabMast;INTERFACECONSTAi_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 }TYPEBIT_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;IMPLEMENTATIONUSES dos,CRT;{$define MASTER}{$i cAlabpac\labhead.btp}CONSTLabPac_Timer_Interrupt =1;LabPac_Timer =2;TYPEIntegerType = integer;IntegerP = "IntegerType;125VARAL 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****************************************************************************************1PROCEDURE 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).Regs.ax := DINIT;Regs.bx := PIO;Regs.cx := 9;intr(LABPAC,Regs);{initialize Labpac Timer}Regs.ax := TIINIT;Regs.bx := TIMER;{ defined in labhead.pas}{ defined in tender.pas }{ for lab master board see labpac manual pg 10-64}{ port a=strobed in, port b = out,port c = out ==> 9{ defined in labhead.pas}{ defined in tender.pas }{ for lab tender board see labpac manual pg 8-13)-126intr(LABPAC,Regs);{initialize Channel Arrays for Labpac}{ these arrays allow labpac to redirect which channel it is currentlylooking at (eg Chn 1 go be assigned to look at physical channel 5Ao_Channel[1] := 5) I am not using any redirection but just assigninga linear sequence of numbers}(*FOR Channel := 0 TO Ao_Chan_Max DOBeginAo_Channel[Channel] := Channel;Ao_Output [Channel] := 0; {this probably should be a read fileof default values}End;{ Warning There is a bug in the labpac software which remaps the physicalChannels into the array wrongly ie Physical Channel 1 goes into arrayposition 0, 2 to 1, 3 to 2, etc, finally 0 to Ao_Chan_Max. The readfunction that LPC provides unmaps the channels but only for thissoftware version Labpac Software #3.01 and if the following initializ-ation is followed -- so be careful if you change anythingFurther experience indicates the bug disappears if the computer is runin run turbo mode some how the faster bus speed seems to correct bug?}FOR Channel := 0 TO Ai_Chan_Max DOAi_Channel[Channel] := Channel;*)Digital_Port_A := 170;Digital_Port_B := 85;END;f***************************************************************************************** LabPacStop : reset and stop the LabPac software and hardware *****************************************************************************************1PROCEDURE 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;BEGINIF (Gain_Num <= 3) AND(Gain_Num >= 0) THENBEGINRegs.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;ENDELSELPC_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;BEGINIF (Sample_Num <= 10000) THENbeginRegs.ax := AIDMA;Regs.bx := 0;Regs.cx := Sample_Num;Regs.dx := 1;Regs.ds := Seg(Store_Data^ [0])Regs.si := Ofs(Store_Data ^ [0]);intr(LABPAC,regs);LPC_Dma_run := Regs.ax;endELSELPC Dma run := LPC BAD PARAMETERS;END;{first channel to be read}{number of times to sweep channels}{number of channels to be read}, {pointer to starting address for data}{Returns error code after completion}- - - _128f***************************************************************************************** LPC TI CountTo : Starts a timer in count mode^ ***********-******************************************************************************1FUNCTION LPC_ TI _CountTo(TimerChannel,Count,Source:integer) : integer;VARRegs : REGISTERS;BEGINIF (( TimerChannel >= 0 )AND( TimerChannel <= 6) AND( Source >= 0) AND( Source <= 239) ) THENBeginRegs.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}EndELSELPC_TI_CountTo := LPC _ BAD _PARAMETERS;END;f**************************************************************************************** LPC TI Special : Starts a timer in a special hardware mode ********-***-*****************************************************************************1FUNCTION LPC_TI_Special(TimerChannel,Count,Mode:LongInt): integer;VARRegs : REGISTERS;BEGINIF (( TimerChannel >= 0 )AND( TimerChannel <= 6) )THENBeginRegs.ax := TIHDW;Regs.bx := TimerChannel;Regs.cx := Mode;Regs.dx := Count;Regs.si := Count;intr(LABPAC,Regs);LPC_TI_Special:= Regs.axEndELSELPC_TI_Special := LPC BAD PARAMETERS;END;{Timer to be programmed}{Special command byte}{Seed count programmed to load register}{Seed count programmed to hold register}{Error code returned}- -129/***************************************************************************************** LabPacEnd : is called as an exit procedure of the unit****************************************************************************************1{$F-F}PROCEDURE LabPacEnd;BEGINLabPacStop;ExitProc := ExitOld;^{ re-install old Exit procedure }END;{$F-}{** Starting code of the unit **}PROCEDURE RequestSystemType;VARIsProceedOk : Boolean;InChar^: Char;BEGINRepeatIsProceedOk := 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) ) THENELSEBeginIsProceedOk := FALSE;Sound(1000);GotoXY(1,1);Write('^Error Illegal Input Parameter 11111111Delay (3000);NoSound;End;Until IsProceed0k;END;BEGINExitOld := ExitProc;^{ mark address of Exit procedure }ExitProc := @LabPacEnd;^{ define LabPacEnd as Exit procedure }(* IF ParamCount <>0 THENBeginVal(ParamStr(1),SystemType,ErrCode);IF (ErrCode = 0) AND( (SystemType = 1) OR (SystemType = 2) ) THENELSE RequestSystemType;EndELSE RequestSystemType;LabPacInit;END.130CONSTBASEData_NumPIPORT_APORT_BPORT_CPort_Con_WordPORT JO_CON= 1808;= 512;= 3.141593;= BASE+12;= BASE+13;= BASE+14;= $81;= BASE+15;VARGATH_Gain_Err^: integer;TYPEGainPtr = ^Ellip_Gain;Ellip_Gain = RECORDLM : integer;Det : integer;END;(***************************************************************************************** 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. ** ****************************************************************************************1UNIT EDA_Gath;INTERFACEUSES crt,dos, LabMast, EDA_dsp, EDA_dis;{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;131IMPLEMENTATION{$define MASTER}{$i cAlabpac\labhead.btp}CONSTCoder_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}VARCycle_Num^: integer;^{Number of data cycles to measure}Done^: array [0 ..18] of integer;^{Reads number of conversions from Done_Counter}ExitOld : pointer;^{Saves old exit procedure pointer}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);VARi, ones, twos : integer;BEGINones := 0;twos := 0;FOR i := 0 to Data_Num-1 DOBEGINIF (Store_Data^ [i] > = 2) THENinc(twos);IF (Store_Data^ [i] = 1) THENinc(ones);END;132IF (twos <> 0) THENwriteln('Detector Offset set too high...');IF (ones < (Data_Num div 8)) THENwriteln('Detector Offset set too low...');END;(**************************************************************************************1PROCEDURE GATH_Dark_exit;BEGINDIS_Write_Text('Signal Level too low. Press any Key to exit...',MargX,Command_LineY);WHILE (NOT Keypressed) DOEND;(***************************************************************************************** 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 ****************************************************************************************1PROCEDURE GATH_GainSet(Data:Data_Ptr; Gain_Num:GainPtr; Inc_Num,Rev_Num:integer);CONSTLoSignal_Limit = 10;VARLM_Gain : integer;Det_Gain : integer;Old_Gain : integer;Max_Val : integer;BEGINGATH_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) THENBEGINinc(LM_Gain);Det_Gain := 0ENDELSEBEGING0T0XY(MargX,Status_LineY+1);ClrEOL;133writeln('Signal too low');GATH_Gain_Err := -2;END;0: ClrEOL;1: IF (LM_Gain > 0) THENBEGINdec(LM_Gain);Det_Gain := 15ENDELSEBEGINGoToXY(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 ** Coef^: The Fourier coefficient desired^ ** DMA_Data^: Photodetector data^ ** Inc_Num^: Number of data bytes per revolution^ ** Rev_Num^: Number of revolutions data acquired for *****************************************************************************************)PROCEDURE GATH_HARMONICS(Coetinteger; DMA_Data:Data_Ptr;Inc_Num,Rev_Num,C_Shiftinteger);VARinteger;BEGIN{FIND NORMALIZATION (COEFO) OF EACH DATA CYCLE AND NORMALIZE EACH CYCLE}FOR j := 0 to Rev_Num-1 DOBEGINDSP 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}BEGINport[PORT_port[PORT_delay (30);port[PORTEND;B] := port[PORT_B] AND Shutter Wait;B] := port[PORT_B] OR Shutter Off;_B] := port[PORT_B] AND Shutter Wait;(**************************************************************************************1PROCEDURE GATH_LASER_ON;^{Turns laser shutter on}BEGINport[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}_^_BEGINport[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);VARtemp : word;speed : integer;BEGINspeed := (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^ ** Rev_Num^: Number of revolutions data acquired for ** Speed_Select : Motor speed^ *****************************************************************************************)PROCEDURE EnableInterrupts;BEGININLINE($FB);END;(**************************************************************************************1PROCEDURE Int_Read_Counters(Flags,CS,IP,AX,BX,CX,DX,SI,DI,DS,ES,BP : Word);INTERRUPT;BEGINEnableInterrupts;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) THENBEGIN{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;(**************************************************************************************1PROCEDURE ADC_DMA_exit(Gain_Set:integer);BEGINport[OCW1] := port[OCW1] OR IRQ3;^{disable interrupt}SetIntVec(Com2Int,OldVector);port[PORT_A] := Disable_Trigger OR 8*Gain_Set; {disable trigger}port[BASE+9] := $FF;^ {resets Counters}END;136(************************ **************************************************************1FUNCTION GATH Data(DMA_Data:Data Ptr; Gain_Num:GainPtr; Inc_Num,Rev_Num:integer;§peed_Select:Speed_ln-dex): string;CONSTADC Con_Word^= $94;^{Word to ADC control port}DMA-Time_Err^= 'DMA OR TIMER SETUP ERROR';No_frror^=' '.,Synch_Err = 'SYNCHRONIZATION ERROR';VARCount^: 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) DOdelay(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 DOIF (((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))) THENGATH_Data := Synch_Err;{CHECK IF DMA COMPLETE}IF (Done[Cycle_Num-1] < Sample_Num) THENGATH_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) THENGATH_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;VARADC_Limit^: real;1,Set_Gain^: integer;BEGINSet_Gain := Old_Gain;ADC_Limit := 4095;{LOWER GAIN TO BELOW 97% OF FULL SCALE OR RETURN ERROR CODES}IF (Max_Val > 0.97*4095) THENCASE Old_Gain OF0 : BEGINGoToXY(MargX,Status_LineY+1);writeln('Signal Strength too high. Peak Amplitude = ',Max_Val);GATH_Gain_Err := 1;END;1..15: BEGINdec(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 DOBEGINADC Limit := 0.84*ADC Limit;IF (Max _Val < ADC Limi) THENCASE-Set Gain dF15^:-BEGINGoToXY(MargX,Status_LineY+1);ClrEOL;writeln('Signal Strength too low. Peak Amplitude = ',Max_Val);GATH_Gain_Err := -1;ENDELSEBEGINinc(Set_Gain);GoToXY(MargX,Status_LineY+1); ClrEOL;END;END; {IF}END; {FOR}IF (Set_Gain <> Old Gain) THENBEGING0T0XY(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;BEGINGATH_LASER_OFF;GATH_MOTOR_OFF;SetIntVec(Com2Int,OldVector);ExitProc := ExitOld;END;{$F-}{re-install old Exit procedure}(******************** ************ ************************************************* **1BEGINExitOld := ExitProc;^ {mark address of Exit procedure}ExitProc := @GATH_Exit; {define GATH_Exit as Exit procedure}END.139(**************************************************************************************1*)(* WRITTEN BY: A. Kleinschnnidt^ *)(* ON: May 18, 1993^ *)^ 1^ UNIT WITH ROUTINES FOR DATA AVERAGING, FOURIER ANALYSIS AND^1(* DATA NORMALIZATION. ALSO INCLUDES TRIGONOMETRIC FUNCTIONS AND^1(* FUNCTIONS TO CALCULATE RHO FROM THE NORMALIZED FOURIER COEFFICIENTS. *)(**************************************************************************************1UNIT EDA_dsp;INTERFACEUSES dos,crt,graph,LabMast,EDA_dis;(* FILE: EDA_Dsp.pasTYPEPcomplex = ^Complex;PStoke = ^Stoke;Complex = RECORDr^: real;real;END;Stoke^= RECORDsl^: real;s2^: real;s3^: real;sO^: real;END;Window^= RECORDal 1 fal 2wpal 2wa21wpa2lwa22fEND;{real part of complex number}{imaginary part}{Stokes parameter Sl}{Stokes parameter S2}{Stokes parameter S3}{Magnitude of Stokes Vector}: Complex;: Complex;: Complex;: Complex;: Complex;: Complex;VARFourier_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_ FOUiiIER_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);140PROCEDURE 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;IMPLEMENTATIONVARCos_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.^ *****************************************************************************************1PROCEDURE DSP_ CHI(Chi:Pcomplex; Az,E11:real);VARdenom : real;BEGINdenom := 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;141f***************************************************************************************** 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] *********-*********************-***********************************************************1PROCEDURE DSP_Data_Average(Store_Data:Data_Ptr; Inc_Num,Cycle_Num:integer);VARi,j,Sum_Val^:integer;BEGINFOR i := 0 to Inc_Num-1 DOBEGINSum_Val := 0;FOR j := 0 to Cycle_Num-1 DOSum_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. *****************************************************************************************1PROCEDURE DSP_Data_Error(Store_Data:Data_Ptr; Inc_Num,Cycle_Num,E_Tainteger);VARi,j^: integer;Data_Err^: integer;Err_Total : integer;BEGINFOR j := 0 to Cycle_Num DOBEGINErr_Total := 0;FOR i := 0 to Inc Num-1 DOBEGINData_Err := Store_Data ^[i+Cycle_Num*Inc_Num]- Store_Data ^ [i+j*Inc_Numj;IF (ABS(Data_Err) > E_Tol) THENinc(Err_Total);END; {FOR}writeln('Number of errors greater than +/-',E_Tol,' for cycle: ', j, ' = ', Err_Total);END;END;142f***************************************************************************************** DSP FOURIER Av : Averages the Fourier Coefficient (Coef Num)_^_^ _* 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);VARi,j^: integer;Sum_A : double;Sum_B : double;BEGINSum_A := 0;Sum_B := 0;FOR i := 0 to Cycle_Num-1 DOBEGINSum_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********************************************************************************* *******1PROCEDURE DSP FOURIER_Coef(Store_Data:Data_Ptr;_Inc_Num,Cycle_Num,Shift_Num,kinteger;Norm:real);VARn,ni^: integer;Coef : integer;Acc_Var^: single;BEGIN{ CALCULATE COSINE COEFF }Acc_Var := 0;FOR ni := 0 to Inc_Num-1 DOBEGINn := (ni+Shift_Num) MOD (Inc Num);Acc_Var := Acc_Var + Store_Data 'N [n+Cycle_Num*Inc_NumrCos_Array[k,ni];END;***143Fourier_Coef_A[Cycle_Num,k] := 2*Acc_Var/Norm;IF (k = 0) THENFourier_Coef A[Cycle_Num,k] := 0.5*Acc_Var/Norm;{ CALCULATE SINE COEFF }Acc_Var := 0;FOR ni := 0 to Inc_Num-1 DOBEGINn := (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) THENFourier_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 *****************************************************************************************1PROCEDURE DSP _FOURIER_CoefO(Store_Data:Data_Ptr; Inc_Num,Cycle_Num:integer);VARn^ : integer;Acc_Var1^ : single;BEGINAcc_Var1 := 0;FOR n := 0 to Inc_Num-1 DOBEGINAcc_Var1 := Acc_Var1 + Store_Data^ [n+Cycle_Num*Inc_Num];END;Fourier_Coef A[Cycle_Num,0] := Acc_Var1;END;144f***************************************************************************************** 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*****;**********************************************************************************1PROCEDURE DSP_FOURIER_Init(Inc_Num:integer);VAR: integer;: integer;Angle^: single;BEGINFOR k := 0 to 9 DOBEGINFOR n := 0 to Inc_Num-1 DOBEGINAngle := 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****************************************************************************************1PROCEDURE DSP_MAG_PHASE_COR(Gain_Adj,Phase_Correal;Cycle_Num,Coef_Num:integer);VARTemp_A, Temp_B : double;BEGINTemp_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;145f***************************************************************************************** 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***************************************************************************1PROCEDURE DSP_Sign_Rho(VAR costerm:real; VAR sinterm: real);BEGINIF (abs(costerm) < abs(sinterm)) THENBEGING0T0XY(MargX,Data_LineY+4);write(' (Calculating from Cosine Term)');IF (sinterm <0) THENsinterm := -SIN(ARCCOS(costerm))ELSEsinterm := SIN(ARCCOS(costerm))ENDELSEBEGING0T0XY(MargX,Data_LineY+4);write(' (Calculating from Sine Term)');IF (costerm < 0) THENcosterm := -COS(ARCSIN(sinterm))ELSEcosterm := 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);VARtemp : real;BEGINtemp := (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;146f***************************************************************************************** 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.****************************************************************************************1PROCEDURE DSP_WINDOW_COR(Chi_out,Rho:Pcomplex);VARa,b,c,d : real;^{temporary variables}denom^: real;BEGINa := 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***************************************************************************************1FUNCTION ARCCOS(Arg:double): double;VARRESULT : double;BEGINArg := Round(1000*Arg)/1000;^{avoids roundoff error}IF (Abs(Arg) > 1.0) THENBEGINDIS_Write_Text('DSP Overflow Error in Cosine Term',MargX,Status_LineY+3);Arg := 1;ENDELSE BEGIN G0ToXY(MargX,Status_LineY+3); ClrEOL; END;IF (Arg = 0) THENRESULT := PI/2ELSERESULT := ARCTAN(SQRT(1-SQR(Arg))/Abs(Arg));IF (Arg < 0 ) THENRESULT := PI - RESULT;ARCCOS := RESULT;END;147f***************************************************************************************1FUNCTION ARCSIN(Arg:double): double;BEGINArg := Round(1000*Arg)/1000;^{avoids roundoff error}IF (Abs(Arg) > 1.0) THENBEGINDIS_Write_Text('DSP Overflow Error in Sine Term',MargX,Status_LineY+3);Arg := 1;ENDELSE BEGIN G0T0XY(MargX,Status_LineY+3); ClrEOL; END;IF (Round(1E6*(1-ABS(Arg))) = 0) THENARCSIN := P1/2ELSEARCSIN := 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.****************************************************************************************1FUNCTION DSP_AZ(StokeVec:PStoke): real;VARaz_from_cos : real;az_from_sin : real;Cos_2ell : real;TEMP_AZ : real;BEGINCos_2e11 := sqrt(sqr(StokeVec^ .s1)+sqr(StokeVec".s2));{CHECK AND TRAP FOR CIRCULARLY POLARIZED LIGHT}IF (Cos_2e11 = 0) THENBEGING0T0XY(MargX,Data_LineY+5);write('Light is Circularly Polarized !');DSP_AZ := 0.0;exit;ENDELSEBEGIN G0T0XY(MargX,Data_LineY+5); ClrEOL; END;{CALCULATE THE AZIMUTH FROM THE LARGER OF Si OR 52}IF (abs(StokeVec ^ .s1) > abs(StokeVec^ .s2)) THENBEGING0T0XY(MargX,Data_LineY+4);write(' (Calculating Azimuth Angle from Si Parameter)');TEMP AZ := ARCCOS(abs(StokeVec^.s1)/Cos_2e11);ENDELSEBEGING0T0XY(MargX,Data_LineY+4);148write('(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)) THENDSP_AZ := 0.5*TEMP_AZ;IF ((StokeVec^.s1 > 0) AND (StokeVec^.s2 < 0)) THENDSP_AZ := -0.5*TEMP_AZ;IF ((StokeVec^.s1 <0) AND (StokeVec^.s2 > 0)) THENDSP_AZ := 0.5*(PI-TEMP_AZ);IF ((StokeVec".s1 <0) AND (StokeVec".s2 < 0)) THENDSP_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;VARtemp^: real;Miu : real;BEGINMiu := 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*************************************************** *************************************1FUNCTION DSP _ SIN _DEL(Q,R,S:real; Cycle_Num:integer): real;VARPSI_par^: real;Miu^: real;BEGINMiu := 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;*149f***************************************************************************************** DSP_Data_Max : Find the Maximum Value of the Data ** ** Store_Data: Time domain data. ** Inc_Num: number of data samples per revolution ** Cycle_Num: number of revolutions sampled *****************************************************************************************1FUNCTION DSP_Data_Max(Store_Data:Data_Ptr; Inc_Num,Cycle_Num:integer): integer;VARinteger;Max_Val^: integer;BEGINMax_Val := 0;FOR i := 0 to Inc_Num-1 DOIF (Store_Data^[i+Cycle_Num*Inc_Num] > Max_Val) THENMax_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 *****************************************************************************************1FUNCTION DSP_Data_Min(Store_Data:Data_Ptr; Inc_Num,Cycle_Num:integer): integer;VARinteger;Min_Val^: integer;BEGINMin_Val := 4095;FOR i := 0 to Inc_Num-1 DOIF (Store_Data" [i+Cycle_Num*Inc_Num] < Mm Val) THENMin_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;VARtemp^: real;BEGINtemp := Arctan(Reflect" .i/Reflect^ .r);IF ((Reflect ^ s < 0) AND (Reflect " .i > 0)) THENtemp := PI + temp;IF ((Reflect ^ s < 0) AND (Reflect ^ .i < 0)) THENtemp := -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^ *****************************************************************************************1FUNCTION DSP_ELL(StokeVec:PStoke): real;VARCos_2e11:^real;BEGINCos_2ell := sqrt(sqr(StokeVec ^ .s1)+sqr(StokeVec^ .s2));{CHECK AND TRAP FOR CIRCULARLY POLARIZED LIGHT}IF (Cos_2ell = 0) THENBEGING0T0XY(MargX,Data_LineY+5);write('Light is Circularly Polarized 1);DSP_ELL := (StokeVec ^ .s3/abs(StokeVec".s3)) * PI/4.0;exit;ENDELSEBEGIN G0T0XY(MargX,Data_LineY+5); ClrEOL; END;DSP_ ELL := 0.5*ArcTan(StokeVec ^ .s3/sqrt(sqr(StokeVec" .s1)+sqr(StokeVec ^ .s2)));END;151f********************************** ************************************************* ****** DSP_FOURIER_Mag: Find the Magnitude of the normalized coefficient^ ** ** A_ Coef: Fourier Cosine coef.^ ** B Coef: Fourier Sine coef. *****-************************************************************************************1FUNCTION DSP_FOURIER_Mag(A_Coef,B_Coef: real): real;BEGINDSP_FOURIER_Mag := sqrt(sqr(A_Coef)+sqr(B_Coef));END;f***************************************************************************************** DSP_ Miu: Calculate MIU^ ** ** Q: Compensator parameter ** Cycle_Num: number of revolutions sampled.^ *****************************************************************************************1FUNCTION DSP_Miu(Q:real; Cycle_Num:integer): real;BEGINDSP_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^ *****************************************************************************************1FUNCTION DSP_Nu(Q:real; Cycle_Num:integer): real;BEGINDSP_Nu := (2+DSP_Miu(Q,Cycle_Num)*Q)*Fourier_Coef_B[Cycle_Num,4]/(2-Q);END;f***************************************************************************************1FUNCTION TAN(Angle:real):real;BEGINIF (COS(Angle) = 0) THENBEGINTAN := (SIN(Angle)/abs(SIN(Angle))) * PI/2.0;exit;END;TAN := SIN(Angle)/COS(Angle);END;152f***************************************************************************************** DSP TAN PSI: Calculate the TAN(PSI) of sample^ ** —^ ** USES: DSP_ Miu ** Q: Compensator parameter^ ** Cycle Num: number of revolutions sampled.^ *********—********************************************************************************}FUNCTION DSP _ TAN _PSI(Q: real; Cycle_Num: integer): real;VARMiu^: real;BEGINMiu := DSP_Miu(Q,Cycle_Num);DSP_TAN_PSI := SQRT((1+Miu)/(1-Miu));END;(**************************************************************************************1{$F-1-}PROCEDURE DSP_exit;BEGINExitProc := 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.(**************************************************************************************1UNIT EDA_fft;INTERFACEUSES dos, crt, graph, LabMast;VARFFT_Imag^: array[0 ..9, 0..512] of real;FFT_Real : array[0 ..9, 0..512] of 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****************************************************************************************1PROCEDURE EDA_FFT_Coef(Store_Data:Data_Ptr; Data_Num,Cycle_Num,Power_of 2:integer);VARindex^: integer;: integer;: integer;: integer;: integer;Offset^: integer;Inc_Num2^: integer;Power_of 2n : integer;: real;: real;: real;Arg^: real;TReal : real;TImag^: real;154function FFT_Power(Mantissa, Exponent: real) : integer;beginFFT_Power := Round(EXP(LN(Mantissa)*Exponent));end;function FFT_BitRev(J: integer) : integer;varindex^: integer;J1 : integer;J2 : integer;T^: integer;beginJ1 := J;T := 0;FOR index := 1 to Power_of 2 DOBEGINJ2 := J1 DIV 2;T := 1*2 + (J1-2*J2);J1 := J2;END;FFT_BitRev := T;end;BEGINOffset := Cycle_Num*Data_Num;{INITIALIZE AIDMA_Datalmag ARRAY}FOR index := 0 to Data Num-1 DOBEGINFFT_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 DOBEGINWHILE (K < Data_Num-1) DOBEGINFOR I := Ito Inc_Num2 DOBEGINP := 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;155FFT_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 DOBEGINI := FFT_BitRev(K);IF (I>K) THENBEGINTReal := 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;BEGINdc_val := SQRT(SQR(FFT_Real[Cycle_Num,0]) + SQR(FFT_Imag[Cycle_Num,0]));FOR i := 0 to Data_Num-1 DOBEGINFFT_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;156f***************************************************************************************** EDA_ FFT_ Av10 : Averages the first 10 FFT Coefficients^ ** over the sample number^ ** ** Data_Num: number of data samples per revolution^ ** Cycle_Num: number of revolutions sampled^ *****************************************************************************************1PROCEDURE EDA_FFT_Av10(Data_Num,Cycle_Num:integer);VARi,j^: integer;Sum_Real : real;Sum_Imag : real;BEGINFOR j := 0 to 9 DOBEGINSum_Real := 0;Sum_Imag := 0;FOR i := 0 to Cycle_Num-1 DOBEGINSum_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***************************************************************************************1END.157(***************************************************************************************1I1111Ck^ 1UNIT EDA_dis;INTERFACEUSES dos, crt, graph, LabMast;CONSTBackColorCommand_LineYData_LineYKeyCon_LineYMargXTitle_LineYStatus_LineYWriteColor. 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);(* FILE: EDA_Dis.pas(* WRITTEN BY: A. Kleinschmidt(* ON: May 18, 1993r(* UNIT WITH ROUTINES FOR GRAPHICAL DISPLAY OF THE DATA AND DISPLAY OF(* TEXT STRINGS IN VARIOUS LOCATIONS WHEN IN TEXT MODE158IMPLEMENTATIONVARExitOld^: 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.^ *****************************************************************************************1PROCEDURE^DIS_Graph_Data(Store_Data:Data_Ptr;Inc_Num,Cycle,Shift_Num,Vert_Offset,Scale:integer; Color:word);VARi,ip^: integer;tbase : integer;^{graphing parameters}BEGINi := 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) divScale,Color);FOR ip:= 0 to Inc_Num-2 DOBEGINi := (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) divScale);END;END;159f***************************************************************************************** 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.****************************************************************************************1PROCEDURE DIS_Graph_Freq(Store_Data:Data_Ptr; Inc_Num,Cycle:integer; Color:word);VAR: integer;tbase^: integer;^{graphing parameters}Vert_Offset : integer;BEGINi := 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 DOBEGINLine(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;VARGraphDriver^: 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 *****************************************************************************************1PROCEDURE DIS_Graph_Setup_Time;VARinteger;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;BEGINTextBackground(BackColor);clrscr;TextColor(WriteColor);END;f***************************************************************************************** DIS Print Reflectivity: Write Tan(Psi) (Mag) and Rho (parts) to screen^ *******-*****-*****************************************************************************1PROCEDURE DIS_Print_Reflectivity(Mag,Angle,real_part,imag_partreal);BEGINDIS_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) THENwrite(real_part:8:6,' -I ',abs(imag_part):8:6)ELSEwrite(real_part:8:6,' +i ',abs(imag_part):8:6);END;f******************************************************************** ********************* DIS_ Write_ Text: Write TextString to screen at^ ** position XPosition,YPosition^ ********************************************************* ********************************1PROCEDURE DIS_Write_Text(TextString:string; XPosition,YPosition:integer);BEGINGoToXY(XPosition,YPosition);write(TextString);END;162f************************* *************************************** ***********************1{$F+}PROCEDURE DIS_exit;BEGINTextBackground(0);TextColor(7);clrscr;ExitProc := ExitOld;END;{$F-}{clrscr and set to black}{re-install old Exit procedure}f****************************************************************** *********************1BEGINExitOld := 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}CONSTAngle_Data_Max = 20;^{Maximum number of samples for curve fit}TYPEArrayPt = ^StoreArray;StoreArray = Array [0..Angle_Data_Max] of real;VARAngle^: 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);VARinteger;BEGINwriteln(DataFile,Angle_Data_Max:8);DIS_Write_Text('# ANGLE MAG',MargX,Data_LineY);i := 0;IsExit := FALSE;164REPEATAngle [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) DOBEGINGet_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.***************************************************************************************1PROCEDURE Find_Max_Min(Max_Min:Boolean; Harm:integer);VARMAG_of_Harm^: real;Rough_Max_Min^: real;BEGINRough_Max_Min := Ord(Max_Min);IF (NOT Max_Min) THEN^DIS_Write_Text(' MAG(4)^Maximum',MargX,Data_LineY)ELSEDIS_Write_Text(' MAG(2)^Minimum',MargX,Data_LineY);REPEATGet_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;165GATH HARMONICS(Harm,DMA Data,Data Num,Rev Num,0);MA6_ of _Harm := DSP _ -FOURIER- Mag(F5URIER _ Coef A[Rev _ Nurn , Harm],nFOURIER_Coef_B[Rev_Num,Har:1-]);IF ((MAG_of Harm > Rough_Max_Min) AND NOT Max_Min) THENRough_Max_Min := MAG_of_Harm;IF ((MAG_of Harm < Rough_Max_Min) AND Max_Min) THENRough_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.(**************************************************************************************1PROCEDURE Rotate_so_Anal_on_P(VAR A:real; VAR P:real);VARArad^: real;FlushKey^: char;BEGINArad := Pl*A/180;IF (SIN(Arad)*COS(Arad) > 0) THENBEGINIF ((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'****************************************************** *********************************1FUNCTION Input_Angle(VAR IsLoop_Done:Boolean; VAR IsLoop_Exit:Boolean): real;VARSt_Err^: integer;Text_Value : string[6];Value^: real;FlushKey^: char;BEGING0T0XY(MargX,Command_LineY+3);ClrEOL;Sound (200)delay(150);NoSound;IsLoop_Done := FALSE;IsLoop_Exit := FALSE;FlushKey := ReadKey;REPEATG0T0XY(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*****************************************************************************************)CONSTMax^= FALSE;Min = TRUE;VARAnal_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}REPEATGet_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 SECONDHARMONIC}clrscr;DIS_Write_Text('COARSE ALIGNMENT OF Polarizer',MargX+15,Title_LineY);DIS_Write_Text('SET Polarizer FOR MINIMUM IN SECONDHARMONIC',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);REPEATPol_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 FOURTHHARMONIC',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);REPEATAnal_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 nearits maximum. MAG 2nd is very sensitive to changes inP - 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 INSECOND',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);169REPEATPol_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);GofoXY(nhereX,WhereY); write(Pol_Angle_to:8:1);DIS Write_Text('Press "E" to EXIT...^',MargX,Keycon_LineY);Angle_Array(Anal Angle_to,4);IF IsExit THEN exit;IF (GATH Gain_Err = -2) THEN exit;close(DatiFile);{RUN C PROGRAM TO QUADRATIC FIT COEFFICIENTS AND RETURNERROR 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)) THENBEGINDIS_Writelext('DOS Error: ',MargX,Status_LineY);GoToXY(WhereX,WhereY);write(DOSERROR);END;Reset(FitFile);FOR i := 1 to 2 DOBEGINReadln(FitFile,Line);Val(Line,Coef[i],St_Err);END;{CHECK FOR GOODNESS OF FIT}IF (Coef[1] <0.4) THENBEGINDIS_Write_Text('Poor Fit. Press Any Key to Continue.',MargX,Status_LineY+1);Answer := ReadKey;ENDELSEAnal_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);170DIS_Write_Text('Press "E" to EXIT...^',MargX,Keycon_LineY);REPEATPol_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./*#######################################################*//* FILE: ANG_FIT.0 *1/* A. Kleinschmidt *1/*^18.1.93 *1/* *//* A PROGRAM, ACCESSED BY "EDA_ALIGN.PAS", WHICH READS THE ANGLE AND *//* MAGNITUDE DATA TO DETERMINE THE QUADRATIC FIT COEFFICIENTS *1/* AND GOODNESS OF FIT. THIS, ALONG WITH THE CALCULATED ANGLE AT *//* WHICH THE DATA IS AN EXTREMA IS WRITTEN TO A FILE: "ALIGN.FIT" *//* WHICH IS USED BY THE CALLING PROGRAM "EDA_ALIGN.PAS". *1/*#######################################################*/#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;1171main()1int^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;CONSTMag_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}VARAnal_Angle_toAnswerC_ShiftC_Shift_storeDataFileDMA_DataExit_KeyGain_CorGain_NumGet_DataHarmonicsiLast_Fourier_BMAGMotor_SpeedOld_GainParameterFilePHASEPhase_CorPol_Angle_toPrintDeviceRev_Numtemp: 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.***************************************************************************************1PROCEDURE Measure_C_Shift(VAR Exit_Flag:Boolean);BEGINGet_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;REPEATIF 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) THENBEGINDIS_Write_Text('Calibration Error. Redoing. (Any key to exit)',MargX,Status_LineY-1);dec(C_Shift)ENDELSE 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***************************************************************************************1BEGIN{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');174Reset(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}REPEATOld_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 DOBEGINREPEATIF 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);175MAG[Harmonics] := DSP_FOURIER_Mag(FOURIER_Coef A[Rev_Num,4],FOURIER_Coef B[Rev_Num,4]);IF (MAG[Harmonics] < Mag_Tol_crossed) THENDIS_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);176DIS_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}REPEATOld_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) THENBEGINPHASE[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 DOBEGINread(DataFile,temp);C_Shift_store[Harmonics] := Round(temp);177read(DataFile,Phase_cor[Harmonics]);END;WHILE NOT KeyPressed DOBEGINIF 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 DODIS_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.***************************************************************************************1PROGRAM EDA_Meas;USES crt, dos, graph, LabMast, EDA_Gath, EDA_dsp, EDA_dis;CONSTQRSRev_Num_Limits= 1.1400;= 0.9901;= 0.0052;= [1..16];{Compensator parameters}{Maximum number of cycles allowed}VARAnal_Angle_toANGLE ERRORAnswerControlKeyCOS_DELTAC Shift store_ _DataFileDELTADMA_DataExitOldGain_CorGain_NumGet_Datai,jLM_GainMotor_SpeedParameterFilePresent_GainPhase_CorPol_Angle_toPol_Set_toPrintDeviceRev_NumRhoSIN_DELTASt_ErrStoke_VectorTAN PSItempT_sampXiXo: 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}179f********************************** ******************************************************* MAIN PROGRAM****************************************************************************************1BEGIN{INITIALIZE DATA FILE AND MESSAGES}DIS_Init_Text;DIS_Write_Text('MEASUREMENT ROUTINE FOR INSITUELLIPSOMETER.',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 DOBEGINread(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);REPEATReadln(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);REPEATReadln(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);REPEAT180Readln(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}REPEATGet_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}REPEATGet_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);181RHO".r := Xi*Xo".r/(sqr(Xo 'N .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) THENBEGINGoToXY(MargX, Data_LineY+8);write('ERROR IN STOKES VECTOR!');ENDELSE 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']) THENwriteln(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 DODIS_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.(***************************************************************************************** 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;VARAnswer^: 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}REPEATGet_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));183clrscr;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 DOBEGINIF 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 DOBEGINGATH_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 DODIS_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.***************************************************************************************1PROGRAM EDA_Bug;USES crt, dos, graph, LabMast, EDA_Gath, EDA_dsp, EDA_dis;VARAnswerC Shift store_ _DataFileDMA_DataGain_CorGain_NumGet_DataHarmonicsMAGMotor_SpeedPHASEPhase_CorPrintDeviceRev_Numtemp: char;: array [second: FILE of real;: Data_Ptr;: array [second: GainPtr;: string;: Harm_Index;: integer;: array [second.: Speed_Index;: array [second.: array [second.: text;: integer;: real;.fourth] of real;.fourth] of real;.fourth] of real; {Calibrated Phase correction}{Number of revolutions to measure}{Temporary storage variable}{Keyboard character input}„fourth] of integer; {Trigger phase correction}{Address of DMA Data}„fourth] of real; {Calibrated gain correction}{Detector and LabMaster gain values}{Error code}{Index of Fourier coefficients}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}REPEATGet_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 DOBEGINread(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 DOBEGINIF 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,",186PHASE[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,' i,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 DODIS_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.(************************************ ***************************************** **********)(* FILE: Shutter.pas(* WRITTEN BY: A. Kleinschmidt(* ON: May 18, 1993(*r UTILITY PROGRAM TO CONTROL THE BISTABLE ELECTRONIC SHUTTER(* FOR THE LASER(**************************************************************************************1PROGRAM shutter;USES crt, dos, labmast;{$define MASTER}{$i cAlabpac\labhead.btp}CONSTBASE^= 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}VARinteger;Key_to_Go^: char;BEGINclrscr;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') DOBEGINIF (Key_to_Go = 'o') THENBEGINport[PORT_BI := Shutter On;delay (20);port[PORT_B] := Shutter Wait;G0ToXY(1,WhereY);write('Shutter Open ');END;IF (Key_to_Go = 'c') THENBEGINport[PORT_B] := Shutter Off;188delay (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, 1993r(* UTILITY PROGRAM TO READ THE PHOTODETECTOR(************************************************************************* *************1PROGRAM adcrun;USES crt, labmast, EDA_dis;{$define MASTER}{$i cAlabpac\labhead.btp}CONSTBASE^= 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_don_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}VARAnswer^: 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}189BEGIN{INITIALIZE LABMASTER PORTS, SET GAIN AND OPEN SHUTTER}DIS_InText;DIS_Write_Text('LABMASTER ADC OUTPUT',MargX+25,Title_LineY);REPEATClrEOL;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));REPEATClrEOL;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) DObeginport[BASE+6] := 0;while ready < 128 dobeginready := 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.190Table Cl: Location in Memory of DMA Data.Memory Address RevolutionNumberData NumberBase Address +^0 0 Data[0]1 Data[1]2 Data[2]3 Data[3]Data Num -^1_ Data[Data_Num - 1]Data Num_ 1.'.'Data[Data_Num]Data Num +^1_ Data[Data Num + 1]Data Num +^2_•Data[Data Num + 2]Data_Num*Rev_Num + 0 Rev Num Data[Data_Num*Rev Num+0]Data Num*(Rev Num+1)-1 Data[Data Num*(Rev_qum+1)-1]191Table C2: Array Storage Locations of Fourier CoefficientsFOURIER COEFFICIENT NUMBER0 1 2 3 4 5 6 7 8 9REV0LUTI0NNUM01234.•REV NUM192Table C3: Error MessagesERRORMESSAGEPROGRAMUSED INCAUSECalibration Error EDA_Set Analyzer or Polarizer misaligned.Possible electrical noise.DOS ERROR EDA_Align External program Ang_fit.c did notexecute properly.DMA OR TIMERSETUP ERROREDA_GATH Setup of DMA controller or timersdid not occur properly.ERROR INSTOKESVECTOREDA_Meas Stokes Vector does not normalizeto one.Light Level tooLowEDA_GATH Something blocking the laser orlaser beam is misaligned.Poor Fit EDA_Align External program Ang_Fit.c unableto fit the data adequately.SynchronizationErrorEDA GATH ADC did not convert the propernumber of data values during therevolution.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:
https://iiif.library.ubc.ca/presentation/dsp.831.1-0074512/manifest

Comment

Related Items