Method and device for positioning camera module lens center, electronic equipment and medium

The initial lens data is directly obtained through the uncalibrated Hall sensor, and iteratively adjusts the control code and Hall value to achieve one-step positioning of the lens, solving the inefficiency problem caused by the complexity of traditional calibration and improving production efficiency.

CN120568041APending Publication Date: 2025-08-29KUNSHAN QIUTI PHOTOELECTRIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510496677.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-08-29

AI Technical Summary

Technical Problem

The traditional Hall sensor calibration process is complicated, resulting in inefficient positioning of the camera module lens.

Method used

Using an uncalibrated Hall sensor, the lens is directly pushed to the target stroke position by obtaining the initial control code, initial Hall value, maximum Hall value and minimum Hall value of the initial position of the lens, and iteratively adjusts the control code and Hall value until the lens is positioned to the center position.

Benefits of technology

The Hall sensor calibration step is omitted, improving the productivity of lens positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120568041A_ABST
    Figure CN120568041A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for positioning the center of a camera module lens, electronic equipment and a medium, and the method comprises the steps: obtaining an initial control code corresponding to the initial position of the lens, and an initial Hall value, a maximum Hall value and a minimum Hall value outputted by a Hall sensor when the lens is in the initial position, and executing the following positioning steps: according to the maximum Hall value, the minimum Hall value, the initial Hall value and the initial control code, obtaining a target control code corresponding to the lens at the target travel position; sending the target control code to a motor to push a lens to a target stroke position, and obtaining a target Hall value output by a Hall sensor; based on the target Hall value, the maximum Hall value and the minimum Hall value, whether the lens is positioned to the center position or not is judged, if not, the target control code serves as the initial control code of next-time positioning, the target Hall value serves as the initial Hall value of next-time positioning, and the positioning step is executed repeatedly till it is judged that the lens is positioned to the center position.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing technology, and in particular to a method, device, electronic equipment and medium for locating the center of a camera module lens. Background Art

[0002] During assembly of an OIS (Optical Image Stabilizer) camera module, the optical components must be aligned to the center to ensure image quality. Traditionally, this is achieved using the module's internal Hall effect sensor. To ensure accurate positioning, the sensor must be calibrated before use. For example, the calibration process involves calibrating the Hall effect sensor's zero drift to obtain a target zero drift value; the zero drift value is the Hall effect sensor's sampled value when the camera is stationary; controlling the camera to move a preset distance to obtain a reference sampled value output by the Hall effect sensor; determining a reference distance based on the target zero drift value and the reference sampled value; and calibrating the Hall effect sensor based on the preset distance and the reference distance to obtain a compensation value corresponding to the preset distance. This includes multiple steps.

[0003] The use of traditional positioning methods makes the entire positioning process slow, affecting production progress. Summary of the Invention

[0004] The embodiments of the present application provide a method, device, electronic device and medium for locating the center of a camera module lens. The method can use an uncalibrated Hall sensor to achieve lens positioning, omitting the calibration step and greatly improving production efficiency.

[0005] In a first aspect, the present invention provides the following technical solutions through an embodiment of the present invention:

[0006] A method for locating the center of a camera module lens, the camera module including a Hall sensor, the method comprising: obtaining an initial control code corresponding to an initial position of the lens, an initial Hall value, a maximum Hall value, and a minimum Hall value output by the Hall sensor when the lens is in the initial position, wherein the maximum Hall value is output by the Hall sensor when the lens is pushed to a maximum travel position, and the minimum Hall value is output by the Hall sensor when the lens is pushed to a minimum travel position, and performing the following positioning steps: obtaining a target control code corresponding to the lens at a target travel position based on the initial Hall value, the maximum Hall value, the minimum Hall value, and the initial control code; sending the target control code to the motor to push the lens to the target travel position, and obtaining a target Hall value output by the Hall sensor; determining whether the lens is positioned at the center position based on the target Hall value, the maximum Hall value, and the minimum Hall value; if not, using the target control code as the initial control code for the next positioning, and the target Hall value as the initial Hall value for the next positioning, and repeating the positioning steps until it is determined that the lens is positioned at the center position.

[0007] Preferably, obtaining the target control code corresponding to the lens at the target travel position according to the initial Hall value, the maximum Hall value, the minimum Hall value and the initial control code includes: determining an intermediate Hall value according to the initial Hall value, the maximum Hall value and the minimum Hall value; and multiplying the intermediate Hall value by the initial control code to obtain the target control code corresponding to the lens at the target travel position.

[0008] Preferably, determining the intermediate Hall value based on the initial Hall value, the maximum Hall value and the minimum Hall value includes: summing the difference between the minimum Hall value and the initial Hall value and the difference between the maximum Hall value and the initial Hall value, and then dividing the sum by the difference between the maximum Hall value and the minimum Hall value to obtain an initial intermediate value, and then dividing the initial intermediate value by 2 and adding 1 to determine the intermediate Hall value.

[0009] Preferably, determining whether the lens is positioned at the center position based on the target Hall value, the maximum Hall value and the minimum Hall value includes: obtaining an average Hall value based on the maximum Hall value and the minimum Hall value; and determining whether the difference between the target Hall value and the average Hall value is less than a preset threshold value, and if so, determining that the lens is positioned at the center position.

[0010] Preferably, before obtaining the initial control code corresponding to the initial position of the lens, the initial Hall value, the maximum Hall value, and the minimum Hall value output by the Hall sensor when the lens is in the initial position, the method further includes: adjusting the sensitivity of the Hall sensor to a target range so that the value output by the Hall sensor is a valid value, and recording the initial position of the lens.

[0011] Preferably, after obtaining the initial control code corresponding to the initial position of the lens, the initial Hall value, the maximum Hall value and the minimum Hall value output by the Hall sensor when the lens is in the initial position, it also includes: judging whether the difference between the initial Hall value and the average Hall value is less than a preset threshold value, and if so, determining that the lens is positioned at the center position, wherein the average Hall value is obtained based on the maximum Hall value and the minimum Hall value; if the difference between the initial Hall value and the average Hall value is greater than or equal to the preset threshold value, executing the positioning step.

[0012] Preferably, after determining that the lens is positioned at the center position, it also includes: determining the optical offset of the lens according to the center position; and calibrating the inherent offset of the lens assembly machine of the camera module based on the optical offset.

[0013] In a second aspect, the present invention provides the following technical solution through an embodiment of the present invention:

[0014] A device for locating the center of a camera module lens, comprising:

[0015] an acquisition module, configured to acquire an initial control code corresponding to an initial position of the lens, an initial Hall value, a maximum Hall value, and a minimum Hall value output by a Hall sensor when the lens is in the initial position, wherein the maximum Hall value is output by the Hall sensor when the lens is pushed to a maximum travel position, and the minimum Hall value is output by the Hall sensor when the lens is pushed to a minimum travel position;

[0016] A positioning module is used to perform the following positioning steps: obtaining a target control code corresponding to the lens when it is at a target travel position based on the maximum Hall value, the minimum Hall value, the initial Hall value, and the initial control code; sending the target control code to a motor to push the lens to the target travel position, and obtaining a target Hall value output by the Hall sensor; based on the target Hall value, the maximum Hall value, and the minimum Hall value, determining whether the lens is positioned at the center position; if not, using the target control code as the initial control code for the next positioning, and the target Hall value as the initial Hall value for the next positioning, and repeating the positioning steps until it is determined that the lens is positioned at the center position.

[0017] In a third aspect, the present invention provides the following technical solution through an embodiment of the present invention:

[0018] An electronic device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any one of the methods described in the first aspect are implemented.

[0019] In a fourth aspect, the present invention provides the following technical solutions through an embodiment of the present invention:

[0020] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described in any one of the first aspects above.

[0021] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0022] The method for locating the center of the camera module lens provided by the embodiment of the present invention obtains the initial control code corresponding to the initial position of the lens, the initial Hall value output by the Hall sensor when the lens is in the initial position, the maximum Hall value and the minimum Hall value, obtains the target control code corresponding to the lens when the lens is in the target stroke position, and then pushes the lens to the target stroke position according to the target control code, obtains the target Hall value output by the Hall sensor at this time, and determines whether the lens has been positioned to the center position according to the target Hall value. If it is not positioned to the center position, the Hall value and the control code are iterated, and the target control code is re-determined according to the initial Hall value and the initial control code after iteration, and then adjusts the lens to the target stroke position until it is determined that the lens is positioned to the center position. The method adopts a one-step approach, without first calibrating the Hall sensor, directly collecting the data corresponding to the lens in the initial position (i.e., the default position), the maximum Hall value, and the minimum Hall value, adjusting the position of the lens, controlling the lens to be in the center position, centering the lens without performing the Hall sensor precision calibration, and completing the lens assembly, so that the positioning process can be completed efficiently, omitting the calibration step, and greatly improving production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0024] Figure 1 Flowchart of a method for locating the center of a camera module lens in an embodiment of the present invention;

[0025] Figure 2 Schematic diagram of the structure of a device for locating the center of a camera module lens in an embodiment of the present invention;

[0026] Figure 3 Schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0027] The embodiments of the present application provide a method, device, electronic device and medium for locating the center of a camera module lens. The method can use an uncalibrated Hall sensor to achieve lens positioning, omitting the calibration step and greatly improving production efficiency.

[0028] The technical solution of the embodiment of the present application is to solve the above technical problems, and the overall idea is as follows:

[0029] A method for locating the center of a camera module lens, the camera module including a Hall sensor, the method comprising: obtaining an initial control code corresponding to an initial position of the lens, an initial Hall value, a maximum Hall value, and a minimum Hall value output by the Hall sensor when the lens is in the initial position, wherein the maximum Hall value is output by the Hall sensor when the lens is pushed to a maximum stroke position, and the minimum Hall value is output by the Hall sensor when the lens is pushed to a minimum stroke position, and performing the following positioning steps: obtaining a target control code corresponding to the lens in a target stroke position according to the maximum Hall value, the minimum Hall value, the initial Hall value, and the initial control code; sending the target control code to a motor to push the lens to a target stroke position, and obtaining a target Hall value output by the Hall sensor; determining whether the lens is positioned at the center position based on the target Hall value, the maximum Hall value, and the minimum Hall value; if not, using the target control code as the initial control code for the next positioning, and the target Hall value as the initial Hall value for the next positioning, and repeating the positioning steps until it is determined that the lens is positioned at the center position.

[0030] In order to better understand the above technical solution, the above technical solution will be described in detail below with reference to the accompanying drawings and specific implementation methods.

[0031] In a first aspect, an embodiment of the present invention provides a method for locating the center of a camera module lens, wherein the camera module includes a Hall sensor and a motor. Specifically, Figure 1 As shown, the method includes the following steps S101 to S104:

[0032] Step S101, obtaining an initial control code corresponding to an initial position of the lens, an initial Hall value, a maximum Hall value, and a minimum Hall value output by the Hall sensor when the lens is in the initial position, wherein the maximum Hall value is output by the Hall sensor when the lens is pushed to a maximum travel position, and the minimum Hall value is output by the Hall sensor when the lens is pushed to a minimum travel position, and performing the following positioning steps:

[0033] Step S102 : Obtaining a target control code corresponding to when the lens is at a target travel position according to the initial Hall value, the maximum Hall value, the minimum Hall value, and the initial control code.

[0034] It should be noted that the execution entity of this application can be an OIS control driver, which is connected to a Hall sensor and a motor. The motor can be a voice coil motor (VCM) with a built-in Hall sensor. The VCM is used to control the position of the lens to achieve focus and stable imaging. The Hall sensor is used to feedback the lens position in the closed-loop control of the VCM. Positioning the lens center uses the Hall sensor to achieve precise focus and position control of the module. The center position in this application is represented by the target mechanical center position of the lens.

[0035] It should be noted that the initial position refers to the initial default position of the lens. The initial position code is Cc, and the initial Hall value of the lens in the initial position is Hc. In actual production, the initial position of each camera module lens may be consistent or different. Alternatively, the initial position of the camera module lenses of the same batch may be consistent, but the initial position of the camera module lenses of different batches may vary.

[0036] In a specific embodiment, the process of obtaining the maximum Hall effect value and the minimum Hall effect value may include: after obtaining the initial control code and the initial Hall effect value, pushing the lens to the maximum travel position (denoted as Cmax) and obtaining the maximum Hall effect value output by the Hall effect sensor (denoted as Hmax); and pushing the lens to the minimum travel position (denoted as Cmin) and obtaining the minimum Hall effect value output by the Hall effect sensor (denoted as Hmin). The order of obtaining the maximum Hall effect value and the minimum Hall effect value can be adjusted as needed.

[0037] In another embodiment, the process of obtaining the maximum Hall value and the minimum Hall value may include: calling a preset relationship library according to the model of the camera module, and determining the maximum Hall value and the minimum Hall value of the camera module lens under the model, wherein the preset relationship library includes the maximum Hall value and the minimum Hall value corresponding to camera modules of different models.

[0038] Furthermore, in order to improve the accuracy of positioning, before obtaining the initial control code corresponding to the initial position of the lens, the initial Hall value, the maximum Hall value and the minimum Hall value output by the Hall sensor when the lens is in the initial position, it can also include: adjusting the sensitivity of the Hall sensor to the target range so that the value output by the Hall sensor is a valid value, and recording the initial position of the lens.

[0039] Assuming that the sensitivity range is 0 to 1, 0 represents the lowest sensitivity and 1 represents the highest sensitivity, the target range can be Increasing the sensitivity causes the value measured by the Hall sensor to change within the effective range of the lens movement.

[0040] Specifically, the Hall effect sensor's sensitivity can be adjusted to the target range by adjusting the supply voltage or controlling the ambient temperature, ensuring that the Hall effect sensor operates within a reliable range, thereby improving test accuracy and effectiveness. After adjusting the Hall effect sensor's sensitivity, recording the initial position of the lens ensures test effectiveness and accuracy.

[0041] Furthermore, in order to optimize the positioning step and make the positioning more efficient, after obtaining the initial control code corresponding to the initial position of the lens, the initial Hall value, the maximum Hall value and the minimum Hall value output by the Hall sensor when the lens is in the initial position, it can also include: judging whether the difference between the initial Hall value and the average Hall value is less than a preset threshold value, and if so, determining that the lens is positioned at the center position, wherein the average Hall value is obtained based on the maximum Hall value and the minimum Hall value; if the difference between the initial Hall value and the average Hall value is greater than or equal to the preset threshold value, executing the positioning step.

[0042] Optionally, the preset threshold value may be 1 to 5 V. For example, in this application, the preset threshold value is 4 V. When the difference between the initial Hall value and the average Hall value is less than the preset threshold value, it can be considered that the ratio of the initial Hall value to the minimum Hall value and the ratio of the initial Hall value to the maximum Hall value are close to 1:1. Average Hall value = (Hmax + Hmin) / 2.

[0043] Specifically, determine whether the difference between the initial Hall value Hc and the average Hall value is less than 4V. If the difference is less than 4V, it is directly determined that the lens has been positioned at the center position and no further adjustment is required; if the difference is greater than or equal to 4V, continue to perform the positioning step.

[0044] In a specific embodiment, obtaining a target control code corresponding to when the lens is at a target travel position based on the maximum Hall value, the minimum Hall value, the initial Hall value, and the initial control code may include: determining an intermediate Hall value based on the initial Hall value, the maximum Hall value, and the minimum Hall value; and multiplying the intermediate Hall value by the initial control code to obtain the target control code corresponding to when the lens is at the target travel position.

[0045] In one embodiment, determining the intermediate Hall value based on the initial Hall value, the maximum Hall value, and the minimum Hall value may include: summing the difference between the minimum Hall value and the initial Hall value, and the difference between the maximum Hall value and the initial Hall value, and then dividing the sum by the difference between the maximum Hall value and the minimum Hall value to obtain an initial intermediate value, and then dividing the initial intermediate value by 2 and adding 1 to determine the intermediate Hall value.

[0046] Specifically, the middle Hall value is determined using the following formula 1:

[0047]

[0048] In another embodiment, determining the intermediate Hall value based on the initial Hall value, the maximum Hall value and the minimum Hall value may include: summing the difference between the minimum Hall value and the initial Hall value, and the difference between the maximum Hall value and the initial Hall value, and then dividing the sum by the difference between the maximum Hall value and the minimum Hall value to obtain an initial intermediate value, and then dividing the initial intermediate value by 3 and adding 1 to determine the intermediate Hall value.

[0049] Specifically, the middle Hall value is determined using the following formula 2:

[0050]

[0051] Compared with determining the intermediate Hall value using Formula 1, this method may have some oscillations during the acquisition process, but it can achieve an effect similar to that of Formula 1.

[0052] Step S103, sending the target control code to the motor to push the lens to the target travel position, and obtaining the target Hall value output by the Hall sensor;

[0053] In step S104, based on the target Hall value, the maximum Hall value, and the minimum Hall value, it is determined whether the lens is positioned at the center position. If not, the target control code is used as the initial control code for the next positioning, and the target Hall value is used as the initial Hall value for the next positioning. The positioning steps are repeated until it is determined that the lens is positioned at the center position.

[0054] In a specific embodiment, the target control code is sent to the motor to push the lens to the target travel position (denoted as Cc') through the motor, and the target Hall value (denoted as Hc') output by the Hall sensor after the lens moves is obtained to complete a positioning adjustment of the lens.

[0055] Next, based on the target Hall value, the maximum Hall value and the minimum Hall value, determining whether the lens is positioned at the center position may include: obtaining an average Hall value based on the maximum Hall value and the minimum Hall value; judging whether the difference between the target Hall value and the average Hall value is less than a preset threshold value, and if so, determining that the lens is positioned at the center position.

[0056] If not, the target control code Cc' is used as the initial control code for the next positioning, and the target Hall value Hc' is used as the initial Hall value for the next positioning. Hc' is substituted into Formula 1 to obtain a new intermediate Hall value. The new intermediate Hall value is then multiplied by Cc' to obtain a new target control code. The new target control code is the lens at the new target travel position. The control code instruction is sent to the VCM, which controls the lens to move to the new target travel position and obtains the new target Hall value output by the Hall sensor. The new target Hall value, maximum Hall value, and minimum Hall value are then used to determine whether the lens is positioned at the center. If it is positioned at the center, the operation is stopped. If not, the positioning steps are repeated until it is determined that the lens is positioned at the center.

[0057] In a specific embodiment, after determining that the lens is positioned at the center position, it can also include: determining the optical offset of the lens according to the center position; and calibrating the inherent offset of the lens assembly machine of the camera module based on the optical offset.

[0058] Specifically, in an offline state, before the lens center is located, the laser sensor in the laser table illuminates the lens to determine the current distance between the lens and the laser sensor. After the lens center is located, the laser sensor illuminates the lens again to determine the distance between the located lens and the laser sensor. The two are subtracted to determine the offset between the lens center and the initial position, which is the optical offset of the lens. The inherent offset of the lens assembly machine is then calibrated based on the optical offset, and the calibrated lens assembly machine is used to complete the lens installation.

[0059] In the specific implementation process, the method for locating the center of the camera module lens can be to extract multiple modules from a batch as samples for positioning, obtain multiple optical offsets, average the multiple optical offsets, and obtain the average offset value; calibrate the lens assembly machine according to the average offset value, and use it to install all module lenses in the batch. Alternatively, extract a single module from a batch of modules for testing to obtain the optical offset, and then calibrate the lens assembly machine according to the optical offset, and use it to assemble all module lenses in the batch, so as to achieve the purpose of speeding up production progress. Alternatively, a positioning process is performed on each module to obtain the optical offset corresponding to each module. Before module assembly, the lens assembly machine is calibrated according to the offset corresponding to each module, and then the lens is assembled according to the calibrated assembly machine. The positioning process can be implemented in a variety of ways, which are not limited in this application.

[0060] In summary, a method for locating the center of a camera module lens provided by an embodiment of the present invention proposes a lens centering algorithm that replaces the Hall sensor calibration. It adopts a one-step approach and does not require the Hall sensor to be calibrated first. It directly collects the data corresponding to the initial position of the lens, the maximum Hall value, and the minimum Hall value, adjusts the position of the lens, and controls the lens to be located in the center position, so that the positioning process can be completed efficiently. The lens positioning is achieved using an uncalibrated Hall sensor, which omits the calibration step and greatly improves production efficiency.

[0061] In the second aspect, based on the same inventive concept, this embodiment provides a device for locating the center of a camera module lens, such as Figure 2 As shown, including:

[0062] An acquisition module 401 is configured to acquire an initial control code corresponding to an initial position of the lens, an initial Hall value, a maximum Hall value, and a minimum Hall value output by a Hall sensor when the lens is in the initial position, wherein the maximum Hall value is output by the Hall sensor when the lens is pushed to a maximum travel position, and the minimum Hall value is output by the Hall sensor when the lens is pushed to a minimum travel position;

[0063] The positioning module 402 is used to perform the following positioning steps: obtaining a target control code corresponding to the lens when it is at the target travel position based on the initial Hall value, the maximum Hall value, the minimum Hall value and the initial control code; sending the target control code to the motor to push the lens to the target travel position, and obtaining the target Hall value output by the Hall sensor; based on the target Hall value, the maximum Hall value and the minimum Hall value, determining whether the lens is positioned at the center position; if not, using the target control code as the initial control code for the next positioning, and the target Hall value as the initial Hall value for the next positioning, and repeating the positioning steps until it is determined that the lens is positioned at the center position.

[0064] As an optional embodiment, the positioning module 402 includes:

[0065] A first determining submodule is configured to determine an intermediate Hall value according to an initial Hall value, a maximum Hall value, and a minimum Hall value;

[0066] The second determining submodule is configured to multiply the intermediate Hall value by the initial control code to obtain a target control code corresponding to when the lens is at a target travel position.

[0067] As an optional embodiment, the first determination submodule is specifically used to: sum the difference between the minimum Hall value and the initial Hall value, and the difference between the maximum Hall value and the initial Hall value, and then divide the sum by the difference between the maximum Hall value and the minimum Hall value to obtain an initial intermediate value, and then divide the initial intermediate value by 2 and add 1 to determine the intermediate Hall value.

[0068] As an optional embodiment, the positioning module 402 is specifically used to: obtain an average Hall value based on the maximum Hall value and the minimum Hall value; determine whether the difference between the target Hall value and the average Hall value is less than a preset threshold, and if so, determine that the lens is positioned at the center position.

[0069] As an optional embodiment, the device further includes: a sensitivity adjustment module, configured to adjust the sensitivity of the Hall sensor to a target range so that the value output by the Hall sensor is a valid value, and record the initial position of the lens.

[0070] As an optional embodiment, the device also includes: a Hall value judgment module, used to determine whether the difference between the initial Hall value and the average Hall value is less than a preset threshold value. If so, it is determined that the lens is positioned at the center position, wherein the average Hall value is obtained based on the maximum Hall value and the minimum Hall value; if the difference between the initial Hall value and the average Hall value is greater than or equal to the preset threshold value, the positioning step is executed.

[0071] As an optional embodiment, the device also includes: a calibration module, used to determine the optical offset of the lens according to the center position; based on the optical offset, calibrate the inherent offset of the lens assembly machine of the camera module.

[0072] The above modules can be implemented by software codes, in which case the above modules can be stored in the memory of the control device. The above modules can also be implemented by hardware such as integrated circuit chips.

[0073] An embodiment of the present invention provides a device for locating the center of a camera module lens. Its implementation principle and technical effects are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding content in the aforementioned method embodiment.

[0074] In a third aspect, based on the same inventive concept, this embodiment provides an electronic device 500, such as Figure 3 As shown, it includes: a memory 501, a processor 502 and a computer program 503 stored in the memory and capable of running on the processor. When the processor 502 executes the program, the steps of the method for positioning the center of the camera module lens described in the first aspect are implemented.

[0075] Since the electronic device described in this embodiment is an electronic device used to implement the method for locating the center of the camera module lens in the embodiment of this application, based on the method for locating the center of the camera module lens described in the embodiment of this application, those skilled in the art will be able to understand the specific implementation of the electronic device of this embodiment and its various variations, so how the electronic device implements the method in the embodiment of this application will not be described in detail here. As long as those skilled in the art implement the electronic device used by the method for locating the center of the camera module lens in the embodiment of this application, it falls within the scope of protection to be provided by this application.

[0076] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0077] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts 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, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A module that specifies functions in one or more boxes.

[0078] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction module, which is implemented in the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0079] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0080] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0081] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A method for locating the center of a camera module lens, characterized in that: The camera module includes a Hall sensor and a motor, and the method includes: Obtain an initial control code corresponding to the initial position of the lens, an initial Hall value, a maximum Hall value, and a minimum Hall value output by the Hall sensor when the lens is in the initial position, wherein the maximum Hall value is output by the Hall sensor when the lens is pushed to the maximum stroke position, and the minimum Hall value is output by the Hall sensor when the lens is pushed to the minimum stroke position, and perform the following positioning steps: Obtaining a target control code corresponding to when the lens is at a target travel position according to the initial Hall value, the maximum Hall value, the minimum Hall value, and the initial control code; Sending the target control code to the motor to push the lens to the target stroke position and obtaining the target Hall value output by the Hall sensor; Based on the target Hall value, the maximum Hall value and the minimum Hall value, it is determined whether the lens is positioned at the center position. If not, the target control code is used as the initial control code for the next positioning, and the target Hall value is used as the initial Hall value for the next positioning, and the positioning steps are repeated until it is determined that the lens is positioned at the center position.

2. The method according to claim 1, wherein The step of obtaining a target control code corresponding to the lens being at a target travel position according to the initial Hall value, the maximum Hall value, the minimum Hall value, and the initial control code includes: Determining an intermediate Hall value according to the initial Hall value, the maximum Hall value, and the minimum Hall value; The intermediate Hall value is multiplied by the initial control code to obtain a target control code corresponding to when the lens is at a target travel position.

3. The method according to claim 2, wherein The determining of the intermediate Hall value according to the initial Hall value, the maximum Hall value, and the minimum Hall value includes: After summing the difference between the minimum Hall value and the initial Hall value and the difference between the maximum Hall value and the initial Hall value, the difference is divided by the difference between the maximum Hall value and the minimum Hall value to obtain an initial intermediate value, and then the initial intermediate value is divided by 2 and added by 1 to determine the intermediate Hall value.

4. The method according to claim 1, wherein The determining whether the lens is positioned at the center position based on the target Hall value, the maximum Hall value, and the minimum Hall value includes: Obtaining an average Hall value according to the maximum Hall value and the minimum Hall value; It is determined whether the difference between the target Hall value and the average Hall value is less than a preset threshold value. If so, it is determined that the lens is positioned at the center position.

5. The method according to claim 1, wherein Before acquiring the initial control code corresponding to the initial position of the lens, the initial Hall value, the maximum Hall value, and the minimum Hall value output by the Hall sensor when the lens is in the initial position, the method further includes: The sensitivity of the Hall sensor is adjusted to a target range so that the value output by the Hall sensor is a valid value, and the initial position of the lens is recorded.

6. The method according to claim 1, wherein After acquiring the initial control code corresponding to the initial position of the lens, the initial Hall value, the maximum Hall value, and the minimum Hall value output by the Hall sensor when the lens is in the initial position, the method further includes: determining whether a difference between the initial Hall value and the average Hall value is less than a preset threshold, and if so, determining that the lens is positioned at the center position, wherein the average Hall value is obtained according to the maximum Hall value and the minimum Hall value; If the difference between the initial Hall value and the average Hall value is greater than or equal to the preset threshold, the positioning step is performed.

7. The method according to claim 1, wherein After determining that the lens is positioned at the center position, the method further includes: determining an optical offset of the lens according to the center position; Based on the optical offset, the inherent offset of the lens assembly machine of the camera module is calibrated.

8. A device for locating the center of a camera module lens, characterized in that: include: an acquisition module, configured to acquire an initial control code corresponding to an initial position of the lens, an initial Hall value, a maximum Hall value, and a minimum Hall value output by a Hall sensor when the lens is in the initial position, wherein the maximum Hall value is output by the Hall sensor when the lens is pushed to a maximum travel position, and the minimum Hall value is output by the Hall sensor when the lens is pushed to a minimum travel position; A positioning module is used to perform the following positioning steps: obtaining a target control code corresponding to the lens when it is at a target travel position based on the initial Hall value, the maximum Hall value, the minimum Hall value, and the initial control code; sending the target control code to a motor to push the lens to the target travel position, and obtaining a target Hall value output by the Hall sensor; based on the target Hall value, the maximum Hall value, and the minimum Hall value, determining whether the lens is positioned at the center position; if not, using the target control code as the initial control code for the next positioning, and the target Hall value as the initial Hall value for the next positioning, and repeating the positioning steps until it is determined that the lens is positioned at the center position.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the method according to any one of claims 1 to 7 are implemented when the processor executes the program.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.