Skip to content

Kilo DM

Kyle Van Gorkom edited this page Sep 11, 2020 · 24 revisions

Software setup

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

Powering on

Wear a heel grounding strap and use an ESD wrist strap whenever handling the DM or the DM driver.

  1. Turn on the dry air from the wall
  2. Plug in the USB cable from the Arduino humidity monitor into corona
  3. Launch the humidity monitor process on corona
    1. In a shell session, call arduino &
    2. In the window that pops up, load the humidity monitor sketch: File > Examples > DHT > DHTtester
    3. Verify and upload the sketch (check mark and arrow icons)
    4. Launch the monitor (magnifying glass icon)
  4. 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.)
  5. Launch the DM control process on corona
    1. 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.
    2. To kill the control process, hit ctrl + c. This will zero out the DM and safely close the driver connection.

Powering off

Wear a heel grounding strap and use an ESD wrist strap whenever handling the DM or the DM driver.

  1. 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.
  2. Power off driver with the switch on the back (while practicing ESD safety).
  3. Shut off the DM dry air flow at the wall.
  4. Unplug the Arduino USB cable from the back of corona.

Setting a flat

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

Sending commands

using predefined shell scripts

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>

in the cacao CLI

  • 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

in python

imagestreamiowrap, etc. (maybe use magpyx)

  • conda activate
  • ipython
  • import magpyx
  • connect to shmim
  • update shmim

Viewing Image Streams

In a new shell window, follow these steps to pull up a viewer:

  1. source activate py37
  2. shmview /tmp/<image stream>.im.shm & (most likely, shmview /tmp/kilo.im.shm &)

Zygo Calibration

zygo-automation package, mounting shared network drive (copy /etc/fstab entry)

notebooks for collecting influence functions, flattening in closed loop, etc?

Humidity Monitor

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

Troubleshooting the humidity monitor

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.

Eye-Doctoring

As user xsup run:

  1. dm_eye_doctor 7626 kiloModes camtip 10 2 .5
  2. dm_eye_doctor 7626 kiloModes camtip 10 2...10 0.25
  3. 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)