Optical phase masks manipulate light by carefully designed geometries that introduce phase accumulation and are essential in many optical systems. They are commonly fabricated using cleanroom lithography or high-precision mechanical processes such as diamond machining and magnetorheological finishing. These methods, however, require costly infrastructure and are poorly suited for rapid prototyping.
Thermocapillary flow is a phenomenon in which temperature gradients along a liquid interface give rise to surface-tension gradients, which in turn drive fluid motion along the surface. In our previous work, we demonstrated that this effect can be used to shape liquid photopolymer films into optical phase masks using a programmable heat map implemented by light projection onto the film; however, that approach lacked sufficient shape accuracy, as the absence of feedback prevented compensation for model uncertainties and disturbances. Here, we present a closed-loop approach that utilizes real-time surface measurements to actively control the film topography. We measure the evolving surface in-situ using a Shack–Hartmann Wavefront Sensor, while a computer-controlled light projector dynamically updates the heating pattern applied to a fluidic chamber. We developed a theoretical model of the thin-film dynamics and used numerical simulations to derive a guidance strategy for driving the liquid toward a desired phase-mask profile. Experimentally, the closed-loop system improves shape accuracy and reduces process convergence time by an order of magnitude, producing customized phase masks within minutes.