VUV code overview
User interface
The user interface is written using PyQt5 - python binding for Qt v5.
The interface is divided into three sections.
- Setup control - Displays current value of slow control parameter (temperature, pressure, and monochromator wavelength) and their evolution since the start of measurement. Also provides an interface to control the motor and to specify file saving location.
- Measurement - New measurements can be scheduled and started using this page. The details of the measurement completed are also shown in the bottom half of the page.
- Results - Completed measurements from the current run can be accessed with a simple plot showing the count rate of photons measured by the SiPM. It is also possible to add existing measurements by providing the directory where the measurements are saved.
Code overview:
Motor control
The stepper motor is controlled using an Arduino sketch that can be found in motorcontrol->motor.ino. The sketch is uploaded only once and then the code inside loop() runs indefinitely until the code needs to be modified or if we need to run the code inside the setup() again (this shouldn't happen ideally). The sketch can be uploaded using:
- the Makefile (with hardcoded path) provided in the same folder
- the Arduino IDE.
Code overview:
The Arduino reads the serial input request from the Raspberry Pi (routines defined in daq->arduino.py) on a loop and can perform the following actions:
- Read the current wavelength
- Go to a new wavelength (if the movement does not require going beyond the allowed range)
- Calibrate the wavelength measurement ( needs the infrared laser input)
NOTE: The current setup (without the infrared input) requires reading the starting wavelength from the dial in the monochromator and providing it to the motor control interface as the starting value. All later wavelength values are calculated with respect to this initial value.
TODO: Cross-check that the dial readings are accurate before real measurements.
Pressure
The pressure is measured using MPT 200 and can be read visually from the inbuilt display. The pressure can also be read via serial communication with the protocol defined in the operating manual of the sensor in [1].
The communication is done by sending and receiving a telegram to the sensor. The code that defines and reads these telegrams can be found in daq->pressure_sensor.py. Many simple routines can be created to control the sensor and read different parameter values but the most useful routine is readpressurevalue() which requests the current pressure in the vacuum chamber.
Temperature
The temperature of the sample will be measured using a PT 100 sensor. The resistance of PT100 is 100 Ω at 0°C and increases linearly with temperature (138.5 Ω at 100°C).
Using another resistor (1 kΩ) in series with the PT100 and applying known voltage (3.3 V) on the PT100, the current resistance of PT 100 can be calculated. The external resistor is connected to the ground and the voltage across the resistor is measured (as shown in [2]).
The voltage V can be converted to the resistance R of PT100 using:
R = (V)*1000 / (3.3-V).
Now, the temperature T of PT100 can be calculated from R as:
T = (R - 100) / 0.385,
where the factor 0.385 is calculated using R100°C = R0°C ( 1 + α*100°C ).
Note - The circuit is perhaps too simplistic [3] and we should check if the temperature reading is accurate enough for our setup.