Focusing control system and method based on sensor fusion and adaptive PID

Through the Hall sensor group and potentiometer combined with adaptive PID control, the steady-state error, mechanical collision and slow response problems in traditional optical camera focus are solved, and efficient and accurate automatic focus effect is achieved.

CN120568199AActive Publication Date: 2025-08-29CHANGCHUN TONGSHI PHOTOELECTRIC TECH CO LTD

Patent Information

Application Number
CN202511061805.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2025-08-29
Estimated Expiration
2045-07-31

AI Technical Summary

Technical Problem

The automatic focus technology of traditional optical cameras has problems such as steady-state error deviation, mechanical collision, slow response and oscillation, and the feedback of a single sensor cannot achieve high-precision focus.

Method used

The Hall sensor group, potentiometer and focus motor are combined with adaptive PID control, and the precise limit and integral anti-saturation design is achieved through multi-sensor information fusion and phased search path optimization.

Benefits of technology

It improves focus efficiency and accuracy, reduces mechanical collisions and oscillations, enhances the operating reliability of the system, and achieves fast and accurate automatic focus control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120568199A_ABST
    Figure CN120568199A_ABST
Patent Text Reader

Abstract

The invention relates to a focusing control system and method based on sensor fusion and adaptive PID (Proportion Integration Differentiation). Belongs to the technical field of optical imaging and automatic control, and particularly relates to the technical field of optical imaging automatic focusing. The system comprises a Hall sensor group, a potentiometer, a focusing motor and a control processing unit, the Hall sensor group comprises two Hall sensors which are respectively arranged at two ends of a lens stroke and are respectively used for carrying out forward Hall limiting and reverse Hall limiting on the lens; the potentiometer is installed on a lens zoom gear shaft and used for collecting the AD value of a lens. The focusing motor is coupled with the lens focusing mechanism through a reduction gear and is used for controlling the movement of the lens; and the control processing unit is connected with the camera core, acquires an image definition value, receives data of the two Hall sensors and the potentiometer, and controls the motor driver. The problem that the final focusing position has deviation due to the fact that traditional PD control lacks integral terms and cannot completely eliminate steady-state errors is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of optical imaging and automatic control, and in particular to the technical field of optical imaging automatic focusing. Background Art

[0002] Currently, high-precision autofocus technology for various optical cameras, such as industrial cameras and security monitoring equipment, typically uses a single sensor feedback (such as a potentiometer or image gradient). This presents the following challenges: Traditional PD control lacks an integral term and cannot completely eliminate steady-state errors, resulting in deviations in the final focus position. Relying solely on potentiometers cannot perceive image clarity, and relying solely on image gradients lacks an absolute position reference; In the focusing process, there are often invalid searches or mechanical collisions, and there are also problems with slow response; When approaching the target position, oscillation is likely to occur, which prolongs the focusing time. Summary of the Invention

[0003] In order to solve the above technical problems, the present invention provides a focusing control system and method based on sensor fusion and adaptive PID.

[0004] The system includes a Hall sensor group, a potentiometer, a focus motor and a control processing unit; The Hall sensor group includes two Hall sensors, which are respectively installed at both ends of the lens stroke and are used to perform positive Hall limit and reverse Hall limit on the lens respectively; The potentiometer is installed on the lens zoom gear shaft and is used to collect the AD value of the lens; The focusing motor is coupled to the lens focusing mechanism via a reduction gear and is used to control the movement of the lens; The control processing unit is connected to the camera core, obtains the image clarity value, receives data from two Hall sensors and a potentiometer, and controls the motor driver.

[0005] The method is performed using the focus control system as described above, and comprises the following steps: S1, control the lens to move in reverse until the reverse Hall limit is triggered; S2, control the lens to move forward until the positive Hall limit is triggered. During the forward movement, record the maximum image clarity and the corresponding lens AD value AD peak ; S3, control the lens to move in the reverse direction at a higher speed until ,in Indicates the current AD value of the lens. is a pre-set threshold; S4, control the lens to move in the reverse direction at a lower speed until ,in is a pre-set threshold; S5, use the parameter adjustable PID control method to control the lens so that its AD value reaches AD peak Continuous movement for the target: Initially based on the current AD value of the lens and AD peak The deviation adjusts the lens movement direction, which is manifested as the current AD value of the lens in AD peak The PID parameters are dynamically adapted as the control progresses, and the movement range of the lens gradually narrows, becoming larger or smaller than the AD peak The deviations of AD peak A slight stable fluctuation is formed near the target value, infinitely approaching it, and automatic focusing is completed.

[0006] Furthermore, reverse movement means that the lens moves counterclockwise, and forward movement means that the lens moves clockwise.

[0007] further, .

[0008] Furthermore, the higher speed is PWM_60%-80%, and the lower speed is PWM_10%-30%.

[0009] Furthermore, the parameter adjustable PID control method is achieved by Control the lens to continue moving, Indicates the current moment, represents the output of the PID controller, Indicates the current AD value and AD peak The difference, represents the proportional gain, represents the integral gain, represents the differential gain.

[0010] further, 、 and The specific values ​​are: 。

[0011] Further, in After that, further adjust the integral gain: ,in, represents the integral gain after further adjustment, Indicates the current AD value of the lens.

[0012] Further, when After that, the integral gain is further increased. The value 1.2 in is gradually increased until the integral limit is reached. The meaning of the integral limit is ,in express The real-time value of express The upper limit of the value is 500; In the process of gradually increasing the value of 1.2, if If Reset to zero, and then return to step S1 to continue.

[0013] The beneficial effects of the method of the present invention are: The present invention effectively solves the problems of local optimal search and insufficient parameter adaptability existing in traditional automatic focusing methods by integrating multi-sensor information such as potentiometer position detection, Hall limit protection and image clarity feedback, combined with an adaptive PID control strategy of phased search path optimization. Ultimately, it achieves comprehensive technical effects such as significantly improving focusing efficiency, greatly optimizing focusing accuracy, and effectively enhancing system operation reliability, providing optical imaging equipment with a fast, accurate, safe and efficient automatic focusing control solution.

[0014] In the present invention, the Hall limit sensor is fully utilized to optimize the search path, reducing invalid searches or mechanical collisions; when focusing the lens, oscillation is likely to occur when approaching the target position, which prolongs the focusing time. In order to avoid the influence of oscillation, the present invention performs an integral anti-saturation design to avoid oscillation and improve the lens focusing efficiency. The integral anti-saturation design can also overcome the problem of slow response during focusing. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is a schematic diagram of the overall structure of the system in an embodiment of the present invention; Figure 2 This is a flow chart of automatic focusing control in an embodiment of the present invention; Figure 3 Schematic diagram of the phased control strategy in an embodiment of the present invention; Figure 4 Flowchart of calculation of the parameter-adjustable PID control method according to an embodiment of the present invention; Figure 5 Schematic diagram of the integral anti-saturation mechanism in an embodiment of the present invention; Figure 6 This is a structural block diagram of a potentiometer detection circuit in an embodiment of the present invention; Figure 7 This is a structural block diagram of the Hall limit interface circuit in an embodiment of the present invention. DETAILED DESCRIPTION

[0016] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0017] Example 1 like Figure 1 As shown, this embodiment provides a focus control system based on sensor fusion and adaptive PID, the system including a Hall sensor group, a potentiometer, a focus motor and a control processing unit; The Hall effect sensor assembly includes two Hall effect sensors, one mounted at each end of the lens' travel range, for positive and negative Hall effect limit settings, respectively. When the total lens focus range is specified (for example, the motor's full rotational range is approximately 50mm, but the lens only requires 20mm of travel), the dual Hall effect sensors provide travel boundary locations, which, combined with the search process, prevents blind scanning throughout the full rotational range.

[0018] The structure diagram of the Hall limit interface circuit is as follows: Figure 7 As shown in the figure, when the motor drives the mechanical structure close to the limit position, the magnet triggers the Hall effect sensor to output a raw signal. This signal is first fixed to a fixed level by a pull-up resistor, then filtered through an RC filter to eliminate electromagnetic noise. A comparator then converts the signal into a standard digital signal, which is then transmitted to the control processing unit via the GPIO. When the control processing unit detects the sensor trigger signal, it immediately issues a command to stop the motor or reverse the direction of motion. If the signal is not triggered, the motor is allowed to continue running, thus achieving precise limit control.

[0019] The potentiometer is installed on the lens zoom gear shaft and is used to collect the AD value of the lens; Figure 6 Figure 2 shows a block diagram of the potentiometer detection circuit structure in an embodiment of the present invention. When the motor drives the potentiometer shaft to rotate, it outputs an analog voltage signal proportional to the rotation angle. This signal is first filtered by an RC filter to remove noise, then amplified by an operational amplifier to the ADC's adaptive range (0-3.3V). The 12-bit ADC then converts the signal into a digital value ranging from 0 to 4095, which is then transmitted to the control processing unit. The control processing unit calculates the motor's current position in real time based on the digital value and a preset position relationship (e.g., full-scale corresponds to the motor's maximum travel), thereby achieving precise monitoring of the motor's motion position.

[0020] The focusing motor is coupled to the lens focusing mechanism via a reduction gear and is used to control the movement of the lens; The control processing unit is connected to the camera movement, obtains the image clarity value, receives data from two Hall sensors and a potentiometer, and controls the motor driver of the lens, thereby controlling the movement of the lens.

[0021] Example 2 This embodiment provides a focusing control method based on sensor fusion and adaptive PID, which is based on the system in Example 1.

[0022] like Figure 2 As shown, the method includes the following steps: S1, control the lens to move in reverse until the reverse Hall limit is triggered; S2, control the lens to move forward until the positive Hall limit is triggered. During the forward movement, record the maximum image clarity and the corresponding lens AD value AD peak ; S3, control the lens to move in the reverse direction at a higher speed until ,in Indicates the current AD value of the lens. is a pre-set threshold; S4, control the lens to move in the reverse direction at a lower speed until ,in is a pre-set threshold; S5, use the parameter adjustable PID control method to control the lens so that its AD value reaches AD peak Continuous movement for the target: Initially based on the current AD value of the lens and AD peak The deviation adjusts the lens movement direction, which is manifested as the current AD value of the lens in AD peak The PID parameters are dynamically adapted as the control progresses, and the movement range of the lens gradually narrows, becoming larger or smaller than the AD peak The deviations of AD peak A slight stable fluctuation is formed near the target value, infinitely approaching it, and automatic focusing is completed.

[0023] In the method, reverse movement is counterclockwise movement of the lens, and forward movement is clockwise movement of the lens; ; The higher speed is PWM_60%-80%, and the lower speed is PWM_10%-30%. Figure 3 FIG. 1 is a schematic diagram of a staged control strategy in an embodiment of the present invention.

[0024] like Figure 4 The figure shows the calculation flow chart of the parameter adjustable PID control method, which is Control the lens to continue moving, Indicates the current moment, Represents the output of the PID controller. It is the motor drive signal (i.e. the duty cycle of the PWM wave) output by the PID controller, rather than the direct AD value. The real-time position of the lens is collected by the potentiometer and converted into an AD value, which is then compared with the AD value. peak The error is obtained after comparing the values The PID controller calculates the control quantity based on the error , drive the motor to adjust the lens position, and finally make the feedback AD value approach AD peak value to achieve closed-loop control.

[0025] Indicates the current AD value and AD peak The difference, Represents the proportional gain, represents the integral gain, represents the differential gain.

[0026] 、 and The specific values ​​are: 。

[0027] exist After that, further adjust the integral gain: ,in, represents the integral gain after further adjustment, Indicates the current AD value of the lens.

[0028] when After that, the integral gain is further increased, and the integral anti-saturation mechanism is added during the improvement process: The value 1.2 in is gradually increased until the integral limit is reached. The meaning of the integral limit is ,in express The real-time output value of express The upper limit of the value is 500; In the process of gradually increasing the value of 1.2, if If Return to zero and then return to step S1 to continue. Figure 5 The figure shows a schematic diagram of the integral anti-saturation mechanism in an embodiment of the present invention, wherein That is , the integral term I is .

[0029] During autofocus, when the focus range is large or the AD value changes rapidly, the integral term may saturate due to continuous accumulation. This saturated integral term will still drive the motor, resulting in overshoot. Subsequent adjustments will require a longer "reverse correction," such as when the focus continues to wobble after being properly adjusted. The anti-saturation mechanism truncates integral accumulation to prevent overshoot and overdrive due to historical accumulation, enabling faster convergence to the optimal position. Therefore, by suppressing the "ineffective motion" and "correction delay" caused by integral saturation, the integral anti-saturation design indirectly speeds up the focus system's response and alleviates the problem of slow response.

[0030] Example 3 This embodiment provides processing steps for implementing the system and method of the present invention.

[0031] The system integration includes: Mechanical integration a) Potentiometer mounted directly on the lens zoom gear shaft b) Hall sensors are installed at both ends of the lens travel c) The motor is coupled to the lens focusing mechanism through a reduction gear Signal transmission a) Position signal: analog level signal (0-3.3V) b) Limit signal: digital level signal (0 / 3.3V) c) Motor control: PWM signal (10kHz frequency) Control algorithm flow a) Read the potentiometer AD value and calculate the current position b) Detect the Hall limit status to ensure the safety range c) Get the clear gradient value of the image d) Implement a phased control strategy Stage 1: Reverse search for the starting point Stage 2: Forward search for the clear point Stage 3: Reverse search for a rough position Stage 4: Reverse search for a fine position Stage 5: Adaptive PID control e) Output motor signal Protection mechanism a) Hardware limit: Hall sensor provides end-of-travel protection b) Software limit: AD value range limit (0-4095) c) Timeout protection: The maximum time limit for a single focusing operation.

Claims

1. Focus control system based on sensor fusion and adaptive PID, characterized by: The system includes a Hall sensor group, a potentiometer, a focus motor and a control processing unit; The Hall sensor group includes two Hall sensors, which are respectively installed at both ends of the lens stroke and are used to perform positive Hall limit and reverse Hall limit on the lens respectively; The potentiometer is installed on the lens zoom gear shaft and is used to collect the AD value of the lens; The focusing motor is coupled to the lens focusing mechanism via a reduction gear and is used to control the movement of the lens; The control processing unit is connected to the camera core, obtains the image clarity value, receives data from two Hall sensors and a potentiometer, and controls the motor driver.

2. A focusing control method based on sensor fusion and adaptive PID, characterized in that: The method is performed using the focus control system according to claim 1, comprising the following steps: S1, control the lens to move in reverse until the reverse Hall limit is triggered; S2, control the lens to move forward until the positive Hall limit is triggered. During the forward movement, record the maximum image clarity and the corresponding lens AD value AD peak ; S3, control the lens to move in the reverse direction at a higher speed until ,in Indicates the current AD value of the lens. is a pre-set threshold; S4, control the lens to move in the reverse direction at a lower speed until ,in is a pre-set threshold; S5, use the parameter adjustable PID control method to control the lens so that its AD value reaches AD peak Continuous movement for the target: Initially based on the current AD value of the lens and AD peak The deviation adjusts the direction of lens movement, which is manifested as the current AD value of the lens in AD peak The PID parameters are dynamically adapted as the control progresses, and the movement range of the lens gradually narrows, becoming larger or smaller than the AD peak The deviations of AD peak A slight stable fluctuation is formed near the target value, infinitely approaching it, and automatic focusing is completed.

3. The focusing control method according to claim 2, wherein: Reverse movement means the lens moves counterclockwise, and forward movement means the lens moves clockwise.

4. The focusing control method according to claim 3, wherein: 。 5. The focusing control method according to claim 4, wherein: The higher speed is PWM_60%-80%, and the lower speed is PWM_10%-30%.

6. The focusing control method according to claim 5, wherein: The parameter adjustable PID control method is achieved by Control the lens to continue moving, Indicates the current moment, represents the output of the PID controller, Indicates the current AD value and AD peak The difference, represents the proportional gain, represents the integral gain, represents the differential gain.

7. The focusing control method according to claim 6, wherein: 、 and The specific values ​​are: 。 8. The focusing control method according to claim 7, wherein: exist After that, further adjust the integral gain: ,in, represents the integral gain after further adjustment, Indicates the current AD value of the lens.

9. The focusing control method according to claim 8, wherein: when After that, the integral gain is further increased. The value 1.2 in is gradually increased until the integral limit is reached. The meaning of the integral limit is ,in express The real-time value of express The upper limit of the value is 500; In the process of gradually increasing the value of 1.2, if If Reset to zero, and then return to step S1 to continue.

Citation Information

Patent Citations

  • Method for actively carrying out motor precision calibration

    CN108344356A

  • Camera module and position control method of optical component thereof

    CN108828874A

  • Focusing method and device, electronic equipment and storage medium

    CN111432125A

  • Focus-adjustable lens module and optical equipment

    CN115508977A

  • Live broadcast display device and control method thereof

    CN117097918A

Cited By

  • Oscillating mirror angle adjusting device and method based on Hall element

    CN120949403A

  • Focusing method and system of infrared camera

    CN121357418A

  • A method and system for focusing an infrared camera

    CN121357418B