Opto Engineering® - 20 years
Home Ressourcen Tech notes
Liquid Lens

The purpose of this document is to guide you through the usage of a liquid lens. We will discuss the different modes of use, then move on to some technical considerations to keep in mind when using this kind of optics, and how to set them using Opto Engineering Products. In this document we will provide information about liquid lenses technology integrated by Opto Engineering. Other kinds of liquid lenses and adaptive optics exist but we will not delve into that topic.
If you are looking for technical details on the products, their features and specifications, we recommend that you always refer to the product manuals.

Introduction

Throughout the machine vision industry, it has always been a challenge to achieve a good focus on 3D and thick objects or to quickly set the best focus on various objects at different distances. This challenge is even more difficult when the optical performance required by the application must be high in terms of resolution, distortion or perspective error.

The Depth of Field (i.e.: the range of distances from the lens where the acquired image shows an “acceptable” focusing) of the vision system is limited by several specifications, among the most important ones there are the diameter of the aperture stop (i.e. the working f-number) and the magnification, which are both specifications of the optics.

Since the Depth of Field increases proportionally to the f-number increase, vision systems which require long focusing ranges usually implement high f-number values. This choice creates drastic limitations on both the achievable image brightness and resolution, limiting the acquisition speed and the overall performance of the vision system.

Depth of Field also increases inversely proportional to the square of the magnification, then vision systems which require long focusing ranges must accept small magnification values, and consequently the achievable image resolution is strongly limited. In other words, it is very difficult to distinguish small details in the acquired image on a long Depth of Field range.

An example is entocentric lenses (e.g. fixed focal lenses) with low values of focal lengths, which allow to achieve long Depth of Fields. This approach is only possible when the Field of View to be acquired is wide and the working distance (i.e.: the distance between the object and the lens) is long. Because of these, the overall resolution is drastically limited and usually the acquired image shows high distortion and perspective errors.

The same concepts could be extended to telecentric as well as hypercentric lenses, and it is a general limitation to all types of optical systems.

Traditional approaches to overcome those limitations usually require the acquisition of multiple images where the focus is set at different working distances.

Combining these images, it is then possible to use high magnification and low f-number to obtain images with high resolution on a large distance range or, in other words, to increase the Depth of Field in the final processed image.

Typical systems to do that either use additional mechanics (e.g.: a movement of the vision system along the vertical axis) to change the distance between the camera and the focusing plane, or multiple cameras focused on different distances. When it comes to vision system integration and software elaboration these become strong limitations in terms of size, reliability and complexity.

In particular, the first solution has limitations in terms of size, speed and reliability. The second one results in a multiplication of equipment costs.

Liquid lens is a technology which allows focus adjustment by an electrical signal instead of a mechanical regulation of the lenses’ positions inside the optics.

This technology allows focusing within few milliseconds by remote focus control, enabling the fast acquisition of images at the best focus over a distance range typically much longer than the Depth of Field of the optical system.

The Technology

The liquid lens is a cell containing a liquid, that is sealed off with an elastic polymer membrane, wrapped in a voice coil. The current is driven through the coil to produce a magnetic field, that causes the membrane to change its shape. By changing the shape, the performance of the whole optical system changes, and the parameter that is affected the most by this is the working distance. Changing the shape of the liquid lens lets you focus on different planes within a certain range which depends on the design of the optic. This means that we are effectively able to refocus the optic at a different working distance by means of an electrical signal.

The liquid lens technology allows for a faster refocus compared to mechanical focusing by step motors or hand adjustment. Furthermore, the focus is more precise compared to the rotation of a focusing gear. This is a strong advantage of this technology because it increases repeatability across different systems and different focus positions.

For what concerns the dimensions, the liquid lenses diameters are in the order of few centimeters considering both the lens clear aperture and the electronics to control its shape. Additionally, a change in lens radius in the order of few micrometers allows a working distance variation equivalent to moving the entire lens several centimeters in a mechanical focusing system. The electronics needed to control the lens only require a small Hirose 6 pin connector on the side of the optics. The design is compact and robust, and high reliability is also guaranteed thanks to a billion cycles of tests. In addition, due to the absence of moving parts, it has a lower chance of breaking.

Liquid lenses can be driven in two different manners. One is power mode, and the other is current mode. In the following chapters, we are going to show in detail how to use the two modes and the benefits of each one.

Power Mode

Driving a lens in Power mode means setting the value of the liquid lens optical power. Since the lens working distance depends on the lens optical power, power mode allows a direct control on the working distance (i.e.: distance from the optics where the object is at the best focus).

This kind of control is particularly useful for industrial applications because it allows the lens to operate at a constant power and working distance.

Moreover, the relationship between the working distance and the optical power is typically linear, hence the power mode operation allows the user to easily set the best focus distance.

The focal power in a liquid lens is a function of both the temperature and the current provided to the lens, a change in temperature is proportional to a change in focal power. In a real word scenario, the temperature keeps changing due to the heat generated by the camera, the liquid lens operation, and the continuous variations in the environment temperature.

Operating the lens in power mode, a sensor integrated in the liquid lens monitors the temperature, and the current is continuously adjusted to maintain the focal power constant. This mode is useful because the focus remains constantly stable during image acquisition.

`Focal Power [dpt] = f(Temperature [C°], Current [A])`

Current Mode

This mode allows setting the value of current provided to the liquid lens.

While this operation method is useful to maintain a constant current, it should be noted that the optical power could change due to changes of the liquid lens temperature. Since the distance of best focus depends on the lens optical power, current mode operation is less reliable in setting the best focus distance compared to the power mode, because the actual focal power may change over time.

This mode can be useful for applications where the environmental temperature is constant. In fact, when the liquid lens starts operating it usually heats until a convergence temperature. Once this has been achieved the current can be used to set the focus if the environmental temperature is also stable.

On some lenses this is the only possible mode as not all lenses are equipped with a temperature sensor which is needed for the focal power calibration. These liquid lenses usually feature a more compact design, because they do not integrate the temperature sensor and the electronics to compensate for temperature drifts and could be an interesting solution when the space constraints are thigh in the design of the overall optics.

Finally, applications where image acquisition is fast and which require changing or adjusting the focusing distance at every image acquisition are suitable for current mode operation, for example when samples’ dimensions or positions are unknown or variable and focusing requires a scanning on the distance range, when autofocusing is implemented or when the focusing distance needs to be continuously changed (e.g.: moving vision systems).

Technical Considerations on using a Liquid Lens

Delay

When the optical power of the lens is changed there will be a delay before the new configuration takes effect. This delay is composed of two different times: the Response Time and the Setting Time.

The response time is defined as the rising time when applying a current step, this delay is fixed and will appear every time that the configuration of the liquid lens is changed. The value depends on the model of the liquid lens used and it can be found in the datasheet of the product.

The setting time is a delay which appears due to the fluid nature of the liquid lens material. Since a force is applied to a liquid material it will need some time to stop its motion and assume a new position, this is the setting time. The maximum setting time can be found on the datasheet of the specific optics. This value is always reported as a maximum and it is defined as the time needed to stop the motion when moving the liquid lens from one end to the other of the range of possible values.

Delay is an important parameter in those applications which require acquiring images at different working distances. The vision system synchronization must consider the delay, and the camera exposure time must begin after the response time and setting time have been completed.

In fast imaging the liquid lens delay could become a critical parameter, the choice of the proper liquid lens should consider this parameter to be:

`"delay" < 1 / (2*cameraFrameRate)`

Temperature Drift

As it has already been explained in the chapter dedicated to Power Mode, the temperature plays a crucial role when dealing with liquid lenses. When there is a change in temperature, if the lens is controlled in current mode, the optical power also changes.

The best way to compensate for this effect is to use Power Mode, which allows to set a fixed value of Focal Power that will be kept constant by a regulation of the current supplied to the lens depending on its temperature. However, it is possible to use this mode only with lenses that integrate a sensor for reading the temperature.

The relation between temperature and optical power is complex, hence when power mode is not available and the application requires a fixed working distance during a certain period, the best way to operate a liquid lens is to keep the temperature constant during this period. There are two main factors which contributes to the change of temperature:

  • The environment where the liquid lens is operated.
  • The heat generated by the vision system.

The first piece of advice is to keep the ambient temperature as constant as possible by proper heat isolation and dissipation, for example using fans or passive dissipators.

As for the heat generated by the vision system, this usually rises to a certain temperature when the vision system starts functioning and then it stabilizes around a more constant value. This heat is mainly caused by the liquid lens operating and the camera, which being connected to the optics, can dissipate some heat on that. We suggest setting the current value of the liquid lens after the temperature is stable, this could take some time when starting up the vision system but will result in a more stable focus.

Since part of the heat generated by the vision system is dissipated in the working environment, we also recommend properly installing the devices considering their heat dissipation. Devices such as cameras, high power illuminators and controllers can generate a big amount of heat and it is recommended to install these directly in contact with metal plates and heat dissipators.

Calibration

When dealing with accurate measurement systems, calibration is one of the most trivial steps to perform correctly to obtain an accurate measurement.

When changing the focal power of a liquid lens we are effectively changing the working distance of the lens, this means that also the magnification will change. This is true not only for entocentric optics but also for telecentric optics whose telecentricity is not perfectly zero. With this kind of optics, a typical magnification change could be in the order of 2% for the full working distance range. This variation could be negligible for applications where telecentric optics are mainly needed to avoid perspective errors, but it could be significant, and it must be compensated, for those applications which require a high measurement accuracy.

To achieve the best possible measurement accuracy, we suggest performing multiple calibration steps, ideally one for each working distance at which the vision system should work. This solution can be easily implemented if the vision system works at a finite number of working distances. In all the other cases, we recommend to still perform multiple calibrations and load the calibration map with the working distance closer to the one at which the vision system is currently working. The higher the number of calibration maps generated beforehand, the better the final accuracy of the vision system will be.

Repeatability

The repeatability of a liquid lens is measured in diopters, and it measures the maximum deviation from a selected value of focal power. It represents the uncertainty interval when setting a focal power value. For simplicity purposes we will consider controlling the lens in power mode in this way we can discuss about the repeatability without considering the temperature drift.

The repeatability also depends on the amount of optical power change between two consecutive positions of the liquid lens. The higher the change the higher will also be the uncertainty interval. So, if for an application the repeatability is a key parameter, and you want to minimize the uncertainty interval, we recommend changing the focus of the liquid lens in small steps.

By calculating the relationship between the working distance and the focal power, it is possible to understand how the repeatability error affects the working distance. The relationship between working distance and optical power is linear, but its linear coefficient could be different for each model of optics and serial number, meaning that lenses with the same part number may have different linear coefficients. Note that such a difference is generally small, and it could be negligible depending on the application needs. However, since usually repeatability error influences those applications which require a high precision, it could be interesting to calculate it. To do that, we suggest setting the focus at two known working distances and saving the corresponding focal power values, then doing the ratio.

To understand it better, we can make an example. We are considering a TCEL100 which has a repeatability of ± 0.05 [dpt]. We can then fix the focus at a working distance of 142.14 [mm] and measure the focal power which would be of –2.26 [dpt] in our experiment. Then we do the same at a working distance of 117.96 [mm] and we measure a focal power of 2.56 [dpt].

We can understand that a range of 24.18 [mm] of working distance, which is the difference between 142.14 and 117.96, is achieved by an excursion of 4.82 [dpt], which is the difference between the two optical powers.

By doing the proportion we can calculate that 0.05 [dpt] corresponds to a working distance shift of 0.25 [mm]. This means that with this optics the repeatability error on the focal power will correspond to a repeatability error of ± 0.25 [mm] in the working distance.

The value calculated is referred to the best focus position, but the Depth of Field of the lens must also be considered. The Depth of Field of the TCEL100, while considering in our example an ITA50-GM-10C camera, can be estimated using the following formula (refer to our Basics section for further insights about this formula and the Depth of Field):

`Dof [mm] = ("pixelSize" [um] * WF# * k) / "magnification"^2`

Where:

  • pixelSize is the linear dimension of the image sensor pixel, in this case it is 3.45 [μm].
  • WF# is the Working F-Number of the optics, in this case it is 12.
  • k is a dimensionless parameter that depends on the application, a reasonable value for defect inspection applications is 0.015.
  • magnification of the optics is 1.


Note that the Depth of Field depends on the application, and the best way to evaluate it is to measure its value by a test.
According to the above formula, the resulting estimated Depth of Field is 0.621 [mm]. Since it is longer than the repeatability error (i.e.: which has been calculated as ± 0.25 [mm], hence 0.5 [mm] in total) it means that when the working distance is set at a desired value, the actual value will be close to the desired value in a range which is inside the application’s Depth of Field. This results in an image of the sample (i.e.: supposed to be at the desired WD value) which focus is acceptable for the application needs.

There could be a case in which the resulting Depth of Field is shorter than the repeatability error of the liquid lens. When this happens, we recommend setting the focal power by minimizing repeatability errors. The maximum error happens when the change in optical power is between values with a certain difference. However, the smaller the difference between consecutive focal power values the less would be the possible defocusing caused by repeatability errors. We suggest, in these cases, to do a tuning of the lens with a high granularity which simulates an analog-like control. Instead of stepping from the starting focal power value to the target one, we suggest setting the lens also to values in between these two. This operation will reduce the effect of the overall repeatability error.

Camera control using an ITALA G.EL

Advantages

To control the liquid lens and supply the current we need a driver, which is usually either a USB stick or a circuit board. Both these solutions require the integration of an additional product with the relative supply of power and accessories such cables and mechanical clamps. Additionally, this new device needs to properly communicate with the vision system, its automation, control signals and software.

An easier solution is to integrate the drivers of the liquid lens directly into the camera. Since each vision system has at least one camera, by having the lens driver directly inside it, we are not required to use an additional component into the system.

This is possible using the ITALA G.EL cameras, this kind of approach guarantees several benefits for your application, such as:

  • Simpler hardware. Using a camera removes the need for an additional driver and cable, it is possible to use a y-shaped cable to connect the lens to the Hirose connector of the camera.
  • Lower cost of the system. There is not only one less driver to buy, but also less time is needed to develop the system, since the integration of the camera includes the liquid lens control.
  • Easier integration. The driver can be controlled using the same communication protocol of the camera. All the parameters needed to change drive the liquid lens can be found inside the GenICam tree allowing for a higher standardization of the vision system.

The software part is also simplified, because the camera with the integrated driver only requires a single software. Conversely, if using an external driver, the user could need two software or libraries, one for the camera and one for the lens when doing the development of the system, or two different libraries.

How to implement the camera control

For the hardware connection between the ITALA G.EL camera and the liquid lens, please refer to the Getting Started technical note. After the camera has been connected, open ITALA View and start the acquisition.

By default, the liquid lens control is disabled, as it is only needed when a liquid lens is connected. To configure the liquid lens, follow these steps:

  1. Go on oe Liquid Lens Control and check the oe Liquid Lens Enable field. The parameter needed to control the liquid lens will appear in the GenICam tree.
  2. Set the oe Liquid Lens Mode to either Power Mode or Current Mode, depending on the approach that you want to use. In this example we will use Power Mode.
  3. You can edit oe Liquid Lens Power to select the optical power of the lens. If you are in live mode with the camera, you will see the focus changing in the image.
Schau Video
Group 2 Liquid Lens
Liquid Lens