Plane distortion compensation method of voice coil motor and electronic equipment

By establishing a dense calibration grid within the two-dimensional motion stroke of the voice coil motor and performing cluster analysis, and fitting a homography compensation matrix, the planar distortion problem of the voice coil motor is solved, achieving high-precision nonlinear distortion compensation and improving positioning accuracy and imaging quality.

CN121728352APending Publication Date: 2026-03-24PUYA SEMICON SHANGHAI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-18
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing planar distortion compensation methods for voice coil motors suffer from insufficient positioning accuracy and image quality due to inter-axis crosstalk. Existing linear compensation methods have large residual errors and cannot effectively improve autofocus speed and optical image stabilization performance.

Method used

By establishing a dense calibration grid within the two-dimensional motion stroke of the voice coil motor, the theoretical and measured coordinates of the grid points are obtained. Cluster analysis is used to divide the grid into intervals with similar distortion characteristics, and a homography compensation matrix is ​​fitted in each interval. Finally, the local compensation matrices are merged into a global compensation matrix to achieve high-precision nonlinear distortion compensation.

Benefits of technology

The accuracy of planar distortion compensation of the voice coil motor has been improved, which has enhanced autofocus speed, optical image stabilization performance and image sharpness, and ensured the positioning and control accuracy of the voice coil motor throughout the entire two-dimensional motion stroke.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121728352A_ABST
    Figure CN121728352A_ABST
Patent Text Reader

Abstract

The invention provides a plane distortion compensation method of a voice coil motor and electronic equipment, and relates to the technical field of camera modules. The method comprises the following steps: converting a target moving position coordinate of the voice coil motor by using a preset global compensation matrix, and then controlling the voice coil motor to act; wherein the calibration process of the global compensation matrix comprises the following steps of: establishing grids according to a two-dimensional motion travel range of the voice coil motor, and acquiring theoretical coordinates of each grid point; controlling the voice coil motor to sequentially move to each theoretical coordinate, and synchronously acquiring the actual arrival position of the voice coil motor to obtain an actual measurement coordinate; performing clustering analysis according to the error between the theoretical coordinate and the actually measured coordinate of each grid point, and dividing the grid into one or more intervals; in each interval, taking theoretical coordinates and actually measured coordinates of all grid points in the interval as matching pairs, and performing fitting solving to obtain a corresponding homography compensation matrix; and fusing all compensation matrixes to obtain a global compensation matrix. According to the scheme, the plane distortion compensation precision of the voice coil motor can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of camera module technology, and more specifically, to a planar distortion compensation method and electronic device for a voice coil motor. Background Technology

[0002] In modern optical imaging devices, such as smartphones and security cameras, the voice coil motor (VRM) is a core component for achieving autofocus and optical image stabilization. The VRM drives the lens or image sensor through precise translational motion within a two-dimensional plane. However, due to factors such as mechanical structure and magnetic field distribution, the movement of the VRM in one axis can couple to another, generating "inter-axis crosstalk." This causes its actual motion trajectory to deviate from the command, inducing nonlinear distortion and severely affecting positioning accuracy and final image quality.

[0003] To overcome the aforementioned planar distortion problem, existing technologies typically employ a linear compensation method based on center axis calibration. This method involves selecting a limited number of sampling points along the X and Y axis centerlines of the voice coil motor's motion plane. By measuring crosstalk data at these points, a simple linear error model is established, and a linear interpolation algorithm is used to extrapolate this model to the entire motion plane to achieve distortion compensation. While this method can alleviate the impact of inter-axis crosstalk to some extent, the residual error after compensation remains significant, and there is still considerable room for improvement in overall control accuracy. This limits further improvements in high-end camera modules in areas such as autofocus speed, optical image stabilization performance, and image sharpness. Summary of the Invention

[0004] The purpose of this application is to provide a planar distortion compensation method and electronic device for a voice coil motor, which can effectively improve the planar distortion compensation accuracy of the voice coil motor.

[0005] This application is implemented as follows: In a first aspect, this application provides a planar distortion compensation method for a voice coil motor, comprising the following steps: obtaining the target movement position coordinates of the voice coil motor; transforming the target movement position coordinates using a preset global compensation matrix, and controlling the voice coil motor to move according to the transformed position coordinates. The calibration process of the global compensation matrix is ​​as follows: establishing a grid based on the two-dimensional motion range of the voice coil motor, and obtaining the theoretical coordinates of each grid point; controlling the voice coil motor to move sequentially to each theoretical coordinate, and simultaneously obtaining its actual arrival position to obtain the measured coordinates; performing cluster analysis based on the error between the theoretical coordinates and the measured coordinates of each grid point to divide the grid into one or more intervals; within each interval, using the theoretical coordinates and measured coordinates of all grid points within that interval as matching pairs, fitting and solving the corresponding homography compensation matrix; and fusing the homography compensation matrices of all intervals to obtain the global compensation matrix.

[0006] In a second aspect, this application provides an electronic device including a memory for storing one or more programs; a processor; and, when the one or more programs are executed by the processor, implementing the method as described in any one of the first aspects above.

[0007] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of the first aspects above.

[0008] Fourthly, this application provides a computer program product including computer program instructions that, when executed by a processor, implement the method as described in any one of the first aspects above.

[0009] Compared with the prior art, this application has at least the following advantages or beneficial effects: This application proposes a planar distortion compensation method for a voice coil motor. First, a dense calibration grid is established across the entire two-dimensional motion stroke of the voice coil motor. The ideal coordinates of each grid point and the actual coordinates reached by the voice coil motor are obtained, and error data covering the entire domain is constructed accordingly. Next, to handle complex nonlinear distortion, cluster analysis is introduced. Based on the error data, the entire grid is divided into several intervals with similar distortion characteristics, thereby achieving a segmented and refined description of the nonlinear distortion law. Then, within each interval, using the theoretical and measured coordinates of all grid points within that interval, a high-precision local compensation matrix is ​​constructed by fitting a homography transformation model capable of describing complex mapping relationships. Finally, these local compensation matrices are fused to generate a position-dependent global compensation matrix. Thus, in actual control, this global compensation matrix can be used to perform high-precision nonlinear inverse transformation correction on any target position command, thereby driving the voice coil motor to accurately reach the predetermined position and achieving efficient compensation for planar distortion. Attached Figure Description

[0010] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a flowchart of an embodiment of a planar distortion compensation method for a voice coil motor according to this application; Figure 2 This is a schematic diagram comparing the theoretical coordinates and measured coordinates in the grid in one embodiment of this application; Figure 3This is a spatial clustering distribution diagram of all grid points divided into 3 clusters in one embodiment of this application; Figure 4A This is a schematic diagram of the weight configuration of cluster 0 in one embodiment of this application; Figure 4B This is a schematic diagram of the weight configuration of cluster 1 in one embodiment of this application; Figure 4C This is a schematic diagram of the weight configuration of cluster 2 in one embodiment of this application; Figure 5 This is a schematic diagram showing the comparison between the coordinates before and after compensation and the ideal position in one embodiment of this application; Figure 6 This is a schematic diagram of error comparison based on measurement points in one embodiment of this application; Figure 7 This is a structural block diagram of an electronic device provided in an embodiment of this application.

[0012] Icons: 201, Processor; 202, Memory; 203, Communication Interface. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. It should be understood that this application is not limited to the exemplary embodiments described herein.

[0014] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.

[0015] Application Overview In developing this application, the inventors discovered that existing linear compensation methods based on center axis calibration still suffer from significant residual errors after compensation. This is because, firstly, their sampling range is limited to only two axes, making it impossible to obtain the true distortion data for most areas of the motion plane (especially the corner areas). Secondly, the linear model used is inconsistent with the complex nonlinear crosstalk characteristics exhibited by voice coil motors in actual operation. These two factors mean that while this method can alleviate the impact of inter-axis crosstalk to some extent, the residual error after compensation remains large, and there is still significant room for improvement in overall control accuracy.

[0016] To address the aforementioned issues, this application provides a planar distortion compensation method for voice coil motors. This method achieves high-precision, global compensation for planar nonlinear distortion of the voice coil motor by fusing global grid calibration with error-feature-based clustering partitioning and employing a homography transformation model for each partition. In other words, the solution presented in this application effectively improves the accuracy of planar distortion compensation for voice coil motors, contributing to further improvements in camera module performance, including autofocus speed, optical image stabilization, and image sharpness.

[0017] After introducing the basic principles of this application, various non-limiting embodiments of this application will be described in detail below with reference to the accompanying drawings. Unless otherwise specified, the various embodiments and features described below can be combined with each other.

[0018] Exemplary methods This method for compensating for planar distortion in a voice coil motor comprises two logical stages: an offline calibration stage and an online compensation control stage. The offline calibration stage is responsible for calibrating the global compensation matrix, while the online compensation control stage uses this global compensation matrix to perform high-precision real-time control of the voice coil motor to compensate for planar distortion.

[0019] Please refer to Figure 1 The online compensation and control phase includes the following steps: Step S101: Obtain the target movement position coordinates of the voice coil motor; Step S102: Using a preset global compensation matrix, transform the target's moving position coordinates, and control the voice coil motor to operate based on the transformed position coordinates.

[0020] In steps S101 to S102 above, when controlling the voice coil motor, a command calculated by the autofocus algorithm or optical image stabilization algorithm is first received. This command carries the target movement position coordinates of the voice coil motor, that is, the desired target ideal position coordinates that the voice coil motor should eventually reach. Then, instead of directly controlling the voice coil motor using this command, a preset global compensation matrix is ​​used to perform an inverse transformation on the target movement position coordinates to obtain a corrected drive command (this command compensates and corrects the target movement position coordinates). The voice coil motor is then controlled according to this corrected drive command.

[0021] It should be noted that since the preset global compensation matrix describes the distortion from "theoretical coordinates" to "measured coordinates," its inverse transformation describes the correction from "measured coordinates" to "theoretical coordinates." Therefore, when the voice coil motor is controlled by a drive command that has been corrected through distortion compensation, its inherent distortion will precisely correct the final position coordinates reached by the voice coil motor back to the initially desired target position coordinates, thereby improving the control accuracy of the voice coil motor.

[0022] The offline calibration phase in this method is the calibration process for the global compensation matrix; please refer to [link / reference needed]. Figure 1 The calibration process includes the following steps: Step S201: Establish a grid based on the two-dimensional motion range of the voice coil motor and obtain the theoretical coordinates of each grid point.

[0023] In step S201 above, a grid composed of theoretical coordinate points is established within the two-dimensional motion range of the voice coil motor. Each theoretical coordinate represents a position that the voice coil motor should theoretically be able to perfectly reach. It should be noted that, unlike existing technologies that only sample on the axis, this grid covers the entire area of ​​the voice coil motor in the two-dimensional motion plane (including edges and corners) as reference points. Therefore, subsequent high-precision correction can be performed on motion commands (commands to control the voice coil motor to reach any position) at any position in the plane (including the central axis, edges, and corners). That is, unlike schemes that only sample on the axis, which have the drawback of being effective only on the axis and having poor or even failed compensation in the corner areas, this method improves the overall and uniform positioning accuracy of the voice coil motor throughout its entire two-dimensional motion range.

[0024] Step S202: Control the voice coil motor to move sequentially to each theoretical coordinate, and simultaneously obtain its actual position to get the measured coordinates.

[0025] In step S202 above, a command can be sent sequentially to the voice coil motor to reach the theoretical coordinates corresponding to each grid point defined in step S201. Simultaneously, a high-precision position sensor (such as a laser interferometer or image sensor) can be used to measure the actual position of the lens or image sensor in real time.

[0026] Step S203: Perform cluster analysis based on the error between the theoretical coordinates and the measured coordinates of each grid point to divide the grid into one or more intervals.

[0027] In step S203 above, the error between the theoretical and measured coordinates of each grid point is first calculated. Then, cluster analysis is performed on the theoretical coordinates of each grid point and the corresponding error. This allows grid points with similar error conditions and concentrated coordinate ranges to be grouped into the same group. The spatial region corresponding to each group can then be defined as an interval, thereby dividing the original grid into one or more intervals.

[0028] Step S204: Within each interval, using the theoretical and measured coordinates of all grid points within that interval as matching pairs, fit and solve the corresponding homography compensation matrix.

[0029] Within each interval defined in step S203, the theoretical and actual coordinates of all grid points are treated as pairs of "ideal-actual" matching points. Then, using these point pairs, a 3×3 homography matrix is ​​calculated through numerical optimization algorithms (such as least squares). This homography matrix mathematically describes the complex, nonlinear geometric mapping relationship between theoretical and actual coordinates within the interval.

[0030] It should be noted that the homography matrix can describe complex geometric relationships, including perspective transformations, and its fitting accuracy is much higher than that of a simple linear model. That is, step S204 above establishes a corresponding high-precision nonlinear distortion model for each interval.

[0031] The transformation formula for the homography matrix can be: .in, The coordinates before the transformation. The coordinates are the transformed coordinates. For the first The homography matrix of each interval.

[0032] Thus, the corrected coordinates are:

[0033] in, For the first The data in the first row and first column of the homography matrix corresponding to each interval. For the first The data in the first row and second column of the homography matrix corresponding to each interval, ... For the first The data in the third row and third column of the homography matrix corresponding to each interval.

[0034] Step S205: Merge the homography compensation matrices of all intervals to obtain the global compensation matrix.

[0035] In step S205 above, a unified, position-dependent global compensation matrix is ​​obtained by fusing the homography compensation matrices of all intervals. Therefore, when a coordinate (X, Y) is input, this global compensation matrix can map the coordinate (X, Y) to a new coordinate (X', Y') according to its defined rules (such as affine transformation, transmission transformation, etc.). This fusing process also avoids abrupt compensation changes at interval boundaries, ensuring the continuity and smoothness of motion commands when the voice coil motor crosses different distortion intervals, thus achieving a seamless transition from discrete local models (homography matrices) to continuous global control (global compensation matrix).

[0036] In summary, the above embodiments first establish a dense calibration grid across the entire two-dimensional motion stroke of the voice coil motor. By acquiring the ideal coordinates of each grid point and the actual coordinates reached by the voice coil motor, error data covering the entire domain is constructed. Next, to handle complex nonlinear distortion, the embodiments introduce cluster analysis, dividing the entire grid into several intervals with similar distortion characteristics based on the error data, thereby achieving a segmented and refined description of the nonlinear distortion pattern. Then, within each interval, using the theoretical and measured coordinates of all grid points within that interval, a high-precision local compensation matrix is ​​constructed by fitting a homography transformation model capable of describing complex mapping relationships. Finally, these local compensation matrices are fused to generate a position-dependent global compensation matrix. Thus, in actual control, this global compensation matrix can be used to perform high-precision nonlinear inverse transformation correction on any target position command, thereby driving the voice coil motor to accurately reach the predetermined position and achieving efficient compensation for planar distortion.

[0037] Based on the aforementioned scheme, in some implementations of this application, the step of establishing a grid based on the two-dimensional motion range of the voice coil motor includes: placing points at equal intervals along the horizontal and vertical directions within the two-dimensional motion range of the voice coil motor to obtain a uniform grid; or, within the two-dimensional motion range of the voice coil motor, sparsely or densely placing points according to an error distribution density map to obtain a non-uniform grid, wherein the error distribution density map is a density map characterizing the deviation of the mapping relationship between the actual motion position of the voice coil motor and the input control command from the ideal linear ratio.

[0038] The above implementation provides two methods for establishing the calibration mesh to accommodate voice coil motors with different characteristics: The first method is the equidistant division scheme. Specifically, based on the travel range of the voice coil motor in the X and Y axes, at least three points are evenly selected in each direction, thus dividing the travel in each axis into multiple segments. This forms an N×N uniform grid matrix (N is an integer greater than or equal to 3) in a two-dimensional plane. The coordinates of the intersection points of this matrix serve as the ideal coordinates required for calibration. This scheme is suitable for motors with relatively uniform error distribution, and its advantages lie in its simplicity and regular point layout.

[0039] The second approach is a non-uniformly spaced calibration scheme. The core of this scheme lies in targeted calibration point placement based on the measured stroke nonlinearity characteristics of the voice coil motor (i.e., the spatial distribution of errors). Specifically, in areas where measured data shows significant distortion and severe errors, denser calibration points are placed to obtain high-resolution distortion data; in areas with less distortion and gentler errors, relatively sparse calibration points are placed. This method, by intensive sampling and focused compensation in key error-concentrated intervals, can more effectively improve the overall compensation accuracy with a fixed total number of calibration points, and is particularly suitable for voice coil motors with significantly uneven error distribution.

[0040] Based on the aforementioned scheme, in some implementations of this application, the step of performing cluster analysis based on the error between the theoretical coordinates and measured coordinates of each grid point to divide the grid into one or more intervals includes: for each grid point, constructing a corresponding multidimensional feature vector based on its theoretical coordinates, and the error vector, error magnitude, and error direction between the theoretical coordinates and measured coordinates; using a clustering algorithm to perform clustering processing on the set composed of the multidimensional feature vectors of all grid points, dividing grid points with similar features into the same cluster; for each cluster obtained by the clustering processing, using the minimum bounding box algorithm to generate a corresponding axial bounding box, and defining the rectangular region defined by each axial bounding box as an interval.

[0041] In the above implementation, a multidimensional feature vector is first constructed for each calibrated grid point. This multidimensional feature vector not only includes its spatial location (theoretical coordinates) but also integrates its distortion characteristics: namely, the error vector calculated from the theoretical and measured coordinates, the magnitude of the error vector (error magnitude), and the orientation angle (error direction). This quantitative description organically combines "where the error occurs" and "how the error occurs" of the grid point. Subsequently, by using a clustering algorithm (such as DBSCAN) to process the set of multidimensional feature vectors of all grid points, natural groupings in the data can be discovered based on feature similarity, grouping grid points with similar distortion patterns into the same cluster, so that regions with consistent distortion patterns can be identified at the algorithm level. Finally, to transform the abstract "point cluster" into spatial partitioning, a minimum bounding box (axial bounding box) algorithm is used for each cluster. By extracting the extreme values ​​of the coordinates of all points in the X and Y directions within the cluster, a rectangular region that exactly surrounds the cluster is quickly generated, and this rectangle is explicitly defined as an interval.

[0042] To facilitate intuitive understanding, the above implementation method will be illustrated below using mathematical expressions. The steps described above, "dividing the grid into one or more intervals by performing cluster analysis based on the error between the theoretical and measured coordinates of each grid point," can be mainly divided into two steps: "calculating the error between the theoretical and measured coordinates" + "dividing the intervals through cluster analysis." The first step is to calculate the error between the theoretical coordinates and the measured coordinates:

[0043] in, The measured coordinates of the grid points Axis coordinates The measured coordinates of the grid points Axis coordinates The theoretical coordinates corresponding to the grid points Axis coordinates The theoretical coordinates corresponding to the grid points Axis coordinates.

[0044] The second step is to divide the intervals using cluster analysis: (1) Construction of multidimensional feature vectors: using the theoretical coordinates and error vectors corresponding to the grid points ( , ), error magnitude and error direction (arctan( / )) Construct features.

[0045] (2) Clustering: The DBSCAN algorithm is used for clustering as an example.

[0046] (3) Interval boundary extraction: The compensation interval is generated using the minimum bounding box (AABB) algorithm.

[0047]

[0048] in, For the first Each interval This is the set of coordinates for the current interval. For the first each interval Minimum coordinates of the axis For the first each interval Maximum coordinate of axis For the first each interval Minimum coordinates of the axis For the first each interval Maximum coordinate of the axis.

[0049] For example, in some implementations of this application, the clustering algorithm is a density-based clustering algorithm.

[0050] It should be noted that by employing density-based clustering algorithms (such as the DBSCAN algorithm), on the one hand, it can be used to identify clusters of arbitrary shapes without pre-specifying the number of intervals, which perfectly matches the characteristics of the complex and irregular spatial distribution of the plane distortion of the voice coil motor. On the other hand, density-based clustering algorithms are naturally robust to noise and outliers, and can identify and eliminate a few abnormal calibration points caused by measurement errors as noise, ensuring that each final interval is composed of core points with highly consistent distortion characteristics and a close distribution.

[0051] Based on the aforementioned scheme, in some implementations of this application, the step of dividing the grid into one or more intervals further includes: modifying the number or range boundary of the one or more intervals in response to the input.

[0052] In the above implementation, after the clustering algorithm automatically generates one or more compensation intervals, operators or engineers are allowed to manually adjust the automatically partitioned results in response to external input commands. These adjustments mainly include two categories: first, modifying the number of intervals (e.g., merging two intervals that the algorithm deems should be separated but have similar actual characteristics, or splitting an excessively large interval); second, modifying the spatial boundaries of specific intervals (e.g., fine-tuning the coordinates of the bounding box to better fit actual process requirements or known physical constraints). This enhances the interpretability and engineering practicality of the planar distortion compensation method for voice coil motors, avoids potentially mechanical errors in partitioning by clustering algorithms, and ensures a high degree of consistency between subsequent compensation strategies and the real physical world.

[0053] Based on the aforementioned scheme, in some implementations of this application, the step of fusing the homography compensation matrices of all intervals includes: calculating the weight of each interval using a preset weight function, and weighting the homography compensation matrix of the interval according to the calculated weight. The preset weight function is a continuous function with an output range of [0,1], and its function value increases monotonically with the proximity of the spatial point to the core of the interval.

[0054] In the above implementation, by designing the preset weight function as a continuous function with an output range of [0,1], and whose function value monotonically increases with the proximity of a spatial point to the core of the interval, the homography compensation matrices of all intervals can be fused according to the preset weight function. This allows for dynamic weight allocation to each interval, achieving a smooth transition between intervals and avoiding abrupt changes caused by hard boundaries. Specifically, it can configure weights close to 1 in the core interval with large errors and a large number of grid points, and configure weights close to 0 in the edge regions with small errors and a small number of grid points, while smoothly changing the weights across past intervals.

[0055] For example, in some implementations of this application, the preset weighting function includes at least one of the Sigmoid function, polynomial smoothing function, radial basis function, or piecewise linear smoothing function.

[0056] Based on the aforementioned scheme, in some implementations of this application, the step of fusing the homography compensation matrices of all intervals includes: calculating the weight of each interval using the Sigmoid function, normalizing the calculated weights, and then using the normalized weights to weight the homography compensation matrices of the corresponding intervals, so as to fuse the homography compensation matrices of all intervals.

[0057] In the above implementation, the Sigmoid function, with its perfect smoothness, monotonicity, and boundedness, can perfectly match the requirement that the weights of each interval transition continuously from 0 to 1 without abrupt changes. At the same time, the normalization process ensures that the total weight of all interval contributions remains constant, making the fused compensation amount mathematically consistent and avoiding additional gains or deviations that may be introduced by fluctuations in the total weight.

[0058] For example, in some implementations of this application, the step of calculating the weights of each interval using the Sigmoid function includes: using the calculation formula Calculate the weight of each interval, where, For the first The weights of each interval, For the first Within each interval, the distance from each grid point to the interval boundary. For smoothing parameters that control the steepness of the transition, It is the natural logarithm.

[0059] For example, normalization can ensure that the sum of all weights is 1:

[0060] in, For the first The weight values ​​after interval normalization For the first The weight values ​​of each interval before normalization Sum the weights for all intervals. The index is used for range traversal.

[0061] Thus, the final generated global compensation matrix is:

[0062] in, For the global compensation matrix, For the first The 3×3 homography compensation matrix for each interval. For the first The weights are normalized values ​​for each interval. It should be noted that within each interval: In the boundary transition zone: It is a smooth blend of adjacent matrices.

[0063] Finally, in the compensation application phase, for any point The corrected coordinates are:

[0064] any point This refers to the target movement position coordinates obtained in step S101; the transformed coordinates. That is, the position coordinates obtained by transforming the target's moving position using a preset global compensation matrix in step S102; For the transformation function, the input coordinates are transformed using the rules defined by the global compensation matrix (such as affine transformation, perspective transformation, etc.). Mapped to new coordinates The specific operations depend on the type of matrix.

[0065] To enable those skilled in the art to understand this application more intuitively, a specific example will be used here for illustration. In this example, a complete process and effect of the voice coil motor planar distortion compensation method of this application will be demonstrated step by step through a set of specific experimental data.

[0066] (1) Obtain calibration data like Figure 2 As shown, a uniform calibration grid is first established for a voice coil motor within its two-dimensional motion stroke (set to ±300 micrometers in both the X and Y directions). The voice coil motor is controlled to move sequentially to the theoretical coordinates of each grid point, and its measured coordinates are simultaneously measured using a high-precision sensor, thereby obtaining calibration data pairs covering the entire area. Figure 2 The ideal values ​​are the theoretical coordinates of each grid point, and the test values ​​are the measured coordinates of each grid point.

[0067] (2) Cluster analysis and interval partitioning Cluster analysis is performed based on the theoretical coordinates of all grid points and their corresponding error vectors (measured coordinates - theoretical coordinates). In this example, the clustering algorithm automatically divides all grid points into 3 clusters. The range of theoretical and measured coordinates for each cluster is shown in the table below:

[0068] Based on the theoretical extreme values ​​of all points in each cluster, three rectangular compensation intervals can be defined using the minimum bounding box algorithm. The boundaries of these intervals are the "ideal coordinate range" shown in the table above. A diagram illustrating the partitioning results can be found here. Figure 3 .

[0069] (3) Calculate the homography compensation matrix for each interval. For each compensation interval defined above, using the theoretical and measured coordinates of all grid points within it as matching point pairs, a 3×3 homography compensation matrix specifically for that interval is calculated through least squares fitting. The calculation results are as follows: 1) Interval 0 (corresponding to cluster 0): Number of grid points = 54, theoretical coordinates X = [-300, 300], theoretical coordinates Y = [-300, -50], homography compensation matrix is: [1.0230-0.0089-1.4945] [0.00051.030127.7556] [-0.0000-0.00011.0000] 2) Interval 1 (corresponding to cluster 1): Number of grid points = 45, theoretical coordinates X = [0, 300], theoretical coordinates Y = [0, 300], homography compensation matrix is: [0.9726-0.0066 -22.3707] [0.00300.9719 -22.6539] [-0.0001-0.00001.0000] 3) Interval 2 (corresponding to cluster 2): Number of grid points = 38, theoretical coordinates X = [-300, -50], theoretical coordinates Y = [0, 300], homography compensation matrix is: [0.98270.003820.8553] [0.00590.9989 -23.9575] [0.0000-0.00001.0000] (4) Weight calculation and matrix fusion To perform matrix fusion, weights need to be calculated for each interval. Taking a point in space as an example, the initial weights (raw_weights) of its position relative to the three intervals are calculated using the Sigmoid function: [0.23984, 0.01, 0.012194]. After normalization, the final normalized weights are obtained: [0.915299, 0.038163, 0.04653798]. A diagram illustrating the weight configuration can be found here. Figure 4A , Figure 4B and Figure 4C .

[0070] Subsequently, the homography compensation matrices of the three intervals above are weighted and summed using this normalized weight. After fusion, the global compensation matrix applicable to this spatial point is obtained as follows: [1.01919886e+00, -8.25256712e-03, -1.25110113e+00] [8.73962507e-04,1.02645280e+00,2.34251354e+01] [-3.99556445e-05, -8.52619434e-05,1.00000000e+00] (5) Verification of compensation effect By comparing the data before and after applying this global compensation matrix for position correction, the compensation effect can be quantitatively evaluated. Figure 5 The comparison between the coordinates before and after compensation and the ideal position clearly shows that the position after compensation ( Figure 5 The blue dot (in the middle) is compared to its position before compensation. Figure 5 The red dot in the middle is clearly closer to the ideal target location. Figure 5 (Green dot). This means that the experimental results show that the error between the actual position of the voice coil motor and its target ideal position is significantly reduced after compensation. For example... Figure 6 As shown, the average positioning error before compensation was about 25 micrometers, while after compensation by the voice coil motor plane distortion compensation method of this application, the average error was reduced to about 10 micrometers.

[0071] Exemplary electronic devices Please see Figure 7 This application provides an electronic device including at least one processor 201 and at least one memory 202. The processor 201 and memory 202 are directly connected to each other, or communicate with each other through a communication interface 203, or are electrically connected through one or more communication buses or signal lines to achieve data transmission or interaction. The memory 202 stores program instructions executable by the processor 201, which can call and execute the program instructions to implement a planar distortion compensation method for a voice coil motor according to various embodiments of this application, as described in the "Exemplary Methods" section above. For example, implementing: The target movement position coordinates of the voice coil motor are obtained. A preset global compensation matrix is ​​used to transform these coordinates, and the voice coil motor is controlled based on the transformed coordinates. The calibration process for the global compensation matrix is ​​as follows: a grid is established based on the two-dimensional motion range of the voice coil motor, and the theoretical coordinates of each grid point are obtained; the voice coil motor is controlled to move sequentially to each theoretical coordinate, and its actual position is simultaneously obtained to obtain the measured coordinates; cluster analysis is performed based on the error between the theoretical and measured coordinates of each grid point to divide the grid into one or more intervals; within each interval, the corresponding homography compensation matrix is ​​fitted and solved using the theoretical and measured coordinates of all grid points within that interval as matching pairs; the homography compensation matrices of all intervals are fused to obtain the global compensation matrix.

[0072] The memory 202 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.

[0073] The processor 201 can be an integrated circuit chip with signal processing capabilities. The processor 201 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0074] Understandable. Figure 7 The structure shown is for illustrative purposes only; the electronic device may also include components that are more advanced than those shown. Figure 7 The more or fewer components shown, or having the same Figure 7 The different configurations shown. Figure 7 The components shown can be implemented using hardware, software, or a combination thereof.

[0075] Exemplary computer-readable storage media and computer program products This application provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor 201, the computer program implements a planar distortion compensation method for a voice coil motor according to various embodiments of this application as described in the "Exemplary Methods" section above. For example, it implements: The target movement position coordinates of the voice coil motor are obtained. A preset global compensation matrix is ​​used to transform these coordinates, and the voice coil motor is controlled based on the transformed coordinates. The calibration process for the global compensation matrix is ​​as follows: a grid is established based on the two-dimensional motion range of the voice coil motor, and the theoretical coordinates of each grid point are obtained; the voice coil motor is controlled to move sequentially to each theoretical coordinate, and its actual position is simultaneously obtained to obtain the measured coordinates; cluster analysis is performed based on the error between the theoretical and measured coordinates of each grid point to divide the grid into one or more intervals; within each interval, the corresponding homography compensation matrix is ​​fitted and solved using the theoretical and measured coordinates of all grid points within that interval as matching pairs; the homography compensation matrices of all intervals are fused to obtain the global compensation matrix.

[0076] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0077] Furthermore, embodiments of this application can also be computer program products, comprising computer program instructions that, when executed by a processor, implement the steps of a planar distortion compensation method for a voice coil motor according to various embodiments of this application as described in the "Exemplary Methods" section above. For example, implementing: The target movement position coordinates of the voice coil motor are obtained. A preset global compensation matrix is ​​used to transform these coordinates, and the voice coil motor is controlled based on the transformed coordinates. The calibration process for the global compensation matrix is ​​as follows: a grid is established based on the two-dimensional motion range of the voice coil motor, and the theoretical coordinates of each grid point are obtained; the voice coil motor is controlled to move sequentially to each theoretical coordinate, and its actual position is simultaneously obtained to obtain the measured coordinates; cluster analysis is performed based on the error between the theoretical and measured coordinates of each grid point to divide the grid into one or more intervals; within each interval, the corresponding homography compensation matrix is ​​fitted and solved using the theoretical and measured coordinates of all grid points within that interval as matching pairs; the homography compensation matrices of all intervals are fused to obtain the global compensation matrix.

[0078] The computer program product can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this application. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0079] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from the spirit or essential characteristics of this application. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within this application. No reference numerals in the claims should be construed as limiting the scope of the claims.

Claims

1. A method for compensating for planar distortion in a voice coil motor, characterized in that, Includes the following steps: Obtain the target movement position coordinates of the voice coil motor; The target's position coordinates are transformed using a preset global compensation matrix, and the voice coil motor is controlled to operate based on the transformed position coordinates. The calibration process of the global compensation matrix is ​​as follows: a grid is established based on the two-dimensional motion range of the voice coil motor, and the theoretical coordinates of each grid point are obtained; the voice coil motor is controlled to move sequentially to each theoretical coordinate, and its actual position is obtained synchronously to obtain the measured coordinates; cluster analysis is performed based on the error between the theoretical coordinates and the measured coordinates of each grid point to divide the grid into one or more intervals. Within each interval, the corresponding homography compensation matrix is ​​obtained by fitting the theoretical and measured coordinates of all grid points within that interval as matching pairs; the homography compensation matrices of all intervals are then fused to obtain the global compensation matrix.

2. The method according to claim 1, characterized in that, The step of establishing a grid based on the two-dimensional motion range of the voice coil motor includes: Within the two-dimensional motion range of the voice coil motor, points are evenly spaced along the horizontal and vertical directions to obtain a uniform grid; or, within the two-dimensional motion range of the voice coil motor, points are spaced according to the error distribution density map to obtain a non-uniform grid. The error distribution density map is a density map characterizing the deviation of the mapping relationship between the actual motion position of the voice coil motor and the input control command from the ideal linear ratio.

3. The method according to claim 1, characterized in that, The step of dividing the grid into one or more intervals by performing cluster analysis based on the error between the theoretical and measured coordinates of each grid point includes: For each grid point, a corresponding multidimensional feature vector is constructed based on its theoretical coordinates, the error vector between the theoretical coordinates and the measured coordinates, the error magnitude, and the error direction. Clustering algorithms are used to cluster the set of multidimensional feature vectors of all grid points, and grid points with similar features are grouped into the same cluster. For each cluster obtained by clustering, a corresponding axial bounding box is generated using the minimum bounding box algorithm, and the rectangular region defined by each axial bounding box is defined as an interval.

4. The method according to claim 3, characterized in that, The clustering algorithm is a density-based clustering algorithm.

5. The method according to claim 1, characterized in that, The step of dividing the grid into one or more intervals is followed by: In response to the input, modify the number or range boundaries of one or more partitions.

6. The method according to claim 1, characterized in that, The step of fusing the homography compensation matrices of all intervals includes: The weights of each interval are calculated using a preset weight function, and the homography compensation matrix of the interval is weighted according to the calculated weights. The preset weight function is a continuous function with an output range of [0,1], and its function value increases monotonically with the proximity of the spatial point to the core of the interval.

7. The method according to claim 6, characterized in that, The preset weighting function includes at least one of the following: the Sigmoid function, the polynomial smoothing function, the radial basis function, or the piecewise linear smoothing function.

8. The method according to claim 1 or 6, characterized in that, The step of fusing the homography compensation matrices of all intervals includes: The weights of each interval are calculated using the Sigmoid function, and the calculated weights are normalized. Then, the homography compensation matrices of the corresponding intervals are weighted using the normalized weights to merge the homography compensation matrices of all intervals.

9. The method according to claim 8, characterized in that, The steps for calculating the weights of each interval using the Sigmoid function include: Using calculation formula Calculate the weight of each interval, where, For the first The weights of each interval, For the first Within each interval, the distance from each grid point to the interval boundary. For smoothing parameters that control the steepness of the transition, It is the natural logarithm.

10. An electronic device, characterized in that, include: Memory, used to store one or more programs; processor; When the one or more programs are executed by the processor, the method as described in any one of claims 1-9 is implemented.