Skip to content

rprospero/PAPA-Control

Repository files navigation

PAPA Control Manual

Introduction

This document servers as the main user manual for the control software for the PAPA detector. The program was written for python 2.6 and requires the following libraries:

  • DaqMx: A library from National Instruments for speaking interfacing with their digital IO cards. Specifically, we use the nicaiu.dll file.
  • BmmServer4: A server program written by the SNS which records the spectrum on the neutron beam monitor. This program is part of the SNS dcom system.
  • NumPy: A numerical library for python
  • PySerial: A python library for communicating over a computer’s serial port.
  • Current Listener: A LabView program on the motor server which controls the current in the power supplies. An energetic grad student should replace this with more python code in order to condense us down to a single language. Also, LabView VIs hate text based source control.

Basic Usage

The recommended way to run the control system is to load up Control.py into an interactive python prompt. This can be done by using the -i command line switch on python. To simplify this process, a batch file is kept on the desktop of the control computer which will do this loading automatically.

Control.py defines a control object in the variable c. This object is the main interface for controlling the instrument. At any time, the command help(c) will display the documentation on all of the control object’s member functions.

To close the program, use the exit() function. This will kill all of the detector processes and handle the shutdown of the resources acquired by the program. Do not use the quit() command, as it will not kill the detector and instrument threads.

Power supplies

The instrument uses two different types of Kepco power supplies. There are eight 20A/20V power supplies used to power the triangle coils and four 10A/20V power supplies for the remaining solenoids. The triangle supplies are controlled via the triangle member function, which takes the power supply’s number and the desired current. For instance, c.triangle(3,-7) sets the current in the third power supply to -7A. The 10A power supplies are named flipper, guides, phase, and sample and can be adjust by the eponymous member function. For instance, c.triangle(4) sets the current in the triangle power supply to 4A.

Making a polarization measurement

The flippingrun member function starts data collection on a polarization measurement. The function takes one argument: a tuple that controls the amount of time spent in the spin up and spin down states. For instance, c.flippingrun((1,3)) takes 120 seconds of data in the first spin state, then 360 seconds of data in the second before repeating the process. The spin state is chosen by flipping the current in the guides power supply. As there is some overhead involved in flipping the currents, longer runs may benefit from having longer times given (e.g. c.flippingrun((10,30)) would spend 1200 seconds in the first spin state and 3600 in the second). For the best statistics, the times should be chosen so that the ratio between the time spent in the low count state to the time in the high count state is equal to the square root of the flipping ration.

To end a measurement, use the stop member function.

Detector Control

It may become necessay to change the settings on the PAPA detector. The current settings can be queried with the query member function, while the values can be set through the detectorParameter member function. Global variables q and d re.erence query and detectorParameter, respectively. . Here’s a list of the parameters that can be read and adjusted:

NameCommandArgumentsReadWriteComments
shutterSO1TT
modeAM1TT
pulse strobePS1TT
gate captureGC1TT
reset timer polarityRT1TT
power supply voltagePV1TT
pmt power supply statePE1TT
energy pmt power supply voltageEV1TT
energy pmt power supply stateEE1TT
intensifier power supply voltageIV1TT
intensifier power supply stateIE1TT
trigger thresholdsTE2TT
end event fraction for energyTF1TT
trigger thresholds for papa strobeTP2TT
end event fraction for papa strobeTQ1TT
coincidence timer lead and lagCT2TT
offset for ADC channel AOA1TT
offset for ADC channel BOB1TT
offset for ADC channel COC1TT
offset for ADC channel DOD1TT
channel A filter?FATF
channel D filter?FDTF
gray constant?BATF
bit shift?BSTF
temperature set point for zone zero?TS0TF
temperature set point for zone one?TS1TF
kp gain for zone zeroKP01TT
kp gain for zone oneKP11TT
ki for zone zeroKI01TT
ki for zone oneKI11TT
kd for zone zero?KD0TF
kd for zone one?KD1TF
temperature for zone zero?TC0TF
temperature for zone one?TC1TF
gain for X0?GX01TF
gain for X1?GX11TF
gain for X2?GX21TF
gain for X3?GX31TF
gain for X4?GX41TF
gain for X5?GX51TF
gain for X6?GX61TF
gain for X7?GX71TF
gain for X8?GX81TF
gain for X9?GX91TF
gain for Y0?GY01TF
gain for Y1?GY11TF
gain for Y2?GY21TF
gain for Y3?GY31TF
gain for Y4?GY41TF
gain for Y5?GY51TF
gain for Y6?GY61TF
gain for Y7?GY71TF
gain for Y8?GY81TF
gain for Y9?GY91TF
gain for XGX2FTFirst argmuent is PMT number Second Argument is Gain
gain for YGY2FTFirst argmuent is PMT number Second Argument is Gain
gain for strobe pmtGS1TT
gain for threshold channelGT1TT
gain for energy pmtGE1TT
ADC offset voltageAV1TT
serial number?SNTF
version?VSTF

Design

				  
/-------------------\	 /-----------------\	 /-----------------\
.     /----------\  .	 .    Instrument   .     . Control	   .
.     . Detector .  .--------.  /---------\    .     .  /-------\	   .
.     \----------/  . 	 .  . Monitor .    .-----.  . Coils .	   .
.                   . 	 .  \---------/    .   	 .  \-------/	   .
. DetectorProcess   .      	 .  /-----------\  . 	 . /-------------\ .
.                   .      	 .  . XMLConfig .  . 	 . . XMLManifest . .
\-------------------/      	 .  \-----------/  .   	 . \-------------/ .
  			 	 \-----------------/	 \-----------------/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published