-
Notifications
You must be signed in to change notification settings - Fork 0
Kilo DM
This implementation of BMC control software is really a collection of a few software packages:
- BMC API
- cacao
- BMC-interface
Note about calibration files. Installing cacao, etc. imagestreamiowrap
Wear a heel grounding strap and use an ESD wrist strap whenever handling the DM or the DM driver.
- Turn on the dry air from the wall
- Plug in the USB cable from the Arduino humidity monitor into corona
- Launch the humidity monitor process on corona
- In a shell session, call
arduino &
- In the window that pops up, load the humidity monitor sketch:
File > Examples > DHT > DHTtester
- Verify and upload the sketch (check mark and arrow icons)
- Launch the monitor (magnifying glass icon)
- In a shell session, call
- When relative humidity drops below 10%, use the switch on the rear side of the driver to power on the 1K. (The driver is ESD sensitive, so you'd better be wearing a heel and wrist strap! I normally use the attachable alligator clips to ground myself to the driver rack.)
- Launch the DM control process on corona
- in a shell session, call
/home/lab/github/BMC-interface/build/runBMC2K "11W194B#004" <shmim name>
where<shmim name>
is the name of the shared memory image that holds the DM commands. The first argument is the serial number of the 1K and won't ever change. - To kill the control process, hit ctrl + c. This will zero out the DM and safely close the driver connection.
- in a shell session, call
Wear a heel grounding strap and use an ESD wrist strap whenever handling the DM or the DM driver.
- In the shell window with the DM control process, hit ctrl + c to stop the DM. This will zero out the DM and safely close the driver connection.
- Power off driver with the switch on the back (while practicing ESD safety).
- Shut off the DM dry air flow at the wall.
- Unplug the Arduino USB cable from the back of corona.
On corona, the flats defined in front of the Zygo are kept at /home/lab/github/bmc_kilo_calibration/flats
.
To set the flat, call: /home/lab/github/BMC-interface/loadfits </path/to/flat.fits> <shared memory name>
For example, to load the latest "full" flat into a shared memory image named "kilo": /home/lab/github/BMC-interface/loadfits /home/lab/github/bmc_kilo_calibration/flats/flat_BMC1K_2020_01_16_full.fits kilo
A second example, a flat that doesn't correct for defocus: /home/lab/github/BMC-interface/loadfits /home/lab/github/bmc_kilo_calibration/flats/flat_BMC1K_2020_01_16_defocus.fits kilo
Current best flat (post OAP6): /home/lab/github/bmc_kilo_calibration/flats/flat_BMC1K_2020_07_01_testbed_OAP6.fits
Current best flat (pyramid): /home/lab/github/bmc_kilo_calibration/flats/flat_BMC1K_2020_07_08_testbed_pyramid.fits
Two (moderately useful) scripts are bundled with the BMC-interface code, which can be called from the command line:
./loadfits /path/to/fitsfile.fits <shared memory name>
./setpix val x y <shared memory name>
- Launch the cacao CLI:
cacao
- Read in the shmim. Here I assume it's named "kilo":
readshmim kilo
- Check the shape of the shmim:
listim
- Set a single actuator:
setpix kilo value x y
- Zero out the DM:
imzero kilo
- Load in a fits file and copy it to the shmim:
loadfits /path/to/fits/file.fits im
cp im kilo
imagestreamiowrap, etc. (maybe use magpyx)
- conda activate
- ipython
- import magpyx
- connect to shmim
- update shmim
In a new shell window, follow these steps to pull up a viewer:
source activate py37
-
shmview /tmp/<image stream>.im.shm &
(most likely,shmview /tmp/kilo.im.shm &
)
zygo-automation package, mounting shared network drive (copy /etc/fstab entry)
notebooks for collecting influence functions, flattening in closed loop, etc?
See Powering On for directions on starting the humidity monitor up.
The original sketch can be found here.
Wiring setup, in case of unscheduled disassembly:
Connect pin 1 (on the left) of the sensor to +5V
NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
to 3.3V instead of 5V!
Connect pin 2 of the sensor to whatever your DHTPIN is (2)
Connect pin 4 (on the right) of the sensor to GROUND
Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
If the sketch upload fails with an error of the sort avrdude: stk500_recv(): programmer is not responding
, make sure the right serial port is selected. In the Arduino interface, navigate to the dropdown menu Tools > Serial Port and select /dev/ttyACMO
. Then try re-uploading the sketch and launching the serial monitor.
As user xsup
run:
dm_eye_doctor 7626 kiloModes camtip 10 2 .5
dm_eye_doctor 7626 kiloModes camtip 10 2...10 0.25
dm_eye_doctor 7626 kiloModes camtip 10 2...35 0.05
To save the results as a new flat, run dm_eye_doctor_update_flat kilo
. This should automatically zero out the eye doctor channel and reload the flat in the appropriate channel. It'll throw an error about timing out, but that can be ignored.
For more details on how to run the eye doctor, look here
If it seems like the solution is diverging or modes are coupled, see the beam_footprint.ipynb
Jupyter notebook in the xsup home directory on corona for an example of how to measure the beam footprint and redefine the basis set on this footprint. (eventually this will become a proper piece of code or else get moved to github)