/DMD_Holography

This project aims to study the properties of a Digital Micromirror Device (DMD) in the Fourier plane.

Primary LanguagePython

DMD_Holography

This project aims to study the properties of a Digital Micromirror Device (DMD) in the Fourier plane. Working in the Fourier plane can allow for the modulation of the phase and amplitude of a beam in the system, which can then be used to create detailed potentials that could be applied to the atoms in the cold atoms lattice experiment. The work done on this project so far has closely followed the thesis titled "Light Modulation with a Digital Micromirror Device" by Isabelle Racicot. Reading that thesis, as well as the thesis titled "Dynamic Holography and Beamshaping using Digital Micromirror Devices" by Philip P. J. Zupancic, will be extermely helpful in the understanding of this topic. Tristan Gautie's report, "Beamshaping :The Digital Micromirror Device in a Cold Atoms experiment", is also helpful in learning how to use the DMD, create images that can be uploaded to the DMD, and to create and upload the firmware that contains images to the DMD, since he uses the same DMD that I am using for this project, except Tristan operated it in the image plane.

As of August 21st, 2019, I have assembled the optical setup used for opertating the DMD in the Fourier plane, taken calibration images for the phase and amplitude mapping of the system, as well as created a pipeline that crops the calibration images, fits a 2D sine function multiplied by a 2D gaussian to the cropped images, generates the phase and amplitude maps of the system and finally generates a grating used for holographic beam shaping. The final hologram grating that I generated did not yield the expected results, which could be due to the phase instability of the optical setup, and/or potentially the way I coded the amplitude modulation portion of the hologram generation. This will be further discussed in the Future Work section at the end of this README.

There are two main python scripts used for this process, gratingGenerator.py and hologramGenerator.py.

The script gratingGenerator.py does exactly what it sounds like it does, it creates a series of calibration gratings, each containing a stationary "patch" near the center of the image, and a second patch that changes position in each image. The size of the patches can be altered here, as well as the location of the center patch. The angle and period of the underlying grating can also be changed. However, it should be noted that any changes made here to the size and location of patches must also be made to the hologramGenerator.py script, as I have not combined the two yet. The calibration images are saved as 1-bit .bmp files so that they can be compiled into a 24-bit image using the LightCrafter4500 GUI, which is the GUI used to control the DMD.

The script hologramGenerator.py is where the bulk of the code exists. This is where the calibration images, which are images of the interference patterns taken when projecting each of the different calibration gratings on the DMD, are cropped and fitted in order to obtain the phase and amplitude of the interference pattern. The calibration images of the interference pattern taken should be labeled in order going from top to bottom and left to right, labeling the top left corner as (x,y) = (1,1), the bottom left corner as (x,y) = (1,ymax), and the top right corner as (x,y)=(xmax,1), etc; where xmax and ymax are the number of calibration patches in the x and y directions, respectively. The filenames for these calibration images should also be named in a specific way. For example, the first calibration image for the top left corner of the DMD should read "filenamePrefix_X1Y1.bmp". The prefix before the X#Y# portion in the name doesn't matter, as long as the filenamePrefix variable is updated accordingly. The program then uses the parameters from the cropped and fit calibration images to generate a phase and amplitude map of the system and then uses those maps to generate a holographic grating.

There are a few parameters in this program that need to be tweaked depending on the parameters of the experiment. The first set of parameters that should be modified are in the guessParams function, commented as "Optical System Parameters" (line 49). This is where the wavelength of light, the physical distance between the centers of adjacent patches, the camera pixel size and the focal lengths of the three lenses after the DMD are set. In the section of the code after all the functions are defined is where the image directory paths are set, as well as the cropping coordinates for the images, the number of patches in each direction used for calibration, the center patch location and the radii of the patches (which must match the settings from gratingGenerator.py) (lines144-179). Shortly after this are triggers that can be set to 0 or 1 depending on which part of the code you wish to run. There are many in line comments as well that should describe what the different sections of the code should do.

Potential Issues

Here are some issues that I have encountered while working on this project.

  1. Uploading firmware to the DMD tends to stop working on a given computer after a certain amount of time. An error message that reads something like "Unable to detect Flash Manufacturer ID" will pop up when attempting to upload a firmware to the DMD using the LightCrafter4500 GUI. A temporary solution to this is to try switching computers, however, this will only work for so long as there are a finite amount of computers in existence. I am not sure what causes this issue, and there are many forums that cover this issue, however, I have not found one that is helpful.

  2. If the firmware upload ever fails halfway through, the firmware on the DMD will most likely be corrupted or non-existent. If this happens you will notice a red LED light blinking on the back of the DMD motherboard. A fix for this is to apply a jumper to the J18 jumper pins on the back of the DMD motherboard. This will force it into bootloader mode, allowing the computer to detect it again. Then acces the DMD via the Lightcrafter 4500 GUI and upload the default firmware downloadable from the Texas Instrumenents website. Once the firmware has succesfully uploaded then remove the power from the DMD and remove the jumper from the J18 jumper pins. Information on this can be found in the Lightcrafter 4500 User Manual. NOTE: When uploading firmware to the DMD, ensure that the "Skip Bootloader Update" option is checked, as this will prevent the bootloader from being corrupted.

Future Work

There is still quite a bit of work to be done with regards to this project. I will list a few of the next steps that could be a good starting point for someone picking up this project.

  1. Improving the phase stability of the optical setup by designing a more secure and stable mount for the DMD, as well as improving the stability for the different optical components in the setup as well. This stability is important for creating an accurate phase map, and accomplish accurate phase modulation.

  2. If the phase stability does not improve the results, then a modification to the amplitude modulation section of the code is probably necessary. Also checking the accuracy of the fitting program could be useful, since if the program is yielding inaccurate fitting parameters, the phase and amplitude maps will be incorrect.

  3. A quality of life improvement to the code would be to combine the gratingGenerator.py script and the hologramGenerator.py script. This should be fairly simple.

  4. Once a successful phase and amplitude modulation is performed, the next big step for the project would be to test different target profiles, and see which potentials could be creating using this Fourier plane method.

Contact

If you have any questions, feel free to send me an email at fcorapi@uwaterloo.ca.