Macro-micro linkage automatic focusing control method, controller and system
By using a macro-micro linkage autofocus control method, the system achieves a unified approach of fast focusing over a long stroke and high-precision real-time focusing over a short stroke. This solves the coordination difficulties in existing technologies, reduces system complexity, and improves the applicability of the autofocus system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEFEI ANXIN PRECISION TECH CO LTD
- Filing Date
- 2026-05-26
- Publication Date
- 2026-07-21
AI Technical Summary
Existing autofocus systems face challenges in balancing long stroke and high-precision positioning, especially when the workpiece being inspected is in motion, making it difficult to maintain a stable focal plane. Furthermore, the controller requires multiple axis channels, increasing system complexity.
It adopts a macro-micro linkage autofocus control method, and coordinates the coarse adjustment actuator and the fine adjustment actuator through a three-stage segmented speed control strategy and linkage switching mechanism to achieve fast focusing with a large stroke and high-precision real-time focusing with a small stroke. It uses a single controller to manage the two types of actuators and supports multiple working modes.
It achieves the unification of fast focusing over a wide range and high-precision real-time focusing with a short stroke, reduces the complexity of system integration, meets the requirement of continuous focal plane stability of the inspected workpiece in motion, and improves the versatility and engineering applicability of the system.
Smart Images

Figure CN122269134B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of autofocus control technology, and in particular to a macro-micro linkage autofocus control method, controller and system. Background Technology
[0002] Autofocus technology is one of the core functions of optical imaging inspection systems, widely used in high-precision inspection fields such as semiconductor wafer defect detection and medical pathology slide inspection. In these applications, the system needs to achieve rapid and accurate focusing and positioning over a large focal plane range, and maintain focal plane stability while the inspected workpiece is in motion. With the continuous improvement of inspection resolution requirements, higher demands are placed on the motion travel and positioning accuracy of the autofocus system.
[0003] In existing autofocus systems, a common approach is to use stepper motors or servo motors as focusing actuators. These motors drive the lens assembly along the optical axis via pulse direction control to adjust the focal plane. This approach offers the advantage of a large travel distance (up to tens of millimeters), meeting the needs of a wide range of focal plane variations. However, stepper motors or servo motors, limited by the inherent characteristics of mechanical transmission systems, have limitations in positioning accuracy and dynamic response speed under high-magnification objectives, making it difficult to meet the real-time compensation requirements for minute focal plane deviations in high-magnification scenarios.
[0004] Another approach is to use piezoelectric ceramic actuators as the focusing mechanism, leveraging the piezoelectric effect to achieve high-resolution micro-displacement control. Piezoelectric ceramic actuators are characterized by fast response speed and high positioning resolution, enabling rapid compensation for minute focal plane fluctuations. However, the physical stroke of piezoelectric ceramic actuators is typically on the order of hundreds of micrometers. In applications where the surface of the workpiece being inspected has significant undulations or requires traversing a large focal plane range, relying solely on piezoelectric ceramic actuators cannot complete the full-range focusing task, and also places high demands on the flatness of the workpiece being inspected.
[0005] To balance the demands of long stroke and high precision, existing technologies have introduced solutions that combine long-stroke motion mechanisms with piezoelectric ceramic actuators in a mechanical structure. For example, Chinese patent CN 103801824 B discloses an automatic focusing high-precision long-stroke precision positioning stage. However, at the control level, the above-mentioned combination scheme still controls the two types of actuators as independent motion axes, lacking coordinated linkage control logic between the two axes. It cannot automatically coordinate the working states of the two types of actuators according to real-time changes in focal plane deviation, making it difficult to achieve continuous and stable real-time focusing when the workpiece being detected is in motion.
[0006] Furthermore, existing autofocus controller products, when supporting the above-mentioned combined solution, typically require allocating separate controller axis number channels for the long-stroke motion mechanism and the piezoelectric ceramic actuator, occupying two axis number channel resources and increasing the complexity of system integration. Simultaneously, because the two control channels are independent, the controller lacks a unified linkage control algorithm, making it impossible to achieve real-time coordinated switching between the two types of actuators, and failing to meet the actual requirement of continuously maintaining the focal surface of the workpiece under movement.
[0007] Therefore, a new technical solution is needed to achieve coordinated control of large-stroke actuators and small-stroke high-precision actuators within a single controller framework, solving the problem of the difficulty in simultaneously achieving large-stroke motion and high-precision real-time focusing. Summary of the Invention
[0008] The purpose of this invention is to provide a macro-micro linkage autofocus control method, controller and system to solve the problems in the prior art where the coarse adjustment actuator and the fine adjustment actuator lack an effective linkage switching control mechanism, the fine adjustment actuator's limited stroke restricts continuous focusing capability, and the existing controller needs to occupy two independent axis number channels to control the two types of actuators respectively.
[0009] To achieve the above objectives, the present invention adopts the following technical solution: A macro-micro linkage autofocus control method is applied to a focusing system including a coarse adjustment actuator and a fine adjustment actuator, wherein the travel distance of the coarse adjustment actuator is greater than that of the fine adjustment actuator. The method includes: before focusing is initiated, controlling the fine adjustment actuator to move to the middle position of its travel distance; obtaining the defocus error e between the current focal plane and the target focal plane; and controlling the coarse adjustment actuator to perform focusing at a three-stage segmented speed based on a comparison between the defocus error e and a preset first threshold and a second threshold: in the first stage, when the defocus error e is greater than the first threshold, driving the coarse adjustment actuator to quickly approach the target focal plane at a preset maximum speed; in the second stage, when the defocus error e is between the first threshold and the second threshold, driving the coarse adjustment actuator at a speed positively correlated with the defocus error e. The mechanism decelerates to approach the target focal plane. In the third stage, when the defocus error e is not greater than the second threshold, the coarse adjustment actuator is driven to precisely follow the focus at the speed calculated by the closed-loop control algorithm. The acquisition of the defocus error e and the three-stage segmented speed control are executed cyclically until the coarse adjustment actuator enters the third stage and the defocus error e meets the preset switching condition. The driving amount of the coarse adjustment actuator is locked to zero, and the fine adjustment actuator is switched to the focus control state, whereby the fine adjustment actuator undertakes the subsequent real-time focus. During the focus control state, the current position of the fine adjustment actuator is continuously monitored. When the current position of the fine adjustment actuator exceeds the preset position threshold, the coarse adjustment actuator is controlled to move a preset compensation amount so that the dynamic working range of the fine adjustment actuator is re-centered.
[0010] A macro-micro linkage autofocus controller includes: a defocus amount receiving module for receiving feedback signals from a defocus amount sensor and calculating a defocus amount error e; and a focus linkage control algorithm module connected to the defocus amount receiving module for generating instructions to control a fine-tuning actuator to move to the middle position of its stroke before focusing starts, generating control quantities to control a coarse-tuning actuator to focus at three-stage segmented speeds based on a comparison between the defocus amount error e and a preset first threshold and a second threshold, and driving the coarse-tuning actuator when it enters the third stage and the defocus amount error e meets a preset switching condition. The quantity is locked to zero and the fine-tuning actuator is switched into focus control state. During the focus-following process of the fine-tuning actuator, when the current position of the fine-tuning actuator exceeds a preset position threshold, an instruction is generated to control the movement of the coarse-tuning actuator by a preset compensation amount so that the dynamic working range of the fine-tuning actuator is re-centered. A first drive output module, which is signal-connected to the focus linkage control algorithm module, is used to output control signals to the driver of the coarse-tuning actuator. A second drive output module, which is signal-connected to the focus linkage control algorithm module, is used to output control signals to the driver of the fine-tuning actuator.
[0011] A macro-micro linkage autofocus system includes: a defocus sensor for detecting focal plane deviation and outputting a feedback signal; a coarse adjustment actuator for realizing a large-stroke focusing motion; a fine adjustment actuator for realizing a short-stroke following focus motion, wherein the stroke of the fine adjustment actuator is less than that of the coarse adjustment actuator; and the aforementioned macro-micro linkage autofocus controller, which is connected to the defocus sensor, the driver of the coarse adjustment actuator, and the driver of the fine adjustment actuator, respectively.
[0012] A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of a macro-micro linkage autofocus control method.
[0013] A computer program product comprising computer-executable instructions that, when executed on a processor, cause the processor to perform the steps of a macro-micro linkage autofocus control method.
[0014] The beneficial effects of this invention are: (1) Through a three-stage segmented speed control strategy, the coarse adjustment actuator approaches the focus quickly at the maximum speed when the defocusing amount is large, decelerates smoothly at a speed positively correlated with the error in the middle stage, and accurately follows the focus with a closed-loop control algorithm in the precision focusing stage. This effectively balances focusing speed and stability, and avoids overshoot and oscillation problems under the traditional single-speed control method. (2) Through the macro-micro linkage switching mechanism, the fine adjustment actuator is pre-positioned in the middle of the stroke before focusing starts. After the coarse adjustment actuator completes coarse focusing, it automatically locks and switches to the fine adjustment actuator to take over the focus. The large stroke coarse adjustment and high response fine adjustment are connected in an orderly manner in time, realizing the unification of wide-range fast focusing and small stroke high-precision real-time focusing, meeting the requirement of the workpiece being tested to maintain the focal surface continuously in motion. (3) A single macro-micro linkage controller manages two motion axes of coarse adjustment actuator and fine adjustment actuator at the same time. Compared with the traditional solution where the two types of actuators occupy independent controller axis number channels, the complexity of system integration is reduced and controller hardware resources are saved. At the same time, it supports three working modes: coarse adjustment separate focus, fine adjustment separate focus and linkage focus, which can adapt to different application scenarios and improve the versatility and engineering applicability of the system. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the three-stage segmented relationship between the defocusing error e and the control speed v of the coarse adjustment actuator.
[0017] Figure 2 A flowchart illustrating the separate focus control method for coarse adjustment actuators.
[0018] Figure 3 A flowchart illustrating the individual focus control method for fine-tuning the actuator.
[0019] Figure 4 This is a flowchart illustrating the macro-micro linkage autofocus control method.
[0020] Figure 5 This is a schematic diagram of a macro-micro linkage autofocus system. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] Example 1: Basic process of macro-platform three-stage individual focusing like Figure 1 and Figure 2 As shown, this embodiment discloses a complete control process for three-stage segmented speed focusing performed independently by a coarse adjustment actuator (hereinafter referred to as the macro stage). This process is suitable for application scenarios that do not require the intervention of a fine adjustment actuator and only require large-stroke coarse adjustment focusing, such as wide-range focal plane search under low-magnification objectives.
[0023] like Figure 1 As shown, the defocus error *e* and the control speed *v* of the coarse adjustment actuator exhibit a three-segment relationship. The horizontal axis represents the defocus error *e*, and the vertical axis represents the control speed *v*. The figure defines a first threshold *fth1* and a second threshold *fth2* (*fth2* < *fth1*), as well as corresponding speed thresholds *Vth1* and *Vth2* (*Vth2* < *Vth1*). When *e* is greater than *fth1*, the speed *v* remains at its maximum speed *Vth1*, corresponding to the farfocus stage. When *e* is between *fth1* and *fth2*, the speed *v* decreases linearly with the decrease in error *e*, smoothly decreasing from *Vth1* to *Vth2*, corresponding to the linear deceleration focus stage. When *e* is not greater than *fth2*, the speed *v* is positively correlated with the error *e* and passes through the origin, corresponding to the precision tracking stage.
[0024] like Figure 2 As shown, the macro-platform three-stage individual focus control method includes the following steps: Step S101: Focusing Start. The system receives the focusing start command and enters the focusing control loop.
[0025] Step S102: Obtain the defocus error e. The controller reads the defocus amount of the current focal plane relative to the target focal plane from the feedback signal of the defocus sensor, and calculates the defocus error e, where the unit of e is μm.
[0026] Step S103: Determine the current control stage. The controller compares the defocus error e with the preset first threshold fth1 and the second threshold fth2 to determine which of the three control stages to enter.
[0027] Step S104 (First stage, farfocus): When the defocus error e is greater than the first threshold fth1, the coarse adjustment actuator is driven to quickly approach the target focal plane at a preset maximum speed Vth1, and the control quantity is: v(t)=Vth1 ……(1) Where Vth1 is the rated maximum speed of the coarse adjustment actuator, in μm / ms. The controller sends a pulse signal of the corresponding frequency to the driver of the coarse adjustment actuator through the pulse direction output module, driving the coarse adjustment actuator to move towards the target focal plane at its maximum speed.
[0028] Step S105 (Second Stage, Focus): When the defocus error e is between the first threshold fth1 and the second threshold fth2, the coarse adjustment actuator is driven to smoothly decelerate and approach the target focal plane at a linear speed positively correlated with the defocus error e. The control quantity is calculated according to the following formula: v(t)=ke+b ……(2) The formulas for calculating the slope k and the intercept b are as follows: k=(Vth1-Vth2) / (fth1-fth2) ……(3) b = Vth1 - k × fth1 ……(4) In the formula, Vth1 is the preset maximum speed, Vth2 is the speed threshold when entering the third stage, fth1 is the first threshold, and fth2 is the second threshold. Vth2 is calculated using the following formula: Vth2=Kp×fth2 ……(5) Where Kp is the proportional coefficient of the third-stage closed-loop control algorithm. Using the above linear formula, the drive speed of the coarse-adjustment actuator decreases smoothly as the defocusing error decreases, avoiding mechanical oscillations and overshoot caused by sudden speed changes.
[0029] Step S106 (Third Stage, Tracking): When the defocusing error e is not greater than the second threshold fth2, the coarse adjustment actuator is driven to precisely focus using the speed calculated by the closed-loop proportional-integral-derivative (PID) control algorithm. The control quantity is: v(t)=PID(e)=Kp×e+Ki×∫e+Kd×de……(6) Where Kp, Ki, and Kd are the proportional coefficient, integral coefficient, and derivative coefficient, respectively. The total displacement of the coarse adjustment actuator is accumulated according to the following formula: s(t)=s(t-1)+v×dt……(7) Where dt is the control period, measured in milliseconds (ms). Through closed-loop PID control, the defocusing error can be controlled within the depth of field, achieving precise focusing.
[0030] Step S107: Repeat steps S102 to S106 until a stop focusing command is received. Upon receiving the stop focusing command, set v = 0, lock the coarse adjustment actuator at the current position s(t), and focus ends.
[0031] Regarding the setting of key parameters: The second threshold fth2 is set to N times the depth of field of the objective lens corresponding to the focusing system (N is a preset multiple greater than 1, typically N=3), to ensure that the coarse adjustment actuator is sufficiently close to the target focal plane when entering the third stage; the first threshold fth1 is calculated according to the following kinematic formula to ensure that the coarse adjustment actuator moves a distance exactly equal to the difference between fth1 and fth2 during the deceleration process from the maximum speed Vth1 in the first stage to the final speed Vth2 in the second stage, thereby achieving a smooth transition: ……(8)
[0032] Where 'a' is the preset acceleration of the coarse adjustment actuator, in μm / ms².
[0033] Example 2: Fine-tuning the individual focusing process of the actuator like Figure 3 As shown in the figure, this embodiment discloses a complete control process for focusing and tracking performed independently by a fine-tuning actuator (hereinafter referred to as the micro-stage). This process is suitable for application scenarios that do not require the intervention of a coarse-tuning actuator and only require high-precision focusing with a short stroke, such as scenarios where the flatness of the workpiece being inspected is high and the focal plane deviation is always within the stroke range of the fine-tuning actuator. The fine-tuning actuator typically uses a piezoelectric ceramic actuator, whose displacement is positively correlated with the control voltage, and whose stroke is no more than 200μm, featuring fast response speed and high positioning resolution.
[0034] like Figure 3 As shown, the individual focus control method for the fine-tuning actuator includes the following steps: Step S201: Focusing Start. The system receives the focusing start command and enters the focusing control cycle of the fine-tuning actuator.
[0035] Step S202: Obtain the defocus error e. The controller reads the defocus error e, in μm, from the feedback signal of the defocus sensor relative to the target focal plane.
[0036] Step S203: Determine the current control mode. The controller compares the defocusing error e with the preset second threshold fth2 to determine whether to use standard incremental PID control or variable gain incremental PID control.
[0037] Step S204 (Focusing stage, large error): When the defocusing error e is greater than the second threshold fth2, a variable gain incremental control algorithm is used to generate control quantities to ensure the control stability of the fine-tuning actuator when the error is large. U(t)=U(t-1)+PID'(e)=U(t-1)+αKp×e+βKi×∫e+σKd×de……(9) Where U(t) is the control voltage output to the piezoelectric amplifier at the current moment, in V; U(t-1) is the control voltage at the previous moment; α, β, and σ are all variable gain coefficients less than 1, used to reduce PID parameters when the error is large, preventing unstable vibration of the fine-tuning actuator caused by control overshoot. The typical range of variable gain coefficients is 0.1 to 0.5, and the specific value is tuned according to the dynamic characteristics of the fine-tuning actuator.
[0038] Step S205 (Focusing stage, small error): When the defocusing error e is not greater than the second threshold fth2, the standard incremental PID control algorithm is used to generate the control quantity: U(t)=U(t-1)+PID(e)=U(t-1)+Kp×e+Ki×∫e+Kd×de……(10) Where Kp, Ki, and Kd are the proportional coefficient, integral coefficient, and derivative coefficient, respectively. The incremental control algorithm calculates the increment of the control quantity rather than its absolute value each time, offering advantages such as smooth control and resistance to integral saturation, making it suitable for high-precision position control of piezoelectric ceramic actuators. The controller converts U(t) into a corresponding analog voltage signal through an analog output module. After amplification by a piezoelectric amplifier, this signal drives the piezoelectric ceramic actuator to produce a displacement positively correlated with the control voltage, achieving precise compensation of the focal plane.
[0039] Step S206: Repeat steps S202 to S205 until a stop focusing command is received. Upon receiving the stop focusing command, the fine-tuning actuator locks at the position corresponding to the current control quantity U(t), and focusing ends.
[0040] It is worth noting that when focusing using a fine-tuning actuator alone, its physical travel is typically within the range of 100μm to 200μm, making it unsuitable for scenarios with large focal plane variations. When the surface of the workpiece being inspected has significant undulations, the macro-micro linkage focusing method described in Example 3 should be used.
[0041] like Figure 4 As shown in the figure, this embodiment discloses the complete process of the macro-micro linkage autofocus control method. This process seamlessly connects the large-stroke rapid focusing of the coarse adjustment actuator with the high-response precision focusing of the fine adjustment actuator. Furthermore, it overcomes the physical stroke limitations of the fine adjustment actuator through an overtravel compensation mechanism, achieving theoretically unlimited continuous high-precision focusing. This method is suitable for high-end applications where the workpiece being inspected is in motion and requires continuous focal plane stability.
[0042] like Figure 4 As shown, the macro-micro linkage autofocus control method includes the following steps: Step S301: Before focusing begins, control the fine-tuning actuator to move to the middle position of its stroke. The controller sends a centering command to the fine-tuning actuator, setting the control quantity of the fine-tuning actuator to: U(0)=(Umax+Umin) / 2……(11) Umax and Umin represent the upper and lower limits of the control quantity of the fine-tuning actuator, respectively. Presetting the fine-tuning actuator to the middle position of its stroke allows it to have maximum margin of movement in both directions during subsequent focusing, thereby maximizing the effective dynamic range of the fine-tuning actuator.
[0043] Step S302: The coarse adjustment actuator performs three-stage segmented speed focusing. The controller obtains the defocus error e, and based on the comparison result of e with the preset first threshold fth1 and second threshold fth2, controls the coarse adjustment actuator to sequentially go through three stages: farfocus, focus, and tracking. For the specific control algorithm, please refer to formulas (1) to (8) in Example 1. During this process, the fine adjustment actuator remains in the middle position, and the coarse adjustment actuator is responsible for rapidly approaching the target focal plane over a large range.
[0044] Step S303: Determine if the linkage switching condition is met. The controller continuously monitors the current control stage of the coarse adjustment actuator and the defocus error e. When the coarse adjustment actuator enters the third stage (tracking) and the defocus error e meets the preset switching condition, step S304 is executed; otherwise, return to step S302 to continue the three-stage focusing. The preset switching condition is: the coarse adjustment actuator is in the third stage and the defocus error e enters the depth of field range of the objective lens magnification corresponding to the focusing system, that is, e is less than the depth of field value DOF, to ensure that the coarse adjustment actuator has pulled the focal plane into the effective working range of the fine adjustment actuator before switching.
[0045] Step S304: Perform macro-micro linkage switching. The controller locks the driving quantity of the coarse adjustment actuator to zero (v=0), and the coarse adjustment actuator remains stationary at its current position s(t); at the same time, it switches the fine adjustment actuator into the focus control state (tracking2), and the fine adjustment actuator independently undertakes the subsequent real-time focus tracking task. The fine adjustment actuator adopts an incremental PID control algorithm, calculates the control quantity U(t) in real time according to formula (10), and drives the fine adjustment actuator to perform real-time compensation for the focus surface fluctuation through the analog output module and piezoelectric amplifier.
[0046] Step S305: During the focus-following control state of the fine-tuning actuator, the controller continuously monitors the current control quantity U(t) of the fine-tuning actuator to determine whether it exceeds a preset position threshold. The preset position threshold is set according to the travel boundary of the fine-tuning actuator. When U(t) exceeds the upper boundary threshold or falls below the lower boundary threshold, it is determined that the current position of the fine-tuning actuator exceeds the preset position threshold, and step S306 is executed; otherwise, the process returns to step S304 to continue focus-following by the fine-tuning actuator.
[0047] Step S306: Perform overtravel compensation. The controller controls the coarse adjustment actuator to move by a preset compensation amount dx, which is equal to half of the full stroke of the fine adjustment actuator, i.e.: The physical displacement corresponding to dx = (Umax - Umin) / 2...(12) During the coarse adjustment mechanism's compensation movement, the fine adjustment mechanism remains in a closed-loop focusing state, its high response speed compensating for focal plane fluctuations during the coarse adjustment mechanism's movement. After the coarse adjustment mechanism completes its compensation movement, the fine adjustment mechanism's dynamic working range is re-centered, restoring its maximum bidirectional motion margin. Then, the system returns to step S305 to continue monitoring the fine adjustment mechanism's stroke status. By repeatedly executing steps S305 and S306, the system can maintain the focal plane even when there are significant fluctuations on the surface of the workpiece being inspected, theoretically supporting continuous high-precision focusing with unlimited stroke.
[0048] Step S307: After receiving the stop focusing command, the coarse adjustment actuator and the fine adjustment actuator maintain their current positions s(t) and control quantity U(t) respectively, and the system focuses.
[0049] Example 4: Hardware Architecture of Macro-Micro Linkage Controller like Figure 5 As shown in the figure, this embodiment discloses the hardware architecture of a macro-micro linkage autofocus controller (hereinafter referred to as the controller). The controller is a single hardware platform that manages two motion axes, the coarse adjustment actuator and the fine adjustment actuator, through modular design, and supports three working modes: coarse adjustment separate focus mode, fine adjustment separate focus mode, and linkage focus mode.
[0050] like Figure 5 As shown, the macro-micro linkage autofocus controller includes a defocus amount receiving module, a focus linkage control algorithm module, a first drive output module, a second drive output module, and a communication interface module.
[0051] The defocus amount receiving module is connected to the signal output terminal of the defocus amount sensor. It receives the feedback signal output by the defocus amount sensor, converts the feedback signal into a defocus amount error e, and outputs it to the focus linkage control algorithm module. The defocus amount receiving module supports multiple sensor interface types, including analog and digital signals, and is compatible with defocus amount sensors based on different principles.
[0052] The focus linkage control algorithm module is signal-connected to the defocus amount receiving module and is the decision-making core of the controller. It incorporates all the control algorithms described in Embodiments 1 to 3, and performs the following functions: Before focusing begins, it generates an instruction to control the fine-tuning actuator to move to the middle position of its stroke; based on the comparison between the defocus amount error e and a preset first threshold and second threshold, it generates a control quantity to control the coarse-tuning actuator to focus at a three-stage segmented speed; when the coarse-tuning actuator enters the third stage and the defocus amount error e meets the preset switching condition, it locks the coarse-tuning actuator's drive quantity to zero and switches the fine-tuning actuator to the follow-focus control state; and during the follow-focusing period of the fine-tuning actuator, when the current position of the fine-tuning actuator exceeds a preset position threshold, it generates an instruction to control the coarse-tuning actuator to move by a preset compensation amount, so that the dynamic working range of the fine-tuning actuator is re-centered. The focus linkage control algorithm module includes a macro-stage control submodule, a micro-stage control submodule, and a linkage switching submodule. The macro stage control submodule is used to execute the three-stage segmented speed control logic; the micro stage control submodule is used to execute the incremental focus control logic of the fine-tuning actuator; the linkage switching submodule is used to execute the switching control logic between the coarse-tuning actuator and the fine-tuning actuator, as well as the overtravel compensation logic. It contains a travel monitoring unit and a compensation triggering unit. The travel monitoring unit continuously monitors the current control quantity of the fine-tuning actuator and compares it with a preset position threshold. When the compensation triggering unit detects that the preset position threshold is exceeded, it generates a trigger command to control the coarse-tuning actuator to move by a preset compensation amount.
[0053] The first drive output module is connected to the focus linkage control algorithm module and is a pulse direction output module. It is used to convert the control quantity of the coarse adjustment actuator generated by the focus linkage control algorithm module into pulse signals and direction signals, and output them to the stepper driver or servo driver of the coarse adjustment actuator. The frequency of the pulse signal corresponds to the movement speed of the coarse adjustment actuator, and the direction signal controls the movement direction of the coarse adjustment actuator.
[0054] The second drive output module is signal-connected to the focus linkage control algorithm module. As an analog output module, it converts the control signals generated by the focus linkage control algorithm module into analog voltage signals, which are then output to the piezoelectric amplifier of the focus linkage actuator. The communication interface module is signal-connected to the focus linkage control algorithm module and receives operating mode commands and parameter configuration commands from the host computer, and feeds back the current status information of the controller to the host computer. The operating modes include coarse-adjustment single focus mode, fine-adjustment single focus mode, and linked focus mode. The controller switches between these three operating modes according to the host computer commands to adapt to the needs of different application scenarios.
[0055] The controller also includes a power interface module for receiving DC power and providing a stable power supply for the various functional modules inside the controller.
[0056] like Figure 5 As shown, this embodiment discloses the complete composition of the macro-micro linkage autofocus system and the connection relationship and signal interaction process between the components.
[0057] like Figure 5 As shown, the macro-micro linkage autofocus system includes a macro-micro linkage autofocus controller, a servo / stepper driver, a piezoelectric amplifier, a coarse adjustment actuator (macro stage motor), a fine adjustment actuator (micro stage motor), a defocus sensor, a camera, a lens barrel, an objective lens, a workpiece under test, a moving stage, and a host computer.
[0058] The defocus sensor is installed near the lens barrel or objective lens to detect the focal plane deviation between the objective lens and the surface of the workpiece in real time. The detection result is output as an electrical signal to the defocus receiving module of the macro-micro linkage autofocus controller. The defocus sensor can be implemented using various principles such as laser triangulation, confocal detection, and aberration detection. The output signal type is either an analog voltage signal or a digital signal.
[0059] The coarse adjustment actuator includes a stepper motor or a servo motor, and a corresponding stepper driver or servo driver. The stepper driver or servo driver is electrically connected to the first drive output module (pulse direction output module) of the macro-micro linkage autofocus controller. After receiving pulse signals and direction signals, it drives the stepper motor or servo motor to move along the optical axis, achieving a large-stroke focusing displacement of the lens barrel or objective lens. The movement stroke of the coarse adjustment actuator is not less than 10mm, which can meet the needs of a wide range of focal plane changes.
[0060] The fine-tuning actuator includes a piezoelectric ceramic actuator and a piezoelectric amplifier, which drives the piezoelectric ceramic actuator to generate a displacement that is positively correlated with the control voltage, thereby achieving a small-stroke, high-precision focusing displacement of the objective lens.
[0061] The structure and function of the macro-micro linkage autofocus controller are described in detail in Embodiment 4, and will not be repeated here. The controller connects to the host computer through a communication interface module, receives the working mode instructions (coarse adjustment individual focus mode, fine adjustment individual focus mode, or linkage focus mode) and focus parameter configurations (first threshold fth1, second threshold fth2, PID parameters, etc.) issued by the host computer, and provides real-time feedback to the host computer on the current focus status and actuator position information.
[0062] The camera, lens barrel, and objective lens constitute the core optical imaging components used for imaging and inspecting the workpiece. A macro stage motor typically drives the entire lens barrel assembly (including the camera, lens barrel, and objective lens) to move a wide range of motion along the optical axis, while a micro stage motor typically drives only the objective lens to perform small-range precision movements. The combination of both maximizes system performance. The workpiece is placed on a moving stage, which in the automated inspection system is responsible for driving the workpiece to move within the inspection plane.
[0063] The complete workflow of the system is as follows: The host computer sends the linkage focusing mode command and focusing parameters to the controller; the controller executes the complete process of macro-micro linkage switching and overtravel compensation described in Embodiment 3. First, it controls the fine adjustment actuator to center, and then drives the coarse adjustment actuator to complete the three-stage focusing. After the coarse adjustment actuator enters the depth of field range, it locks and switches the fine adjustment actuator to take over the focusing; during the movement of the workpiece under test with the moving platform, the fine adjustment actuator continuously compensates for the focal plane fluctuation in real time; when the stroke of the fine adjustment actuator is saturated, the coarse adjustment actuator actively moves half the stroke compensation amount to make the dynamic range of the fine adjustment actuator re-center, thereby continuously maintaining the focal plane stability throughout the entire movement of the workpiece under test.
[0064] Table 1 lists the performance comparison between the macro-micro linkage focusing scheme of this application and the existing single macro stage focusing scheme with 10mm stroke, 0.1µm resolution, and the single micro stage focusing scheme with 100µm stroke, 24nm resolution (12-bit ADC) (test conditions: 50x objective lens, depth of field approximately 0.91µm, surface undulation range of the tested workpiece 0–3mm, workpiece moving speed 100mm / s): Table 1 Performance Comparison of Various Solutions This application's macro-micro linkage scheme ≥10mm ≤0.4μm Full stroke ≥10mm 24nm Standalone Macro Platform Solution ≥10mm ≤0.9μm Full stroke ≥10mm 0.1um Standalone Micro-platform Solution ≤200μm ≤0.4μm Out of focus beyond the travel range 24nm As shown in Table 1, the macro-micro linkage scheme of this application is comparable to the single macro stage scheme in terms of focusing travel (both are not less than 10mm), and is comparable to the single micro stage scheme in terms of focusing response and focusing retention. Moreover, it achieves continuous high-precision focusing with theoretically unlimited travel through the overtravel compensation mechanism, overcoming the inherent defects of slow focusing response of the single macro stage scheme and limited travel of the single micro stage scheme.
[0065] In summary, the beneficial effects of the technical solution of this invention are: (1) Through a three-stage segmented speed control strategy, the coarse adjustment actuator approaches the focus quickly at the maximum speed when the defocusing amount is large, decelerates smoothly at a speed positively correlated with the error in the middle stage, and accurately follows the focus with a closed-loop control algorithm in the precision focusing stage. This effectively balances focusing speed and stability, and avoids overshoot and oscillation problems under the traditional single-speed control method. (2) Through the macro-micro linkage switching mechanism, the fine adjustment actuator is pre-positioned in the middle of the stroke before focusing starts. After the coarse adjustment actuator completes coarse focusing, it automatically locks and switches to the fine adjustment actuator to take over the focus. The large stroke coarse adjustment and high response fine adjustment are connected in an orderly manner in time, realizing the unification of wide-range fast focusing and small stroke high-precision real-time focusing, meeting the requirement of the workpiece being tested to maintain the focal surface continuously in motion. (3) Through the overtravel compensation mechanism, the position of the fine adjustment actuator is continuously monitored during the focusing process. When it exceeds the preset position threshold, the coarse adjustment actuator actively moves to compensate for the amount, so that the dynamic working range of the fine adjustment actuator is re-centered. This breaks through the limitation of the physical travel of the fine adjustment actuator and can theoretically support continuous high-precision focusing with unlimited travel. (4) A single macro-micro linkage controller manages two motion axes of the coarse adjustment actuator and the fine adjustment actuator at the same time. Compared with the traditional solution where the two types of actuators occupy independent controller axis number channels, the complexity of system integration is reduced and controller hardware resources are saved. At the same time, it supports three working modes: coarse adjustment separate focus, fine adjustment separate focus and linkage focus, which can adapt to different application scenarios and improve the versatility and engineering applicability of the system.
[0066] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several modifications and improvements can be made without departing from the inventive concept of this application, and these all fall within the protection scope of this application.
Claims
1. A macro-micro linkage autofocus control method, applied to a focusing system comprising a coarse adjustment actuator and a fine adjustment actuator, wherein the stroke of the coarse adjustment actuator is greater than the stroke of the fine adjustment actuator, characterized in that, The method includes: Before focusing is initiated, the fine-tuning actuator is controlled to move to the middle position of its stroke; Obtain the defocusing error e between the current focal plane and the target focal plane; Based on the comparison between the defocus error e and the preset first threshold and second threshold, the coarse adjustment actuator is controlled to perform focusing at a three-stage segmented speed: In the first stage, when the defocus error e is greater than the first threshold, the coarse adjustment actuator is driven to quickly approach the target focal plane at a preset maximum speed; in the second stage, when the defocus error e is between the first threshold and the second threshold, the coarse adjustment actuator is driven to decelerate and approach the target focal plane at a speed positively correlated with the defocus error e; in the third stage, when the defocus error e is not greater than the second threshold, the coarse adjustment actuator is driven to precisely follow the focus at a speed calculated by the closed-loop control algorithm. The acquisition of the defocus error e and the three-stage segmented speed control are executed cyclically until the coarse adjustment actuator enters the third stage and the defocus error e meets the preset switching condition. At this point, the driving amount of the coarse adjustment actuator is locked to zero, and the fine adjustment actuator is switched into the focus tracking control state, whereby the fine adjustment actuator takes over the subsequent real-time focus tracking. During the focus tracking control state, the current position of the fine adjustment actuator is continuously monitored. When the current position of the fine adjustment actuator exceeds a preset position threshold, the coarse adjustment actuator is controlled to move a preset compensation amount so that the dynamic working range of the fine adjustment actuator is re-centered.
2. The macro-micro linkage autofocus control method according to claim 1, characterized in that, The first threshold fth1 is calculated according to the following kinematic formula: , Where a is the preset acceleration of the coarse adjustment actuator, Vth1 is the maximum speed of the first stage, and Vth2 is the final speed of the second stage.
3. The macro-micro linkage autofocus control method according to claim 1, characterized in that, When the fine-tuning actuator is in the focus control state, it uses an incremental control algorithm to generate the control quantity: U(t) = U(t-1) + PID(e), where U(t) is the control quantity at the current moment, U(t-1) is the control quantity at the previous moment, and PID(e) = Kp×e + Ki×∫e + Kd×de, where Kp, Ki, and Kd are the proportional coefficient, integral coefficient, and derivative coefficient, respectively.
4. The macro-micro linkage autofocus control method according to claim 1, characterized in that, The preset switching condition is: the coarse adjustment actuator is in the third stage and the defocusing error e enters the depth of field range of the objective lens magnification corresponding to the focusing system.
5. The macro-micro linkage autofocus control method according to claim 1, characterized in that, The preset compensation amount is one-half of the full stroke of the fine-tuning actuator.
6. The macro-micro linkage autofocus control method according to any one of claims 1-5, characterized in that, The second threshold is set to N times the depth of field of the objective lens corresponding to the focusing system, where N is a preset multiple greater than 1.
7. The macro-micro linkage autofocus control method according to claim 6, characterized in that, The coarse adjustment actuator has a stroke of not less than 10 mm, and the fine adjustment actuator has a stroke of not more than 200 μm.
8. A macro-micro linkage autofocus controller, characterized in that, include The defocus measurement receiving module is used to receive the feedback signal from the defocus measurement sensor and calculate the defocus measurement error e; The focus linkage control algorithm module, connected to the defocus amount receiving module, is used to: generate an instruction to control the fine-tuning actuator to move to the middle position of its stroke before focusing starts; generate a control quantity to control the coarse-tuning actuator to focus at a three-stage segmented speed based on the comparison result of the defocus amount error e with the preset first threshold and second threshold; when the coarse-tuning actuator enters the third stage and the defocus amount error e meets the preset switching condition, lock the driving quantity of the coarse-tuning actuator to zero and switch the fine-tuning actuator to enter the focus-following control state; And during the focusing process of the fine-tuning actuator, when the current position of the fine-tuning actuator exceeds a preset position threshold, an instruction is generated to control the movement of the coarse-tuning actuator by a preset compensation amount, so that the dynamic working range of the fine-tuning actuator is re-centered; The first drive output module is signal-connected to the focus linkage control algorithm module and is used to output control signals to the driver of the coarse adjustment actuator. The second drive output module is connected to the focus linkage control algorithm module and is used to output control signals to the driver of the fine-tuning actuator.
9. The macro-micro linkage autofocus controller according to claim 8, characterized in that, The first drive output module is a pulse direction output module, used to output pulse signals and direction signals to the stepper driver or servo driver of the coarse adjustment actuator; the second drive output module is an analog output module, used to output analog voltage signals to the piezoelectric amplifier of the fine adjustment actuator.
10. The macro-micro linkage autofocus controller according to claim 8, characterized in that, The focusing linkage control algorithm module includes: a macro stage control submodule, used to execute the three-stage segmented speed control logic; a micro stage control submodule, used to execute the incremental focus control logic of the fine-tuning actuator; and a linkage switching submodule, used to execute the switching control logic and overtravel compensation logic between the coarse-tuning actuator and the fine-tuning actuator.
11. The macro-micro linkage autofocus controller according to claim 10, characterized in that, The linkage switching submodule includes: a stroke monitoring unit, used to continuously monitor the current control quantity of the fine-tuning actuator and compare it with the preset position threshold; and a compensation triggering unit, used to generate a trigger command to control the coarse-tuning actuator to move the preset compensation amount when the stroke monitoring unit detects that the current position of the fine-tuning actuator exceeds the preset position threshold.
12. The macro-micro linkage autofocus controller according to any one of claims 8-11, characterized in that, It also includes a communication interface module, which is connected to the focus linkage control algorithm module for receiving working mode instructions sent by the host computer. The working modes include coarse adjustment individual focus mode, fine adjustment individual focus mode and linkage focus mode.
13. A macro-micro linkage autofocus system, characterized in that, include A defocus sensor is used to detect focal plane deviation and output a feedback signal; The coarse adjustment actuator is used to achieve long-stroke focusing motion; A fine-tuning actuator is used to achieve short-stroke focusing motion, wherein the stroke of the fine-tuning actuator is less than the stroke of the coarse-tuning actuator. A defocus amount receiving module is used to receive the feedback signal from the defocus amount sensor and calculate the defocus amount error e; a focus linkage control algorithm module is signal-connected to the defocus amount receiving module, used to generate an instruction to control the fine adjustment actuator to move to the middle position of its stroke before focusing starts, generate a control quantity to control the coarse adjustment actuator to focus at a three-stage segmented speed based on the comparison result of the defocus amount error e with the preset first threshold and second threshold, lock the coarse adjustment actuator drive quantity to zero and switch the fine adjustment actuator to enter the focus tracking control state, and generate an instruction to control the coarse adjustment actuator to move a preset compensation amount to make the dynamic working range of the fine adjustment actuator re-centered when the current position of the fine adjustment actuator exceeds the preset position threshold during the focus tracking of the fine adjustment actuator. The first drive output module is connected to the driver signal of the focus linkage control algorithm module and the coarse adjustment actuator, respectively, and is used to output control signals to the driver of the coarse adjustment actuator. The second drive output module is connected to the driver signal of the focus linkage control algorithm module and the fine-tuning actuator, respectively, and is used to output control signals to the driver of the fine-tuning actuator.
14. The macro-micro linkage autofocus system according to claim 13, characterized in that, The fine-tuning actuator includes a piezoelectric ceramic actuator and a piezoelectric amplifier. The piezoelectric amplifier is electrically connected to the second drive output module and is used to drive the piezoelectric ceramic actuator to generate a displacement positively correlated with the analog voltage signal output by the second drive output module.
15. The macro-micro linkage autofocus system according to claim 13, characterized in that, The system supports three working modes: coarse adjustment individual focus mode, in which only the coarse adjustment actuator is used for focusing; fine adjustment individual focus mode, in which only the fine adjustment actuator is used for focusing; and linked focus mode, in which the coarse adjustment actuator and the fine adjustment actuator are controlled in a coordinated manner to perform focusing according to a three-stage segmented speed control, linked switching and overtravel compensation. The system switches between the three working modes according to the instructions of the host computer.
16. The macro-micro linkage autofocus system according to any one of claims 13-15, characterized in that, The coarse adjustment actuator includes a stepper motor or a servo motor, and a stepper driver or servo driver corresponding to the stepper motor or the servo motor.
17. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the macro-micro linkage autofocus control method as described in any one of claims 1-7.
18. A computer program product comprising computer-executable instructions that, when executed on a processor, cause the processor to perform the steps of the macro-micro linkage autofocus control method as described in any one of claims 1-7.