Laser calibration: Difference between revisions
No edit summary |
|||
(One intermediate revision by the same user not shown) | |||
Line 64: | Line 64: | ||
===== Access SPI as non-root user ===== | ===== Access SPI as non-root user ===== | ||
Following the instructions from [http://www.airspayce.com/mikem/bcm2835/] non-root access to the SPI pins requires the following: | Following the instructions from [http://www.airspayce.com/mikem/bcm2835/] non-root access to the SPI pins requires the following: | ||
* install libcap-dev (see [[Laser_calibration#Required_packages|Required packages]]) | |||
<pre> | <pre> | ||
sudo apt install libcap-dev | sudo apt install libcap-dev | ||
</pre> | </pre> | ||
====== uncomment the BCM2835_HAVE_LIBCAP line in src/bcm2835.h | |||
* add current user to kmem group | |||
<pre> | |||
sudo adduser $USER kmem | |||
</pre> | |||
* give group kmem access to /dev/mem | |||
<pre> | |||
echo 'SUBSYSTEM=="mem", KERNEL=="mem", GROUP="kmem", MODE="0660"' | sudo tee /etc/udev/rules.d/98-mem.rules | |||
sudo reboot | |||
</pre> | |||
* uncomment the BCM2835_HAVE_LIBCAP line in src/bcm2835.h | |||
<pre> | <pre> | ||
sed -i 's/\/\/#define BCM2835_HAVE_LIBCAP/#define BCM2835_HAVE_LIBCAP/' src/bcm2835.h | sed -i 's/\/\/#define BCM2835_HAVE_LIBCAP/#define BCM2835_HAVE_LIBCAP/' src/bcm2835.h | ||
</pre> | </pre> | ||
* compile libbcm2835 as normal | |||
<pre> | <pre> | ||
./configure | ./configure | ||
Line 78: | Line 92: | ||
sudo make install # (make check fails) | sudo make install # (make check fails) | ||
</pre> | </pre> | ||
* in addition to -lbcm2835, compilation of example or own code requires -lcap, e.g. | |||
<pre> | <pre> | ||
gcc -o spi spi.c -l bcm2835 -lcap | gcc -o spi spi.c -l bcm2835 -lcap | ||
</pre> | |||
* after compilation, give program permission to access cap | |||
<pre> | |||
sudo setcap cap_sys_rawio+ep <progname> | |||
</pre> | </pre> | ||
===== C++ ===== | ===== C++ ===== | ||
C++ classes to simplify the use are provided in the mems code. | C++ classes to simplify the use are provided in the mems code. |
Latest revision as of 12:58, 21 July 2020
Introduction
Both the prototype and final TPC have aluminium strips on the central cathode that are intended for laser calibration. To that end a plane of UV laser light is sent into the TPC intersecting with the strips. Each laser pulse should then create a bunch of electrons with well defined position and time at each of the strips.
Photoelectron efficiency tests
One worry with the intended geometry is that the laser hits the far strips at a very glancing angle, and it was assumed the photoelectron efficiency (i.e. number of photoelectrons per photon) would go down in favour of reflection. To prevent this two methods of surface treatment were considered, and both the validity of the aforementioned assumption as well as the effectiveness of the treatments were investigated in a test setup at UBC. Details and results are given in this report.
Laser operating procedure
The following describes the standard operating procedure for running the laser setup on the prototype.
Safety
NEVER have the key inserted in the "ignition" when the optical fiber is disconnected, the black box is open, or the TPC is open (e.g. gas lines disconnected).
Start-up
- Check integrity of enclosure, i.e. optics box closed and bolted down, fiber attached at both ends.
- Turn on laser system with key on main unit.
- Push button "Flash lamp -> Ready" on handheld unit.
- Push button "Flash lamp -> Start" on handheld unit.
- Set collimator via mvat program on computer.
- Open manual shutter on laser head.
- Push button "Q-switch -> Start" on handheld unit.
Pause
Short pause
Simply push stop/start for Q-switch.
Longer pause
- Stop Q-switch.
- Stop flash lamp.
- Close manual shutter.
- After pause restart according to after-key part of start-up procedure.
Shutdown
- Stop Q-switch.
- Stop flash lamp.
- Close manual shutter.
- Wait a few minutes for cool-down.
- Turn off and remove key.
General best practice
- Limit laser shots to a minimum, to reduce wear on laser, flash lamp, and fiber.
- To that end, do non-critical steps like attenuator setting and DAQ start before starting Q-switch.
- Ideally allow system some time to warm up between turning on flash lamp and Q-switch.
Optics
Laser requirements
MEMS Multiplexer
Raspberry Pi setup
Operating System
We're running the most recent version of Raspberry Pi OS as downloaded from raspberrypi.org
Required packages
Install the following with apt get:
- emacs
- libcap-dev (required to access SPI as non-root user)
SPI library
The recommended way to interface with SPI from a raspberry pi is now no longer using the wiringPi library, instead raspberrypi.org recommends bcm2835. This is a direct hardware C library for pin communication that includes examples for GPIO, SPI, and I2C.
Access SPI as non-root user
Following the instructions from [1] non-root access to the SPI pins requires the following:
- install libcap-dev (see Required packages)
sudo apt install libcap-dev
- add current user to kmem group
sudo adduser $USER kmem
- give group kmem access to /dev/mem
echo 'SUBSYSTEM=="mem", KERNEL=="mem", GROUP="kmem", MODE="0660"' | sudo tee /etc/udev/rules.d/98-mem.rules sudo reboot
- uncomment the BCM2835_HAVE_LIBCAP line in src/bcm2835.h
sed -i 's/\/\/#define BCM2835_HAVE_LIBCAP/#define BCM2835_HAVE_LIBCAP/' src/bcm2835.h
- compile libbcm2835 as normal
./configure make sudo make install # (make check fails)
- in addition to -lbcm2835, compilation of example or own code requires -lcap, e.g.
gcc -o spi spi.c -l bcm2835 -lcap
- after compilation, give program permission to access cap
sudo setcap cap_sys_rawio+ep <progname>
C++
C++ classes to simplify the use are provided in the mems code.