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

By combining Hall sensors and potentiometers with adaptive PID control, the steady-state error and slow response problems in optical camera autofocus are solved, achieving efficient and accurate autofocus control.

CN120568199BActive Publication Date: 2025-10-17CHANGCHUN TONGSHI PHOTOELECTRIC TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The autofocus technology of traditional optical cameras has problems such as steady-state error, mechanical collision, slow response and oscillation, and single sensor feedback cannot accurately perceive image clarity.

Method used

The Hall sensor group, potentiometer and focus motor are combined with adaptive PID control. Through multi-sensor information fusion and staged search path optimization, precise limit and image clarity feedback are achieved, and the integral anti-saturation design is combined to avoid oscillation and slow response.

Benefits of technology

It improves focusing efficiency and accuracy, reduces invalid searches and mechanical collisions, enhances system operation reliability, and achieves fast, accurate and safe automatic focusing control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120568199B_ABST
    Figure CN120568199B_ABST
Patent Text Reader

Abstract

The application discloses a focusing control system and method based on sensor fusion and adaptive PID, belongs to the field of optical imaging and automatic control technology, and particularly relates to the field of optical imaging automatic focusing technology.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 installed at two ends of a lens stroke and are respectively used for positive Hall limiting and reverse Hall limiting of the lens; the potentiometer is installed on a lens zoom gear shaft and is used for collecting AD values of the lens; the focusing motor is coupled with a 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 a camera core, acquires an image definition value, receives data of the two Hall sensors and the potentiometer, and controls a motor driver.The application solves the problem that a traditional PD control lacks an integral term and cannot completely eliminate a steady-state error, thereby causing deviation of a final focusing position.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of optical imaging and automatic control, and particularly relates to the field of optical imaging automatic focusing technology. BACKGROUND

[0002] At present, for realizing high-precision automatic focusing technology of various optical cameras such as industrial cameras and security monitoring devices, a single sensor feedback (such as a potentiometer or an image gradient) is usually adopted, and the following problems exist:

[0003] The traditional PD control lacks an integral term and cannot completely eliminate steady-state error, resulting in deviation of the final focusing position;

[0004] The potentiometer cannot perceive image sharpness, and the image gradient lacks absolute position reference;

[0005] There are often invalid searches or mechanical collisions in the focusing process, and there is also the problem of slow response;

[0006] Oscillation is easy to occur when approaching the target position, prolonging the focusing time. SUMMARY

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

[0008] The system comprises a Hall sensor group, a potentiometer, a focusing motor and a control processing unit;

[0009] The Hall sensor group comprises two Hall sensors, which are respectively installed at both ends of the lens stroke and are respectively used for forward Hall limiting and reverse Hall limiting of the lens;

[0010] The potentiometer is installed on the lens zoom gear shaft and is used for collecting the AD value of the lens;

[0011] The focusing motor is coupled with the lens focusing mechanism through a reduction gear and is used for controlling the movement of the lens;

[0012] The control processing unit is connected with the camera core, acquires the image sharpness value, receives the data of the two Hall sensors and the potentiometer, and controls the motor driver.

[0013] The method is performed using the focusing control system as described above, and comprises the following steps:

[0014] S1, control the lens to move reversely to trigger the reverse Hall limiting;

[0015] S2, control the lens to move forwardly to trigger the forward Hall limiting, and record the maximum image sharpness value and the corresponding lens AD value AD during the forward movementpeak ;

[0016] S3, control the lens to move reversely at a higher speed until , wherein represents the current AD value of the lens, is a pre-set threshold value;

[0017] S4, control the lens to move reversely at a lower speed until , wherein is a pre-set threshold value;

[0018] S5, control the lens to move by using a PID control method with adjustable parameters so that the AD value of the lens reaches AD peak is the target continuous movement: initially, the moving direction of the lens is adjusted according to the deviation of the current AD value of the lens from AD peak , which is manifested as that the current AD value of the lens alternately fluctuates above and below AD peak . With the control advancing, the PID parameters are dynamically adapted, the moving range of the lens is gradually narrowed, the deviation from AD peak is continuously reduced, and the lens approaches AD peak in a form of damped oscillation, finally forms a micro-amplitude stable fluctuation near AD peak , and completes the automatic focusing.

[0019] Further, the reverse movement is counterclockwise movement of the lens, and the forward movement is clockwise movement of the lens.

[0020] Further, .

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

[0022] Further, the PID control method with adjustable parameters controls the lens to continue to move, wherein represents the current time, represents the output of the PID controller, represents the difference between the current AD value of the lens and AD peak , represents the proportional gain, represents the integral gain, represents the differential gain. Further,

[0023] , , and are specifically as follows:

[0024] 。

[0025] Further, after , the integral gain is further adjusted:

[0026] , wherein, represents the further adjusted integral gain, represents the current AD value of the lens.

[0027] Further, when , the integral gain is further increased, and the value 1.2 in is gradually increased until the integral limit is reached, and the integral limit means that , wherein represents the real-time value of , represents the upper limit value of , and the value is 500; during the gradual increase of the value 1.2 in , if occurs, then is reset to zero, and then the step S1 is returned to continue.

[0028] The method has the following beneficial effects:

[0029] The present application effectively solves the problems of local optimal search and insufficient parameter adaptability in the traditional automatic focusing method by fusing the multi-sensor information of potentiometer position detection, Hall limit protection and image sharpness feedback, combining the adaptive PID control strategy of phased search path optimization, and finally realizes the significant improvement of focusing efficiency, the substantial optimization of focusing accuracy, and the effective enhancement of system operation reliability, etc. Comprehensive technical effects, providing a fast, accurate, safe and efficient automatic focusing control scheme for optical imaging equipment.

[0030] In the present application, the Hall limit sensor is fully utilized to optimize the search path and reduce invalid search or mechanical collision; when focusing the lens, oscillation is easy to occur near the target position, which prolongs the focusing time. The present application avoids the influence of oscillation by integral anti-saturation design, avoids the occurrence of oscillation, improves the lens focusing efficiency, and the integral anti-saturation design can also overcome the problem of slow response during focusing. BRIEF DESCRIPTION OF DRAWINGS

[0031] Figure 1 is a schematic diagram of the overall structure of the system in the embodiment of the present application;

[0032] Figure 2 is an automatic focusing control flowchart in the embodiment of the present application;

[0033] Figure 3 is a schematic diagram of the phased control strategy in the embodiment of the present application;

[0034] Figure 4 Flow chart for PID control method with adjustable parameters in embodiments of the present application;

[0035] Figure 5 Schematic diagram of integral anti-windup mechanism in embodiments of the present application;

[0036] Figure 6 Block diagram of potentiometer detection circuit structure in embodiments of the present application;

[0037] Figure 7 Block diagram of Hall limit interface circuit structure in embodiments of the present application. DETAILED DESCRIPTION

[0038] The technical solutions of the present application will be described clearly and completely below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the present application.

[0039] Embodiment 1,

[0040] As shown in the figure, the present embodiment provides a focusing control system based on sensor fusion and adaptive PID, which comprises a Hall sensor group, a potentiometer, a focusing motor and a control processing unit. Figure 1 The Hall sensor group comprises two Hall sensors, which are respectively installed at both ends of the lens stroke and are respectively used for positive Hall limit and reverse Hall limit of the lens. In the case of a specified total lens focusing stroke (for example: the total stroke of a motor through a circle is about 50 mm, but the actual total stroke of the lens is only 20 mm), the double Hall sensors can provide stroke boundary positions, combined with a search step, to avoid full-circle blind scanning.

[0041] The block diagram of the Hall limit interface circuit structure is shown in the figure. When the motor drives the mechanical structure to approach the limit position, the magnet triggers the Hall sensor to output an original signal. The signal is first fixed to a level by a pull-up resistor, then the electromagnetic noise is eliminated by RC filtering, then it is converted into a standard digital signal by a comparator, and finally it is transmitted to the control processing unit through GPIO. When the control processing unit detects the sensor trigger signal, it immediately outputs a command to stop the motor or reverse drive. When it is not triggered, the motor is allowed to continue to run, so as to realize precise limit.

[0042] Figure 7 The potentiometer is installed on the lens zoom gear shaft and is used for collecting the AD value of the lens.

[0043] The potentiometer is installed on the lens zoom gear shaft and is used for collecting the AD value of the lens. Figure 6 ​As shown, it is a structure block diagram of the potentiometer detection circuit in the embodiment of the application. When the motor drives the rotation of the potentiometer shaft, the output analog voltage signal proportional to the rotation angle is first filtered by RC to remove noise, amplified by the operational amplifier to the ADC adaptation range (0-3.3V), then converted to 0-4095 digital quantity by 12-bit ADC, and finally transmitted to the control processing unit. The control processing unit calculates the current position of the motor in real time through the digital quantity and the preset position relationship (such as full-scale corresponding to the maximum stroke of the motor), so as to realize the accurate monitoring of the motion position.

[0044] The focusing motor is coupled with the lens focusing mechanism through a reduction gear for controlling the movement of the lens.

[0045] The control processing unit is connected with the camera core to obtain the image sharpness value, receive the data of the two Hall sensors and the potentiometer, and control the motor driver of the lens, so as to control the movement of the lens.

[0046] Embodiment 2,

[0047] The embodiment provides a focusing control method based on sensor fusion and adaptive PID, which is based on the system in embodiment 1.

[0048] As Figure 2 shown, the method comprises the following steps:

[0049] S1, control the lens to move reversely to trigger the reverse Hall limit;

[0050] S2, control the lens to move forwardly to trigger the forward Hall limit, and record the maximum image sharpness value and the lens AD value AD peak corresponding thereto during the forward movement.

[0051] S3, control the lens to move reversely at a higher speed until , wherein AD represents the current AD value of the lens, is a pre-set threshold value.

[0052] S4, control the lens to move reversely at a lower speed until , wherein is a pre-set threshold value.

[0053] S5, control the lens by using the parameter-adjustable PID control method to make the AD value reach AD peak Target continuous movement: initially, the movement direction of the lens is adjusted according to the deviation of the current AD value of the lens from AD peak , which is manifested as that the current AD value of the lens is within AD peakThe 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.

[0054] 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.

[0055] 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.

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

[0057] 、 and The specific values ​​are:

[0058] 。

[0059] exist After that, further adjust the integral gain:

[0060] ,in, represents the integral gain after further adjustment, Indicates the current AD value of the lens.

[0061] 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 .

[0062] 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.

[0063] Example 3

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

[0065] The system integration includes:

[0066] Mechanical integration a) Potentiometer mounted directly on the lens zoom gear shaft

[0067] b) Hall sensors are installed at both ends of the lens travel

[0068] c) The motor is coupled to the lens focusing mechanism through a reduction gear

[0069] Signal transmission a) Position signal: analog level signal (0-3.3V)

[0070] b) Limit signal: digital level signal (0 / 3.3V)

[0071] c) Motor control: PWM signal (10 kHz frequency)

[0072] Control algorithm flow a) Read potentiometer AD value, calculate current position

[0073] b) Detect hall limit state, ensure safety range

[0074] c) Get image sharpness gradient value

[0075] d) Execute phased control strategy

[0076] Phase 1 Reverse search starting point Phase 2 Forward search sharp point Phase 3 Reverse search rough positioning Phase 4 Reverse fine search Phase 5 Adaptive PID control e) Output motor signal

[0077] Protection mechanism a) Hardware limit: Hall sensor provides end-of-travel protection

[0078] b) Software limit: AD value range limit (0-4095)

[0079] c) Timeout protection: Maximum time limit for single focusing operation.

Claims

1. A focusing control method based on sensor fusion and adaptive PID is performed using a focusing control system, characterized in that: 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 movement, obtains the image clarity value, receives data from the two Hall sensors and the potentiometer, and controls the motor driver; The method 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 the target value, completing automatic focusing; 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; 、 and The specific values ​​are: 。 2. The focusing control method according to claim 1, wherein: Reverse movement means the lens moves counterclockwise, and forward movement means the lens moves clockwise.

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

5. The focusing control method according to claim 1, 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.

6. The focusing control method according to claim 5, 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

  • Focusing method and device, electronic equipment and storage medium

    CN111432125A

  • Mobile phone shooting control method and device based on multiple cameras

    CN117750188A

  • Circuit, system and method for airborne photoelectric pod camera motor limiting system

    CN119906301A