Spectro-Polarimeter Characterization and Control

Software Design

 

Code Overview
Centeral Program Code
ASD Code
Ocean Optics Code
Rotation Stage Code
Telescope Mount Code

 

Code Overview

 

 The code for this project will run four separate components in one final program. These components are:

 

 The language used for this task is C++ due to its compatibility with all the equipment and the existence of pre-existing example code that was able to be modified and used for our system. Each of the components, as well as the central code to combine them together, are described below. The GUI for the program is shown in the image below.

 

 

Code GUI

 

 

Central Program Code

 

 The central code in the program will connect all the modules and pull data from each when needed. A basic flow chart of how this code will work is below. The modules called in the flowchart are described in detail in the next sections.

 The central code includes all the code to create the multiple windows used, as well as input and output data. It also contains serial port functions, one to create a port and one to send data to that port. These are used for both the rotation stage and the telescope mount, so it is useful to have easily called functions to allow for multiple uses.

 

 

Centeral Flowchart

 

 

ASD Code

 

 Using an SDK from ASD Inc code was written that could send commands to and receive data from the ASD spectrometer. This was done with the help of included example code that came with the SDK. The data read from the ASD is output on the graph shown on the GUI and to a CSV file, which will be read later in MATLAB. A basic flowchart of the code is shown below.

 

 

ASD/Ocean Flowchart

 

 

Ocean Optics Code

 

 The code for the Ocean Optics spectrometer is written using the Ocean Optics libraries included in their OmniDriver software. These libraries are Java based, but come with an included C++ wrapper for Visual Studio. This means that the computer running the final software must have the OmniDriver libraries and a current version of Java SDK installed. The command structure is very similar to that of the ASD code, and allows sending commands to and receiving data from the Ocean Optics Spectrometer. Data is again output to a CSV file. The flowchart from the previous section also describes this section of code.

 

Rotation Stage Code

 

 The rotation stage is run by sending ASCII commands to a serial port. The commands will tell the motor to rotate a certain amount, and other commands will be used to keep a status on when the rotation is finished. The flowchart for the rotation stage is below.

 

 

ASD/Ocean Flowchart

 

 

Telescope Mount Code

 

 The telescope mount also runs by sending ASCII commands to a serial port, just like the rotation stage, so the same basic code is used here. Commands are sent to point the mount to a certain position, then other commands are used to keep track of when the mount reaches the desired location. The mount uses altitude-azimuth coordinates for input which is also how we want them entered by the user, so no conversion in necessary. A flowchart showing the entire telescope mount system code is shown here.

 

 

ASD/Ocean Flowchart