Motor offset correction method and apparatus

By obtaining the target travel position of the voice coil motor on the Z-axis in the camera module and calculating the offset coefficients on the X and Y axes, the travel position of the voice coil motor in the X and Y axes is corrected, thus solving the autofocus drift problem caused by the movement of the voice coil motor on the Z-axis and improving the focusing accuracy.

CN115842488BActive Publication Date: 2026-06-30KUNSHAN Q TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
KUNSHAN Q TECH CO LTD
Filing Date
2022-11-16
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

During autofocus, the movement of the voice coil motor in the Z-axis direction causes offset in the X and Y-axis directions, resulting in autofocus drift and affecting focusing accuracy.

Method used

By obtaining the target travel position of the voice coil motor in the Z-axis direction, dividing it into N travel sub-intervals, calculating the offset coefficients in the X and Y-axis directions, and correcting the travel position of the voice coil motor in the X and Y-axis directions based on these coefficients and the target travel position.

Benefits of technology

The focusing accuracy of the camera module has been improved, autofocus drift has been reduced, and the stability of the voice coil motor in the X and Y axes has been ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115842488B_ABST
    Figure CN115842488B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for correcting motor offset. The method includes: obtaining the target travel position of the voice coil motor in the Z-axis direction; determining a target sub-interval from N travel sub-intervals based on the target travel position; dividing the travel range of the voice coil motor in the Z-axis direction into N travel sub-intervals, where N is an integer greater than 2; obtaining a first offset coefficient in the X-axis direction and a second offset coefficient in the Y-axis direction based on the endpoint positions and travel distance of the target sub-intervals; and obtaining a first correction position and a second correction position based on the target travel position, the first offset coefficient, the second offset coefficient, and the target sub-interval; the first correction position and the second correction position are the corrected travel positions of the voice coil motor in the X-axis and Y-axis directions, respectively. This invention can correct motor offset caused during the focusing process of a camera module, improving the focusing accuracy of the camera module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of camera module technology, and in particular to a method and apparatus for correcting motor offset. Background Technology

[0002] During autofocus, the voice coil motor (VCM) of the camera module moves along the Z-axis, which is the direction in which the camera module focuses. When the VCM moves along the Z-axis, its position in the X and Y axes is also affected, causing a shift and resulting in severe autofocus drift (AF drift). The plane formed by the X and Y axes is perpendicular to the Z-axis of the VCM. To ensure the focusing accuracy of the camera module, the VCM should not shift in the X and Y axes while moving along the Z-axis; that is, the VCM should not shift its center. However, currently there is no good way to control the VCM's shift, leading to inaccurate focusing by the camera module. Summary of the Invention

[0003] In view of the above problems, the present invention proposes a motor offset correction method and apparatus, which can correct the motor offset caused by the focusing process of the camera module and improve the focusing accuracy of the camera module.

[0004] In a first aspect, this application provides the following technical solution through an embodiment:

[0005] A method for correcting motor offset includes:

[0006] Obtain the target travel position of the voice coil motor in the Z-axis direction; based on the target travel position, determine a target sub-interval from N travel sub-intervals; the travel interval of the voice coil motor in the Z-axis direction is divided into N travel sub-intervals, where N is an integer greater than 2; based on the endpoint positions and travel distance of the target sub-intervals, obtain a first offset coefficient in the X-axis direction and a second offset coefficient in the Y-axis direction; the X-axis, Y-axis, and Z-axis are axes of a spatial rectangular coordinate system; based on the target travel position, the first offset coefficient, the second offset coefficient, and the target sub-interval, obtain a first correction position and a second correction position; wherein, the first correction position and the second correction position are the corrected travel positions of the voice coil motor in the X-axis direction and the Y-axis direction, respectively.

[0007] Optionally, the N+1 endpoint positions of the N travel sub-intervals correspond to N+1 first offset travel positions in the X-axis direction and N+1 second offset travel positions in the Y-axis direction; obtaining the first offset coefficient in the X-axis direction and the second offset coefficient in the Y-axis direction based on the endpoint positions and travel distance of the target sub-intervals includes:

[0008] Based on the endpoint positions of the target sub-interval, adjacent first and second offset positions are determined from N+1 first offset travel positions, and adjacent third and fourth offset positions are determined from N+1 second offset travel positions; based on the first offset position, the second offset position, the third offset position, the fourth offset position and the travel distance of the target sub-interval, the first offset coefficient and the second offset coefficient are obtained.

[0009] Optionally, obtaining the first offset coefficient and the second offset coefficient based on the first offset position, the second offset position, the third offset position, the fourth offset position, and the travel distance of the target sub-interval includes:

[0010] The first offset coefficient is obtained based on the ratio of the travel distance between the first offset position and the second offset position to the travel distance of the target sub-interval; the second offset coefficient is obtained based on the ratio of the travel distance between the third offset position and the fourth offset position to the travel distance of the target sub-interval.

[0011] Optionally, obtaining the first corrected position and the second corrected position based on the target travel position, the first offset coefficient, the second offset coefficient, and the target sub-interval includes:

[0012] Based on the travel distance between the target travel position and the target endpoint position of the target sub-interval, a compensation length is determined; based on the first offset coefficient, the compensation length, and the first target offset position, a first corrected position is obtained; the first target offset position is the offset position corresponding to the target endpoint position between the first offset position and the second offset position; based on the second offset coefficient, the compensation length, and the second target offset position, a second corrected position is obtained; the second target offset position is the offset position corresponding to the target endpoint position between the third offset position and the fourth offset position.

[0013] Optionally, obtaining the first corrected position based on the first offset coefficient, the compensation length, and the first target offset position includes:

[0014] The first compensation stroke is determined based on the product of the first offset coefficient and the compensation length; the first correction position is obtained based on the first target offset position and the first compensation stroke.

[0015] The step of obtaining the second corrected position based on the second offset coefficient, the compensation length, and the second target offset position includes: determining the second compensation stroke based on the product of the second offset coefficient and the compensation length; and obtaining the second compensation position based on the second target offset position and the second compensation stroke.

[0016] Optionally, the target endpoint position is the endpoint position that is closest to the target travel position among the two endpoint positions of the target sub-interval.

[0017] Optionally, the travel range of the voice coil motor in the Z-axis direction is 0 to 1023 codes, and N is 4, 8, or 16.

[0018] Secondly, based on the same inventive concept, this application provides the following technical solution through an embodiment:

[0019] A motor offset correction device, comprising:

[0020] The system includes a position acquisition module for acquiring the target travel position of the voice coil motor in the Z-axis direction; a travel interval determination module for determining a target sub-interval from N travel sub-intervals based on the target travel position; the travel interval of the voice coil motor in the Z-axis direction is divided into N travel sub-intervals, where N is an integer greater than 2; an offset coefficient acquisition module for obtaining a first offset coefficient in the X-axis direction and a second offset coefficient in the Y-axis direction based on the endpoint positions and travel distance of the target sub-interval; the X-axis, Y-axis, and Z-axis are axes of a spatial rectangular coordinate system; and an offset correction module for obtaining a first correction position and a second correction position based on the target travel position, the first offset coefficient, the second offset coefficient, and the target sub-interval; wherein the first correction position and the second correction position are the corrected travel positions of the voice coil motor in the X-axis direction and the Y-axis direction, respectively.

[0021] Thirdly, based on the same inventive concept, this application provides the following technical solution through an embodiment:

[0022] A camera module includes a processor and a memory, the memory being coupled to the processor, the memory storing instructions that, when executed by the processor, cause the camera module to perform the steps of any of the methods described in the first aspect above.

[0023] Fourthly, based on the same inventive concept, this application provides the following technical solution through an embodiment:

[0024] A readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the first aspects above.

[0025] This invention provides a motor offset correction method and apparatus. The method involves obtaining the target travel position of the voice coil motor along the Z-axis, then determining corresponding target sub-intervals along the Z-axis based on this target travel position. Furthermore, based on the travel distance and endpoint positions of these target sub-intervals, a first offset coefficient along the X-axis and a second offset coefficient along the Y-axis are determined. Finally, based on the target travel position, the first offset coefficient, the second offset coefficient, and the target sub-intervals, the corresponding first and second correction positions are obtained. This corrects the travel positions of the voice coil motor along the X and Y axes, improving the focusing accuracy of the camera module.

[0026] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:

[0028] Figure 1 A flowchart of a motor offset correction method in an embodiment of the present invention is shown;

[0029] Figure 2 A schematic diagram of the motor stroke segmentation in an embodiment of the present invention is shown;

[0030] Figure 3 A schematic diagram showing the offset comparison before and after correction using the method of the embodiments of the present invention is shown;

[0031] Figure 4 A schematic diagram of a motor offset correction device according to an embodiment of the present invention is shown. Detailed Implementation

[0032] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0033] Current camera modules require adjusting the Z-axis travel of the voice coil motor to control focus during autofocus. However, this Z-axis movement causes positional shifts in the X and Y axes, leading to significant autofocus drift, particularly noticeable in ball-bearing OIS (Optical Image Stabilizer) systems. To address this, this invention provides a motor offset correction method. This method adjusts the motor's position in the X and Y axes by adjusting its Z-axis travel, thereby optimizing autofocus drift and improving focus accuracy. This motor offset correction method can be applied to the camera module's chip for focus control.

[0034] It should be noted that the X, Y, and Z axes mentioned above are axes of a spatial rectangular coordinate system. The travel of the voice coil motor along the Z-axis corresponds to the focusing direction of the camera module, and the travel of the voice coil motor along the X and Y axes corresponds to directions perpendicular to the focusing direction of the camera module. The motor focus offset correction method of the present invention will be described and illustrated below through specific embodiments.

[0035] Please see Figure 1 In one embodiment of the present invention, a motor offset correction method is provided, the method comprising:

[0036] Step S10: Obtain the target stroke position of the voice coil motor in the Z-axis direction;

[0037] Step S20: Based on the target travel position, determine the target sub-interval from N travel sub-intervals; the travel interval of the voice coil motor in the Z-axis direction is divided into N travel sub-intervals, where N is an integer greater than 2;

[0038] Step S30: Based on the endpoint positions and travel distance of the target sub-interval, obtain the first offset coefficient corresponding to the X-axis direction and the second offset coefficient corresponding to the Y-axis direction; the X-axis, Y-axis and Z-axis are the axes of the spatial rectangular coordinate system;

[0039] Step S40: Based on the target travel position, the first offset coefficient, the second offset coefficient, and the target sub-interval, obtain the first corrected position and the second corrected position; wherein, the first corrected position and the second corrected position are the corrected travel positions of the voice coil motor in the X-axis direction and the Y-axis direction, respectively.

[0040] In this embodiment, steps S10 to S30 involve obtaining the target travel position of the voice coil motor along the Z-axis, then determining the corresponding target sub-intervals along the Z-axis based on this target travel position. Furthermore, based on the travel distance and endpoint positions of these target sub-intervals, a first offset coefficient along the X-axis and a second offset coefficient along the Y-axis are determined. Finally, based on the target travel position, the first offset coefficient, the second offset coefficient, and the target sub-intervals, the corresponding first and second correction positions are obtained, thus correcting the travel positions of the voice coil motor along the X and Y axes. The specific meaning and possible implementation methods of each step are explained below.

[0041] Step S10: Obtain the target stroke position of the voice coil motor in the Z-axis direction.

[0042] In step S10, the voice coil motor can be the voice coil motor in the camera module. The voice coil motor can control the movement of the camera module in the X, Y, and Z axes through its stroke. It can be understood that the X, Y, and Z axes described in this embodiment should be understood as the directions in which the camera module moves when the voice coil motor moves. That is, the Z axis can be understood as the direction in which the camera module focuses. The X, Y, and Z axes constitute three directions in a spatial rectangular coordinate system.

[0043] Of course, in some implementations, the X, Y, and Z axes can also be the three travel directions of the voice coil motor. The Z-axis is the direction in which the voice coil motor is controlled to move; the X and Y axes are the directions that need to be kept constant, that is, the directions that need to be corrected.

[0044] In some implementations, the travel of the voice coil motor can be 0–1023 codes, 0–2047 codes, or other travel ranges without limitation. The following description in this embodiment will use 0–1023 codes as an example.

[0045] The target stroke position is the position that the voice coil motor needs to be adjusted to achieve in the Z-axis direction. When adjusting to this target stroke position, the positions of the voice coil motor in the X and Y axes should remain unchanged. However, in existing technologies, the corresponding stroke positions of the voice coil motor in the X and Y axes often drift due to adjustments in the corresponding Z-axis position. Therefore, corrections are needed to adjust the stroke of the voice coil motor in the X and Y axes.

[0046] Before performing correction compensation, the travel of the voice coil motor along the Z-axis can be divided into N travel sub-intervals. These N sub-intervals correspond to N+1 dividing points (endpoint positions), including the two endpoints of the travel along the Z-axis and the dividing point between each sub-interval (endpoint position of the travel sub-interval). The N travel sub-intervals can be equally divided or unequally divided; there is no restriction. In this embodiment, N is a positive integer greater than or equal to 2.

[0047] Understandably, because the travel of the voice coil motor in the Z-axis direction changes, the travel in the X and Y-axis directions will also shift. Therefore, when dividing each travel sub-interval, each division position will also correspond to a first drift travel in the X-axis direction and a second drift travel in the Y-axis direction. The first and second drift travels can be understood as the actual positions (positions before correction) of the voice coil motor in the X and Y-axis directions when it moves to the division position in the Z-axis direction. Therefore, if we denote the travel drift corresponding to each endpoint position in the X-axis direction as the first offset travel position, then there are N+1 first offset travel positions. Similarly, if we denote the travel drift corresponding to each endpoint position in the Y-axis direction as the second offset travel position, then there are N+1 second offset travel positions.

[0048] For example, when the travel distance of a voice coil motor in the Z-axis direction, from 0 to 1023 codes, is divided into 8 (N=8) sub-intervals, if these N sub-intervals are evenly divided, then there are 9 dividing points: 0, 127 codes, 255 codes, 383 codes, 511 codes, 639 codes, 767 codes, 895 codes, and 1023 codes. Figure 2 As shown, the travel distance of each travel sub-interval is 128 codes. Correspondingly, the 9 segmentation points correspond to 9 first offset travel positions and 9 second offset travel positions. Of course, in other implementations, it can be divided into more travel sub-intervals to improve accuracy. For example, the travel distance of the sub-interval can be 64 codes, dividing the travel into 16 (N=16) travel sub-intervals. Alternatively, it can be divided into fewer travel sub-intervals to reduce computation. For example, the travel distance of the sub-interval can be 256 codes, dividing the travel into 4 (N=4) travel sub-intervals. In this embodiment, the travel distance of the travel sub-interval can be determined to be 128 codes, thereby ensuring good accuracy while avoiding excessive computation, which would affect the focusing speed of the camera module.

[0049] Step S20: Based on the target travel position, determine the target sub-interval from N travel sub-intervals; the travel interval of the voice coil motor in the Z-axis direction is divided into N travel sub-intervals, where N is an integer greater than 2;

[0050] Step S30: Based on the endpoint positions and travel distance of the target sub-interval, obtain the first offset coefficient corresponding to the X-axis direction and the second offset coefficient corresponding to the Y-axis direction; the X-axis, Y-axis and Z-axis are the axes of the spatial rectangular coordinate system.

[0051] In steps S20 to S30, it can be understood that the sub-interval containing the target stroke position is the target sub-interval. When the voice coil motor is at the target stroke position in the Z-axis direction, the two endpoints of the determined target sub-interval can correspond to two first offset stroke positions in the X-axis direction, denoted as the first offset position and the second offset position; similarly, they can correspond to two second offset stroke positions in the Y-axis direction, denoted as the third offset position and the fourth offset position. Specifically, step S30 can include the following process:

[0052] First, based on the endpoint positions of the target sub-interval, adjacent first and second offset positions are determined from N+1 first offset travel positions, and adjacent third and fourth offset positions are determined from N+1 second offset travel positions.

[0053] Then, based on the first offset position, the second offset position, the third offset position, the fourth offset position, and the travel distance of the target sub-interval, a first offset coefficient and a second offset coefficient are obtained. The first offset coefficient can be used to correct and compensate for the offset in the X-axis direction, and the second offset coefficient can be used to correct and compensate for the offset in the Y-axis direction.

[0054] In some implementations, the first offset coefficient can be obtained based on the ratio of the travel distance between the first and second offset positions to the travel distance of the target sub-interval. This allows the first offset coefficient to represent the offset in the X-axis direction caused by each 1-code change in the Z-axis direction. Furthermore, in this embodiment, the first offset coefficient is calculated based on the travel sub-interval, which can mask the influence of the offset amount or offset direction (positive or negative) of different segments. The magnitude of the offset and the proportion of offset as the Z-axis travel changes vary in different segments; segmentation makes the first offset coefficient more reflective of the actual situation.

[0055] Similarly, a second offset coefficient is obtained based on the ratio of the travel distance between the third and fourth offset positions to the travel distance of the target sub-interval. This allows the first offset coefficient to represent the offset in the Y-axis direction caused by each 1-code change in the Z-axis direction. Therefore, the first offset coefficient can more accurately reflect the offset in the Y-axis direction, achieving more accurate correction.

[0056] For example, the first offset coefficient and the second offset coefficient can be represented as follows:

[0057] slopX[i]=(HallX[i]-HallX[i-1]) / stepcode;

[0058] slopY[i]=(HallY[i]-HallY[i-1]) / stepcode;

[0059] Where i represents the travel sub-interval (corresponding to the target sub-interval), the i-th travel sub-interval corresponds to the (i-1)-th endpoint position (corresponding to the first offset position, the first endpoint position is recorded as 0 in this embodiment) and the i-th endpoint position (corresponding to the second offset position); stepcode represents the travel distance (code value) corresponding to the i-th travel sub-interval; slopX[i] represents the offset coefficient (corresponding to the first offset coefficient) corresponding to the i-th travel sub-interval in the X-axis direction; (HallX[i]-HallX[i-1]) corresponds to the travel distance between the second offset position and the first offset position; slopY[i] represents the offset coefficient (corresponding to the second offset coefficient) corresponding to the i-th travel sub-interval in the Y-axis direction; (HallY[i]-HallY[i-1]) corresponds to the travel distance between the fourth offset position and the third offset position; HallY[i] and HallY[i-1] can be code values ​​or other parameters representing positions.

[0060] When the 8 travel sub-intervals corresponding to the Z-axis direction are evenly divided travel sub-intervals, i = 1, 2, 3, 4, 5, 6, 7, 8; the travel distance of each travel sub-interval is stepcode.

[0061] Step S40: Based on the target travel position, the first offset coefficient, the second offset coefficient, and the target sub-interval, obtain the first corrected position and the second corrected position; wherein, the first corrected position and the second corrected position are the corrected travel positions of the voice coil motor in the X-axis direction and the Y-axis direction, respectively.

[0062] Step S40 may specifically include the following implementation steps:

[0063] Step S41: Determine the compensation length based on the travel distance between the target travel position and the target endpoint position of the target sub-interval.

[0064] Since the target sub-interval has two endpoints, the target endpoint can be the one closer to the target travel position or the one farther away. The travel distance between the target travel position and the target endpoint can be used as the compensation length. Alternatively, the compensation length can be obtained by modifying this travel distance; for example, a fixed value can be corrected after calibration testing and multiplied by a proportional coefficient, without limitation.

[0065] Step S42: Based on the first offset coefficient, the compensation length, and the first target offset position, obtain the first corrected position; the first target offset position is the offset position corresponding to the target endpoint position between the first offset position and the second offset position;

[0066] Step S43: Based on the second offset coefficient, the compensation length, and the second target offset position, obtain the second corrected position; the second target offset position is the offset position corresponding to the target endpoint position among the third offset position and the fourth offset position.

[0067] It should be noted that there is no restriction on the execution order of steps S42 and S43. Step S42 can be executed first, step S43 can be executed first, or steps S42 and S43 can be executed simultaneously.

[0068] In step S42, the first target offset position is corrected using a first offset coefficient and a compensation length to obtain a first corrected position. Specifically, the first compensation stroke can first be determined based on the product of the first offset coefficient and the compensation length. In some implementations, the product of the first offset coefficient and the compensation length can be used as the first compensation stroke; of course, in other implementations, the product can be modified to a certain extent, and the modified result can be used as the first compensation stroke. The compensation method can be to increase or decrease a correction amount, or to multiply the product by a correction factor, without limitation. The correction amount and correction factor can be obtained through common calibration methods, which will not be elaborated here.

[0069] Next, based on the first target offset position and the first compensation stroke, the first corrected position is obtained. The first target offset position is understood to be the position corresponding to the target endpoint position in the X-axis direction. This first target offset position can be understood as the actual offset of the voice coil motor relative to the zero point in the X-axis direction. The first corrected position is obtained by compensating for the first compensation stroke based on this actual offset. This first compensation stroke can be understood as a vector, meaning the first target offset position may be offset in a positive or negative direction. When the target stroke position is between the target endpoint position and the zero point, the above correction process is: first target offset position minus the first compensation stroke (size); when the target endpoint position is between the target stroke position and the zero point, the above correction process is: first target offset position plus the first compensation stroke (size).

[0070] Similarly, in step S43, the second target offset position is corrected using a second offset coefficient and a compensation length to obtain a second corrected position. Specifically, firstly, the second compensation stroke is determined based on the product of the second offset coefficient and the compensation length; then, the second compensation position is obtained based on the second target offset position and the second compensation stroke. In this step, the process of obtaining the second corrected position can be understood with reference to the process of obtaining the first corrected position; when the target stroke position is between the target endpoint position and the zero point, the above correction process is: second target offset position minus the second compensation stroke (size); when the target endpoint position is between the target stroke position and the zero point, the above correction process is: second target offset position plus the second compensation stroke (size).

[0071] For example, when the target travel position is between the target endpoint position and the zero point, the expressions for the first and second correction positions can be as follows:

[0072] ComX=slopX[i]*(M-code[i])+HallX[i];

[0073] ComY=slopY[i]*(M-code[i])+HallY[i];

[0074] Where M represents the code value of the target travel position, which is located within the i-th travel sub-interval (corresponding to the target sub-interval), code[i] represents the code value of the i-th endpoint position (corresponding to the code value of the target endpoint position), ComX represents the first correction position, HallX[i] represents the position of the target endpoint position in the i-th travel sub-interval in the X-axis direction (corresponding to the second offset position), ComY represents the second correction position, and HallY[i] represents the position of the target endpoint position in the i-th travel sub-interval in the Y-axis direction (corresponding to the fourth offset position).

[0075] When the target endpoint position is between the target travel position and the zero point, the expressions for the first correction position and the second correction position can be as follows:

[0076] ComX=slopX[i]*(M-code[i-1])+HallX[i-1];

[0077] ComY=slopY[i]*(M-code[i-1])+HallY[i-1];

[0078] Where M represents the code value of the target travel position, which is located within the i-th travel sub-interval (corresponding to the target sub-interval), code[i-1] represents the code value of the (i-1)-th endpoint position (corresponding to the code value of the target endpoint position), ComX represents the first correction position, HallX[i-1] represents the position of the target endpoint position in the i-th travel sub-interval on the X-axis (corresponding to the first offset position), ComY represents the second correction position, and HallY[i-1] represents the position of the target endpoint position in the i-th travel sub-interval on the Y-axis (corresponding to the third offset position).

[0079] Both of the above methods can be used to correct and obtain the first and second correction positions.

[0080] In some implementations, to further improve the accuracy of the correction, the distance between the target travel position and the two endpoints of the target sub-interval can be determined, and the target endpoint position is identified as the endpoint of the target sub-interval that is closest to the target travel position. This reduces the amount of correction and improves the accuracy of the correction. Furthermore, in this embodiment, the correction process is cumulative; the above correction process can be implemented whenever the voice coil motor is adjusted to any travel position, thus ensuring the final stability of the voice coil motor in the X and Y axis directions.

[0081] Please see Figure 3 Based on the motor offset correction method described above, the offset curves HallX1 in the X-axis direction and HallY1 in the Y-axis direction after correction were recorded. It can be seen that the fluctuation of the corrected curves can be controlled within 50 codes; the fluctuation range of the curves (HallX, HallY) before correction reached (-1500 codes, 2000 codes). After using the method of this embodiment, the poor offset of the voice coil motor during the focusing process of the camera module is significantly improved.

[0082] Please see Figure 4 Based on the same inventive concept, another embodiment of the present invention also provides a motor offset correction device 300, which includes:

[0083] The position acquisition module 301 is used to acquire the target travel position of the voice coil motor in the Z-axis direction; the travel interval determination module 302 is used to determine a target sub-interval from N travel sub-intervals based on the target travel position; the travel interval of the voice coil motor in the Z-axis direction is divided into N travel sub-intervals, where N is an integer greater than 2; the offset coefficient acquisition module 303 is used to obtain a first offset coefficient in the X-axis direction and a second offset coefficient in the Y-axis direction based on the endpoint position and travel distance of the target sub-interval; the X-axis, Y-axis and Z-axis are axes of a spatial rectangular coordinate system; the offset correction module 304 is used to obtain a first corrected position and a second corrected position based on the target travel position, the first offset coefficient, the second offset coefficient and the target sub-interval; wherein the first corrected position and the second corrected position are the corrected travel positions of the voice coil motor in the X-axis direction and the Y-axis direction, respectively.

[0084] As an optional implementation, the N+1 endpoint positions of the N stroke sub-intervals correspond to the N+1 first offset stroke positions in the X-axis direction and the N+1 second offset stroke positions in the Y-axis direction; the offset coefficient acquisition module 303 is specifically used for:

[0085] Based on the endpoint positions of the target sub-interval, adjacent first and second offset positions are determined from N+1 first offset travel positions, and adjacent third and fourth offset positions are determined from N+1 second offset travel positions; based on the first offset position, the second offset position, the third offset position, the fourth offset position and the travel distance of the target sub-interval, the first offset coefficient and the second offset coefficient are obtained.

[0086] As an optional implementation, the offset coefficient acquisition module 303 is specifically used for:

[0087] The first offset coefficient is obtained based on the ratio of the travel distance between the first offset position and the second offset position to the travel distance of the target sub-interval; the second offset coefficient is obtained based on the ratio of the travel distance between the third offset position and the fourth offset position to the travel distance of the target sub-interval.

[0088] As an optional implementation, the offset correction module 304 is specifically used for:

[0089] Based on the travel distance between the target travel position and the target endpoint position of the target sub-interval, a compensation length is determined; based on the first offset coefficient, the compensation length, and the first target offset position, a first corrected position is obtained; the first target offset position is the offset position corresponding to the target endpoint position between the first offset position and the second offset position; based on the second offset coefficient, the compensation length, and the second target offset position, a second corrected position is obtained; the second target offset position is the offset position corresponding to the target endpoint position between the third offset position and the fourth offset position.

[0090] As an optional implementation, the offset correction module 304 is specifically used to: determine the first compensation stroke based on the product of the first offset coefficient and the compensation length; and obtain the first correction position based on the first target offset position and the first compensation stroke.

[0091] The step of obtaining the second corrected position based on the second offset coefficient, the compensation length, and the second target offset position includes: determining the second compensation stroke based on the product of the second offset coefficient and the compensation length; and obtaining the second compensation position based on the second target offset position and the second compensation stroke.

[0092] As an optional implementation, the target endpoint position is the endpoint position that is closest to the target travel position among the two endpoint positions of the target sub-interval.

[0093] As an optional implementation, the travel range of the voice coil motor in the Z-axis direction is 0 to 1023 codes, and N is 4, 8 or 16.

[0094] It should be noted that the motor offset correction device 300 provided in this embodiment of the invention has the same implementation and technical effects as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0095] Based on the same inventive concept, another embodiment of the present invention provides a camera module that can be applied to electronic devices such as mobile phones, tablets, laptops, televisions, cameras, drones, etc. The camera module includes a processor and a memory, the memory being coupled to the processor. The memory stores instructions, which, when executed by the processor, cause the electronic device to perform the steps of any of the methods described in the foregoing embodiments. It should be noted that in the electronic device provided by the embodiments of the present invention, the specific implementation of each step and the resulting technical effects are the same as in the foregoing method embodiments when the instructions are executed by the processor. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the foregoing method embodiments.

[0096] Based on the same inventive concept, another embodiment of the present invention provides a readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of any of the methods described in the foregoing method embodiments. It should be noted that, in the readable storage medium provided in this embodiment, when the program is executed by a processor, the specific implementation of each step and the resulting technical effects are the same as in the foregoing method embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the foregoing method embodiments.

[0097] The term "and / or" as used herein is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects are in an "or" relationship; the word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of multiple such elements. This invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims listing several means, several of these means can be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0098] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0099] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0100] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0101] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0102] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0103] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for correcting motor offset, characterized in that, include: Obtain the target stroke position of the voice coil motor in the Z-axis direction; Based on the target travel position, a target sub-interval is determined from N travel sub-intervals; the travel interval of the voice coil motor in the Z-axis direction is divided into N travel sub-intervals, where N is an integer greater than 2; Based on the endpoint positions and travel distance of the target sub-interval, a first offset coefficient corresponding to the X-axis direction and a second offset coefficient corresponding to the Y-axis direction are obtained; the X-axis, Y-axis and Z-axis are axes of a spatial rectangular coordinate system; Based on the target travel position, the first offset coefficient, the second offset coefficient, and the target sub-interval, a first corrected position and a second corrected position are obtained; wherein, the first corrected position and the second corrected position are the corrected travel positions of the voice coil motor in the X-axis direction and the Y-axis direction, respectively; The N+1 endpoint positions of the N travel sub-intervals correspond to N+1 first offset travel positions in the X-axis direction and N+1 second offset travel positions in the Y-axis direction; obtaining the first offset coefficient in the X-axis direction and the second offset coefficient in the Y-axis direction based on the endpoint positions and travel distance of the target sub-intervals includes: Based on the endpoint positions of the target sub-interval, adjacent first offset positions and second offset positions are determined from N+1 first offset travel positions, and adjacent third offset positions and fourth offset positions are determined from N+1 second offset travel positions. The first offset coefficient and the second offset coefficient are obtained based on the first offset position, the second offset position, the third offset position, the fourth offset position and the travel distance of the target sub-interval.

2. The method according to claim 1, characterized in that, The step of obtaining the first offset coefficient and the second offset coefficient based on the first offset position, the second offset position, the third offset position, the fourth offset position, and the travel distance of the target sub-interval includes: The first offset coefficient is obtained based on the ratio of the travel distance between the first offset position and the second offset position to the travel distance of the target sub-interval; The second offset coefficient is obtained based on the ratio of the travel distance between the third offset position and the fourth offset position to the travel distance of the target sub-interval.

3. The method according to claim 1, characterized in that, The step of obtaining the first corrected position and the second corrected position based on the target travel position, the first offset coefficient, the second offset coefficient, and the target sub-interval includes: The compensation length is determined based on the travel distance between the target travel position and the target endpoint position of the target sub-interval; Based on the first offset coefficient, the compensation length, and the first target offset position, a first corrected position is obtained; the first target offset position is the offset position corresponding to the target endpoint position between the first offset position and the second offset position. Based on the second offset coefficient, the compensation length, and the second target offset position, a second corrected position is obtained; the second target offset position is the offset position corresponding to the target endpoint position among the third offset position and the fourth offset position.

4. The method according to claim 3, characterized in that, The step of obtaining the first corrected position based on the first offset coefficient, the compensation length, and the first target offset position includes: The first compensation stroke is determined based on the product of the first offset coefficient and the compensation length; Based on the first target offset position and the first compensation stroke, the first corrected position is obtained; The step of obtaining the second corrected position based on the second offset coefficient, the compensation length, and the second target offset position includes: The second compensation stroke is determined based on the product of the second offset coefficient and the compensation length; The second corrected position is obtained based on the second target offset position and the second compensation stroke.

5. The method according to claim 3, characterized in that, The target endpoint position is the endpoint position that is closest to the target travel position among the two endpoint positions of the target sub-interval.

6. The method according to claim 1, characterized in that, The travel range of the voice coil motor in the Z-axis direction is 0~1023code, and N is 4, 8 or 16.

7. A motor offset correction device, characterized in that, include: The position acquisition module is used to acquire the target stroke position of the voice coil motor in the Z-axis direction; The travel range determination module is used to determine the target sub-range from N travel sub-ranges based on the target travel position; the travel range of the voice coil motor in the Z-axis direction is divided into N travel sub-ranges, where N is an integer greater than 2; The offset coefficient acquisition module is used to obtain a first offset coefficient in the X-axis direction and a second offset coefficient in the Y-axis direction based on the endpoint positions and travel distance of the target sub-interval; the X-axis, Y-axis and Z-axis are axes of a spatial rectangular coordinate system; The offset correction module is used to obtain a first correction position and a second correction position based on the target travel position, the first offset coefficient, the second offset coefficient, and the target sub-interval; wherein the first correction position and the second correction position are the corrected travel positions of the voice coil motor in the X-axis direction and the Y-axis direction, respectively. The N+1 endpoint positions of the N travel sub-intervals correspond to N+1 first offset travel positions in the X-axis direction and N+1 second offset travel positions in the Y-axis direction; obtaining the first offset coefficient in the X-axis direction and the second offset coefficient in the Y-axis direction based on the endpoint positions and travel distance of the target sub-intervals includes: Based on the endpoint positions of the target sub-interval, adjacent first offset positions and second offset positions are determined from N+1 first offset travel positions, and adjacent third offset positions and fourth offset positions are determined from N+1 second offset travel positions. The first offset coefficient and the second offset coefficient are obtained based on the first offset position, the second offset position, the third offset position, the fourth offset position and the travel distance of the target sub-interval.

8. A camera module, characterized in that, It includes a processor and a memory, the memory being coupled to the processor, the memory storing instructions that, when executed by the processor, cause the camera module to perform the steps of the method according to any one of claims 1-6.

9. A readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-6.

Citation Information

Patent Citations

  • CN103455383A

  • CN107003587A