Liquid lens temperature compensation closed loop process control method and system

CN122901985APending Publication Date: 2026-10-13SHENZHEN KUMO TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611310572.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

基于温度系数的单点或线性修正方案,无法准确描述温度、驱动量与光焦度之间的非线性耦合关系,在宽温区及多物距场景下补偿精度不足

Benefits of technology

[0042]采用以温度、驱动量为输入、焦度量为输出的二次多项式模型,可精准拟合全温区下驱动量与光焦度的对应关系,在多物距场景下均能保持稳定的补偿准确度;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122901985A_ABST
    Figure CN122901985A_ABST
Patent Text Reader

Abstract

The application discloses a liquid lens temperature compensation closed-loop process control method and system, a plurality of temperature collection points covering a working temperature range are set, after the temperature of a temperature box is stabilized, a liquid lens is driven to scan and collect images, and a correction sample is generated according to a driving amount corresponding to an imaging quality peak value; a quadratic polynomial model with temperature and driving amount as input and focal power as output is fitted, a target driving amount is reversely solved in combination with a target focal power and a real-time temperature; a deployment path calculated by a panel end or a host computer is selected according to the capability of a lens driver, and full-process data is periodically verified and associatedly stored, so that full-process automatic calibration is realized, the correction accuracy in a wide temperature range and a multi-distance scene is improved, different hardware configurations are adapted, and good engineering practicability and data traceability are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of optical lens calibration technology, and in particular to a closed-loop process control method and system for temperature compensation of liquid lenses. Background Technology

[0002] Liquid lenses are widely used in machine vision, industrial inspection and intelligent imaging equipment due to their compact structure, fast response speed and wide focusing range. However, in practical applications, changes in ambient temperature can cause changes in the volume, refractive index and interfacial tension of the liquid inside the lens, causing the optimal driving force corresponding to the same target distance to drift, thereby reducing the image clarity and autofocus accuracy. Therefore, an effective temperature compensation scheme is needed to counteract the effect of temperature drift.

[0003] Existing liquid lens temperature compensation solutions mainly include hardware structure compensation, isothermal closed-loop control, lookup table compensation, and temperature coefficient correction. Hardware structure compensation uses customized mechanical components to offset the thermal expansion and contraction of the liquid, requiring redesign for specific lenses, resulting in high modification costs and poor versatility. Isothermal closed-loop control maintains a constant lens temperature through additional temperature control elements, increasing device size, power consumption, and hardware costs, making it difficult to adapt to miniaturized imaging devices. Lookup table compensation pre-stores the correspondence between discrete temperature points and driving quantities. When covering wide temperature ranges and multi-object distance scenarios, the amount of data required to store increases significantly, and the compensation accuracy is limited due to interpolation calculations for unsampled points. Single-point or linear correction schemes based on temperature coefficients cannot accurately describe the nonlinear coupling relationship between temperature, driving quantity, and optical power, resulting in insufficient compensation accuracy in wide temperature ranges and multi-object distance scenarios.

[0004] In addition, existing compensation schemes mostly focus on a single algorithm or a single step, and have not yet formed a complete automated chain from sample collection, model building, parameter deployment to effect verification. In actual calibration, manual operation is required to switch between temperature control, image acquisition, parameter calculation and equipment configuration, which is prone to problems such as collecting samples before the temperature is stable, incorrect or missing sample records, and deployment errors. At the same time, the compensation samples are not directly bound to the peak image quality, and the correlation between the compensation effect and the actual image quality is insufficient. Faced with lens drivers with different hardware capabilities, there is a lack of flexible adaptation paths, and there is generally a lack of a sound verification and data traceability mechanism, which is not conducive to mass production calibration and quality inspection. Summary of the Invention

[0005] The main objective of this invention is to provide a closed-loop process control method and system for temperature compensation of liquid lenses. By collecting the calibration samples with the best imaging quality under steady-state conditions at multiple temperature points in the temperature chamber, a quadratic polynomial compensation model coupling temperature, driving quantity, and focal length is constructed and adapted to differentiated deployment paths, thereby achieving high-precision automated compensation and full-process traceable control of temperature drift of liquid lenses across multiple object distances in the entire temperature range.

[0006] To achieve the above objectives, the present invention provides a closed-loop process control method for temperature compensation of liquid lens, comprising the following steps:

[0007] Set up multiple temperature acquisition points covering the working temperature range of the liquid lens;

[0008] After the temperature chamber reaches each temperature point and stabilizes, the liquid lens is driven to acquire images under multiple driving quantities. The driving quantity corresponding to the peak image quality is taken as the optimal driving quantity, and the current temperature, target distance and optimal driving quantity are recorded as the correction sample.

[0009] After all temperature acquisition points have been collected, a quadratic polynomial model with temperature and driving quantity as input and focal quantity as output is fitted using the calibration sample. The focal quantity is calculated from the target object distance.

[0010] The target focal length is determined by the target object distance, the current lens temperature is obtained, and the target driving quantity is solved in reverse using the quadratic polynomial model.

[0011] Based on the capabilities of the lens driver, the model coefficients are written into the lens driver, or the target driving quantity is sent out after being solved by the host computer.

[0012] The verification driving quantity is periodically obtained based on the current lens temperature and target focal length, and verification images are collected. The verification results are then associated with and stored with the correction samples.

[0013] Furthermore, after all temperature acquisition points have been collected, the step of fitting a quadratic polynomial model with temperature and driving quantity as input and joule quantity as output using the calibration sample includes:

[0014] The target object distance in the calibration sample is converted into focal length.

[0015] The quadratic polynomial model is set as: K=A(t)·v²+B(t)·v+C(t), where K is the joule, v is the driving quantity, t is the temperature, and A(t), B(t), and C(t) are quadratic functions of temperature t. After expansion, the model contains nine undetermined coefficients.

[0016] Substitute all the calibration samples into the quadratic polynomial model to construct a system of linear equations with respect to the nine undetermined coefficients. Solve for the nine undetermined coefficients using singular value decomposition to obtain the fitted model.

[0017] Furthermore, the step of substituting all the corrected samples into the quadratic polynomial model to construct a system of linear equations for the nine undetermined coefficients, and solving for the nine undetermined coefficients using singular value decomposition, includes:

[0018] When multiple different test heights are set, all calibration samples are merged and uniformly participated in the fitting. All samples jointly construct a system of linear equations about the nine undetermined coefficients, and solve them to obtain a set of nine undetermined coefficients. Alternatively, all calibration samples are divided into multiple sample groups according to the corresponding test heights, and each sample group is fitted separately to obtain an independent nine-coefficient model corresponding to each test height.

[0019] In practical applications, the target distance is determined based on the current working height and converted into the target focal length, which is then input into the unified model. The target driving quantity is then solved in reverse by combining the real-time lens temperature. When group fitting is used, the matching model is selected based on the current working height for solution.

[0020] Furthermore, the step of determining the target focal length from the target object distance, obtaining the current lens temperature, and inversely solving for the target driving quantity using the quadratic polynomial model includes:

[0021] Convert the target distance to the target focal length;

[0022] Substituting the current lens temperature into the quadratic polynomial model, we obtain a univariate quadratic equation for the driving quantity.

[0023] Solve the quadratic equation in one variable. If two valid real roots are obtained, select the root that is within the allowable range of the lens driver and close to the center of the preset working interval as the target driving quantity.

[0024] Furthermore, the steps for solving the quadratic equation include:

[0025] If no valid real root within the allowable range of the lens driver is obtained, the optimal driving quantity corresponding to the calibration sample on both sides of the current lens temperature is selected, and a temporary target driving quantity is obtained by linear interpolation. At the same time, the current state is marked as a calculation anomaly and the corresponding record is retained.

[0026] If only one valid real root is obtained that is within the allowable range of the lens driver, then the valid real root is directly determined as the target driving quantity.

[0027] Furthermore, the step of driving the liquid lens to acquire images under multiple driving forces after the temperature chamber reaches and stabilizes at each temperature point includes:

[0028] The system collects the actual temperature inside the chamber in real time. When the absolute value of the difference between the actual temperature and the target temperature at the current temperature collection point is less than a preset threshold, a stabilization timer is started.

[0029] Once the cumulative duration of the stable timing reaches the preset duration, the temperature is determined to be stable, triggering the liquid lens to perform drive quantity scanning and image acquisition.

[0030] Furthermore, the step of using the driving amount corresponding to the peak imaging quality as the optimal driving amount includes:

[0031] First, scan the entire range of driving volume with the first step length to determine the approximate range with the highest imaging quality;

[0032] Then, a second step size smaller than the first step size is used to perform a fine scan within the approximate range, and the driving amount corresponding to the peak image quality in the fine scan is taken as the optimal driving amount.

[0033] This invention also provides a closed-loop process control system for liquid lens temperature compensation, which executes the liquid lens temperature compensation closed-loop process control method described above. The liquid lens temperature compensation closed-loop process control system includes:

[0034] The image sampling unit is used to receive the sampling trigger command and drive the liquid lens to acquire images under multiple driving quantities. The driving quantity corresponding to the peak image quality is used as the optimal driving quantity to obtain the correction sample.

[0035] The model fitting unit is used to summarize the correction samples of all temperature acquisition points, convert the target object distance into joules, and fit a quadratic polynomial model.

[0036] The drive calculation unit is used to determine the target focal length based on the target object distance, obtain the current lens temperature, and solve the target drive quantity in reverse through a quadratic polynomial model.

[0037] Deploy an adaptation unit to identify the writing capability of the lens driver, write the model coefficients to the lens driver, or retain the model coefficients on the host computer side and send down the target driving quantity obtained by solving.

[0038] The verification traceability unit is used to periodically obtain verification driving quantities based on the current lens temperature and target focal length, acquire verification images, and associate and store the verification results with the correction samples.

[0039] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the liquid lens temperature compensation closed-loop process control method described above.

[0040] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the liquid lens temperature compensation closed-loop process control method described above.

[0041] The closed-loop process control method for liquid lens temperature compensation provided by this invention has the following beneficial effects:

[0042] Using a quadratic polynomial model with temperature and driving force as inputs and focal length as output, it can accurately fit the correspondence between driving force and focal length in the entire temperature range and maintain stable compensation accuracy in multi-object distance scenarios.

[0043] By linking temperature steady-state determination, image acquisition and optimization, model fitting, parameter deployment and effect verification into a closed-loop execution chain, the acquisition is automatically triggered after the temperature chamber reaches stable temperature. The entire process does not require repeated manual switching operations, improving calibration efficiency and sample reliability.

[0044] To address the limitations of existing solutions that are mostly adapted to a single working distance, this solution supports both rapid calibration at a single test height and fitting at multiple test heights. The corresponding modeling method can be selected according to the actual application requirements, balancing mass production calibration efficiency with the needs of multiple working distances.

[0045] By automatically recognizing the driver's write capability, it flexibly selects between two deployment methods: on-board coefficient writing or upper-computer calculation and distribution, adapting to imaging equipment with different configurations and lowering the hardware threshold for solution implementation. It periodically performs compensation effect verification and stores the verification results in association with the original calibration samples and model coefficients, enabling complete backtracking of the entire calibration process data and providing support for quality inspection and model iteration. Attached Figure Description

[0046] Figure 1 This is a flowchart of a closed-loop process control method for liquid lens temperature compensation in one embodiment of the present invention;

[0047] Figure 2 This is a structural block diagram of a closed-loop process control system for liquid lens temperature compensation in one embodiment of the present invention;

[0048] Figure 3 This is a measured curve of the optimal driving voltage of the liquid lens as a function of temperature under different object distances in one embodiment of the present invention;

[0049] Figure 4 This is a graph showing the temperature-driving voltage fitting results of a quadratic polynomial model under multiple object distance ranges in one embodiment of the present invention;

[0050] Figure 5 This is a comparison chart of the temperature-driving voltage model fitting curve and measured data under a typical object distance in one embodiment of the present invention;

[0051] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0053] Reference Figure 1 The above is a flowchart illustrating a closed-loop process control method for liquid lens temperature compensation proposed in this invention, comprising the following steps:

[0054] S1, set multiple temperature acquisition points covering the working temperature range of the liquid lens;

[0055] S2, after the temperature chamber reaches each temperature point and stabilizes, drive the liquid lens to acquire images under multiple driving quantities, take the driving quantity corresponding to the peak of the imaging quality as the optimal driving quantity, and record the current temperature, target distance and optimal driving quantity as the correction sample.

[0056] S3. After all temperature acquisition points have been collected, a quadratic polynomial model with temperature and driving quantity as input and focal quantity as output is fitted using the calibration sample. The focal quantity is calculated from the target object distance.

[0057] S4, determine the target focal length from the target object distance, obtain the current lens temperature, and solve the target driving quantity in reverse using the quadratic polynomial model;

[0058] S5, based on the lens driver capability, write the model coefficients into the lens driver, or have the target driving quantity sent down after being solved by the host computer;

[0059] S6 periodically acquires verification driving quantities and collects verification images based on the current lens temperature and target focal length, and stores the verification results in association with the correction samples.

[0060] As described in step S1 above, the temperature sampling points are set according to the nominal working temperature range of the liquid lens, covering both conventional usage scenarios and extreme operating conditions. The nominal working temperature range is -10℃ to 60℃, adapting to the indoor and outdoor operating environments of industrial imaging equipment. The number of sampling points is determined by the temperature range width and calibration accuracy requirements, with 6 to 8 discrete sampling points set for a single object distance. The point arrangement follows a non-linear distribution principle, with a point spacing of 5℃ within the normal working temperature range of 20℃ to 40℃, to densify sampling and match the changing gradient of the liquid lens's temperature drift characteristics. One boundary sampling point is set at the -10℃ low-temperature end and the 60℃ high-temperature end, covering the boundary correction requirements of the entire temperature range. Each temperature sampling point corresponds to a fixed test object distance. In multi-object distance calibration scenarios, the same temperature point is sequentially matched with three sets of standard test object distances: 100mm, 250mm, and 500mm, ensuring that the sampling environment temperature conditions are completely consistent under different object distances. All temperature sampling points are arranged into a running sequence according to the continuous heating direction and stored in the host computer calibration configuration file as the execution basis for temperature control of the chamber. The sequence can be adjusted to a continuous cooling direction according to calibration requirements, adapting to different test environment conditions and equipment temperature change characteristics.

[0061] As described in step S2 above, the temperature chamber is adjusted to the target temperature point according to the preset operating sequence. The host computer collects the measured temperature inside the temperature chamber in real time. When the absolute value of the difference between the measured temperature and the target temperature is less than 0.5℃, a stabilization timer is started. After the cumulative time reaches 10 minutes, it is determined that the lens has reached thermal equilibrium, and the image acquisition process is started. The lens driver outputs a driving voltage to drive the liquid lens to traverse the preset driving range. The driving voltage range covers 26V to 38V, and the industrial camera is triggered to acquire standard resolution target images under the corresponding working conditions. The full-domain scan uses a 0.5V step size for fast traversal to locate the local interval where the image quality peak is located, and then switches to a 0.1V step size to complete a fine scan within the local interval, balancing acquisition efficiency and peak positioning accuracy. The modulation transfer function value is calculated for each frame of image, and the average value in the horizontal and vertical directions at the spatial frequency of 100lp / mm is taken as the image quality evaluation index. The driving voltage corresponding to the image quality peak is the optimal driving amount under the current working conditions. The host computer binds the current measured temperature, target distance, and optimal driving quantity into a single set of calibration samples, stores them in the calibration database, and completes the sample acquisition process under a single temperature point and single distance.

[0062] As described in step S3 above, after all temperature acquisition points have collected their samples, the validity of the calibration samples is first screened. Invalid samples with temperature deviations exceeding the allowable range or abnormal imaging quality values ​​are removed, and valid samples are retained for model fitting. The target object distance and focal length follow a fixed conversion relationship. The focal length is the reciprocal of the object distance, and the unit is diopter. When the object distance is measured in mm, the focal length value is equal to 1000 divided by the object distance value. All valid samples have undergone the corresponding focal length conversion. A quadratic polynomial model is constructed, with temperature and driving force as inputs and focal length as the output. The focal length in the model consists of three superimposed terms: the first term is the product of the temperature-related quadratic coefficient and the square of the driving force; the second term is the product of the temperature-related linear coefficient and the driving force; and the third term is a temperature-related constant. The temperature-related coefficients corresponding to the three terms are all quadratic functions of temperature. After full expansion, the model contains nine undetermined coefficients. By substituting the temperature, driving force, and corresponding keratin quantity of all valid calibration samples into the model expression, a system of linear equations with nine unknowns is constructed. The singular value decomposition method is then used to solve the system of equations, obtaining the definite values ​​of all nine undetermined coefficients, thus completing the fitting of the quadratic polynomial model. The fitted model can then directly input any temperature and driving force to calculate the corresponding keratin quantity.

[0063] As described in step S4 above, during the actual imaging stage, the target focal length is calculated based on the current target object distance. The conversion rule remains consistent with that in the calibration stage, and the focal length unit is diopter. The real-time operating temperature of the liquid lens is simultaneously acquired, with a temperature acquisition accuracy of 0.1℃. The real-time temperature is substituted into the fitted quadratic polynomial model to calculate the quadratic coefficients, linear coefficients, and constant term at the corresponding temperature. The target focal length is then substituted into the model expression, resulting in a quadratic equation with the driving quantity as the unknown. The quadratic equation is solved, and the number and specific values ​​of the real roots are determined based on the discriminant value. The obtained real roots are compared with the allowable driving quantity range of the lens driver, which is set to 26V to 38V. If two valid real roots exist within the allowable range, the root with a value closer to the center of the driving quantity operating range is selected as the target driving quantity, with the center of the operating range set at 32V. If only one valid real root exists within the allowable range, this root is directly determined as the target driving quantity. If the equation has no valid real roots within the allowable range, retrieve two sets of calibration samples adjacent to each other on both sides of the current temperature from the calibration database, extract the optimal driving quantity corresponding to the two sets of samples, and calculate the temporary target driving quantity through linear interpolation. Simultaneously mark the current state as a calculation anomaly, and retain the corresponding temperature, object distance, and solution process data.

[0064] As described in step S5 above, the host computer establishes a communication connection with the lens driver, reads the hardware configuration information stored inside the driver, and identifies whether it has onboard parameter storage and real-time calculation capabilities. The communication link adopts an industrial standard serial bus with a transmission baud rate set to 115200bps to ensure the stability and data integrity of the parameter transmission process. If the driver supports onboard parameter storage and calculation, the host computer packages the nine model coefficients obtained from the fitting according to the agreed data format and writes them into the driver's internal non-volatile storage unit. After writing, a readback verification is automatically performed to compare the consistency between the readback data and the original coefficients. If the verification fails, a rewrite process is triggered, with a maximum of 3 rewrites. Under normal operating conditions, the driver directly collects the real-time lens temperature, calls the stored model coefficients to complete the target driving quantity calculation, and outputs the corresponding driving voltage to the liquid lens. If the driver does not have onboard parameter storage capabilities, or if the write verification fails continuously, the host computer automatically switches to remote calculation mode. The model coefficients are stored in the host computer's local storage unit. During operation, the host computer acquires the lens temperature and target distance in real time. After completing the target driving quantity calculation locally, the driving command is sent to the lens driver through the communication link. The two operating modes can be flexibly switched according to the hardware configuration.

[0065] As described in step S6 above, after calibration and deployment are completed, a periodic verification phase begins. The verification cycle is set according to the equipment usage scenario, typically 7 days for conventional industrial testing scenarios. A temporary verification process can be triggered when the ambient temperature fluctuation exceeds 5°C. During verification, the real-time operating temperature of the liquid lens is first collected, matched with the target focal length corresponding to the current working object distance, and the currently active quadratic polynomial model is used to calculate the verification driving quantity. After the driving quantity is sent to the lens driver, the liquid lens is adjusted to enter the corresponding working state, and the industrial camera is simultaneously triggered to acquire verification images of the standard resolution target. For each frame of verification image, the modulation transfer function value is calculated, and the average value in the horizontal and vertical directions at a spatial frequency of 100 lp / mm is taken as the imaging quality evaluation index. The evaluation rules are consistent with those in the calibration phase to ensure data comparability. The temperature values, object distance parameters, driving quantity values, and imaging quality results during the verification process are compiled to generate a single verification record. The verification record is indexed and associated with the corresponding batch of original calibration samples and model coefficient files, and stored in the equipment calibration archive database. Each verification record is bound to a unique batch number and can be retrieved by dimensions such as temperature range, object distance parameter, and calibration time.

[0066] The following detailed description, along with the working principle and process of the technical solution, is provided in conjunction with specific embodiments:

[0067] Example 1

[0068] This embodiment is designed for multi-object distance full-domain temperature compensation scenarios and supports batch parallel calibration of multiple liquid lenses. The calibration system includes a high and low temperature test chamber, a four-channel industrial camera and liquid lens module, a lens drive controller array, and a host computer calibration and management platform.

[0069] The high and low temperature test chamber provides a uniform temperature environment. Four test modules are arranged in parallel inside the chamber, with each module independently connected to its corresponding drive channel. The host computer coordinates the entire process of status scheduling and data processing. The drive quantity adopts the form of voltage equivalent value. The drive value output by the register can be linearly converted into the corresponding voltage according to the controller range, adapting to the unified calibration requirements of different specifications of drive hardware.

[0070] The host computer establishes an independent logical file for each device under test, recording the device name, camera hardware identifier, driver port address, lens model and specifications, autofocus scanning parameters, and multiple sets of calibration test object distances. Temperature acquisition points are set according to the nominal operating temperature range of the liquid lens, covering the commonly used operating range of 25℃ to 50℃. Five discrete points are sequentially set, with the spacing between points adjusted according to temperature drift. All temperature acquisition points are arranged into a temperature chamber operation sequence according to the continuous heating direction, bound to the corresponding device file, and stored in the calibration configuration library as a unified benchmark for the entire process.

[0071] The temperature chamber adjusts its internal environment temperature point by point according to a preset sequence. The host computer collects the temperature values ​​of the chamber cavity and the vicinity of the lens in real time. When the absolute value of the difference between the measured temperature and the target temperature is less than 0.5℃, a stabilization timer is started. After the cumulative time reaches 10 minutes, the lens is determined to have reached thermal equilibrium. The steady-state signal is synchronously sent to the multi-device sampling and scheduling module, and the four devices start the image acquisition process in parallel.

[0072] Each device independently performs drive quantity traversal, with a drive voltage range covering 26V to 38V. Full-domain scanning uses a 0.5V step size to quickly locate the peak imaging quality range, then switches to a 0.1V step size for fine scanning. For each image frame, the modulation transfer function (MTF) value is calculated, and the average horizontal and vertical values ​​at a spatial frequency of 100 lp / mm are used as the imaging quality evaluation index. The drive voltage corresponding to the peak imaging quality is the optimal drive quantity for the current operating condition. After single-temperature point acquisition, each device generates an independent calibration sample, which is bound to the device identifier, measured temperature, target distance, optimal drive quantity, peak MTF value, and corresponding image frame.

[0073] After all temperature points have been collected, a sample validity screening is performed to remove invalid data such as temperature deviations exceeding the allowable range, driving quantities exceeding the hardware range, object distance mismatch, and abnormally low MTF values. Valid samples are retained for model fitting. Figure 3The test results of three sets of test object distances for a single device are shown. Each curve shows a consistent upward trend as the temperature increases. At the same temperature, the smaller the object distance, the higher the corresponding driving voltage, which intuitively reflects the coupling relationship between temperature drift characteristics and object distance.

[0074] For all valid samples, a uniform conversion of diopter was performed. The unit of diopter is diopter, and the value is equal to 1000 divided by the corresponding object distance in millimeters. A quadratic polynomial temperature compensation model was constructed, with temperature t and driving force v as inputs and diopter K as output. The model expression is as follows:

[0075] In the formula, a, b, c, d, e, f, g, h, and i are nine undetermined model coefficients. The coefficients of the temperature-related quadratic term, linear term, and constant term in the model all change as a quadratic function with temperature, fully covering the nonlinear coupling relationship between temperature and driving quantity.

[0076] Substituting the temperature and driving force of each valid sample, a nine-dimensional feature vector is constructed, with the following form: The corresponding coefficient vector is:

[0077]

[0078] The feature vectors of all samples are stacked row-wise to form the feature matrix X, and the corresponding focal length values ​​form the output vector Y. The coefficient vector is solved using the least squares method, and the solution relationship is as follows:

[0079]

[0080] When a high condition number in a matrix leads to decreased numerical stability, singular value decomposition can be used directly to solve the problem, ensuring the reliability of the fitting results.

[0081] After obtaining the determined values ​​of the nine undetermined coefficients, the global multi-object distance temperature compensation model for a single-path device is constructed. Figure 5 The model fitting effect is shown under typical object distances. Discrete dots represent measured sampling data, and the smooth curve represents the model calculation results. The fitting error is less than 0.15V across the entire temperature range, verifying the fitting ability of the quadratic polynomial model for nonlinear temperature drift characteristics. When the narrow temperature range causes the coefficient of the quadratic term to approach zero, the model automatically degenerates into a linear function form. The solution logic is adjusted accordingly to ensure computational stability across the entire temperature range.

[0082] During the actual imaging process, the target focal length K* is calculated based on the current target distance, and the real-time operating temperature of the liquid lens is simultaneously acquired with an accuracy of 0.1℃. Substituting the real-time temperature into the fitted temperature-compensated model, the quadratic coefficient A(t), linear coefficient B(t), and constant C(t) at the corresponding temperature are calculated. Substituting the target focal length into the model expression, a quadratic equation with the driving quantity as the unknown is obtained: Calculate the discriminant of the equation: The number and specific values ​​of real roots are determined based on the discriminant value. The root-finding formula is as follows:

[0083] The obtained real roots are compared with the allowable driving range of the lens driver, which is 26V to 38V. Based on the discriminant results and the validity of the real roots, three cases are handled:

[0084] There are two valid real roots: when Furthermore, when both real roots are within the allowable range of 26V to 38V, the root whose value is closer to the center of the driving quantity working range is selected as the target driving quantity, with the center of the working range being 32V.

[0085] There exists a single valid real root: when And the real root is within the allowable range, or However, if only one real root is within the allowable range, the valid real root is directly determined as the target driving quantity.

[0086] No valid real root: when If there is no real root, or if both real roots exceed the allowable range of 26V to 38V, retrieve two sets of calibration samples adjacent to each other on both sides of the current lens temperature from the calibration database, and extract the measured temperatures corresponding to the two sets of samples. , With the corresponding optimal driving force , The temporary target driving quantity is obtained by linear interpolation. The interpolation formula is as follows:

[0087] In the formula The current measured lens temperature, and meets the following requirements. The system synchronously marks the current state as a calculation anomaly, retains the corresponding temperature, target distance, equation solution process, and interpolation calculation data, and stores them in the calibration archive for model optimization and problem tracing.

[0088] Taking the working condition of 30℃ and 100mm object distance as an example, substituting the model coefficients, we can calculate A(t) as -2.1×10^-5 diopters per square volt, B(t) as 1.8×10^-3 diopters per volt, C(t) as 3.2 diopters, and the target focal length as 10 diopters. Substituting these values ​​into the equation, we obtain two real roots. Among them, 36.9V is within the allowable range and close to the center of the working range, which is the target driving voltage. The deviation from the measured value is less than 0.1V.

[0089] Taking the abnormal operating condition of 28℃ and 100mm object distance as an example, assuming that the equation has no valid real roots within the allowable range at the current temperature, we retrieve two adjacent calibration samples from the calibration database at 100mm object distance and 25℃ and 30℃, respectively. The corresponding optimal driving quantities are 36.6V and 36.9V, respectively. Substituting these values ​​into the interpolation formula, we obtain:

[0090] This value is issued as a temporary target driving quantity, and at the same time, any calculation anomalies are recorded, and all process data is retained.

[0091] After model fitting is complete, the deployment phase begins. The host computer establishes communication connections with each lens driver, reads hardware configuration information, and identifies whether the driver has onboard parameter storage and real-time computation capabilities. For devices supporting onboard computation, the host computer writes nine model coefficients into the driver's internal non-volatile storage unit according to a pre-defined data format. After writing, a readback verification is performed to compare the readback data with the original coefficients. A single verification failure triggers a rewrite process. If three consecutive write verification failures occur, the device is automatically marked as being in software compensation mode, switching to the host computer's remote calculation path. In onboard mode, the driver directly acquires real-time lens temperature, calls the stored model coefficients to complete the target drive quantity calculation, and outputs the corresponding drive signal to the liquid lens. In software compensation mode, the model coefficients are stored locally on the host computer. During operation, the host computer acquires lens temperature and target object distance in real time, completes the calculation locally, and then sends the drive command to the lens driver. The two modes can be automatically switched according to hardware configuration to adapt to the mass production calibration requirements of different specifications of equipment.

[0092] After deployment, a periodic verification phase begins, with a standard verification cycle of 7 days. A temporary verification process is triggered when the ambient temperature fluctuation exceeds 5°C. During a single verification, a verification image is acquired every 5 minutes. After three consecutive acquisitions, the average image quality is used as the evaluation result, with evaluation rules consistent with the calibration phase. During verification execution, real-time lens temperature is first acquired, matched with the target focal length corresponding to the current working object distance, and the currently active model is called to calculate the verification driving quantity. The lens is then driven into the corresponding working state to complete image acquisition. All verification records are indexed and associated with the corresponding batch's equipment files, temperature chamber operation sequences, original calibration samples, model coefficient files, deployment execution records, anomaly logs, and verification images, and stored in the equipment calibration file database. Each record is bound to a unique batch number and timestamp, supporting retrieval through multiple dimensions such as equipment identifier, temperature range, object distance parameter, and calibration time. If the image quality deviation exceeds a preset threshold after three consecutive verifications, a recalibration prompt is automatically triggered. The preset threshold is set at an image quality index decrease exceeding 10%. End-to-end data retention allows for complete backtracking of the entire calibration and verification process, providing comprehensive data support for model iteration and equipment status investigation.

[0093] Example 2

[0094] This embodiment is applied to industrial vision inspection equipment with fixed object distance settings. The hardware configuration is completely the same as that of Embodiment 1. For scenarios where there is no need for continuous adjustment of object distance and the pursuit of single-level compensation accuracy is required, a multi-height temperature compensation mode with independent fitting according to object distance groups is adopted. Each group of object distances corresponds to an independent nine-coefficient temperature compensation model, which is suitable for high-precision inspection requirements of three standard working distances.

[0095] The host computer establishes a logical file for the device under test, inputting the device identifier, camera parameters, drive port information, and lens specifications. It also configures three fixed test object distances: 100mm, 250mm, and 500mm, corresponding to the device's three operating modes. Temperature acquisition points cover the commonly used operating range of 25℃ to 50℃, set as five discrete points: 25℃, 30℃, 35℃, 40℃, and 50℃. All temperature points are arranged in a continuous heating direction to form a temperature chamber operation sequence, which is bound to the device file and object distance configuration and stored in the calibration database. Samples are collected sequentially at the same temperature point for all three object distances, ensuring that the ambient temperature conditions corresponding to different object distances are completely consistent, eliminating sampling errors introduced by temperature variations.

[0096] The temperature chamber is adjusted to the target temperature according to the operating sequence. The host computer collects the temperature values ​​of the cavity and the area around the lens in real time. When the absolute value of the difference between the measured temperature and the target temperature is less than 0.5℃, a stabilization timer is started. After the cumulative time reaches 10 minutes, the lens is determined to have reached thermal equilibrium, and the sampling process is started. The test object distance settings are switched sequentially. At each setting, the drive quantity traversal and image quality evaluation are performed independently. The drive voltage scan range, step size setting, and MTF evaluation rules are consistent with those in Example 1. After the peak search of each setting is completed, a calibration sample bound to the corresponding object distance label is generated. The sample includes the device identifier, measured temperature, object distance setting, optimal drive voltage, peak MTF value, and corresponding image frame.

[0097] After all temperature points were collected, a comprehensive sample validity cleaning process was performed to remove invalid data, including those with excessive temperature deviations, driving quantities exceeding hardware ranges, abnormal object distance configurations, and abnormally low MTF values. Valid samples were then divided into three independent sample groups based on object distance labels. For example... Figure 3 As shown, the optimal driving voltages corresponding to the three object distances exhibit a parallel distribution pattern with temperature changes. The slopes and curvatures of the curves show significant differences, corresponding to the variations in temperature drift characteristics under different object distances. This provides a basis of measured data for independent group modeling. At an object distance of 100mm, the driving voltage ranges from 36.8V to 38.0V; at 250mm, it ranges from 29.5V to 30.7V; and at 500mm, it ranges from 27.9V to 28.7V. All data show a monotonically increasing trend with increasing temperature, and the curve curvature conforms to the characteristics of a quadratic function.

[0098] The three sample groups underwent foci conversion, with the unit being diopter, and the value equal to 1000 divided by the corresponding object distance in millimeters. A quadratic polynomial temperature compensation model was independently constructed for each sample group. The model expression for the object distance in the j-th group is:

[0099] In the formula These are the nine undetermined model coefficients corresponding to the j-th group of object distances. The three groups of models are independent of each other and do not interfere with each other.

[0100] For the j-th group of samples, a nine-dimensional feature vector is constructed according to the same rules as in Example 1. The feature vectors of all samples in the group are stacked row by row to form a feature matrix. The corresponding focal length values ​​form the output vector. The coefficient vector is solved using the same least squares method as in Example 1. When the condition number of the matrix is ​​high, singular value decomposition is also used to improve numerical stability. After solving the three sets of samples, three independent nine-coefficient models are obtained, corresponding to the three object distance levels.

[0101] like Figure 4As shown, the family of temperature compensation curves generated by group fitting covers all test object distances. Each curve corresponds to the variation of driving voltage with temperature under a fixed object distance, and the curve shape is highly consistent with the variation trend of the measured data.

[0102] During the actual imaging process, the device first identifies the current object distance setting, retrieves the corresponding coefficient vector, and simultaneously acquires the real-time operating temperature of the liquid lens with an accuracy of 0.1℃. The real-time temperature is then substituted into the temperature compensation model for the corresponding setting to calculate the quadratic coefficient at the current temperature. coefficient of the first term With constant term Combined with the target focal length corresponding to the current gear. The quadratic equation of the driving quantity is obtained by sorting out the equation. The target driving voltage is calculated according to the discriminant determination, root calculation and effective root selection rules that are completely consistent with those in Example 1. When there are two effective real roots, the value close to the center of the 32V working range is selected. When there is a single effective real root, the value is directly used.

[0103] If no valid real root is found within the allowable range, retrieve two sets of calibration samples adjacent to the current temperature within the sample group corresponding to the current object distance setting. Extract the corresponding measured temperature and optimal driving quantity, and calculate the temporary target driving quantity using the linear interpolation formula identical to that in Example 1. Simultaneously mark the current state as a calculation anomaly, and retain the corresponding temperature, object distance setting, equation solution process, and interpolation calculation data, storing them in the calibration file for analysis.

[0104] Taking the working condition of 35℃ and 250mm object distance as an example, by calling the model coefficients corresponding to the 250mm setting, the coefficient of the quadratic term at the current temperature is calculated to be -1.9×10⁻ 5 The diopter per square volt, the coefficient of the first term is 1.6 × 10⁻³ diopter per volt, the constant term is 2.8 diopter, the target focal length is 4 diopter, and the effective real root is 30.2V when substituted into the equation. The deviation from the optimal driving voltage measured under the same working conditions is less than 0.08V, and the accuracy is better than the global unified model.

[0105] During the model deployment phase, if the lens driver supports onboard parameter storage and calculation, the host computer writes the three sets of model coefficients sequentially into the driver's internal non-volatile storage unit according to the gear position number. The writing process performs readback verification group by group; a single verification failure triggers a rewrite. If three consecutive write verification failures occur, the device is automatically marked as being in software compensation mode, switching to the host computer's remote calculation path. In onboard mode, after receiving the object distance gear position command, the driver calls up the corresponding set of model coefficients, combines them with the real-time lens temperature to complete the drive voltage calculation, and outputs the corresponding drive signal to the liquid lens. In software compensation mode, the three sets of model coefficients are stored locally on the host computer. After identifying the current gear position, the host computer retrieves the corresponding model to complete the calculation and then sends the drive command to the lens driver. The two operating modes can be automatically switched according to the hardware configuration to adapt to the mass production calibration requirements of different specifications of equipment.

[0106] After deployment, a periodic verification phase begins. Verification is performed sequentially according to the object distance settings. For each setting, three typical temperature points are selected for verification data acquisition. The verification cycle, temporary triggering conditions, sampling intervals, and evaluation rules remain consistent with Example 1. Verification records for each setting are indexed and associated with the corresponding group's calibration samples, model coefficients, and deployment execution records, and stored in the equipment calibration archive database. Each record is bound to a setting identifier, batch number, and timestamp. If the image quality degradation of a single setting exceeds the 10% threshold three times consecutively, recalibration for that setting can be triggered independently, eliminating the need for full-temperature-range, full-object-distance retesting, effectively reducing equipment maintenance time costs. All traceability data covers equipment archives, temperature chamber operation sequences, original acquisition samples, grouped model coefficients, deployment execution logs, verification MTF results, anomaly records, and verification images. Data can be retrieved and accessed through multiple dimensions such as equipment identifier, setting, temperature range, and calibration time, allowing for complete backtracking of the entire calibration and verification process.

[0107] Reference Figure 2 Here is a structural block diagram of a closed-loop process control system for liquid lens temperature compensation according to an embodiment of the present invention, comprising:

[0108] The image sampling unit is used to receive the sampling trigger command and drive the liquid lens to acquire images under multiple driving quantities. The driving quantity corresponding to the peak image quality is used as the optimal driving quantity to obtain the correction sample.

[0109] The model fitting unit is used to summarize the correction samples of all temperature acquisition points, convert the target object distance into joules, and fit a quadratic polynomial model.

[0110] The drive calculation unit is used to determine the target focal length based on the target object distance, obtain the current lens temperature, and solve the target drive quantity in reverse through a quadratic polynomial model.

[0111] Deploy an adaptation unit to identify the writing capability of the lens driver, write the model coefficients to the lens driver, or retain the model coefficients on the host computer side and send down the target driving quantity obtained by solving.

[0112] The verification and traceability unit is used to periodically obtain verification driving quantities based on the current lens temperature and target focal length, acquire verification images, and associate and store the verification results with the correction samples.

[0113] In summary, this invention constructs a fully automated temperature compensation control chain encompassing steady-state sampling, model fitting, adaptive deployment, and closed-loop verification. It establishes a quadratic polynomial compensation model with temperature and driving quantity as inputs and focal length as output. By combining the driver hardware capabilities, it flexibly selects between board-side coefficient writing and host computer calculation and distribution paths. This achieves high-precision temperature compensation for liquid lenses in wide temperature ranges and multi-object distance scenarios. Simultaneously, it ensures automated execution of the calibration process, flexible adaptation to multiple hardware configurations, and traceable management of the entire process data, effectively improving the engineering practicality and mass production adaptability of the temperature compensation solution.

[0114] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0115] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the present invention and embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM, etc.

[0116] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0117] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A closed-loop process control method for temperature compensation in a liquid lens, characterized in that, Includes the following steps: Set up multiple temperature acquisition points covering the working temperature range of the liquid lens; After the temperature chamber reaches each temperature point and stabilizes, the liquid lens is driven to acquire images under multiple driving quantities. The driving quantity corresponding to the peak image quality is taken as the optimal driving quantity, and the current temperature, target distance and optimal driving quantity are recorded as the correction sample. After all temperature acquisition points have been collected, a quadratic polynomial model with temperature and driving quantity as input and focal quantity as output is fitted using the calibration sample. The focal quantity is calculated from the target object distance. The target focal length is determined by the target object distance, the current lens temperature is obtained, and the target driving quantity is solved in reverse using the quadratic polynomial model. Based on the capabilities of the lens driver, the model coefficients are written into the lens driver, or the target driving quantity is sent out after being solved by the host computer. The verification driving quantity is periodically obtained based on the current lens temperature and target focal length, and verification images are collected. The verification results are then associated with and stored with the correction samples.

2. The closed-loop process control method for liquid lens temperature compensation according to claim 1, characterized in that, After all temperature acquisition points have been collected, the step of fitting a quadratic polynomial model with temperature and driving quantity as input and joule quantity as output using the calibration sample includes: The target object distance in the calibration sample is converted into focal length. The quadratic polynomial model is set as: K=A(t)·v²+B(t)·v+C(t), where K is the joule, v is the driving quantity, t is the temperature, and A(t), B(t), and C(t) are quadratic functions of temperature t. After expansion, the model contains nine undetermined coefficients. Substitute all the calibration samples into the quadratic polynomial model to construct a system of linear equations with respect to the nine undetermined coefficients. Solve for the nine undetermined coefficients using singular value decomposition to obtain the fitted model.

3. The closed-loop process control method for liquid lens temperature compensation according to claim 2, characterized in that, The step of substituting all the corrected samples into the quadratic polynomial model to construct a system of linear equations for the nine undetermined coefficients, and solving the nine undetermined coefficients using singular value decomposition, includes: When multiple different test heights are set, all calibration samples are merged and uniformly participated in the fitting. All samples jointly construct a system of linear equations about the nine undetermined coefficients, and solve them to obtain a set of nine undetermined coefficients. Alternatively, all calibration samples are divided into multiple sample groups according to the corresponding test heights, and each sample group is fitted separately to obtain an independent nine-coefficient model corresponding to each test height. In practical applications, the target distance is determined based on the current working height and converted into the target focal length, which is then input into the unified model. The target driving quantity is then solved in reverse by combining the real-time lens temperature. When group fitting is used, the matching model is selected based on the current working height for solution.

4. The closed-loop process control method for temperature compensation of liquid lens according to claim 1, characterized in that, The steps of determining the target focal length from the target object distance, obtaining the current lens temperature, and inversely solving the target driving quantity using the quadratic polynomial model include: Convert the target distance to the target focal length; Substituting the current lens temperature into the quadratic polynomial model, we obtain a univariate quadratic equation for the driving quantity. Solve the quadratic equation in one variable. If two valid real roots are obtained, select the root that is within the allowable range of the lens driver and close to the center of the preset working interval as the target driving quantity.

5. The closed-loop process control method for liquid lens temperature compensation according to claim 4, characterized in that, The steps for solving the quadratic equation include: If no valid real root within the allowable range of the lens driver is obtained, the optimal driving quantity corresponding to the calibration sample on both sides of the current lens temperature is selected, and a temporary target driving quantity is obtained through linear interpolation. At the same time, the current state is marked as a calculation anomaly and the corresponding record is retained. If only one valid real root is obtained that is within the range allowed by the lens driver, then the valid real root is directly determined as the target driving quantity.

6. The closed-loop process control method for temperature compensation of liquid lens according to claim 1, characterized in that, The step of driving the liquid lens to acquire images under multiple driving quantities after the temperature chamber reaches and stabilizes at each temperature point includes: The system collects the actual temperature inside the chamber in real time. When the absolute value of the difference between the actual temperature and the target temperature at the current temperature collection point is less than a preset threshold, a stabilization timer is started. Once the cumulative duration of the stable timing reaches the preset duration, the temperature is determined to be stable, triggering the liquid lens to perform drive quantity scanning and image acquisition.

7. The closed-loop process control method for temperature compensation of liquid lens according to claim 1, characterized in that, The step of using the driving amount corresponding to the peak imaging quality as the optimal driving amount includes: First, scan the entire range of driving volume with the first step length to determine the approximate range with the highest imaging quality; Then, a second step size smaller than the first step size is used to perform a fine scan within the approximate range, and the driving amount corresponding to the peak image quality in the fine scan is taken as the optimal driving amount.

8. A closed-loop process control system for temperature compensation in a liquid lens, characterized in that, The liquid lens temperature compensation closed-loop process control method according to any one of claims 1-7, wherein the liquid lens temperature compensation closed-loop process control system comprises: The image sampling unit is used to receive the sampling trigger command and drive the liquid lens to acquire images under multiple driving quantities. The driving quantity corresponding to the peak image quality is used as the optimal driving quantity to obtain the correction sample. The model fitting unit is used to summarize the correction samples of all temperature acquisition points, convert the target object distance into joules, and fit a quadratic polynomial model. The drive calculation unit is used to determine the target focal length based on the target object distance, obtain the current lens temperature, and solve the target drive quantity in reverse through a quadratic polynomial model. Deploy an adaptation unit to identify the writing capability of the lens driver, write the model coefficients to the lens driver, or retain the model coefficients on the host computer side and send down the target driving quantity obtained by solving. The verification traceability unit is used to periodically obtain verification driving quantities based on the current lens temperature and target focal length, acquire verification images, and associate and store the verification results with the correction samples.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the liquid lens temperature compensation closed-loop process control method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the closed-loop process control method for temperature compensation of a liquid lens as described in any one of claims 1 to 7.