Calibration of spatial light modulators suffering from spatially varying phase response

We present a method for converting the desired phase values of a hologram to the correct pixel addressing values of a spatial light modulator (SLM), taking into account detailed spatial variations in the phase response of the SLM. In addition to thickness variations in the liquid crystal layer of the SLM, we also show that these variations in phase response can be caused by a non-uniform electric drive scheme in the SLM or by local heating caused by the incident laser beam. We demonstrate that the use of a global look-up table (LUT), even in combination with a spatially varying scale factor, generally does not yield sufficiently accurate conversion for applications requiring highly controllable output fields, such as holographic optical trapping (HOT). We therefore propose a method where the pixel addressing values are given by a three-dimensional polynomial, with two of the variables being the (x,y)-positions of the pixels, and the third their desired phase values. The coefficients of the polynomial are determined by measuring the phase response in 8×8 sub-sections of the SLM surface; the degree of the polynomial is optimized so that the polynomial expression nearly replicates the measurement in the measurement points, while still showing a good interpolation behavior in between. The polynomial evaluation increases the total computation time for hologram generation by only a few percent. Compared to conventional phase conversion methods, for an SLM with varying phase response, we found that the proposed method increases the control of the trap intensities in HOT, and efficiently prevents the appearance of strong unwanted 0th order diffraction that commonly occurs in SLM systems. © 2013 Optical Society of America OCIS codes: (230.6120) Spatial light modulators; (120.5060) Phase modulation; (090.1970) Diffractive optics; (090.1995) Digital holography; (090.1760) Computer holography; (090.2890) Holographic optical element; (140.7010) Laser trapping; (350.4855) Optical tweezers or optical manipulation. References and links 1. E. Marom and N. Konforti, “Dynamic optical interconnections,” Opt. Lett. 12, 539–541 (1987). 2. P. F. McManamon, T. A. Dorschner, D. L. Corkum, L. J. Friedman, D. S. Hobbs, M. Holtz, S. Liberman, H. Q. Nguyen, D. P. Resler, R. C. Sharp, and E. A. Watson, “Optical phased array technology,” Proc. SPIE 84, 268–298 (1996). #189633 $15.00 USD Received 29 Apr 2013; revised 10 Jun 2013; accepted 13 Jun 2013; published 28 Jun 2013 (C) 2013 OSA 1 July 2013 | Vol. 21, No. 13 | DOI:10.1364/OE.21.016086 | OPTICS EXPRESS 16086 3. E. Hällstig, J. Öhgren, L. Allard, L. Sjöqvist, D. Engström, S. Hård, D. Ågren, S. Junique, Q. Wang, and B. Noharet, ‘Retrocommunication utilizing electroabsorption modulators and non-mechanical beam steering,” Opt.Eng. 44, 045001 (2005). 4. M. Reicherter, T. Haist, E. U. Wagemann, and H. J. Tiziani, “Optical particle trapping with computer-generated holograms written on a liquid-crystal display,” Opt. Lett. 24, 608–610 (1999). 5. E. R. Dufresne, G. C. Spalding, M. T. Dearing, S. A. Sheets, and D. G. Grier, “Computer-generated holographic optical tweezer arrays,” Rev. Sci. Instrum. 72, 1810–1816 (2001). 6. M. A. Seldowitz, J. P. Allebach, and D. W. Sweeney, “Synthesis of digital holograms by direct binary search,” Appl. Opt. 26, 2788–2798 (1987). 7. B. K. Jennison, J. P. Allebach, and D. W. Sweeney, “Efficient design of direct-binary-search computer-generated holograms,” J. Opt. Soc. Am. A 8, 652–660 (1991). 8. G. Milewski, D. Engström, and J. Bengtsson, “Diffractive optical elements designed for highly precise far-field generation in the presence of artifacts typical for pixelated spatial light modulators,” Appl. Opt. 46, 95–105 (2007). 9. R. W. Gerchberg and W. O. Saxton, “A Practical Algorithm for the Determination of Phase from Image and Diffraction Plane Pictures,” Optik 35, 237–246 (1972). 10. M. W. Farn, “New iterative algorithm for the design of phase-only gratings,” Proc. SPIE 1555, 34–42 (1991). 11. J. E. Curtis, B. A. Koss, and D. G. Grier, “Dynamic holographic optical tweezers,” Opt. Commun. 207, 169–175 (2002). 12. D. Engström, A. Frank, J. Backsten, M. Goksör, and Jörgen Bengtsson, “Grid-free 3D multiple spot generation with an efficient single-plane FFT-based algorithm,” Opt. Express 17, 9989–10000 (2009). 13. S. Bianchi, and R. Di Leonardo, “Real-time optical micro-manipulation using optimized holograms generated on the GPU,” Comput. Phys. Commun. 181, 1442–1446 (2010). 14. M. Persson, D. Engström, and M. Goksör, “Real-time generation of fully optimized holograms for optical trapping applications,” Proc. SPIE 8097, 80971H (2011). 15. X. D. Xun and R. W. Cohn, “Phase calibration of spatially nonuniform spatial light modulators,” Appl. Opt. 43, 6400–6406 (2004). 16. J. Oton, P. Ambs, M. S. Millan, and E. Perez-Cabre, “Multipoint phase calibration for improved compensation of inherent wavefront distortion in parallel aligned liquid crystal on silicon displays,” Appl. Opt. 46, 5667–5679 (2007). 17. D. Engström, M. Persson, and M. Goksör, “Spatial phase calibration used to improve holographic optical trapping,” in Biomedical Optics and 3-D Imaging, OSA Technical Digest (Optical Society of America, 2012), paper DSu2C.3. 18. G. Thalhammer, R. W. Bowman, G. D. Love, M. J. Padgett, and M. Ritsch-Marte, “Speeding up liquid crystal SLMs using overdrive with phase change reduction,” Opt. Express 21, 1779–1797 (2013). 19. S. Reichelt, “Spatially resolved phase-response calibration of liquid-crystal-based spatial light modulators,” Appl. Opt. 52, 2610–2618 (2013). 20. Z. Zhang, H. Yang, B. Robertson, M. Redmond, M. Pivnenko, N. Collings, W. A. Crossland, and D. Chu, “Diffraction based phase compensation method for phase-only liquid crystal on silicon devices in operation,” Appl. Opt. 51, 3837–3846 (2012). 21. T. Cizmar, M. Mazilu, and K. Dholakia, “In situ wavefront correction and its application to micromanipulation,” Nat. Photonics 4, 388–394 (2010). 22. R. W. Bowman, A. J. Wright, and M. J. Padgett, “An SLM-based ShackHartmann wavefront sensor for aberration correction in optical tweezers,” J. Opt. 12, 124004 (2010). 23. T. H. Barnes, K. Matsumoto, T. Eijo, K. Matsuda, and N. Ooyama, “Grating interferometer with extremely high stability, suitable for measuring small refractive index changes,” Appl. Opt. 30, 745–751 (1991). 24. A. Bergeron, J. Gauvin, F. Gagnon, D. Gingras, H. H. Arsenault, and M. Doucet, “Phase calibration and applications of a liquid-crystal spatial light modulator,” Appl. Opt. 34, 5133-5139 (1995). 25. Z. Zhang, G. Lu, and F. T. S. Yu, “Simple method for measuring phase modulation in liquid crystal televisions,” Opt. Eng. 33, 3018–3022 (1994). 26. D. Engström, G. Milewski, J. Bengtsson, and S. Galt, “Diffraction-based determination of the phase modulation for general spatial light modulators,” Appl. Opt. 45, 7195–7204 (2006). 27. A. Linnenberger, S. Serati, and J. Stockley, “Advances in Optical Phased Array Technology,” Proc. SPIE 6304, 63040T (2006). 28. D. Preece, R. Bowman, A. Linnenberger, G. Gibson, S. Serati, and M. Padgett, “Increasing trap stiffness with position clamping in holographic optical tweezers,” Opt. Express 17, 22718–22725 (2009). 29. M. Schadt and W. Helfrich, “Voltage-dependent optical activity of a twisted nematic liquid crystal,” Appl. Phys. Lett. 18, 127–128 (1971). 30. A. Linnenberger and Teresa Ewing, Boulder Nonlinear Systems, 450 Courtney Way, #107 Lafayette, CO 80026, USA (personal communication, February 2013). 31. Software available at http://www.physics.gu.se/forskning/komplexa-system/biophotonics/download/hotlab/ 32. M. Persson, D. Engström, and M. Goksör, “Reducing the effect of pixel crosstalk in phase only spatial light #189633 $15.00 USD Received 29 Apr 2013; revised 10 Jun 2013; accepted 13 Jun 2013; published 28 Jun 2013 (C) 2013 OSA 1 July 2013 | Vol. 21, No. 13 | DOI:10.1364/OE.21.016086 | OPTICS EXPRESS 16087 modulators,” Opt. Express 20, 22334–22343 (2012). 33. C. Runge, “Über empirische Funktionen und die Interpolation zwischen äquidistanten Ordinaten,” in Zeitschrift für Mathematik und Physik 46, R. Mehmke and C. Runge, eds. (Druck und verlag von B. G. Teubner, Leipzig, 1901), 224–243.


Introduction
Since the 1980s, liquid crystal (LC) based spatial light modulators (SLMs) have been used for holographic beam steering in optical communication applications [1][2][3].Since the late 1990s the technique has also been used in optical trapping systems to obtain multiple, independently controllable traps.This technique is called holographic optical trapping (HOT) [4,5].Common for all these applications is the desire to efficiently distribute the incident optical power into a number of spots/traps (in this work referred to as "spots", except in the optical trapping experiments described in Section 5. 4.3).For some of of these applications, and HOT in particular, it is not sufficient just to be able to position the spots at the desired locations but it is also important to obtain aberration free spots with well specified optical power.
Similar to static diffractive optical elements, the SLMs used for holographic beam steering are generally only capable of phase modulation, and holograms with good performance are thus achieved only if an iterative optimization algorithm is used.A multitude of algorithms that optimize spot-generating phase-only holograms have been developed, most of which are either direct search algorithms [6][7][8] or, more commonly, variations of the Gerchberg-Saxton algorithm [9][10][11][12][13][14].To obtain the desired relative optical power distribution among the spots, most of the above-mentioned algorithms include a weighting procedure in their iterative cycle; a few different approaches have been suggested, all of them with the same purpose, to force the power in the individual spots to approach their desired values [10][11][12][13][14].
While many such algorithms provide virtually perfect distribution of light to the desired positions, it is ultimately the hologram physically realized by the SLM that determines the performance of the system.In short, an LC-SLM is typically addressed with a two-dimensional matrix of 8-bit integers.Each matrix position represents one SLM pixel, and the integer value corresponds to the desired phase that should be realized.To assure that the realized hologram accurately resembles the desired one, it is crucial to find the correct relation between desired pixel phase and pixel value in the addressing matrix.Commonly, all pixels are assumed to behave identically and thus a global look-up-table (LUT) is used to convert the desired phase, from the hologram optimization algorithm, to the corresponding pixel value for all pixels.
Although a global LUT may work adequately for some SLM types and applications, local variations in the phase response of the SLM often degrade the realized hologram.If the pixel response varies over the SLM and this is not accounted for when the SLM is addressed the optical power in the realized spots will differ from the desired values.Also, an unwanted side effect is that a relatively high optical power generally ends up on the optical axis of the system as the 0th order diffraction.As will be described in more detail in Section 3.1, earlier work has shown that it is possible to correct for a spatially varying phase response, provided the relation between phase and pixel addressing value only changes by a space-dependent constant [15,16].However, a more complex spatially varying phase response of the SLM is frequently occurring and must be compensated for by space dependent LUTs for optimal performance [17,18].The importance of accounting for a spatially dependent phase response of the SLM is emphasized in Ref. 19 with the particular application of holographic imaging, which in this context can be viewed as an SLM producing a very large number of spots where the exact intensities of the individual spots are of less importance.Compared to our work, the spatially resolved characterization of the phase response of the SLM is done differently as well as the pixel value generation, but also here an improved phase modulation accuracy over the entire SLM is achieved, which, in this case, shows as a much improved visual quality of the holographic images, although no quantitative data are given for this improvement.Further, also Ref. 20 deals with compensation for spatially varying response in phase-only SLMs using a space dependent LUT, resulting in improved diffraction efficiency and reduced crosstalk (in other orders than the 0th, which is not measured).However, they only demonstrate single point beam steering with their calibrated system, so it is not clear to what extent their approach would improve the intensity uniformity of multispot patterns and suppress the 0th diffraction order intensity -two factors that are crucially important in HOT applications.
In this work we demonstrate the detrimental impact of a spatially varying phase response and how such response occurs in LC-based SLMs, in Sections 2 and 3, respectively.Our method, applicable for any type of phase modulating SLM, is explained in detail in Section 4 and verified by numerous experiments in Section 5. Finally, the conclusions are given in Section 6.

Impact of a spatially varying phase response on ideal holograms
To illustrate how an ideal hologram, i.e., the spatial phase distribution from the hologram optimization, is affected by a spatially varying phase response of the SLM we have simulated the performance of two different holograms, see Fig. 1.The ideal performance of holograms producing a circle of 14 spots and an array of 24 out of 5×5 spots is shown in Figs.1(d) and 1(g), respectively.Note that neither of the holograms ideally produces a spot on the optical axis.The spot patterns are almost perfect with a uniformity u = 1 − max(P spots ) − min(P spots ) max(P spots ) + min(P spots ) of the spot powers of 98.5% and 97.7% for the circle and array, respectively.Furthermore, the (undesired) power on the optical axis, the 0th order power P 0 , is very low, 0.2% and 0.1% of the total power for the circle and array, respectively.If the SLM induces a static aberration, i.e., the zero-level for the phase varies over the SLM surface, see Fig. 1(b) the spot shape is strongly affected while the uniformity and P 0 are hardly affected at all, see Figs. 1(e) and 1(h).By compensating for such aberrations it has been shown that it is possible to restore the ideal shape of the spots [21,22].
A second type of possible error induced by the SLM is a spatially varying phase response, see Fig. 1(c).This type of phase error increases the power in the zeroth order quite drastically, see Figs. 1(f) and 1(i).The zeroth order is ∼3.5 and ∼5 times stronger than the average spot in the circle and array pattern, respectively.Also, the uniformity among the 24 desired spots of the array drops to ∼72%.Thus, it is important that the phase mapping, i.e., the conversion between desired and realized phase, is accurate also locally on the SLM.

Spatial variations in phase response of LC SLMs
In a reflective LC-based SLM, by far the most commonly used type of SLM for phase modulation, the LC layer is typically sandwiched between a reflective backplane with pixelated electrodes and a transmissive front glass with a common electrode.The modulated phase ϕ of the polarized light exiting such a reflective SLM (thus passing the LC layer twice) is given by Here, λ is the used wavelength, ∆n = n eff − n o is the difference between the effective and the ordinary refractive index of the LC material, and d is the thickness of the LC layer.The effective refractive index, and consequently the phase, for each pixel can be varied (n o ≤ n eff ≤ n e ;  d-f) but for a hologram optimized to produce 24 spots in a 5×5 grid centered on the optical axis; no spot is positioned on the optical axis.The uniformity u and P 0 , the fraction of the total power in the simulation window that falls into the unwanted zeroth order, are given for each case.
n e being the extraordinary refractive index) by rotating the rod-shaped LC molecules in a plane normal to the polarization of the incident beam.This is achieved by controlling the electric field over the pixel, in turn accomplished by applying a voltage over the pixel electrode and the common electrode.The SLM is addressed with an 8 or 16-bit number for each pixel, hereafter referred to as the pixel value (PV), which is converted into voltage by the SLM driving hardware.
Since the pixel phase does not correspond linearly to the PV, and hence the applied voltage, a LUT is typically applied to the hologram, in some cases by the SLM driver itself.Typically a global LUT, which only takes the desired phase as input, is used, and consequently the SLM where ϕ desired (x, y) is the phase of the ideal hologram in position (x, y).The LUT can either be provided by the SLM manufacturer or determined by measuring the phase response of the SLM [23][24][25][26].
Applying a global LUT implies that a pixel's position on the SLM does not affect its phase response.However, this is not always true.In the remainder of this section three experimentally verified reasons why LC-based SLMs often show spatial variations in their phase response are described.

Thickness variations in liquid crystal SLMs
Due to manufacturing issues, the pixelated backplane of the SLM can become slightly nonflat [27].Combined with a flat front glass, a non-flat backplane yields an LC layer with varying thickness d(x, y).Such a thickness variation also affects the electric field applied across the pixels, resulting in a spatially dependent effective refractive index n eff (x, y).Thus, Eq. (2) becomes dependent on x and y and therefore a non-flat backplane results in a spatially varying phase response.
In previously presented work, which focused on such a non-flat backplane imperfection, it has been shown that to compensate for this effect it is sufficient to use a global LUT multiplied by a spatially varying scaling factor f (x, y), hereafter referred to as the "scaling matrix method" [15,16].The SLM is then addressed according to where, for a certain position (x, y), f (x, y) is chosen such that Eq. ( 4) is exactly fulfilled for some fixed value of ϕ desired (x, y), e.g., π or 2π.

Non-uniform electric drive scheme
For nematic LCs only the absolute value of the drive voltage matters for the induced birefringence.To avoid degradation of the LC over time (due to ion migrations) it is, however, crucial that the material is kept DC-balanced, i.e., that the time-averaged applied voltage is 0 V.As an example, in most SLMs fabricated by Boulder Nonlinear Systems this is accomplished by keeping the common electrode (positioned on the front glass of the SLM) at a voltage of 2.5 V while the pixelated backplane electrode is switched between 2.5 −U pixel V and 2.5 +U pixel V at  3. Pixel values yielding a specific pixel phase, ϕ, as determined from measurements with an incident power on the SLM (same device as in Fig. 2), of 50 mW (top row) and 1 W (bottom row).The color scaling shown in the bottom of each column is used both for 50 mW and 1 W. The results were obtained with the method described in Section 4.1.
a frequency of 1 kHz.This results in a maximum usable voltage U pixel of 2.5 V, for backplane electrode voltage switching between 0 and 5 V.
To allow for real-time experiments, e.g., position clamps, [28] a short response time of the SLM is crucial.For an LC-based device the response time τ is proportional to d 2 /(E LC +C LC ) where E LC is the electric field applied over the LC and C LC is a material constant [29].Thus, it is beneficial to increase the electric voltage applied across the SLM pixels.Recently, the company introduced a new drive scheme that allows twice as large applied electric field without increasing the backplane voltage.By time sequentially toggling the voltage on the common electrode between 0 V and 5 V and the backplane voltage between U pixel and 5 − U pixel , the full backplane voltage of 5 V can be utilized while the LC is still DC-balanced [30].However, since the pixel electrodes are switched sequentially (row by row, or similarly), i.e., at slightly different times relative to the switching of the common electrode, the latter approach often induces a spatially varying phase behavior.
This effect is exemplified in Fig. 2, which shows the realized phase response from 8×8 regions of an SLM.As all the curve shapes are different, no spatial scaling function can yield an accurate phase mapping.

LC heating induced by high laser power
For applications requiring high optical power in the incident beam, heating of the LC material can affect the phase response.Since the intensity usually varies across the surface of the SLM, e.g. for a Gaussian beam, the change in phase response may also be spatially different.Figure 3 shows the measured local phase response in different locations of an SLM for an incident power of 50 mW and 1 W. The measurements show a rather complicated relation between realized phase and pixel value; a region can demand a relatively high pixel value to reach a phase of π/2 but a relatively low value to reach 2π.It is also evident that the LUT (or a more advanced addressing scheme) must be determined using the same power of the incident beam as in subsequent experiments.

Method
Here we first describe how the phase response of the SLM is spatially characterized and then how a hologram is converted to a PV matrix using a 3D polynomial prior to being addressed to the SLM.

Phase modulation characterization
In order to characterize the SLM in-situ with a minimum of modifications of the setup, a diffraction-based method was used.This avoids the problems with an interferometric approach or mapping of the phase as a grayscale intensity [19], both of which techniques require additional optical components to be inserted or repositioning of the camera.In a diffraction based method, a set of simple holograms is displayed on the SLM, and the phase modulation is determined by measuring the varying intensity in the resulting diffraction spots [25,26].
To determine the localized phase response, the SLM is divided into subregions, typically 8×8, and a sequence of holograms with only two phase levels, realized as linear gratings with 50% duty cycle, is displayed on one subregion at a time, while the rest of the SLM is blank, see Fig. 4(a).In each sequence, one phase level is kept constant and the other is stepped through the range of pixel values to be characterized.For each displayed hologram, the intensity is measured in either the +1st or −1st diffraction order, see Fig. 4(b).The measured data from each region is then normalized such that the maxima corresponding to a phase of π equal one; a typical result is shown in Fig. 4(c).Finally, the phase is calculated according to (PV), between first maximum and first minimum (5) where PV) , i is the region index and p norm i,±1 (PV) ∈ [0, 1] is the normalized power in the ±1st order for region i.

Fitting a 3D polynomial to the measured data
The aim here is to find a 3D polynomial f (ϕ desired , x, y) that gives the optimal PV for a desired phase value ϕ desired at the position on the SLM given by x and y.To do this, the determined relations between ϕ desired and PV for all measured SLM regions are arranged in a linear equation system.Exemplified using a polynomial of the seventh order we end up with where N is the number of SLM subregions used for the fit, K is the number of measured phase levels, c T contains the coefficients that determine the polynomial, and M is the number of terms in the polynomial.In the example given above, with a polynomial of the seventh order, M = 120.Each row in the matrix on the left side contains the polynomial terms for a set (ϕ, x i , y i ) and on the same row in the vector on the right side is the corresponding PV that yielded the phase ϕ.Here, x i and y i correspond to the coordinates defining the center of SLM subregion i.Finally, the coefficients are obtained by solving the, generally overdetermined, linear equation system in Eq. ( 6).

Phase compensation using the 3D polynomial
Once the polynomial coefficients are determined, it is straightforward to convert a desired phase hologram, ϕ desired (x, y), to the suitable PV matrix; for each SLM pixel the PV is given by the polynomial PV(ϕ desired (x, y), x, y) = f (ϕ desired (x, y), x, y).
For test purposes the conversion was done either in Matlab or LabVIEW.The calculation time needed to convert a 512×512 element phase hologram to an equally large PV matrix was roughly 10 s.For real applications, such as the trapping experiments presented in Section 5.4.3, the method was implemented in the parallel programming language CUDA for C. In the latter case the calculation time was ∼0.13 ms and thus it is possible to generate optimized holograms and convert them using the 3D polynomial at a rate higher than 100 Hz [14,31].In most cases this means that the SLM response time, rather than the hologram and PV calculation time, is the bottleneck of the HOT setup.

Optical setup
The optical tweezers setup, illustrated in Fig. 5, was built around a motorized inverted epifluorescence microscope (DMI6000B, Leica Microsystems).The laser beam (1070 nm, IPG Photonics) was first magnified by an afocal telescope to match the beam diameter to the full width of the SLM (HSPDM512 1064-PCIe, Boulder Nonlinear Systems).The SLM has a flat, highly reflective dielectric mirror that covers the backplane electrodes.A second afocal telescope was used to image the SLM plane onto the back focal plane of the microscope objective (100×, NA 1.3).The magnification of the second telescope was chosen such that the output The HOT setup is composed of a laser (λ =1070 nm), a polarizer (P), planoconvex lenses L 1 (focal length 150 mm), L 2 (120 mm), L 3 (400 mm), and L 4 (300 mm) with anti-reflection coating, an SLM, a microscope objective, and a camera.A halogen lamp, a condenser lens, and an IR blocking filter enable bright field imaging.(b) During characterization the SLM was locally addressed with binary gratings, the 0th order was blocked outside the microscope using a beam block (BB), bright field illumination was turned off, and the IR blocking filter was removed to allow detection of the laser light reflected off a cover glass or mirror.For P SLM ≥ 0.5 W, a reflective ND filter was also inserted outside the microscope to decrease the power reaching the camera.
beam slightly overfilled the back aperture of the microscope objective.The microscope objective then forms the spots/traps in the vicinity of its imaging/trapping plane.A camera (Photonfocus MV-D1024E-160-CL, pixel size 10.6µm×10.6µm) was used for capturing bright field images except for the trapping experiments described in Section 5.4.3.
Following the approach described in Section 4.1, we characterized our SLM in-situ within the HOT setup.Only minor adjustments of the HOT setup were made, see Fig. 5(b).First, the IR filter positioned in front of the bright field camera was removed in order to image the reflection of the trapping laser.Second, the 0th order spot was blocked outside the microscope.For measurements with high optical power incident on the SLM, P SLM ≥ 0.5 W, a reflective ND filter (optical density 2-3) was also placed in the beam path outside the microscope.The latter modifications were done in order to reduce the amount of light incident on the camera.Since only 1/64 of the SLM area is used to diffract light to the 1st order in each sequence, the optical power in the 0th order is very high and might even damage the camera sensor.
A cover glass (or a mirror in case of a full SLM evaluation) was placed in the image plane of the microscope so that the reflection of the diffraction spots in its upper surface was focused on the camera sensor.As the corners of the SLM were blocked by the circular aperture stop of the microscope objective, only the central 52 of the 8×8 subregions were characterized and used for fitting the polynomial coefficients.

Phase characterization
Characterization was done at a number of different optical powers incident on the SLM.The binary gratings used had a large period of 16 pixels to minimize pixel crosstalk [8,32] .Figure 6(a,c) shows the normalized power in the 1st diffraction order as function of PV for the different subregions of the SLM, measured at incident powers of 50 mW and 1 W.Each curve corresponds to the measurement for a certain subregion.To obtain this normalized curve, the Fig. 6.Measured results for 52 regions (out of 8×8), all giving a strong enough optical signal through the microscope objective.The binary gratings had a period of 16 pixels.(a) Normalized measured power in the 1st diffraction order as function of the addressed PV and (b) desired PV as function of the desired phase for an incident power onto the SLM of 50 mW.(c) and (d) similar to (a) and (b) but for an incident power of 1 W. Inset shows which color corresponds to which area of the SLM.Table 1.Measured PVs that yield a phase of ϕ = π, 2π, and 3π.Data is given for an incident power of 50 mW and 1 W. The range of PVs for each phase and optical power is the minimum and maximum value among the measured 52 subregions.directly obtained intensity versus PV curve was first used to find the PV values at which the different local minima and maxima occurred, corresponding to values of ϕ i = π, 2π, etc.This raw data curve was then normalized in segments between these PV values, by subtracting a constant "dark intensity" and multiplying by an appropriate constant, such that the value is either zero or one at the beginning and end of each segment, depending on whether ϕ i is an even or odd integer of π in that position.The phase ϕ i (PV) was then extracted from the normalized curve according to Eq. ( 5) and is shown in Figs.6(b) and 6(d) for all subregions.Table 1 shows the ranges of PV that yield a phase of π, 2π, and 3π somewhere on the SLM.From these measurements, it is evident that the phase response varies drastically across the surface of the SLM.In some cases, the obtained phase modulation differs by π for the same PV in different positions on the SLM.As a remark, this spatial variation in the phase response is larger than for the SLM used in Ref. 19, so its correction should be at least as difficult.We also note that the phase response is highly dependent on the optical power of the incident beam.This underlines our statement in Section 3.3; the SLM should be characterized using the same optical power as used in the real application.

Polynomial fitting and accuracy
To determine the optimal polynomial order, the error between the measurements and the polynomial fit for orders between 3 and 9 were calculated, see Fig. 7. First, each polynomial was used to calculate the PV matrix (512×512 elements) for 20 equidistant phase values between 0 and 2π; Fig. 7(a) shows the error in PV between the measurements (averaged for each subregion) and the polynomial of 7th order for four of these phase values.By averaging the PVs obtained from the polynomial for each subregion and phase value, the phase response could be determined from the measurements.For each subregion the mean and maximal phase error (among the 20 phase values) were determined.The largest mean and maximal phase error from all 52 subregions and 32 most central subregions are shown in Figs.7(b) and 7(c), respectively.As seen, for the central part of the SLM the phase error decreases with higher orders, while if all measured subregions are used the error increases for polynomials of orders 7-9.This is caused by Runge's phenomenon [33], i.e., the polynomial fitting starting to induce oscillations at the edges of the fitting region as the polynomial becomes higher; this is seen in the top parts of the sub figures in Fig. 7(a).Runge's phenomenon is one disadvantage of using a single continuous polynomial for the entire SLM, but on the other hand this makes the number of parameters in the phase-to-pixel value conversion method quite small, 120 in our case for a seventh order polynomial.Also in Ref. 19 global polynomials are used, but in this case each of 256 desired phase levels is associated with a globally defined polynomial which gives the required pixel value in any position of the SLM.Since a rather well-behaved SLM is used in this case, it is sufficient to use a polynomial which is the sum of only the four lowest Legendre polynomials, and thus the total number of parameters in their method is 4×256.As a contrast, in Ref. 20 a LUT is created for each pixel and each desired phase, yielding a much larger number of parameters.For pixels that are not located precisely at a measurement position (this SLM is characterized by measuring in 4×3 positions on the SLM surface, just as for the SLM in Ref. 19) linear interpolation between the nearest measurement positions is used, so Runge's phenomenon will not appear.
As the number of terms in the polynomial increases rapidly with the polynomial order and the decrease in phase error (Fig. 7(c)) is negligible for orders 7-9 we decided to use a polynomial of 7th order.We disregard the small increase in phase error for polynomial orders 5-7 seen in Fig. 7(b) since most of the laser power falls on the center of the SLM.For a polynomial of 7th order the largest maximum phase error is 0.46 (0.33) rad and the largest mean phase error is 0.33 (0.11) rad if the 52 (32) central SLM subregions are used in the analysis.

Method evaluation
The performance of the 3D polynomial method was evaluated using three different methods: by applying sequences of binary gratings to subregions of the SLM, by applying full-frame holograms and comparing the desired and obtained spot intensities, and finally in optical trapping experiments, where the obtained trap stiffness for each trap was determined by Brownian motion analysis.In the binary grating and full frame hologram measurements, the method was compared to the use of a global LUT and to the use of the scaling matrix method, where f (x, y) is chosen such that Eq. ( 4) is fulfilled for ϕ desired = π.In the optical trapping experiment, the method was compared to the use of a global LUT.

Binary gratings covering a subregion of the SLM
The binary grating measurements were done similarly to the presented calibration method.The grating period was still 16 pixels and a sequence of gratings was used; one of the two grating levels was changed in the sequence.However, instead of stepping the PV from 0 to 255, the desired phase ϕ desired was stepped from 0 to 2π.The three tested methods for converting desired phase to PV were then used to convert each grating to the corresponding PV matrix.Finally, the power in one of the 1st diffraction orders was measured and normalized to the maximum value and the realized phase was calculated using Eq. ( 5).
In Fig. 8, the normalized power and realized phase are plotted against the desired phase for the three methods.Ideally, the normalized power, see Figs. 8(a)-8(c), should follow a sinesquared curve with a period of 2π, and the phase response curves, see Figs. 8(d)-8(f), should have a constant slope of 1 and no offset.While the scaling matrix method brings the phase response curves closer to the ideal line -the maximum error is reduced from 0.8π to 0.6πit fails to compensate for their varying shapes.With the 3D polynomial method, the response curves are brought much closer to the ideal line and the maximum error is reduced to 0.3π.

Holograms covering the full SLM
The PV calculation methods were then evaluated by studying the spot intensities for full frame holograms.In these measurements, the zeroth order was not blocked.Its intensity was instead measured and used to further judge the performance of the used methods.The measurements were performed using 1 W optical power incident onto the SLM.This power yields a stronger phase response variation over the SLM area than ≤0.5 W and is also a more realistic power used for trapping.
Binary gratings covering the entire SLM were first used in a way similar to the previously described sub-region measurements; the desired phase in one of the grating levels was kept at zero and the other level was stepped from zero to 2π.Again, a grating period of 16 SLM pixels were used.The powers in the zeroth and the two first diffraction orders were measured using a camera.The power in the two first diffraction orders should then ideally vary as P tot (2/π) 2 sin 2 (ϕ/2) and the zeroth order should vary as P tot cos 2 (ϕ/2), where P tot is the total power in the trapping plane.Thus, the zeroth order should completely vanish at ϕ = π and equal P tot at ϕ = 2π and the first diffraction orders should completely vanish at ϕ = 2π.In Fig. 9, the powers for the three measured diffraction orders are plotted for each of the three methods.The difference between the three methods can be seen most clearly in the extreme values.For the zeroth order, the minima equal 0.19P tot , 0.26P tot , and 0.074P tot for the three methods, respectively.At ϕ = 2π the zeroth order equals 0.91P tot , 0.96P tot , and 0.97P tot and the highest of the two 1st order powers equals 0.16P tot , 0.069P tot , and 0.028P tot , respectively.The phase for which the 0th order minimum and ±1st order maxima is found equals 1.05π, 0.88π, and 0.93π radians for the three methods, respectively.Also, an analysis of the shapes of the curves shows that the global LUT and the 3D polynomial give an equally decent fit to the ideal sinesquared shapes while the scaling matrix method degrades the curve shapes.As seen, none of the methods removes the 0th order completely for a phase step of π radians, nor do the first orders completely vanish when the phase step reaches 2π.The reason for this might be that the spatial phase response is still not perfectly corrected for.However, a more pronounced effect is likely that the realized phase gratings are smeared out due to pixel crosstalk resulting in non-ideal "binary" gratings [8,32].In summary, the measured results on binary gratings show that the 3D polynomial gives the best results while the scaling matrix method actually yields slightly worse results than the global LUT.Similar results were obtained for P SLM = 50 mW, 0.5 W, and 1.5 W.
Two holograms with a more complicated phase modulation were also used.One producing 14 spots equidistantly distributed on a circle with radius 0.1875α max and one producing 24 spots forming a regular 5×5 grid with a spacing of 0.125α max ; the center position excluded.Here, α max = sin −1 (λ /2p) is the maximal steering angle allowed by the pixelated SLM; p is the pixel pitch.Both spot arrangements were centered on the optical axis.The two holograms were optimized using a modified Gerchberg-Saxton algorithm to obtain nearly perfect theoretical uniformity [14].For each hologram and phase conversion method, the power in the desired spot positions and the 0th order spot were measured.The uniformity of the spot powers and the power in the 0th order spot were used to assess the performance of the three methods.
In Figs.10(a)-10(c) measured results are shown for the hologram producing a circle containing 14 spots.First of all, it is clear that the unwanted optical power on the optical axis decreases as the phase-to-PV conversion method becomes more accurate.For the data shown in Figs.10(a)-10(c), 8.9%, 6.9%, and 2.9% of the captured power falls into the zeroth order.Furthermore, a power uniformity of the 14 spots of 85%, 84%, and 85% is obtained for the three different conversions methods, respectively.Similar results were obtained also for the hologram producing 24 traps out of a 5×5 grid, see Figs. 10(d)-10(f).The measurements show that 7.5%, 6.7%, and 2.7% of the captured power falls into the zeroth order and the uniformity (among the 24 desired traps) was 70%, 69%, and 70% for the three methods, respectively.Here, a higher uniformity was expected for the 3D polynomial method (see simulated results in Fig. 1).However, the reflective measurements are very sensitive to the mirror position and orientation.Thus, with this method it is very difficult to verify any possible increase in the uniformity.

Holographic optical trapping
Finally, the 3D polynomial method was used for trapping and its performance was compared to the use of a global LUT.Since the scaling matrix method had not shown any real improvement over the global LUT method, as described in previous subsections, it was not implemented in CUDA and thus not tested for optical trapping.Prior to the measurements, an IR-filter was mounted onto the camera to block the trapping laser and make it possible to capture clear bright field images, see Fig. 5(a).Also, a camera allowing for a faster frame rate was used (EoSens CL MC1362, Mikrotron GmbH, pixel size 14µm×14µm).
Five silica beads (diameter of 2.56 µm) suspended in water were trapped and positioned with a spacing of 7.6 µm along the x-axis; the central bead coinciding with the optical axis.To obtain bright field images suitable for bead position determination the traps were positioned in a plane 2.4 µm in front of the imaging/trapping plane of the microscope objective.The latter plane coincides with the imaged Fourier plane of the SLM, which is the plane where the 0th order spot is located.The 2.4 µm longitudinal displacement of the traps was accomplished by including a spherical phase curvature when optimizing the hologram.Finally, the sample was placed such that the beads were positioned 10 µm above the glass substrate.
Keeping the incident laser power onto the SLM at 1 W this was repeated for two different holograms designed to yield 10% and 20% of the total power in each of the traps, respectively.To achieve 10% of the total power in each of the 5 traps, the hologram dumped half of the laser power outside the measurement window.By allowing for power to be dumped when calculating the hologram, the intensity distribution within the measurement window can be even closer to the desired one.In particular, the theoretical power in the five traps can be virtually identical, yielding a perfectly uniform trap stiffness [14].The second case, 5 traps each containing 20% of the total power, means that the algorithm tries to maximize the diffraction efficiency without deliberate power dumping, giving very nearly, but not quite, uniform intensity in the trap positions.
The beads were monitored by capturing bright field images at a rate of 8192 frames per second for a duration of 100 s.The positions of the beads were determined in each frame using a center-of-mass calculation after subtraction of the dark signal non uniformity and a constant threshold value.Although the conditions are static the beads move due to Brownian motion.The power spectrum of the position of a bead gives information about the trap stiffness, i.e., how strongly the bead is held in the trap, which in turn is an indication of the intensity of the focused light in the trap position.To minimize the impact of drift the position data was divided into 0.25 s long segments that were used to calculate the power spectrum.In Fig. 11 the average of 100 such power spectra are shown for each of the five beads.
From Figs. 11(a)-11(d) it is clear that the 3D polynomial method yields more similar trapping conditions in the five traps than the global LUT method, as evidenced by the more similar power spectral density curves for the five beads.This is primarily an indication of a considerably more uniform trap stiffness.For a desired trap power of 10% of the total power the mean trap stiffness is 0.33•10 −3 pN/nm and 0.36•10 −3 pN/nm for the global LUT and the 3D polynomial, respectively; the trap stiffness uniformity, calculated with the maximum and minimum stiffness values similarly to Eq. ( 1), is 90% and 96%, respectively.For a desired trap power of 20% of the total power the mean trap stiffness is 0.65•10 −3 pN/nm and 0.68•10 −3 pN/nm for the global LUT and the 3D polynomial, respectively.Furthermore, the trap stiffness uniformity is 81% and 94%, respectively.Thus, the 3D polynomial method increases both the trap stiffness of the traps and the uniformity thereof.
As seen in Figs.11(a)-11(d), all five beads have roughly the same behavior.Thus, the bead in the middle trap, coinciding with the optical axis, is not strongly influenced by the 0th diffraction order spot positioned in the imaging/trapping plane 2.4 µm behind it.However, when a hologram optimized to yield five traps with a desired power in each trap equal to only 2% of the total power, for the global LUT method the 0th diffraction order spot is strong enough to capture the bead from the middle trap, see Fig.  generated configurations of intensity spots and optically trapped beads confirm that the SLM behaves more ideally than when previously proposed conversion methods are used.The main advantages are that the unwanted 0th diffraction order, i.e., optical power on the optical axis of the system, is strongly suppressed, and that the optical power is more accurately distributed among the desired spots/traps.In HOT, the suppression of the 0th diffraction order is a major improvement as it means that unwanted particles being drawn into the optical axis, typically in the center of the measurement region, is no longer such a severe problem.Thus, there is no need to block the 0th diffraction order outside the microscope.Instead, traps close to -or even coinciding with -the optical axis behave as any other trap.Furthermore, the 3D polynomial method has shown to increase both the trap stiffness and the trap uniformity.
Since the conversion method is applied only after the desired phase pattern/hologram has been found, the optimization method used to calculate the hologram is not critical to the conversion method.Hence, the method can be used with holograms optimized with any algorithm.For instance, we are currently using the method together with an algorithm that creates holograms that minimize the pixel crosstalk effect [32].
Even though this work has focused on HOT, the benefits of the scheme presented here can be utilized in any applications in which an SLM is used for phase modulation.As a straightforward further development of the method, to improve the behavior of the polynomial in the outer parts of the SLM, i.e., decrease the impact of Runge's phenomenon, dummy data points may be introduced outside the measured area of the SLM.
The 3D polynomial method adds calculation time to the hologram generation cycle.However, utilizing our implementation in CUDA, the conversion time for a 512×512 element hologram is merely ∼0.13 ms.This means that if holograms are created at a rate of 100 Hz, the PV conversion needs less than 2% of the time window, leaving enough time to use an accurate optimization algorithm resulting in holograms with a near-ideal performance.

Fig. 1 .
Fig. 1.Simulated results.(a) Segment (64×64 pixels) of an optimized hologram generating 14 spots in a circle centered around the the optical axis; black and white corresponds to a phase of 0 and 2π, respectively.SLM imperfections: (b) static aberration (same color mapping as in (a)) and (c) spatially varying phase response; the phase response changes in the horizontal direction over the SLM.Inset shows which color corresponds to which area of the SLM.Simulated far-field patterns for (d) the ideal hologram in (a), (e) the ideal hologram with the static aberration in (b), and (f) the ideal hologram encoded with the spatially varying phase response in (c).(g-i) Similar as (d-f) but for a hologram optimized to produce 24 spots in a 5×5 grid centered on the optical axis; no spot is positioned on the optical axis.The uniformity u and P 0 , the fraction of the total power in the simulation window that falls into the unwanted zeroth order, are given for each case.

#Fig. 2 .
Fig.2.Measured phase response for 8×8 regions (each 64×64 pixels large) of an SLM (HSPDM512 1064-PCIe, Boulder Nonlinear Systems) as function of the addressed pixel value; the shape of ϕ realized as function of the pixel value varies over the SLM.

Fig. 4 .
Fig. 4. Phase characterization method.(a) subregion i of the SLM is addressed with a binary grating.(b) Four binary gratings and their resulting diffraction patterns.The area in the measurement plane used to determine the power in the +1st order is indicated.(c) Normalized optical power in the +1st order as function of the pixel value.(d) Extracted phase modulation as function of the pixel value.In (c) and (d) the indicated numbers correspond to the four gratings shown in (b).

Fig. 5 .
Fig. 5. (a)The HOT setup is composed of a laser (λ =1070 nm), a polarizer (P), planoconvex lenses L 1 (focal length 150 mm), L 2 (120 mm), L 3 (400 mm), and L 4 (300 mm) with anti-reflection coating, an SLM, a microscope objective, and a camera.A halogen lamp, a condenser lens, and an IR blocking filter enable bright field imaging.(b) During characterization the SLM was locally addressed with binary gratings, the 0th order was blocked outside the microscope using a beam block (BB), bright field illumination was turned off, and the IR blocking filter was removed to allow detection of the laser light reflected off a cover glass or mirror.For P SLM ≥ 0.5 W, a reflective ND filter was also inserted outside the microscope to decrease the power reaching the camera.

Fig. 7 .
Fig. 7. Accuracy of the polynomial.(a) Difference in PV between the measured average and the values given by the fitted polynomial of 7th order for a desired phase of π/2, π, 3π/2, and 2π.(b) and (c) Largest maximal absolute error and largest mean absolute error in phase for the 52 and 32 most central SLM regions, respectively.An incident laser power of 50 mW was used.

Fig. 8 .Fig. 9 .
Fig. 8. Phase conversion comparison using gratings covering individual SLM subregions.(a-c) Measured power in the first diffraction order as a function of the desired phase for binary gratings converted using (a) a global LUT, (b) the scaling matrix method, and (c) a 3D polynomial.(d-f) Realized phase (derived from data shown in(a-c)) as a function of desired phase for binary gratings converted using (d) a global LUT, (e) the scaling matrix method, and (f) a 3D polynomial.The incident power on the SLM was 0.5 W.

Fig. 10 .
Fig.10.Measured spot patterns for optimized holograms producing (a-c) 14 traps in a circle centered on the optical axis and (d-f) 24 traps in a 5×5 grid (0th order omitted).Phase-to-PV conversion made using (a,d) a global LUT, (b,e) the scaling matrix method, and (c,f) a 3D polynomial.An incident power of 1 W onto the SLM was used.