This repository has been archived by the owner on Aug 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.html
73 lines (70 loc) · 10.4 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<h1>Laser triggering: an application for high-throughput laser processing and characterization</h1>
<p>This respository contains code for an application which allows in situ spectroscopic characterization of materials during automated laser processing. The application controls triggering of laser pulses, acquisition of Raman spectra, acquisition of traces from an oscilloscope, and motorized control of optical polarizer/analyzer systems.</p>
<p>A screenshot of the user interface is shown below.
<img alt="Screenshot of the GUI" src="./img/gui.jpg" /></p>
<p> A schematic of the experimental configuration is shown below.
<img alt='Schmatic of experimental diagram" src="./img/experiment_diagram.JPG /></p>
<h1>Use</h1>
<p>The application can be started by opening a Python code editor running the <code>app.py</code> file. Alternatively, the software can be started using the <code>RUN_LASER_TRIGGERING.bat</code> Windows BAT file.</p>
<h2>Connecting to instruments</h2>
<p>To view the avilable instrument ports, navigate to <strong>Menu -> Show avilable instrument ports</strong>. Addresses of each avilable VISA, serial, and FTID USB port will be printed in the output box. To connect with a particular instrument, navigate to the box for that instrument on the front panel of the GUI. Enter the appropriate address for the instrument in the <strong>Address</strong> field, and click the checkbox adjacent to the address field to connect to the instrument. For example: to communicate with the SRS DG645 pulse generator, enter the serial port address (e.g. COM6) in the address field and select the checkbox to connect to the device. The output box will indicate if connection to the instrument was successful. If the connection failed, check the instument address and connection to the PC. The user may also determine whether the instument can be identified by the PC using Windows Device Manager or National Instruments Measurement & Automation Explorer (NI MAX).</p>
<p>Notes:
* Instruments may not be communicating properly unless they return an identification message in the outout box when the are connected. If instruments will not connect, check that their addresses are correct.
* The application is set up to trigger pulses from the SRS DG645 using the A-B output. So when using the SRS DG645 as an external trigger for an auxilary laser, connect the DG645 <em>A-B output</em> to the laser <em>external trigger</em> input.</p>
<h2>Connecting to Gentec S-Link photometer</h2>
<p>The photometer will not communicate with the PC if it has been left in an inconsistent state. To reset connection to the PC, unplug the USB cable from the photometer for 5 seconds and then plug it back in. </p>
<h2>Connecting to Thorlabs K-Cube KDC101 controllers</h2>
<p>These controllers cannot be found by the computer if the <code>import thorlabs_apt as apt</code> command has been run before the controllers were connected to the PC. After they are connected, make sure the Python kernel has been restarted to allow initialization of <code>APT.DLL</code> while the controllers are connected and powered. </p>
<h2>Connecting to Marzhauser MCL-3 stage controler</h2>
<p>Make sure the "Joystick" knob on the front panel of the MCL-3 is in the "Auto" position. In the "Man" position, serial communication is disabled.</p>
<h2>Connecting to Laseroptik AVACS beam attenuator</h2>
<p>The AVACS beam atenuator will not communicate with the PC unless the <em>Mode</em> is set to <em>Remote</em> on the top panel of the AVACS unit. </p>
<h2>Connecting to LightField</h2>
<p>To acquire Raman spectra using Princeton Instruments LightField software, LightField must be opened from the GUI by clicking <strong>Launch LightField*<em>. Once LightField loads, the user should load the LightField experiment called <strong>Default Python Experiment</strong>. After the experiment is loaded, settings can be modified in LightField. Raman spectra can be acquired by clicking the **Acquire Raman spectrum</em></strong> button the the GUI.</p>
<h2>Running an experimental Sequence</h2>
<p>The <em>Experimental sequence</em> box contains options for running an automated experimental sequence. The sequence is started by selecting the <em>Run</em> button. Clicking <em>Abort sequence</em> will stop the sequence before it is complete. The sequence will initiate a procedure which runs <em>Number of cycles</em> times, with each cycle separated by <em>Cycle delay</em> number of seconds. Each checkbox that is checked in the <em>Experimental sequence</em> box will repeat during each cycle. For example, when <em>Laser triggering</em>, <em>Raman acquisition</em>, and <em>Polarizer rotation</em> checkboxes are all selected, the sequence will proceed as follows:
1. a list of polarizer angles is generated based on values in the <em>Start angle</em>, <em>End angle</em>, and <em>Steps</em> fields in the <em>Thorlabs controllers</em> box.
2. a Raman spectrum is acquired at each of the polarizer angles
3. the pulse generator is used to trigger laser pulses for material processing. The pulses are controlled by the <em>pulse width</em>, <em>pulse delay</em>, <em>pulse maplitude</em>, and <em>number of pulses</em> in the <em>Pulse generator</em> box.
4. Steps (2) and (3) are repeated <em>Number of cycles</em> times.</p>
<h2>File output</h2>
<p>Each time a Raman spectrum is acquired, the spectrum is saved to a <em>.csv</em> file, and the application log file is appended. The log file contains the list of experimental parameters that were active during each Raman acquisition, as well as the filename of the Raman spectrum. The log file can be found by selecting <em>Menu</em> -> <em>Show path to log file</em>, and the location of Raman spectra can be viewed by selecting <em>Menu</em> -> <em>Show acquisition file list</em>.</p>
<h1>Description of files</h1>
<ul>
<li><strong>laser_triggering</strong>: main directory which holds files and supporting directories <ul>
<li><strong>app.py</strong>: main file for starting the GUI application. Calls <em>ui.ui</em> and files inside <em>instr_files</em> directory to create the application. Controls logic of the application and links GUI widgets to their actions.</li>
<li><strong>README.md</strong>: the file you are reading, which describes instructuins for use</li>
<li><strong>ui.ui</strong>: user interface file, created in QT Desginer, which is called by <em>app.py</em> and provides thelayout of graphical user interface widgets for the application.</li>
<li><strong>RUN_LASER_TRIGGERING.bat</strong>: Windows bat file. Make a shortcut of this file and place it anywhere on the PC to run <em>app.py</em> by clicking on the shortcut.</li>
<li><strong>requirements.txt</strong>: text file containing list of all dependencies. These can be installed using Anaconda as described in the <em>Installation</em> section below.</li>
</ul>
</li>
<li><strong>instr_libs</strong>: directory which contains Python scripts for controlling instruments and operation of the GUI<ul>
<li><strong>avacs.py</strong>: module for controlling Laseroptik AVACS beam attenuator</li>
<li><strong>kcube.py</strong>: module for controlling Thorlabs KDC101 brushed servo motor controllers</li>
<li><strong>lf.py</strong>: modules for controlling Princeton Instruments LightField software</li>
<li><strong>mcl.py</strong>: module for controlling Marzhauser Wetzlar MCL-3 microscope stage controller</li>
<li><strong>mso.py</strong>: module for controlling Tektronix MSO64 oscilloscope</li>
<li><strong>ops.py</strong>: module for controlling operations and file I/O of the main GUI</li>
<li><strong>srs.py</strong>: module for controlling SRS DG645 digital delay pulse generator</li>
<li><strong>slink.py</strong>: module for controlling Gentech S-link photometer</li>
</ul>
</li>
<li><strong>logs</strong>: default directory for saving experiment configuration files and logging experimental data</li>
<li><strong>support_files</strong>: directory for storing supporting files (<em>APT.dll</em>, <em>APTAPI.h</em>, <em>ATP.lib</em>) and other unused depreciated files</li>
<li><strong>img</strong>: directory for storing images which are embedded in the README.md file</li>
</ul>
<h1>Editing the software</h1>
<p>To edit the user interface, use <em>QT Designer</em>. This installed by default with <em>Anaconda</em>. After <em>Anaconda</em> is installed, open the <em>Anaconda prompt</em>. In the command prompt, type <code>designer</code> and hit <em>enter</em>. The program <em>QT Designer</em> will open. Next, open the file <em>ui.ui</em> which is the unser-interface design file in this directory. The user interface can now be edited. Each widget on the user-interface can be named with a custom name, and this name will be called by the <em>app.py</em> file to assign functionality to the widget.</p>
<p>The main script which opens up the user-interface file is <em>app.py</em>. This script contains code for connecting each user-interface widget with associated functions to run when that widget is activated by the user. The script also calls other modules which control specific instruments. These are located inside the <em>instr_libs</em> directory. For example, the module <em>srs.py</em> inside the <em>instr_libs</em> directory contains code for controlling the SRS digital Delay Generator. In <em>app.py</em>, data is transferred between <em>app.py</em> and <em>srs.py</em> using the dictionary <em>self.srs</em>, which ocntains references to all SRS-related widgets on the user-interface.</p>
<h1>Installation of dependencies</h1>
<p>Prior to use, Python libraries and dependencies must be installed. To install dependencies, it is recommended to use Anaconda (https://www.anaconda.com/distribution/#download-section).</p>
<p>To install all dependencies on a Windows 64-bit computer, create an Anaconda envinrment and populate it with the required dependencies by opening the Anaconda command prompt and running:
<code>conda create --name env --file requirements.txt</code>
where <code>env</code> is the name of the new environment.</p>
<p>After installation of the <em>thorlabs_apt</em> library, three files in the support_files directory must be copied to the thorlabs_apt directory and placed in the same folder as <em>core.py</em>:
1. <em>APT.dll</em>
2. <em>ATP.lib</em>
3. <em>ATPAPI.h</em></p>
<p>This allows communication between Thorlabs instruments, Windows, and Python.</p>
<p>The <em>PI_GCS2_DLL_x64.dll</em> library must be placed inside the same folder as the <em>piline.py</em> script for communication between Python and the PI hardware.</p>