Autofocus method, autofocus apparatus, and camera module, device and medium

By increasing the number of magnetic gate segments of the automatic focus motor with magnetic sensor detection in the automatic focus device, the problem of long flow time of the electronic device camera module is solved, improving user experience and reducing power consumption.

WO2025124048A1PCT designated stage expired Publication Date: 2025-06-19HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/131500
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-13
Filing Date
2024-11-12
Publication Date
2025-06-19

AI Technical Summary

Technical Problem

When the existing electronic devices turn on the camera, they need to move the autofocus motor to the top or bottom of the machine, resulting in a long flow time for the camera module and affecting the user's shooting experience.

Method used

One or more magnetic sensors are added to the autofocus device to detect the number of magnetic gate segments currently in which the autofocus motor is located, so that the motor does not need to be moved to the top or bottom of the machine when the camera is turned on.

Benefits of technology

The video module flow time is shortened, the user's shooting experience is improved, and the device power consumption is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024131500_19062025_PF_FP_ABST
    Figure CN2024131500_19062025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the embodiments of the present application are an autofocus method, an autofocus apparatus, and a camera module, a device and a medium. The autofocus apparatus comprises a magnetic assembly, a driving assembly, a magnetic grating, a magnetic grating sensor and a magnetic sensor, wherein the driving assembly drives, under the action of a magnetic field of the magnetic assembly, a lens to move in the direction of an optical axis, and also drives the magnetic assembly or the magnetic sensor to move and drives the magnetic grating or the magnetic grating sensor to move; the magnetic grating sensor outputs a first electrical signal by means of sensing a magnetic field of the magnetic grating that periodically changes; and the magnetic sensor outputs, by means of sensing the magnetic field of the magnetic assembly, a second electrical signal for indicating the number of a magnetic grating segment at which the autofocus apparatus is currently located. In this way, by means of additionally adding a magnetic sensor in an autofocus apparatus to detect the number of a magnetic grating segment at which the autofocus apparatus is located, the boot-to-stream time of a camera module is shortened, thereby improving the photographing experience of a user.
Need to check novelty before this filing date? Find Prior Art

Description

Autofocus method, autofocus device, camera module, equipment and medium

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on December 13, 2023, with application number 202311720375.0 and application name “Autofocus method, autofocus device, camera module, equipment and medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of photographing technology, and in particular to an autofocus method, an autofocus device, a camera module, an electronic device, and a computer-readable storage medium. Background Art

[0003] With the increasing popularity of electronic devices such as mobile phones and increasingly powerful shooting functions, using mobile phones and other electronic devices to shoot images and videos has gradually become a trend.

[0004] During the shooting process, electronic devices such as mobile phones can control the movement of the autofocus motor to drive the optical lens (lens) along the optical axis, thereby adjusting the distance between the lens and the image sensor to achieve auto focus (AF), so that objects at different distances are clearly imaged on the image sensor.

[0005] Currently, some electronic devices use a position detection solution based on magnetic gratings and tunnel magnetoresistance (TMR) sensors to detect the lens position during autofocus. However, this position detection solution requires moving the autofocus motor to the top or bottom of the mechanism each time the camera is turned on. This results in a longer startup time for the camera module, affecting the user's shooting experience.

[0006] Summary of the Invention

[0007] The present application provides an autofocus method, an autofocus device, a camera module, an electronic device, and a computer-readable storage medium, which can solve the problem of long start-up time of the camera module.

[0008] In a first aspect, an embodiment of the present application provides an autofocus device, comprising a magnetic component, a drive component, a magnetic grid, a magnetic grid sensor, and a magnetic sensor; the magnetic component is used to generate a magnetic field; the magnetic grid is used to generate a periodically changing magnetic field; the drive component is used to drive the lens to move along the optical axis under the action of the magnetic field generated by the magnetic component, and drive one of the magnetic component and the magnetic sensor to move relative to the other, and drive one of the magnetic grid and the magnetic grid sensor to move relative to the other; the magnetic grid sensor is used to output a first electrical signal by sensing the periodically changing magnetic field when the magnetic grid and the magnetic grid sensor move relative to each other; the magnetic sensor is used to output a second electrical signal by sensing the magnetic field generated by the magnetic component when the magnetic component and the magnetic sensor move relative to each other, and the second electrical signal is used to indicate the number of magnetic grid segments in which the autofocus device (e.g., an autofocus motor) is currently located.

[0009] As can be seen from the above, the embodiment of the present application is directed to an autofocus device that uses a magnetic grating and a magnetic grating sensor to detect the lens position. One or more magnetic sensors are additionally added to the autofocus device to detect the number of magnetic grating segments the autofocus motor is currently located in. In this way, when the camera is turned on, there is no need to move the autofocus motor to the top or bottom of the machine, which shortens the camera module startup time and improves the user's shooting experience.

[0010] In some possible implementations of the first aspect, the magnetic grating sensor is a giant magnetoresistance sensor or a tunnel magnetoresistance effect sensor.

[0011] In some possible implementations of the first aspect, the magnetic sensor is a Hall sensor, an anisotropic magnetoresistance effect sensor, a giant magnetoresistance sensor, or a tunnel magnetoresistance effect sensor.

[0012] In some possible implementations of the first aspect, the one or more magnetic sensors are disposed on the left side, right side, top side, or bottom side of the magnetic component.

[0013] In some possible implementations of the first aspect, the magnetic assembly includes one or more magnetic members, and the driving assembly includes a coil; when the coil drives the lens to move along the optical axis, it drives the magnetic member and the magnetic grid to move.

[0014] In a second aspect, embodiments of the present application provide a camera module comprising a lens, a driver chip, a magnetic component, a driver component, a magnetic grid, a magnetic grid sensor, and a magnetic sensor. The magnetic component is used to generate a magnetic field; the magnetic grid is used to generate a periodically changing magnetic field.

[0015] The drive assembly is configured to drive the lens along the optical axis under the influence of the magnetic field generated by the magnetic assembly, thereby causing the magnetic assembly and magnetic sensor to move relative to the other, and the magnetic grid and magnetic grid sensor to move relative to the other. The magnetic grid sensor is configured to output a first electrical signal by sensing the periodically changing magnetic field when the magnetic grid and magnetic grid sensor experience relative displacement. The magnetic sensor is configured to output a second electrical signal by sensing the magnetic field generated by the magnetic assembly when the magnetic assembly and magnetic sensor move relative to each other. The driver chip is configured to receive the first and second electrical signals, determine the number of magnetic grid segments the autofocus device is currently located in based on the second electrical signal, and determine the lens position based on the number of magnetic grid segments and the first electrical signal.

[0016] The embodiment of the present application is directed to a camera module that uses a magnetic grid and a magnetic grid sensor to determine the lens position. One or more magnetic sensors are additionally added to the camera module to detect the number of magnetic grid segments the magnetic grid sensor is currently located in. This eliminates the need to move the autofocus motor to the top or bottom of the mechanism when the camera is turned on, thereby shortening the camera module startup time and improving the user's shooting experience.

[0017] In some possible implementations of the second aspect, the magnetic grating sensor is a giant magnetoresistance sensor or a tunnel magnetoresistance effect sensor.

[0018] In some possible implementations of the second aspect, the magnetic sensor is a Hall sensor, an anisotropic magnetoresistance effect sensor, a giant magnetoresistance sensor, or a tunnel magnetoresistance effect sensor.

[0019] In some possible implementations of the second aspect, the magnetic assembly includes one or more magnetic members, and the driving assembly includes a coil; when the coil drives the lens to move along the optical axis, it drives the magnetic member and the magnetic grid to move.

[0020] In some possible implementations of the second aspect, the second electrical signal is a voltage signal. The driver chip is specifically configured to determine, based on a correspondence between motor displacement and the voltage signal, a number of magnetic grating segments corresponding to the second electrical signal, where the number of magnetic grating segments is the current magnetic grating segment of the autofocus device.

[0021] In some possible implementations of the second aspect, the driving component includes a coil, and the driving chip is also used to: adjust the current signal output to the coil according to the number of magnetic grating segments and the first electrical signal, so as to control the autofocus motor to move to the corresponding position in a closed loop, thereby driving the lens to move to the desired focus position to complete autofocus.

[0022] In some possible implementations of the second aspect, due to the detection accuracy of the magnetic sensor, when the autofocus device is at the junction of two magnetic grid segments, determining the magnetic grid segment number of the autofocus device based solely on the second electrical signal output by the magnetic sensor may result in an incorrect determination of the magnetic grid segment number. To further improve the accuracy of detecting the magnetic grid segment number, the driver chip can first determine the current junction of the two magnetic grid segments based on the second electrical signal, and then further accurately determine which of the two magnetic grid segments the autofocus device is currently located in based on the first electrical signal.

[0023] That is, the driver chip is specifically configured to: if the autofocus device is currently within a preset range, based on the second electrical signal, determine that the autofocus device is currently at the intersection of the nth magnetic grating segment and the n+1th magnetic grating segment, and then determine the final magnetic grating segment number the autofocus device is currently located in based on the voltage amplitude of the first electrical signal, where the final magnetic grating segment number is either the nth segment or the n+1th segment; wherein the preset range is a±b microns, where a is the position of the boundary between the nth magnetic grating segment and the n+1th magnetic grating segment, and the detection accuracy of the magnetic sensor is ±b microns. In this way, the problem of inaccurate determination of the number of magnetic grating segments at the magnetic grating boundary due to the limited detection accuracy of the magnetic sensor is addressed. By further combining the voltage signal output by the magnetic grating sensor, the number of magnetic grating segments can be accurately determined, achieving high-precision detection of the number of magnetic grating segments.

[0024] If it is determined based on the second electrical signal that the autofocus device is not currently in the preset range, that is, not at the junction of two magnetic grids, the number of magnetic grid segments corresponding to the second electrical signal is determined based on the correspondence between the motor displacement and the voltage signal.

[0025] In some possible implementations of the second aspect, in addition to accurately determining the number of magnetic grating segments the autofocus device is located in based on the first and second electrical signals at the junction of two magnetic grating segments, the number of magnetic grating segments the autofocus device is located in can also be determined based on the first and second electrical signals at any location, thereby improving magnetic grating detection accuracy. In this case, the driver chip is specifically configured to determine the number of magnetic grating segments the autofocus device is currently located in based on the second and first electrical signals.

[0026] In a third aspect, an embodiment of the present application provides an autofocus method, the method comprising: obtaining a focus instruction, the focus instruction being used to indicate a desired focus position; obtaining a first electrical signal output by a magnetic grating sensor, and a second electrical signal output by a magnetic sensor; determining the number of magnetic grating segments in which the autofocus device is currently located based on the second electrical signal; and controlling the movement of the autofocus device in a closed loop based on the number of magnetic grating segments and the first electrical signal to drive the lens to move to the desired focus position.

[0027] Among them, the autofocus device includes a magnetic component, a driving component, a magnetic grid, a magnetic grid sensor and a magnetic sensor; the magnetic component is used to generate a magnetic field; the magnetic grid is used to generate a periodically changing magnetic field; the driving component is used to drive the lens to move along the optical axis under the action of the magnetic field generated by the magnetic component, and drive one of the magnetic component and the magnetic sensor to move relative to the other, and drive one of the magnetic grid and the magnetic grid sensor to move relative to the other; the magnetic grid sensor is used to output a first electrical signal by sensing the periodically changing magnetic field when the magnetic grid and the magnetic grid sensor move relative to each other; the magnetic sensor is used to output a second electrical signal by sensing the magnetic field generated by the magnetic component when the magnetic component and the magnetic sensor move relative to each other.

[0028] In some possible implementations of the third aspect, the second electrical signal is a voltage signal; and determining the number of the magnetic grid segment in which the autofocus device is currently located based on the second electrical signal includes:

[0029] According to the corresponding relationship between the motor displacement and the voltage signal, the number of magnetic grating segments corresponding to the second electrical signal is determined, and the number of magnetic grating segments is the number of magnetic grating segments where the autofocus device is currently located.

[0030] In some possible implementations of the third aspect, determining the number of the magnetic grid segment in which the autofocus device is currently located according to the second electrical signal includes:

[0031] If it is determined based on the second electrical signal that the autofocus device is currently within a preset range, then determining based on the second electrical signal that the autofocus device is currently at the intersection of the nth magnetic grid segment and the n+1th magnetic grid segment, and determining based on the voltage amplitude of the first electrical signal the final magnetic grid segment number that the autofocus device is currently located at, where the final magnetic grid segment number is the nth magnetic grid segment or the n+1th magnetic grid segment; wherein the preset range is a±b microns, where a is the position of the boundary between the nth magnetic grid segment and the n+1th magnetic grid segment, and the detection accuracy of the magnetic sensor is ±b microns;

[0032] If the autofocus device is determined not to be within the preset range based on the second electrical signal, the number of magnetic grating segments corresponding to the second electrical signal is determined based on the correspondence between the motor displacement and the voltage signal, where the number of magnetic grating segments is the number of magnetic grating segments the autofocus device is currently within. In some possible implementations of the third aspect, the magnetic grating sensor is a giant magnetoresistive sensor or a tunnel magnetoresistive effect sensor; and the magnetic sensor is a Hall sensor, an anisotropic magnetoresistive effect sensor, a giant magnetoresistive sensor, or a tunnel magnetoresistive effect sensor.

[0033] In some possible implementations of the third aspect, after determining the magnetic grating segment number of the magnetic grating sensor according to the second electrical signal, the method further includes: controlling the magnetic sensor to enter a sleep mode. In this way, power consumption can be reduced.

[0034] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising the autofocus device as described in any one of the first aspect above or the camera module as described in any one of the second aspect above.

[0035] In a fifth aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any one of the third aspects above when executing the computer program.

[0036] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method of any one of the third aspects above.

[0037] In a seventh aspect, an embodiment of the present application provides a chip system, comprising a processor coupled to a memory, the processor executing a computer program stored in the memory to implement any of the methods described in the third aspect. The chip system can be a single chip or a chip module composed of multiple chips.

[0038] In an eighth aspect, an embodiment of the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute the method described in the third aspect above.

[0039] It can be understood that the beneficial effects of the second to eighth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] FIG1 is a schematic diagram of an auto-focus closed-loop control system provided in an embodiment of the present application;

[0041] FIG2 is a schematic diagram of position detection based on a TMR sensor and a magnetic grating according to an embodiment of the present application;

[0042] FIG3A is a schematic diagram of a sensor arrangement position according to an embodiment of the present application;

[0043] FIG3B is a schematic cross-sectional view of an auto-focusing device 300 provided in an embodiment of the present application;

[0044] FIG3C is a schematic side view of an auto-focusing device 300 according to an embodiment of the present application;

[0045] FIG4 is a schematic block diagram of an auto-focus closed-loop control system provided in an embodiment of the present application;

[0046] FIG5A is a schematic diagram showing the corresponding relationship between the magnetic field and the motor displacement according to an embodiment of the present application;

[0047] FIG5B is a schematic diagram of the corresponding relationship between voltage and magnetic field provided in an embodiment of the present application;

[0048] FIG5C is a schematic diagram showing the corresponding relationship between voltage and magnetic field provided in an embodiment of the present application;

[0049] FIG5D is a schematic diagram showing the correspondence between the calculated displacement and the motor displacement according to an embodiment of the present application;

[0050] FIG6A is a schematic diagram of a process for determining the number of magnetic grating segments at a magnetic grating junction according to an embodiment of the present application;

[0051] FIG6B is a schematic diagram of a process for determining the number of magnetic grating segments at a magnetic grating junction according to an embodiment of the present application;

[0052] FIG7 is a schematic block diagram of a process of an auto-focusing method provided in an embodiment of the present application;

[0053] FIG8 is a schematic block diagram of the autofocus process provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] In the following description, for the purpose of illustration rather than limitation, specific details such as particular system structures and technologies are provided to facilitate a thorough understanding of the embodiments of the present application.

[0055] The following describes relevant contents that may be involved in the embodiments of this application.

[0056] (1) Autofocus closed-loop control process.

[0057] For example, referring to the schematic diagram of the autofocus closed-loop control system provided in an embodiment of the present application shown in FIG1 , the autofocus closed-loop control system may include but is not limited to: an image sensor (sensor) 10, a lens (lens) 11, an autofocus motor 12, a driver chip 13, a control chip 14 and a position sensor 15.

[0058] The autofocus motor 12 is used to drive the lens 11 to move along the optical axis when moving within the motor travel range to increase or decrease the distance between the lens 11 and the image sensor 10, so that objects at different distances can be clearly imaged on the image sensor 10.

[0059] The autofocus motor 12 can be a voice coil motor (VCM), a piezoelectric motor, or another type of motor. Typically, the autofocus motor 12 includes a stator and a mover. The mover can be connected to the lens 11. When the mover moves within the motor's travel range, the lens 11 also moves.

[0060] The control chip 14 may be, for example, a system on chip (SOC) of an electronic device such as a mobile phone, and is configured to send a focus instruction to the driver chip 13. The focus instruction is configured to indicate a target position of the auto-focus motor.

[0061] The driver chip 13 is used to receive the focus instruction sent by the control chip 14, and obtain the target position of the autofocus motor according to the focus instruction; based on the target position, the driver chip 13 outputs a control signal to the autofocus motor 12 to control the autofocus motor to move to the target position.

[0062] The position sensor 15 is used to detect the position of the lens 11 and feed back the detected position of the lens 11 to the driver chip 13 so that the driver chip 13 performs closed-loop control according to the fed-back position.

[0063] The position sensor 15 may be a magnetic sensor (eg, a Hall sensor) or a magnetoresistive sensor, such as an anisotropic magnetoresistive sensor (AMR), a giant magnetoresistive (GMR) sensor, or a TMR sensor.

[0064] For example, taking the VCM motor as an example, the autofocus closed-loop control process can be as follows:

[0065] The control chip 14 sends a focus instruction to the driver chip 13; the driver chip 13 obtains the target position according to the focus instruction, and outputs a current signal of corresponding magnitude and direction to the coil of the autofocus motor 12 according to the target position; after the coil of the autofocus motor 12 is energized, it interacts with the magnet to generate a Lorentz force, which drives the mover part of the autofocus motor 12 to move, thereby driving the lens 11 to move along the optical axis.

[0066] After the driver chip 13 outputs a current signal to the coil, the position sensor 15 detects the position of the lens 11 and feeds back the detected position to the driver chip 13. The driver chip 13 performs closed-loop control based on the feedback position signal to continuously adjust the position of the autofocus motor 12 so that the position of the lens 11 is consistent with the desired focus position. For example, the driver chip 13 determines that the current position of the lens 11 is not the final desired focus position based on the feedback position of the lens 11, and then obtains the moving distance and direction of the lens based on the difference between the current position of the lens 11 and the desired focus position; determines the output current size and direction based on the moving distance and direction of the lens; and outputs a corresponding current signal to the coil of the autofocus motor 12 based on the determined current size and current direction to control the mover part of the autofocus motor 12 to move the corresponding distance in the corresponding direction, thereby driving the lens 11 to reach the desired focus position.

[0067] Typically, position sensors such as Hall sensors, AMR sensors, or GMR sensors can achieve the requirements for autofocus closed-loop control (e.g., control accuracy). However, in some cases, such as when the camera's image sensor target area is large (e.g., 1 inch), or when the camera is a periscope camera and the autofocus stroke is greater than 1 millimeter (mm), in order to meet the requirements for autofocus distances from infinity to near focus, a position detection solution based on a TMR sensor and a magnetic grating is often used to provide feedback on the lens position.

[0068] (2) Position detection scheme based on TMR sensor and magnetic grating.

[0069] During autofocus, the TMR sensor or magnetic grid can move with the lens, resulting in relative motion between the TMR sensor and the magnetic grid. For example, the TMR sensor, the magnetic grid, and the lens carrier are fixed. The mover of the autofocus motor drives the lens carrier to move along the optical axis. As the lens carrier moves, the magnetic grid also moves with it.

[0070] When the TMR sensor and the magnetic grid move relative to each other, the TMR sensor outputs a sine voltage signal and a cosine voltage signal by sensing the periodically changing magnetic field signal generated by the magnetic grid. Based on the sine voltage signal and the cosine voltage signal, the position of the autofocus motor can be determined to determine the position of the lens, thereby realizing lens position detection during the autofocus process.

[0071] For example, referring to FIG2 , which shows a schematic diagram of position detection based on a TMR sensor and a magnetic grid according to an embodiment of the present application, the magnetic grid 20 includes a plurality of S-pole magnets and a plurality of N-pole magnets, and the S-pole magnets and N-pole magnets are arranged alternately. FIG2 exemplarily shows that the magnetic grid 20 is a long strip-shaped magnetic grid, and is composed of an S-pole magnet, an N-pole magnet, an S-pole magnet, an N-pole magnet, an S-pole magnet, and an N-pole magnet arranged in sequence along a first direction.

[0072] Based on the alternating arrangement of S-pole magnets and N-pole magnets, the magnetic grid 20 can generate a periodically varying magnetic field according to a fixed length period. The length period can be, for example, 800 microns (μm). One length period can be considered as one magnetic grid segment. The magnetic grid 20 can include multiple length periods, and thus multiple magnetic grid segments.

[0073] The TMR sensor 21 generally includes a Wheatstone full-bridge circuit, which is composed of a plurality of magnetic sensitive elements, which can be equivalent to resistors with equal resistance values.

[0074] The TMR sensor 21 and the magnetic grid 20 may be disposed adjacent to each other so that the TMR sensor 21 can sense the magnetic field generated by the magnetic grid 20. Typically, the TMR sensor 21 may be disposed opposite the magnetic grid 20.

[0075] When the magnetic grid 20 and the TMR sensor 21 move relative to each other, the TMR sensor 21 senses the periodically changing magnetic field of the magnetic grid 20 through its magnetosensitive element and outputs a corresponding electrical signal based on the sensed periodically changing magnetic field signal. The electrical signal can be a current signal or a voltage signal. For example, the raw signals output by the TMR in Figure 2 include sine and cosine voltage signals V1 and V2. As shown in Figure 2, the horizontal axis of the sine voltage signal V1 and the cosine voltage signal V2 represents the motor displacement, and the vertical axis represents the voltage. That is, as the autofocus motor moves, a periodically changing voltage signal is obtained.

[0076] It can be understood that the relative movement of the magnetic grid 20 and the TMR sensor 21 may mean that the magnetic grid 20 is fixed and the TMR sensor 21 is moving; or it may mean that the magnetic grid 20 is moving and the TMR sensor 21 is fixed.

[0077] During the autofocus closed-loop control process, when the autofocus motor moves within its travel range, in addition to driving the lens along the optical axis, it can also drive the magnetic grid 20 or TMR sensor 21 to move. For example, the autofocus motor includes a stator and a mover, with the TMR sensor 21 connected to the stator and the magnetic grid 20 connected to the mover. When the mover of the autofocus motor moves to drive the lens along the optical axis, the magnetic grid 20 connected to the mover moves with the mover, while the stator and TMR sensor 21 do not move. In other words, the TMR sensor 21 remains stationary, while the magnetic grid 20 moves back and forth in a first direction and a second direction relative to the TMR sensor 21. As the magnetic grid 20 moves back and forth, the stationary TMR sensor 21 outputs sine and cosine voltage signals V1 and V2, as shown in Figure 2, based on the periodically varying magnetic field generated by the sensed magnetic grid 20.

[0078] The electrical signal output by TMR sensor 21 can be used to calculate the relative motion between magnetic grid 20 and TMR sensor 21, enabling linear displacement detection. Because magnetic grid 20 or TMR sensor 21 moves with the autofocus motor, the relative motion between magnetic grid 20 and TMR sensor 21 is equivalent to the displacement of the autofocus motor.

[0079] As shown in Figure 2, an inverse tangent calculation is performed on the sine and cosine voltage signals V1 and V2 output by the TMR sensor to produce a graph showing the relationship between motor travel and motor displacement. The horizontal axis of this graph represents the motor displacement (actual motor displacement), while the vertical axis represents the calculated motor displacement per cycle. Based on this graph, the number of magnetic grid segments traversed by the motor can be determined, as well as the motor displacement per length cycle or per magnetic grid segment. Finally, the total motor displacement is calculated based on the length of each magnetic grid segment (e.g., 800 μm) and the number of magnetic grid segments traversed by the motor.

[0080] For example, the number of magnetic grid segments in FIG2 includes 1 to 6, represented by the numbers 1 to 6, respectively. In the first magnetic grid segment, the displacement of the autofocus motor within the first magnetic grid segment (or the first length period) is calculated based on the sine voltage signal and cosine voltage signal output by the TMR sensor. In the second magnetic grid segment, the displacement of the autofocus motor in the second magnetic grid segment is calculated based on the sine voltage signal and cosine voltage signal output by the TMR sensor. Similarly, the displacement of the autofocus motor in the third magnetic grid segment, the displacement of the fourth magnetic grid segment, the displacement of the fifth magnetic grid segment, and the displacement of the sixth magnetic grid segment are calculated. Finally, the displacement of the autofocus motor in the first to sixth magnetic grid segments is added together to obtain the total displacement of the motor.

[0081] It is understandable that since the autofocus motor will drive the lens to move along the optical axis when it moves, the displacement of the lens can be obtained based on the displacement of the autofocus motor. The position of the lens can be determined based on the displacement of the lens, thereby realizing the lens position detection of the TMR sensor. In the grid position detection scheme, since the magnetic field provided by the magnetic grid changes periodically, the voltage signal output by the TMR sensor can only determine the displacement of the TMR sensor within the current magnetic field cycle (or length cycle), and cannot determine the magnetic field cycle in which the TMR sensor is located. That is, based on the voltage signal output by the TMR sensor, it is impossible to know the number of magnetic grid segments in which the autofocus motor is currently located. If the number of magnetic grid segments in which the autofocus motor is currently located is unknown, the total displacement of the autofocus motor cannot be calculated, and thus the lens position detection cannot be realized, and the autofocus closed-loop control cannot be realized.

[0082] Therefore, each time the camera is turned on, the related technology drives the autofocus motor to move to the top or bottom of the mechanism (or the zero point of travel), and sets the initial magnetic grid segment of the autofocus motor to the first or last magnetic grid segment by default, thereby obtaining the initial magnetic grid segment number of the autofocus motor. In this way, during the autofocus process, the displacement of the autofocus motor within the current magnetic field cycle and the current magnetic grid segment number can be determined based on the electrical signal output by the TMR sensor and the initial magnetic grid segment number.

[0083] For example, when the camera is turned on, the autofocus motor is driven to the starting point of the initial magnetic grid segment number (i.e., the initial magnetic grid segment number is the first magnetic grid segment). During the autofocus process, the autofocus motor begins moving from the starting point of the first magnetic grid segment. During this movement, the electrical signal continuously output by the TMR sensor is acquired. Based on this electrical signal, it can be calculated that the autofocus motor has passed through three magnetic field cycles, that is, passed through three magnetic grid segments (the first, second, and third magnetic grid segments), and stopped at a certain point on the fourth magnetic grid segment. At this point, since the initial magnetic grid segment number is the first segment and the autofocus motor has passed through three magnetic grid segments, it can be determined that the autofocus motor is currently in the fourth magnetic grid segment number. After determining the current magnetic grid segment number of the autofocus motor, the displacement between the starting point of the fourth magnetic grid segment and a certain point is added to the total displacement of the first three magnetic grid segments to obtain the total displacement of the autofocus motor.

[0084] However, during the long-term research process, the inventors found that if the autofocus motor needs to be moved to the top or bottom of the machine every time the camera is turned on in order to know the initial magnetic grating segment number of the autofocus motor, it will cause the camera module to take a long time to start, affecting the user experience.

[0085] Specifically, driving the autofocus motor to move to the top or bottom of the machine takes a certain amount of time, for example, about 300 milliseconds (ms). During the process of driving the autofocus motor to move to the top or bottom of the machine, the camera module does not output a video stream, and electronic devices such as mobile phones will be in a black screen state without displaying an image. After the autofocus motor reaches the top or bottom of the machine, the camera module is ready and will output a video stream. In this way, the interval between turning on the camera and the camera starting to stream is long, resulting in a long time for the camera module to start streaming, which seriously affects the user experience.

[0086] Furthermore, the inventors discovered during their long-term research that if an electronic device, such as a mobile phone, includes multiple cameras and the camera that uses the TMR sensor and magnetic grid for lens detection is not the main camera, but another camera (such as a periscope camera), then in order to reduce edge processing time and improve the user experience, when the main camera is turned on, the camera using this position detection solution must also be turned on, thereby increasing device power consumption.

[0087] Specifically, electronic devices such as mobile phones may include multiple cameras (for example, main camera, periscope, wide-angle and telephoto cameras). When opening the camera application to shoot, camera switching may be involved. For example, switching from the main camera to the wide-angle camera. When switching from the current camera to the next camera, it is necessary to refocus the next camera. When refocusing the next camera, if the next camera is a camera that performs lens detection based on a magnetic grating and a TMR sensor, it is necessary to obtain the initial position of the autofocus motor.

[0088] In the related art, when switching to the next camera, the autofocus motor can also be moved to the top or bottom of the machine to obtain the initial position of the autofocus motor, thereby completing the autofocus of the camera. However, this will result in a longer startup time for the camera, affecting the user experience. Therefore, in order to reduce the edge time and reduce the startup time of the camera, the related art usually starts the camera at the same time as starting other cameras, and continuously powers on the autofocus motor to monitor and obtain the position of the TMR sensor. Although this can reduce the edge time and reduce the camera startup time, it increases the power consumption of the device.

[0089] For example, taking a periscope camera as an example, its autofocus motor includes a magnetic grid and a TMR sensor, which detects the lens position based on the TMR sensor. In related art, to reduce the periscope camera's edge-to-edge time, the periscope camera is turned on at the same time as the main camera, and the periscope camera's autofocus motor is continuously powered on to monitor the position of the TMR sensor. While the autofocus motor is continuously powered on, the MCU and TMR sensor in the periscope camera's driver chip need to continuously perform signal processing and other processes, which will increase the device's power consumption. The increased power consumption is, for example, around 40 milliamperes (mA).

[0090] To address the aforementioned issues, embodiments of the present application add one or more magnetic sensors to the autofocus device to detect the current magnetic segment number of the autofocus motor. This allows the magnetic sensor to detect the initial magnetic segment number of the autofocus motor, eliminating the need to move the autofocus motor to the top or bottom of the mechanism to determine the initial magnetic segment number when turning on the camera. This shortens the time between turning on the camera and camera start-up (e.g., reducing the time by approximately 300ms).

[0091] In addition, if an autofocus device with one or more additional magnetic sensors is applied to a periscope camera or other camera, when turning on other cameras (such as the main camera), there is no need to simultaneously turn on a camera that uses a magnetic grating sensor for lens position detection to reduce the startup time of the camera. Instead, the camera can be turned on only when switching to the camera (such as the periscope camera), and the initial number of magnetic grating segments of the autofocus motor can be obtained through the magnetic sensor to reduce the camera startup time, thereby reducing the power consumption of the device (for example, reducing the power consumption by approximately 40mA).

[0092] For example, a mobile phone includes a main camera and a periscope camera. The main camera is turned on by default, and the periscope camera uses a TMR sensor to detect the lens position during the autofocus process. In this case, when the user opens the camera app, the main camera is turned on by default for shooting. During the shooting process, if the phone needs to switch from the current main camera to the periscope camera, the periscope camera is turned on and the periscope camera's autofocus motor is powered on. The autofocus motor's magnetic sensor detects the initial number of magnetic grating segments currently located in the autofocus motor, thereby obtaining the autofocus motor's initial position. Based on the autofocus motor's initial position and the TMR sensor, the periscope camera's autofocus closed-loop process is completed. In this way, when the main camera is turned on, there is no need to turn on the periscope camera at the same time to reduce the periscope camera's startup time. Instead, the periscope camera is turned on only when it is needed, and the magnetic sensor in the periscope camera detects the initial position of the autofocus motor to reduce the startup time of the periscope camera, thereby reducing device power consumption.

[0093] The autofocus device may include a magnetic component, a driving component, a magnetic grid, a magnetic grid sensor, and a magnetic sensor.

[0094] The magnetic assembly interacts with the drive assembly to drive the lens along the optical axis. For example, the magnetic assembly includes one or more magnets, and the drive assembly includes one or more coils. The coils and magnets are positioned relative to each other. When energized, the coils interact with the magnets to generate a driving force that drives the lens along the optical axis.

[0095] In some embodiments, the magnetic component can be a movable component, and the drive component is fixed. For example, the autofocus device can be an autofocus motor, which includes a housing and a lens carrier. The housing is fixed, and the lens carrier is movable along the optical axis. The lens carrier is used to carry the optical lens, and when the lens carrier moves, it drives the lens to move. The magnetic component is fixedly connected to the lens carrier, that is, no relative displacement occurs between the magnetic component and the lens carrier; the drive component is fixedly connected to the housing, that is, no relative displacement occurs between the housing and the drive component. The magnetic component can move along the optical axis under the driving force of the drive component, thereby driving the lens carrier to move along the optical axis.

[0096] Of course, in other embodiments, the magnetic assembly may be fixed and the driving assembly may be a movable component. In this case, the driving force generated by the interaction between the driving assembly and the magnetic assembly may push the driving assembly to move along the optical axis.

[0097] The magnetic grid and magnetic grid sensor are positioned relative to each other. The magnetic grid can be a movable component, while the magnetic grid sensor is fixed. In this case, when the lens moves along the optical axis, the magnetic grid can move with the lens, resulting in relative motion between the magnetic grid and the magnetic grid sensor. Alternatively, the magnetic grid can be fixed, while the magnetic grid sensor is a movable component. In this case, when the lens moves along the optical axis, the magnetic grid sensor can move with the lens, resulting in relative motion between the magnetic grid and the magnetic grid sensor.

[0098] The magnetic grid can generate a periodically changing magnetic field. The magnetic grid and the magnetic grid sensor generate relative motion, so that the magnetic grid sensor can output a first electrical signal (such as sine and cosine voltage signals) by sensing the periodically changing magnetic field.

[0099] The magnetic grating sensor may be a GMR sensor, a TMR sensor, or other similar magnetoresistive sensors.

[0100] The magnetic sensor and magnetic assembly are positioned relative to each other. When the magnetic assembly is a movable component, the magnetic sensor is fixed. In this case, when the magnetic assembly moves with the lens, relative motion occurs between the magnetic assembly and the magnetic sensor. When the magnetic assembly is fixed, the magnetic sensor is a movable component. In this case, the magnetic sensor can move with the lens, resulting in relative motion between the magnetic assembly and the magnetic sensor.

[0101] When the magnetic component and the magnetic sensor move relative to each other, the magnetic sensor can sense the linear magnetic field of the magnetic component to output a second electrical signal (eg, a linear voltage signal).

[0102] The magnetic sensor may be an AMR sensor, a GMR sensor, a TMR sensor, or a Hall sensor. Furthermore, the Hall sensor may be a gallium arsenide Hall sensor, or a Hall sensor comprising a Hall analog signal, an application-specific integrated circuit (ASIC) signal processing portion, and a digital processing output portion. Of course, the magnetic sensor may also be other types of magnetic position sensors, which are not limited here. The magnetic sensor may be packaged using a DFN, WLCSP, or WLBGA packaging process.

[0103] Magnetic components are used to generate a magnetic field, which is usually a linear magnetic field. Magnetic grids are used to generate a periodically changing magnetic field.

[0104] The driving component is used to drive the lens to move along the optical axis under the action of the magnetic field generated by the magnetic component, and drive one of the magnetic component and the magnetic sensor to move relative to the other, that is, drive the magnetic component or the magnetic sensor to move; and drive one of the magnetic grid and the magnetic grid sensor to move relative to the other, that is, drive the magnetic grid or the magnetic grid sensor to move.

[0105] The magnetic assembly may include one or more magnetic parts, which may be magnets. The driving assembly includes a coil. When the coil drives the lens to move along the optical axis, it drives the magnetic part and the magnetic grid to move. Exemplarily, the magnetic assembly includes one or more magnets, and the driving assembly includes one or more coils; the coil is fixed (for example, fixed to the housing), the magnet is movably arranged, and the magnet can move with the movement of the lens. The magnetic grid is movably arranged and can move with the movement of the lens, and the magnetic grid sensor is fixed (for example, it can be arranged on the flexible circuit board of the camera module). After the coil is energized, the driving force generated by the interaction between the magnet and the coil pushes the magnet, the lens and the magnetic grid to move, so that relative movement occurs between the magnet and the magnetic sensor, and relative movement occurs between the magnetic grid and the magnetic grid sensor.

[0106] The magnetic grid sensor is configured to output a first electrical signal by sensing a periodically changing magnetic field when the magnetic grid and the magnetic grid sensor move relative to each other. This first electrical signal is used to indicate the lens position. For example, the first electrical signal includes a sine voltage signal and a cosine voltage signal. By calculating and processing the sine and cosine voltage signals based on the initial number of magnetic grid segments in the autofocus motor, the position of the autofocus motor and, therefore, the lens position can be determined.

[0107] It is understood that when the magnetic grid and the magnetic grid sensor are not in relative motion, the magnetic grid sensor can still output an electrical signal by sensing the magnetic field generated by the magnetic grid. When the magnetic grid and the magnetic grid sensor are in relative motion, the magnetic grid sensor can continuously output an electrical signal.

[0108] The magnetic sensor is configured to output a second electrical signal by sensing the magnetic field generated by the magnetic component when the magnetic component and the magnetic sensor move relative to each other. The second electrical signal is configured to indicate the number of the magnetic grid segment the autofocus device is currently located in.

[0109] It's understood that the magnetic sensor generates a voltage signal by detecting changes in the magnetic field of the magnetic component. The magnetic field generated by the magnetic component is linear, so there's a linear relationship between the voltage signal output by the magnetic sensor and the magnetic field. The magnetic field also has a linear relationship with the motor displacement, so there's also a linear relationship between the motor displacement and the voltage signal. Based on this linear relationship between the motor displacement and the voltage signal, the motor displacement corresponding to each voltage can be determined, thereby determining the motor's position and, consequently, the number of magnetic grid segments currently occupied by the autofocus motor.

[0110] In the autofocus mechanism, the magnetic grid sensor serves as the primary position sensor for detecting the lens position during the autofocus process. The newly added magnetic sensor serves as an auxiliary position sensor for detecting the number of magnetic grid segments the autofocus motor is in. This allows the auxiliary position sensor to detect the initial position of the autofocus motor when the camera is turned on, rather than moving the motor to the top or bottom of the mechanism.

[0111] The detection accuracy of the primary position sensor is higher than that of the auxiliary position sensor. For example, the detection accuracy of the magnetic grating sensor is 1 micron (μm), the detection accuracy of the magnetic sensor is within 50 μm (μm), and the length of each magnetic grating segment (pitch) can be 800 μm (μm).

[0112] The number of magnetic sensors can be one or more. Typically, a single magnetic sensor is sufficient. However, in some cases (e.g., when the autofocus travel is long), multiple magnetic sensors may be used.

[0113] The arrangement position of the magnetic sensor may be related to the arrangement position of the magnetic assembly. Typically, the magnetic sensor may be arranged on the left side, right side, top side or bottom side of the magnetic assembly.

[0114] For example, referring to a schematic diagram of sensor arrangement positions shown in FIG3A , the autofocus device 300 includes magnetic sensors 311 - 315 , a motor drive magnet 32 ​​, a magnetic grid 33 , and a magnetic grid sensor 34 (eg, a TMR sensor).

[0115] Magnetic sensors 311 to 315 represent magnetic sensors disposed at different locations. Magnetic sensor 311 is disposed at the first location, magnetic sensor 312 is disposed at the second location, magnetic sensor 313 is disposed at the third location, magnetic sensor 314 is disposed at the fourth location, and magnetic sensor 315 is disposed at the fifth location.

[0116] As shown in Figure 3A, the magnetic sensor 311 is set on the lower side of the motor drive magnet 32, the magnetic sensor 312 is set on the left side of the motor drive magnet 32, the magnetic sensor 313 and the magnetic sensor 314 are set on the upper side of the motor drive magnet, and the magnetic sensor 315 is set on the right side of the motor drive magnet.

[0117] It can be understood that when there is only one magnetic sensor, the magnetic sensor can be set at any position where the magnetic sensors 311 to 315 are located; when there are at least two magnetic sensors, at least two magnetic sensors can be set at the positions where the magnetic sensors 311 to 315 are located, for example, when there are two magnetic sensors, the two magnetic sensors can be set at the positions where the magnetic sensor 311 and the magnetic sensor 315 are located.

[0118] When the magnetic sensor is set to the first position (i.e., the position of magnetic sensor 311), the cross-sectional view of the auto-focus device may be as shown in Figure 3B. When the magnetic sensor is set to the fifth position (i.e., the position of magnetic sensor 315), the side view of the auto-focus device may be as shown in Figure 3C.

[0119] As shown in Figure 3B, the autofocus device 300 includes a motor-driven magnet 32, a coil 35, a magnetic sensor 311, a magnetic grid 33, and a magnetic grid sensor 34. When coil 35 is energized, it drives the motor-driven magnet 32 ​​to move along the optical axis, thereby driving the lens and moving the magnetic grid 33. The magnetic sensor 311 and the magnetic grid sensor 34 can be fixedly mounted on a component such as an insert molding wiring or a flexible circuit board, where the wiring is made of a conductive material. When the motor-driven magnet 32 ​​moves, relative motion occurs between the magnetic sensor 311 and the motor-driven magnet 32. The magnetic sensor 311 senses the linear magnetic field generated by the movement of the motor-driven magnet 32 ​​and outputs a linear voltage signal. When the magnetic grid 33 moves, relative motion occurs between the magnetic grid 33 and the magnetic grid sensor 34, allowing the magnetic grid sensor 34 to sense the periodically changing magnetic field and output a periodic voltage signal.

[0120] As shown in Figure 3C, the autofocus device 300 includes a coil 35, a motor-driven magnet 32, a magnetic grid sensor 34, and a magnetic sensor 315. The magnetic grid sensor 34 is fixedly mounted on a component such as an insert molding trace or a flexible circuit board. The motor-driven magnet 32 ​​can move under the action of the coil 35, driving the magnetic grid, resulting in relative motion between the motor-driven magnet 32 ​​and the magnetic sensor 315, and between the magnetic grid sensor 34 and the magnetic grid.

[0121] The first electrical signal output by the magnetic grating sensor and the second electrical signal output by the magnetic sensor can be transmitted to a module with processing capabilities such as a microprocessor (MCU) or a SOC chip of a driver chip, so that the MCU or SOC chip can determine the number of magnetic grating segments the autofocus motor is currently located in based on the second electrical signal, and determine the position of the autofocus motor based on the number of magnetic grating segments and the first electrical signal, thereby realizing autofocus closed-loop control.

[0122] As can be seen, the embodiments of the present application add one or more magnetic sensors to the autofocus device to detect the number of magnetic grating segments located in the magnetic grating sensor or autofocus motor. This eliminates the need to move the autofocus motor to the top or bottom of the mechanism to determine the initial position of the magnetic grating sensor when the camera is turned on. This shortens the camera module startup time and improves the user's shooting experience. Furthermore, it may also reduce device power consumption.

[0123] Please refer to Figure 4, which is a schematic block diagram of an autofocus closed-loop control system provided in an embodiment of the present application. The autofocus closed-loop control system may include a camera module 400 and a control chip 410. The camera module 400 may include a lens 401, an image sensor 402, a driver chip 403, a magnetic grid 404, a magnetic grid sensor 405, a driver component 406, a magnetic component 407, and a magnetic sensor 408. The autofocus motor may include but is not limited to the magnetic grid 404, the magnetic grid sensor 405, the driver component 406, the magnetic component 407, and the magnetic sensor 408. The driver chip 403 may be disposed in the autofocus motor or may not be disposed in the autofocus motor.

[0124] The magnetic component 407 is used to generate a magnetic field; and the magnetic grid 405 is used to generate a periodically changing magnetic field.

[0125] Drive assembly 406 is used to drive the lens along the optical axis under the influence of the magnetic field generated by magnetic assembly 407, thereby causing one of magnetic assembly 407 and magnetic sensor 408 to move relative to the other, and one of magnetic grid 404 and magnetic grid sensor 405 to move relative to the other. Magnetic grid sensor 405 is used to output a first electrical signal by sensing the periodically changing magnetic field when magnetic grid 404 and magnetic grid sensor 405 experience relative displacement. Magnetic sensor 408 is used to output a second electrical signal by sensing the magnetic field generated by magnetic assembly 407 when magnetic assembly 407 and magnetic sensor 408 move relative to each other. Driver chip 403 is used to receive the first and second electrical signals, determine the current magnetic grid segment number of the magnetic grid sensor based on the second electrical signal, and determine the lens's position based on the number of magnetic grid segments and the first electrical signal.

[0126] It should be noted that the relevant introductions about the lens 401, image sensor 402, magnetic grid 404, magnetic grid sensor 405, drive component 406, magnetic component 407, and magnetic sensor 408 can be found in the above content about the autofocus device, which will not be repeated here.

[0127] The second electrical signal may be a voltage signal. In this case, the driver chip 406 may determine the magnetic grid segment number where the auto-focus motor is currently located based on the corresponding relationship between the motor displacement and the voltage signal.

[0128] Among them, the correspondence between the motor displacement and the voltage signal is obtained according to a pre-calibrated correspondence. The pre-calibrated correspondence may include the correspondence between the magnetic field and the motor displacement, and the correspondence between the voltage and the magnetic field. For example, referring to the schematic diagram of the correspondence between the magnetic field and the motor displacement shown in FIG5A, the vertical axis is the magnetic field signal of the magnetic component 407 monitored, and the horizontal axis is the displacement of the autofocus motor, that is, there is a linear relationship between the magnetic field and the motor displacement of the monitored magnetic component 407. During the specific calibration process, the autofocus motor is controlled to drive the lens to move along the optical axis, and when the autofocus motor is at each position point, the magnetic field signal generated by the magnetic component 407 monitored at the position point is recorded, so as to generate the correspondence between the magnetic field and the motor displacement as shown in FIG5A based on the magnetic field signal of each motor position point.

[0129] Referring to FIG5B , which illustrates the relationship between voltage and magnetic field, the vertical axis represents the voltage signal output by magnetic sensor 408, and the horizontal axis represents the magnetic field signal generated by magnetic assembly 407. This indicates a linear relationship between the magnetic field generated by magnetic assembly 407 and the output voltage of magnetic sensor 408. During the calibration process, the autofocus motor is controlled to move the lens along the optical axis, and the magnetic field generated by magnetic assembly 407 and the voltage signal output by magnetic sensor 408 are recorded at each motor position. Based on these voltage and magnetic field signals, the relationship between magnetic field and voltage, as shown in FIG5B , is generated.

[0130] Based on the correspondence between the magnetic field and the motor displacement as shown in FIG5A , and the correspondence between the magnetic field and the voltage as shown in FIG5B , it can be determined that there is a linear correspondence between the motor displacement and the voltage signal output by the magnetic sensor 408. Based on this linear correspondence, the motor displacement (i.e., the motor position) corresponding to the voltage signal can be determined based on the voltage signal output by the magnetic sensor 408. For example, for the voltage signal output by the magnetic sensor 408 at a certain moment, based on the one-to-one correspondence between the voltage and the magnetic field as shown in FIG5B , the magnetic field signal corresponding to the voltage signal can be determined. Based on the one-to-one correspondence between the magnetic field signal and the motor displacement as shown in FIG5A , the motor displacement corresponding to the magnetic field signal can be determined. Based on the motor displacement, the position of the autofocus motor at the current moment can be determined. Finally, based on the pre-obtained relationship between each motor position point and the number of magnetic grating segments, the number of magnetic grating segments corresponding to the autofocus motor position can be determined, thereby realizing the detection of the number of magnetic grating segments where the autofocus motor is located based on the magnetic sensor 408.

[0131] Referring to the schematic diagram of the correspondence between voltage and motor displacement shown in FIG5C , the number of magnetic grid segments corresponding to each voltage signal or magnetic field signal can be determined through calculation. For example, in FIG5C , the numbers 1 to 6 are used to identify the magnetic grid segment numbers. The segment containing the number 1 belongs to the first magnetic grid segment (i.e., the magnetic grid segment number is 1), the segment containing the number 2 belongs to the second magnetic grid segment, the segment containing the number 3 belongs to the third magnetic grid segment, the segment containing the number 4 belongs to the fourth magnetic grid segment, the segment containing the number 5 belongs to the fifth magnetic grid segment, and the segment containing the number 6 belongs to the sixth magnetic grid segment.

[0132] Of course, in some embodiments, the corresponding relationship shown in Figure 5C can also be obtained through a pre-calibration operation. In this way, in actual applications, after the driver chip 406 receives the voltage signal output by the magnetic sensor 408, it can determine the number of magnetic grating segments corresponding to the voltage signal according to the corresponding relationship shown in Figure 5C, and then determine the number of magnetic grating segments where the autofocus motor is located.

[0133] After the driver chip 406 determines the number of magnetic grid segments in which the magnetic grid sensor is located based on the second electrical signal output by the magnetic sensor 408, it can calculate the displacement of the autofocus motor based on the first electrical signal output by the magnetic grid sensor and the number of magnetic grid segments. For example, see FIG5D , which shows the correspondence between the calculated total motor displacement and the motor displacement. The horizontal axis represents the motor displacement, and the vertical axis represents the calculated total motor displacement. The calculated total motor displacement refers to the total motor displacement calculated based on the first and second electrical signals after the driver chip 406 controls the movement of the autofocus motor. In FIG5D , the displacement of each magnetic grid segment is indicated by numbers 1 to 6. The length of the line segment corresponding to number 1 represents the motor displacement within the first magnetic grid segment, the length of the line segment corresponding to number 2 represents the motor displacement within the second magnetic grid segment, the length of the line segment corresponding to number 3 represents the motor displacement within the third magnetic grid segment, the length of the line segment corresponding to number 4 represents the motor displacement within the fourth magnetic grid segment, the length of the line segment corresponding to number 5 represents the motor displacement within the fifth magnetic grid segment, and the length of the line segment corresponding to number 6 represents the motor displacement within the sixth magnetic grid segment. By adding up the displacements of the motor within the five magnetic grid segments, the total displacement of the motor can be calculated.

[0134] After the driver chip 406 obtains the calculated total motor displacement based on the first electrical signal and the second electrical signal, it can determine the lens position based on the calculated total motor displacement. If the lens position is different from the desired focus position, the current signal output to the coil is adjusted according to the difference between the lens position and the desired focus position, for example, the magnitude and direction of the current signal are adjusted so that the coil in the driver assembly can drive the lens to the desired focus position, thereby realizing automatic focus closed-loop control.

[0135] It should be noted that the camera module 400 can be a main camera module, a wide-angle camera module, a telephoto camera module, or a periscope camera module. In other words, the autofocus device with one or more magnetic sensors can be used for the autofocus closed-loop control process of the main camera, wide-angle camera, telephoto camera, or periscope camera.

[0136] When the autofocus device is applied to the default camera (such as the main camera) of an electronic device such as a mobile phone, the starting time of the camera can be shortened by adding one or more magnetic sensors to the autofocus device to detect the initial number of magnetic grating segments of the autofocus motor.

[0137] When the autofocus device is used in a periscope, telephoto or wide-angle switching camera of an electronic device such as a mobile phone, by adding one or more magnetic sensors to the autofocus device to detect the initial number of magnetic grating segments of the autofocus motor, not only the starting time of the camera can be shortened, but also the power consumption of the device can be reduced.

[0138] Magnetic sensor 408 has low accuracy. Therefore, simply determining the number of magnetic grid segments based on the second electrical signal output by magnetic sensor 408 may result in an incorrect determination of the number of magnetic grid segments when the autofocus motor is at a magnetic grid boundary. For example, if the magnetic sensor's detection accuracy is 50 microns (μm), the voltage signal within 50 μm before and after the magnetic grid boundary may be affected by the detection accuracy, resulting in an incorrect determination of the number of magnetic grid segments within this range. Assuming that each magnetic grid segment is 800 μm long and the magnetic grid boundary is 800 μm, the voltage signal between 750 μm and 850 μm may result in an incorrect determination of the number of magnetic grid segments.

[0139] In some embodiments, in order to improve the detection accuracy of the number of magnetic grating segments at the magnetic grating boundary and achieve high-precision detection of the number of magnetic grating segments, the first electrical signal and the second electrical signal can be combined to accurately determine the number of magnetic grating segments.

[0140] It is understood that during the continuous movement of the autofocus motor, the first electrical signal continuously output by the magnetic grid sensor may include electrical signals belonging to different magnetic grid segments. For example, as shown in FIG2 , the voltage signal output by the TMR sensor may include voltage signals of the first to sixth magnetic grid segments.

[0141] After receiving the first electrical signal and the second electrical signal collected simultaneously, the driver chip 406 determines whether the autofocus motor is in a preset range based on the second electrical signal. The preset range is the boundary between two magnetic gratings. For example, the driver chip 406 can determine the motor position corresponding to the current second electrical signal based on Figures 5A to 5C. If the current motor position is at the magnetic grating boundary, it is determined that the autofocus motor is currently in the preset range. Conversely, if the current motor position is not at the magnetic grating boundary, it is determined that the autofocus motor is currently not in the preset range. The preset range is a±b microns, where a is the position of the boundary point between the nth magnetic grating segment and the n+1th magnetic grating segment, and the detection accuracy of the magnetic sensor is ±b microns. n is a positive integer greater than or equal to 1.

[0142] For example, assuming each magnetic grid segment is 800 μm long, b is 50, and a is the magnetic grid position where the magnetic grid boundary point is located (for example, at 800 μm, 1600 μm, or 2400 μm). In this case, the preset range can be 750 μm to 850 μm (i.e., the boundary between the first and second magnetic grid segments). If the current motor position is 790 μm or 830 μm, the motor is considered to be at the boundary between the first and second magnetic grid segments.

[0143] After the driver chip 406 determines that the autofocus motor is currently at the junction of two magnetic grid segments, it can then determine, based on the second electrical signal, that the autofocus motor is at the junction of the nth magnetic grid segment and the n+1th magnetic grid segment, that is, determine which two magnetic grid segments the autofocus motor is at the junction of. For example, based on the relationship diagram shown in FIG5C , the second electrical signal can be used to determine which two magnetic grid segments the autofocus motor is at the junction of.

[0144] After determining the intersection of the two magnetic grating segments, the driver chip 406 further combines the first electrical signal to accurately determine the magnetic grating segment number that the auto-focus motor is currently located at.

[0145] Typically, the first electrical signal at a certain moment may include a sine voltage signal and a cosine voltage signal. Based on the amplitudes of the sine voltage signal and the cosine voltage signal, it is determined whether the magnetic grating segment number where the autofocus motor is currently located is the nth segment or the n+1th segment. Specifically, the sine voltage signal and the cosine voltage signal may be used as coordinates of a circle (e.g., a unit circle), and based on the quadrant in which the coordinates are located, it is determined whether the magnetic grating segment number where the autofocus motor is currently located is the nth segment or the n+1th segment. For example, assuming that the second electrical signal determines that the autofocus motor is between the first magnetic grating segment and the second magnetic grating segment, after converting the first electrical signal into the coordinates of a circle, if the coordinates are in the first quadrant, it is determined that the magnetic grating segment number where the autofocus motor is currently located is the second magnetic grating segment; if the coordinates are in the second quadrant, it is determined that the magnetic grating segment number where the autofocus motor is currently located is the first magnetic grating segment.

[0146] For example, referring to the schematic diagram of the process for determining the number of magnetic grid segments at a magnetic grid junction shown in Figures 6A and 6B , the driver chip 406 receives the raw signal output by the TMR sensor and the electrical signal output by the magnetic sensor, and extracts a small segment of the raw signal from the TMR sensor to obtain the signal shown in graph 600. The horizontal axis of graph 600 represents motor displacement, and the vertical axis represents voltage. The horizontal axis of graph 600 is approximately 800 μm long, and the sine and cosine voltage signals in graph 600 represent voltage signals corresponding to a length period or magnetic grid segment.

[0147] Since the detection accuracy of the magnetic sensor is plus or minus 50 microns (μm), a voltage signal approximately 100 μm in length is extracted from the signal in graph 600 to obtain the signal shown in graph 610. The horizontal coordinate of graph 610 ranges from 1 to 99 μm. By performing inverse tangent and other processing on the original signal shown in graph 600, a line segment graph as shown in graph 620 can be obtained. This line segment graph can represent the number of magnetic grating segments. The dotted box is located at the intersection between the first and second magnetic grating segments. In addition, the signals in graph 600 are sinusoidal and cosine voltage signals, so the circle in graph 630 can be represented by the sin and cos functions. That is, the coordinates of the circle in graph 630 can be expressed as (cos, sin). Therefore, in graph 630, the amplitude of the sinusoidal and cosine voltage signals determines the quadrant in which the coordinate point is located.

[0148] The line segment corresponding to the signal in graph 610 is intercepted from the circle in graph 630 to obtain the line segment shown in graph 640. This line segment corresponds to the signal in graph 610 within the circle in graph 630. Driver chip 406 also processes the electrical signal output by the magnetic sensor to obtain a corresponding processing result. As shown in graph 650, this is the displacement detection result corresponding to the signal in graph 610. At this point, points in graph 650 where the vertical axis is less than 0 correspond to points in the second quadrant of graph 640, and points where the vertical axis is greater than 0 correspond to points in the first quadrant of graph 640. At this point, after converting the sine and cosine voltage signals output by the TMR sensor into circular coordinates, if the coordinates fall in the first quadrant, it indicates that the magnetic grid segment currently located in the autofocus motor is the second magnetic grid segment. If the coordinates fall in the second quadrant, it indicates that the magnetic grid segment currently located in the autofocus motor is the first magnetic grid segment.

[0149] According to this principle, after determining at which two sections of the magnetic grid the autofocus motor is currently located according to the second electrical signal, that is, determining at the intersection of the nth section and the n+1th section according to the second electrical signal, it is possible to accurately judge whether the autofocus motor is in the nth section or the n+1th section based on the amplitude of the sine voltage signal and the cosine voltage signal.

[0150] It is worth pointing out that the limited detection accuracy of the magnetic sensor leads to inaccurate judgment of the number of magnetic grating segments at the magnetic grating boundary of the autofocus motor. By further combining the voltage signal output by the magnetic grating sensor, the number of magnetic grating segments can be accurately judged, achieving high-precision detection of the number of magnetic grating segments.

[0151] As shown above, when determining the number of magnetic grating segments where the autofocus motor is located based on the second electrical signal, the number of magnetic grating segments can be determined based solely on the second electrical signal. For example, the number of magnetic grating segments corresponding to the voltage signal output by the magnetic sensor can be directly determined based on the corresponding relationship in FIG5C . The number of magnetic grating segments can be determined based solely on the second electrical signal at non-magnetic grating boundaries, while the number of magnetic grating segments can be further accurately detected based on the first electrical signal at magnetic grating boundaries. Of course, in some embodiments, it is also possible to accurately determine the number of magnetic grating segments by combining the first electrical signal and the second electrical signal at all or any locations without distinguishing whether the grating is at the magnetic grating boundary. The specific process can be as shown in FIG6A and FIG6B .

[0152] The embodiment of the present application adds one or more additional magnetic sensors to the camera module to detect the number of magnetic grating segments the magnetic grating sensor is currently located in. In this way, when the camera is turned on, there is no need to move the autofocus motor to the top or bottom of the machine, which reduces the power consumption of the device, shortens the camera module startup time, and improves the user's shooting experience.

[0153] Please refer to FIG7 , which is a schematic block diagram of a process of an auto-focusing method provided in an embodiment of the present application. The method may include the following steps:

[0154] Step S701: The driver chip obtains a focus instruction, where the focus instruction is used to indicate a desired focus position.

[0155] The driver chip can refer to the driver chip within the autofocus motor, which may include an MCU. In addition to the driver chip performing autofocus closed-loop control, it can also be performed by the application processor of the SOC chip in electronic devices such as mobile phones. In other words, the driver chip in Figure 7 can be replaced with an SOC chip or an SOC chip's application processor.

[0156] The focus command can be a command issued by the SOC chip. The desired focus position can be the target position of the lens determined by the SOC chip based on the autofocus algorithm, or the target position of the autofocus motor, that is, driving the lens to the target position or controlling the autofocus motor to move to the target position to achieve autofocus.

[0157] Step S702: The driving chip obtains the first electrical signal output by the magnetic grating sensor and the second electrical signal output by the magnetic sensor.

[0158] Step S703: The driver chip determines the number of the magnetic grid segment where the auto-focus device is currently located according to the second electrical signal.

[0159] In some embodiments, the second electrical signal is a voltage signal, and the driver chip can determine the number of magnetic grating segments corresponding to the second electrical signal based on the correspondence between the motor displacement and the voltage signal. This number of magnetic grating segments is the number of magnetic grating segments of the autofocus device. The autofocus device can be an autofocus motor.

[0160] In other embodiments, the driver chip may further combine the first electrical signal and the second electrical signal to accurately determine the number of magnetic grating segments of the magnetic grating sensor.

[0161] Exemplarily, if the driver chip determines, based on the second electrical signal, that the autofocus device is currently within a preset range, then the driver chip determines, based on the second electrical signal, that the autofocus device is currently at the intersection of the nth magnetic grid segment and the n+1th magnetic grid segment, and determines, based on the voltage amplitude of the first electrical signal, the final magnetic grid segment number the autofocus device is currently in, where the final magnetic grid segment number is either the nth magnetic grid segment or the n+1th magnetic grid segment. The preset range is a±b microns, where a is the location of the boundary between the nth magnetic grid segment and the n+1th magnetic grid segment, and the detection accuracy of the magnetic sensor is ±b microns.

[0162] If the driver chip determines that the autofocus device is not currently in the preset range based on the second electrical signal, it determines the number of magnetic grating segments corresponding to the second electrical signal based on the correspondence between the motor displacement and the voltage signal. The number of magnetic grating segments is the number of magnetic grating segments where the autofocus device is currently located.

[0163] It is understandable that the driver chip can process the acquired first electrical signal and second electrical signal in real time. The first electrical signal and the second electrical signal can be considered to be acquired simultaneously.

[0164] After determining the number of magnetic grating segments, the magnetic sensor can be controlled to enter sleep mode to reduce power consumption. Of course, the magnetic sensor can also be kept in working mode.

[0165] Step S704 : The driving chip controls the movement of the auto-focus device in a closed loop according to the number of magnetic grating segments and the first electrical signal, so as to drive the lens to move to a desired focus position.

[0166] It is understood that, typically, when the camera starts operating, the second electrical signal output by the magnetic sensor is used to determine the number of magnetic grating segments the autofocus motor is currently located in, thereby determining the initial position of the autofocus motor. After determining the initial position of the autofocus motor, the magnetic sensor can be powered down to save power. Furthermore, based on the initial position of the autofocus motor and the first electrical signal continuously output by the magnetic grating sensor, closed-loop control of the autofocus motor's movement is implemented to achieve the autofocus function.

[0167] Of course, in addition to using the magnetic sensor to detect the initial position of the autofocus motor, the magnetic grating sensor can also be used to detect the position of the autofocus motor at any time.

[0168] To better illustrate the technical solutions provided by the embodiments of this application, the following describes the autofocus process in conjunction with the schematic block diagram shown in FIG8 . As shown in FIG8 , the magnetic grating sensor is exemplarily a TMR sensor, which serves as the primary position sensor; the magnetic sensor serves as the auxiliary position sensor. The process may include the following steps:

[0169] Step S801: The SOC chip issues an auto-focus instruction.

[0170] Step S802: The MCU in the driver chip obtains the position information output by the auxiliary position sensor.

[0171] Step S803: The MCU obtains the TMR position information output by the main position sensor.

[0172] It is understandable that the MCU can simultaneously obtain the position information output by the main position sensor and the auxiliary position sensor.

[0173] Step S804: The MCU determines the number of the magnetic grid segment where the auto-focus motor is currently located based on the position information output by the auxiliary position sensor, or based on the position information output by the auxiliary position sensor and the TMR position information.

[0174] It is understandable that the MCU can use only the position information output by the auxiliary position sensor to determine the number of magnetic grating segments; it can also use the position information output by the auxiliary position sensor and the TMR position information to jointly determine the number of magnetic grating segments to improve the accuracy of judging the number of magnetic grating segments at the magnetic grating boundary.

[0175] The position information and the TMR position information may refer to electrical signals. For example, the TMR position information may be a sine-cosine voltage signal, and the position information may be a linear voltage signal.

[0176] Step S805: The MCU controls the auxiliary position sensor to enter a sleep mode or maintain a working state.

[0177] It is understandable that, in addition to determining the initial magnetic grating segment number of the autofocus motor through the auxiliary position sensor, the auxiliary position sensor can be powered off or put into sleep mode to save power consumption of the device.

[0178] Of course, the auxiliary position sensor can also be kept in a working state all the time, so that in some special cases, the auxiliary position sensor can still obtain the number of magnetic grating segments of the autofocus motor. For example, a user uses an electronic device such as a mobile phone to take a photo. Assuming that the mobile phone or other electronic device has completed autofocus through the above-mentioned autofocus process, or is in the process of autofocusing, the mobile phone or other electronic device is physically hit by an external force, such as the user hitting the camera with his hand. Due to the action of the external force, the autofocus motor will move instantly, causing the driver chip to be unable to detect whether the movement of the main position sensor (such as the TMR sensor) exceeds a length period, and thus unable to know the number of magnetic grating segments where the autofocus motor is located, resulting in autofocus blur. In this case, the auxiliary position sensor can be kept in a working state to detect the magnetic grating segment where the autofocus motor is currently located. Even if the autofocus motor moves instantly due to external force, autofocus blur will not occur.

[0179] Step S806: The MCU controls the autofocus motor to move to the focus code position according to the number of magnetic grating segments and the signal output by the TMR sensor.

[0180] For example, the MCU determines the current position of the autofocus motor based on the number of magnetic grating segments and the signal output by the TMR sensor; based on the difference between the current position of the autofocus motor and the focus code position (i.e., the desired focus position), the MCU changes the size and direction of the current signal input to the coil of the autofocus motor to control the movement of the autofocus motor.

[0181] Step S807 : The MCU outputs current to the coil of the auto-focus motor to control the position of the auto-focus motor in a closed loop.

[0182] Step S808: The MCU reads back the signal output by the TMR sensor to confirm whether the autofocus motor has reached the focus code position. If yes, the process proceeds to step S809; if not, the process returns to step S806.

[0183] In the process of controlling the movement of the autofocus motor, the MCU can obtain the current position of the autofocus motor based on the signal output by the TMR sensor. If the current position of the autofocus motor is the focus code position, it is considered that the focus is completed. If not, it is necessary to continue to adjust the current size and direction of the coil to control the autofocus motor to reach the focus code position, thereby driving the lens to move to the corresponding position.

[0184] Step S809: The current auto focus is completed.

[0185] The same or similar points between this embodiment and the above embodiments can be referred to each other and will not be described in detail here.

[0186] The present application also provides an electronic device, which may include the autofocus device or camera module of any one of the above embodiments. The autofocus device may also be considered as an autofocus motor.

[0187] The present application also provides an electronic device, which may include but is not limited to a control chip 410 and a camera module 400 as shown in FIG4 . The control chip 410 may be a SOC chip, etc. The electronic device may be, for example, a terminal device with a camera function, such as a mobile phone, a tablet computer, or an in-vehicle device.

[0188] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0189] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor (such as the MCU in the driver chip, or the application processor of the SOC chip), it can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to an electronic device such as a driver chip, SOC chip or mobile phone, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0190] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0191] In the embodiments provided in this application, it should be understood that the disclosed devices, electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0192] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0193] The electronic device provided in the embodiments of the present application may include a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a method as described in any one of the above-mentioned autofocus method embodiments is implemented.

[0194] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0195] An embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0196] The present application also provides a chip system, comprising a processor coupled to a memory, and executing a computer program stored in the memory to implement the methods described in the above method embodiments. The chip system can be a single chip or a chip module composed of multiple chips.

[0197] In the above embodiments, the descriptions of each embodiment have different emphases. For portions not described or documented in detail in a particular embodiment, reference should be made to the relevant descriptions of other embodiments. It should be understood that the sequence numbers of the steps in the above embodiments do not imply a sequential order of execution. The execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation of the embodiments of this application. Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used solely for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature designated as "first," "second," "third," or "fourth" may explicitly or implicitly include one or more of such features. Furthermore, it should be understood that "at least one" in the embodiments of this application includes one or more, where "more" means greater than or equal to two. In the embodiments of this application, "and / or" is simply a term used to describe an association relationship between associated objects, indicating that three relationships can exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. In addition, the character “ / ” in this article generally indicates that the previous and next related objects are in an “or” relationship.

[0198] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized.

[0199] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. An automatic focusing device, characterized in that: It includes a magnetic component, a driving component, a magnetic grid, a magnetic grid sensor and a magnetic sensor; The magnetic component is used to generate a magnetic field; the magnetic grid is used to generate a periodically changing magnetic field; The driving assembly is used to drive the lens to move along the optical axis under the action of the magnetic field generated by the magnetic assembly, and drive one of the magnetic assembly and the magnetic sensor to move relative to the other, and drive one of the magnetic grid and the magnetic grid sensor to move relative to the other; The magnetic grating sensor is used to output a first electrical signal by sensing the periodically changing magnetic field when the magnetic grating and the magnetic grating sensor move relative to each other; The magnetic sensor is used to output a second electrical signal by sensing the magnetic field generated by the magnetic component when the magnetic component and the magnetic sensor move relative to each other, and the second electrical signal is used to indicate the number of magnetic grid segments where the autofocus device is located.

2. The device according to claim 1, characterized in that The magnetic grating sensor is a giant magnetoresistance sensor or a tunnel magnetoresistance effect sensor.

3. The device according to claim 1, characterized in that The magnetic sensor is a Hall sensor, an anisotropic magnetoresistance effect sensor, a giant magnetoresistance sensor or a tunnel magnetoresistance effect sensor.

4. The device according to claim 1, characterized in that One or more of the magnetic sensors are disposed on the left side, the right side, the top side or the bottom side of the magnetic component.

5. The device according to any one of claims 1 to 4, characterized in that: The magnetic assembly includes one or more magnetic parts, and the driving assembly includes a coil; when the coil drives the lens to move along the optical axis, it drives the magnetic part and the magnetic grid to move.

6. A camera module, characterized in that: Including a lens, a driver chip, a magnetic component, a driver component, a magnetic grid, a magnetic grid sensor and a magnetic sensor; The magnetic component is used to generate a magnetic field; the magnetic grid is used to generate a periodically changing magnetic field; The driving assembly is used to drive the lens to move along the optical axis under the action of the magnetic field generated by the magnetic assembly, and drive one of the magnetic assembly and the magnetic sensor to move relative to the other, and drive one of the magnetic grid and the magnetic grid sensor to move relative to the other; The magnetic grating sensor is used to output a first electrical signal by sensing the periodically changing magnetic field when the magnetic grating and the magnetic grating sensor generate relative displacement; The magnetic sensor is used to output a second electrical signal by sensing the magnetic field generated by the magnetic component when the magnetic component and the magnetic sensor move relative to each other; The driving chip is used to receive the first electrical signal and the second electrical signal, determine the number of magnetic grating segments where the autofocus device is currently located according to the second electrical signal; and determine the position of the lens according to the number of magnetic grating segments and the first electrical signal.

7. The camera module according to claim 6, characterized in that: The magnetic grating sensor is a giant magnetoresistance sensor or a tunnel magnetoresistance effect sensor.

8. The camera module according to claim 6, characterized in that: The magnetic sensor is a Hall sensor, an anisotropic magnetoresistance effect sensor, a giant magnetoresistance sensor or a tunnel magnetoresistance effect sensor.

9. The camera module according to claim 6, characterized in that: The magnetic assembly includes one or more magnetic parts, and the driving assembly includes a coil; when the coil drives the lens to move along the optical axis, it drives the magnetic part and the magnetic grid to move.

10. The camera module according to any one of claims 6 to 9, characterized in that: The second electrical signal is a voltage signal; The driving chip is specifically used to determine the number of magnetic grating segments corresponding to the second electrical signal according to the corresponding relationship between the motor displacement and the voltage signal, and the number of magnetic grating segments is the number of magnetic grating segments where the autofocus device is currently located.

11. The camera module according to claim 10, characterized in that: The drive assembly includes a coil; The driving chip is further used to adjust the current signal output to the coil according to the number of magnetic grid segments and the first electrical signal.

12. The camera module according to any one of claims 6 to 9, characterized in that: The driver chip is specifically used for: If it is determined according to the second electrical signal that the autofocus device is currently in a preset range, then it is determined according to the second electrical signal that the autofocus device is currently at the junction of the nth magnetic grid and the n+1th magnetic grid, and according to the voltage amplitude of the first electrical signal, the final magnetic grid segment number where the autofocus device is currently located is determined, and the final magnetic grid segment number is the nth magnetic grid or the n+1th magnetic grid; wherein the preset range is a±b microns, a is the position of the boundary point between the nth magnetic grid segment and the n+1th magnetic grid segment, and the detection accuracy of the magnetic sensor is ±b microns; If it is determined based on the second electrical signal that the autofocus device is not currently in the preset range, the number of magnetic grating segments corresponding to the second electrical signal is determined based on the correspondence between the motor displacement and the voltage signal, and the number of magnetic grating segments is the number of magnetic grating segments where the autofocus device is currently located.

13. An automatic focusing method, characterized in that: The method comprises: Acquire a focus instruction, where the focus instruction is used to indicate a desired focus position; Acquire a first electrical signal output by the magnetic grating sensor and a second electrical signal output by the magnetic sensor; determining the number of the magnetic grid segment where the autofocus device is currently located according to the second electrical signal; According to the number of magnetic grid segments and the first electrical signal, the automatic focusing device is controlled in a closed loop to move, so as to drive the lens to move to the desired focusing position; Wherein, the autofocus device comprises a magnetic component, a driving component, the magnetic grid, the magnetic grid sensor and the magnetic sensor; The magnetic component is used to generate a magnetic field; the magnetic grid is used to generate a periodically changing magnetic field; The driving assembly is used to drive the lens to move along the optical axis under the action of the magnetic field generated by the magnetic assembly, and drive one of the magnetic assembly and the magnetic sensor to move relative to the other, and drive one of the magnetic grid and the magnetic grid sensor to move relative to the other; The magnetic grating sensor is used to output the first electrical signal by sensing the periodically changing magnetic field when the magnetic grating and the magnetic grating sensor move relative to each other; The magnetic sensor is used for outputting the second electrical signal by sensing the magnetic field generated by the magnetic component when the magnetic component and the magnetic sensor move relative to each other.

14. The method according to claim 13, characterized in that The second electrical signal is a voltage signal; Determining the number of the magnetic grid segment where the autofocus device is currently located according to the second electrical signal includes: The number of magnetic grating segments corresponding to the second electrical signal is determined according to the corresponding relationship between the motor displacement and the voltage signal, and the number of magnetic grating segments is the number of magnetic grating segments where the autofocus device is currently located.

15. The method according to claim 13, characterized in that Determining the number of the magnetic grid segment where the autofocus device is currently located according to the second electrical signal includes: If it is determined according to the second electrical signal that the autofocus device is currently in a preset range, then it is determined according to the second electrical signal that the autofocus device is currently at the junction of the nth magnetic grid and the n+1th magnetic grid, and according to the voltage amplitude of the first electrical signal, the final magnetic grid segment number where the autofocus device is currently located is determined, and the final magnetic grid segment number is the nth magnetic grid or the n+1th magnetic grid; wherein the preset range is a±b microns, a is the position of the boundary point between the nth magnetic grid segment and the n+1th magnetic grid segment, and the detection accuracy of the magnetic sensor is ±b microns; If it is determined based on the second electrical signal that the autofocus device is not currently in the preset range, the number of magnetic grating segments corresponding to the second electrical signal is determined based on the correspondence between the motor displacement and the voltage signal, and the number of magnetic grating segments is the number of magnetic grating segments where the autofocus device is currently located.

16. The method according to claim 13, characterized in that The magnetic grid sensor is a giant magnetoresistance sensor or a tunnel magnetoresistance effect sensor; the magnetic sensor is a Hall sensor, an anisotropic magnetoresistance effect sensor, a giant magnetoresistance sensor or a tunnel magnetoresistance effect sensor.

17. The method according to any one of claims 13 to 16, characterized in that After determining the number of magnetic grating segments where the magnetic grating sensor is currently located according to the second electrical signal, the method further includes: The magnetic sensor is controlled to enter a sleep mode.

18. An electronic device, characterized in that: It comprises the autofocus device as described in any one of claims 1 to 5 or the camera module as described in any one of claims 6 to 12.

19. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 13 to 17 when executing the computer program.

20. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 13 to 17 is implemented.

Citation Information

Patent Citations

  • Voice coil motor

    CN111580324A

  • Detection device, camera module and electronic equipment

    CN112822379A

  • Voice coil motor, camera module and electronic equipment

    CN114488459A

  • Lens assembly, camera module and electronic equipment

    CN116794791A

  • Automatic focusing method, automatic focusing device, camera module, equipment and medium

    CN117651218A