mmazzanti / SLMcontroller

A python QT based GUI for controlling SLMs
https://slm-controller.readthedocs.io/en/latest/index.html
GNU General Public License v3.0
4 stars 0 forks source link

SLM controller

SLM controller is a python based GUI software for controlling the phase pattern of an SLM (Spatial Light Modulator).

The software takes care of rendering the hologram on top of any graphical interface of the operative system used. For now it has been tested on windows 10/11, ubuntu 22.04(previous release version) and MacOS.

The software offers various types of static holograms that are normally used in the field of optical tweezers.

From the main window it is possible to add new optical elements and toggle the rendering of the hologram.

Main window

Before doing that however the user should set-up the parameters of his SLM and system. In the settings windows it is possible to set the following parameters :

Program settings

Optical elements

It is possible to add various optical elements through the software. Each optical element will have a control tab where it can be activated/deactivated. The final full phase pattern rendered on the SLM will be the sum of all the active optical elements at the moment the user press "Show hologram/Update"

At the center of the optical element tab it is possible to see a small preview of the pattern associated to that element.

Some optical elements have a "live update" feature. The live update permits to change the parameters of the optical element and automatically re-render the whole SLM pattern each time a value is changed. Beware that this works fine on good PCs but can require quite some time on old PCs or when many optical elements are active at once.

Fresnel lens pattern

It is possible to add a virtual lens on the SLM by generating a fresnel lens pattern (fresnel zone plate). This can be done by adding a new "lens" optical element.

Fresnel lens tab

In the tab it is possible to control the focus of the lens and activate/deactivate it.

Grating

This adds a virtual diffractive grating. It is possible to control the lines/mm of the grating and its orientation. The number of lines per pixel will depend on the size of each SLM pixel.

Grating tab

Flatness correction

This controls the flatness correction pattern typically used to correct for flatness imperfections of the SLM. The SLM manufacturing company normally provides a file for each wavelength supported by the SLM. This can be added to the total pattern by selecting the proper flatness correction for the used wavelength. The flatness correction is normally an image and its size should match the SLM size.

Flatness correction tab

Amplitude Renormalization

Applies an amplitude pattern (renormalized in the range [0,1] where 1 = 255 and 0 = 0) to the SLM surface to normalize its diffractive efficiency when correcting for optical aberrations observed by the camera. By matching the amplitude pattern to the shape of the incoming beam, the diffractive efficiency of the SLM can be equalized across all zones, ensuring consistent interference amplitude and preventing camera saturation or weak signals.

Inverted gaussian mask

Displayed pattern

This is a grayscale image [0,255] of the sum of all optical elements that have been activated. The rendered pattern is calculated as following:

Wrapped pattern = mod(Corrected pattern,256)

Displayed pattern = Wrapped pattern * SLM phase correction /255