A laser galvanometer automatic correction method and system based on computer vision and coaxial reference light
By employing a computer vision-based automatic laser galvanometer calibration scheme using coaxial reference light, the system automatically corrects galvanometer deviations by using a red light indicator and a camera to capture the position of the light spot. This solves the coordinate transformation error problem caused by galvanometer deviations and improves the accuracy and efficiency of the laser system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AZURE ENGINE (SHANGHAI) TECHNOLOGY CO LTD
- Filing Date
- 2026-02-27
- Publication Date
- 2026-05-12
AI Technical Summary
The coordinate transformation formula accuracy error caused by galvanometer deviation in existing laser systems cannot meet the high precision requirements, and manual correction methods are inefficient and have poor repeatability.
An automatic calibration scheme for laser galvanometers based on computer vision and coaxial reference light is adopted. A red light indicator is used as a coaxial reference light source. The position of the light spot is collected by a camera, and the coordinate transformation parameters of the galvanometer are calculated and automatically corrected. This includes the coordinated use of calibration plane, combined support, calibration light indicator, camera assembly and control assembly.
It improves the consistency and positioning accuracy of the galvanometer, enhances calibration efficiency, and is suitable for precision applications such as laser marking, laser weeding, laser cutting, and measurement.
Smart Images

Figure CN121742039B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of laser control and computer vision calibration technology, specifically relating to an automatic correction scheme for laser galvanometers. Background Technology
[0002] In laser systems, galvanometers are used to precisely control the deflection of the laser beam, enabling the laser to be positioned and scanned on the target plane. However, existing galvanometer products typically do not have strict limit or mechanical locking systems for their internal X and Y deflection motors when they leave the factory, resulting in certain installation deviations and zero-position drift between different galvanometers.
[0003] This deviation directly affects the accuracy of the galvanometer coordinate transformation formula, resulting in an error between the theoretical pointing and the actual spot landing point. For example, when the target point coordinates are (0, 0), the actual spot landing on the reference plane 80cm away from the galvanometer may deviate from the center, producing a centimeter-level error.
[0004] Correction for this deviation is typically performed manually based on experience. This manual correction method relies on experience-based adjustments, making the process complex, inefficient, and lacking in repeatability.
[0005] With the increasing trend towards higher precision in laser applications, manual inspection and calibration methods are no longer sufficient. Therefore, there is an urgent need in this field for an automated vision calibration scheme that can automatically detect and correct galvanometer deviations to improve consistency and positioning accuracy. Summary of the Invention
[0006] To address the problems caused by manual detection and calibration of galvanometer deviation in existing laser systems, this invention aims to provide an automatic laser galvanometer calibration scheme based on computer vision and a coaxial reference light. This scheme utilizes a red light indicator as a coaxial reference light source, acquires the position of the red light on the calibration plane using a camera, calculates the spot deviation, and automatically corrects the coordinate transformation parameters of the galvanometer, effectively improving the consistency and positioning accuracy of the galvanometer in the laser system.
[0007] To achieve the above objectives, in one aspect, the present invention provides an automatic laser galvanometer calibration system based on computer vision and coaxial reference light, the system comprising:
[0008] A calibration plane is provided in conjunction with a combined support frame to form a calibration environment.
[0009] A combined support bracket is used to support the galvanometer assembly to be calibrated and the camera assembly. The camera assembly is capable of acquiring the light spot generated on the calibration plane by the calibration light indicator, which is coaxially set with the galvanometer assembly to be calibrated.
[0010] A calibration light indicator is used to be coaxially mounted with the galvanometer in the galvanometer assembly to be calibrated, and is capable of generating a calibration light beam facing the calibration plane along the coaxial direction of the galvanometer to form a light spot on the calibration plane.
[0011] A camera assembly, mounted on a combined support, is capable of acquiring images of a calibration plane and the light spots formed thereon;
[0012] A control component is configured to control a camera assembly, a correction light indicator, and a galvanometer assembly to be calibrated. The control component includes a galvanometer calibration module. This module controls the camera assembly to perform distortion parameter correction, obtains the mapping relationship between pixel coordinates and physical calibration plane coordinates, controls the galvanometer in the galvanometer assembly to be calibrated to drive the coaxially mounted correction light indicator to deflect, and controls the correction light indicator to operate on the calibration plane to generate a light spot. After the galvanometer is deflected into position, the control component acquires an image of the calibration plane with the light spot. Based on the acquired image and the mapping relationship between pixel coordinates and physical calibration plane coordinates, the deviation between the actual light spot coordinates and the target position is calculated, and the galvanometer in the galvanometer assembly is calibrated accordingly.
[0013] Furthermore, the calibration plane is composed of a standard reflector or a diffuse reflective target surface.
[0014] Furthermore, the control component includes a control host and a galvanometer control board. The control host runs a galvanometer calibration module and controls the galvanometer control board. The galvanometer control board is connected to the galvanometer assembly to be calibrated.
[0015] Furthermore, the galvanometer correction module includes a calibration submodule, a zero-point reference correction submodule, a scaling parameter correction submodule, and a distortion parameter correction submodule.
[0016] The calibration submodule is configured to control the camera component to calibrate relative to the calibration plane and establish a pixel-to-plane coordinate mapping relationship.
[0017] The zero-point reference correction submodule is configured to control and adjust the Base parameters (i.e., zero-point reference parameters) of the galvanometer assembly to be corrected based on the mapping relationship established by the calibration submodule to complete the zero-point reference correction.
[0018] The scaling parameter correction submodule is configured to control and adjust the scaling parameter of the galvanometer assembly to be corrected after the zero-point reference correction submodule has completed the correction.
[0019] The distortion parameter correction submodule is configured to perform distortion parameter correction based on the already corrected Base parameter and scaling parameter after the scaling parameter correction submodule has completed the correction.
[0020] To achieve the above objectives, in another aspect, the present invention provides an automatic laser galvanometer calibration method based on computer vision and coaxial reference light. The method is based on the automatic laser galvanometer calibration system of the present invention and includes:
[0021] S1: Calibrate the camera component relative to the calibration plane and obtain the mapping relationship between pixel coordinates and physical calibration plane coordinates;
[0022] S2: Controls the galvanometer in the galvanometer assembly to be calibrated to drive the coaxially mounted calibration light indicator to deflect, and controls the light spot generated by the calibration light indicator working on the calibration plane.
[0023] S3: After the galvanometer is deflected into place, the camera module acquires an image of the calibration plane with the light spot, and calculates the deviation between the actual light spot coordinates and the target position based on the acquired image and the mapping relationship between pixel coordinates and physical calibration plane coordinates.
[0024] S4: According to the deviation adjustment command, control the galvanometer in the galvanometer assembly to be corrected to drive the coaxially mounted correction light indicator to deflect, and repeat steps S2-S3 until the deviation between the actual light spot coordinates and the target position is less than the preset threshold, thereby completing the correction of the galvanometer in the galvanometer assembly.
[0025] Furthermore, in step S1, when calibrating the camera component, the distortion parameters of the camera component are corrected, and the mapping relationship between pixel coordinates and physical plane coordinates is obtained.
[0026] Furthermore, in step S3, the center pixel coordinates of the light spot are first calculated based on the acquired calibration plane image, and then the center pixel coordinates of the light spot are mapped to the physical coordinates under the actual galvanometer coordinate system; finally, the deviation between the actual light spot coordinates and the target position is calculated.
[0027] Furthermore, step S4 includes a zero-point reference calibration process. In the zero-point reference calibration process, the Base parameter is adjusted according to the deviation between the calculated actual spot coordinates and the target position by a set minimum step adjustment amount. Based on this, an adjustment command is generated to control the galvanometer in the galvanometer assembly to be calibrated to drive the coaxially mounted calibration light indicator to deflect. Repeated detection and correction are performed until the error is lower than the threshold.
[0028] Furthermore, step S4 also includes a scaling parameter correction process. The scaling parameter correction process is based on the Base parameter that has been corrected in the zero-point reference correction process. Multiple test point coordinates are selected on the calibration plane, and the galvanometers in the galvanometer assembly to be corrected are controlled to point sequentially to the selected test point coordinates. At the same time, a light spot is generated on the calibration plane by a coaxial correction light indicator, and the deviation between the actual light spot coordinates and the target position is calculated.
[0029] Adjust the scaling parameters in the scaling section according to the set minimum step adjustment amount, thereby generating adjustment commands to control the galvanometer in the galvanometer assembly to be calibrated to drive the coaxially mounted calibration light indicator to deflect, and perform repeated detection and correction until the error at each point is lower than the threshold.
[0030] Furthermore, step S4 also includes a distortion parameter correction process, which selects four corner points on the calibration plane based on the Base parameter corrected in the zero-point reference correction process and the scaling parameter corrected in the scaling parameter correction process.
[0031] The galvanometers in the galvanometer assembly to be calibrated are controlled to point sequentially to the selected corner coordinates, while a light spot is generated on the calibration plane by a coaxial calibration light indicator;
[0032] For each corner point, the deviation between the actual spot coordinates and the target position is calculated. The distortion parameters in the scaling part are adjusted according to the set minimum step adjustment amount. Repeated detection and correction are performed, and the distortion parameters are iteratively optimized until the error of each corner point is lower than the threshold.
[0033] The solution provided by this invention can automatically detect and correct galvanometer deviations, effectively improving consistency and positioning accuracy, as well as increasing the efficiency of galvanometer calibration.
[0034] The solution provided by this invention can be used for factory testing of galvanometer systems, automatic precision compensation and coordinate error correction, and can be widely applied in precision application fields such as laser marking, laser weeding, laser cutting and measurement. Attached Figure Description
[0035] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0036] Figure 1 This is a flowchart illustrating the overall process of the automatic laser galvanometer calibration method in this invention.
[0037] Figure 2 This is a flowchart illustrating the process of establishing pixel physical coordinate mapping in this invention.
[0038] Figure 3 This is an example diagram of the zero-point calibration process in this invention.
[0039] Figure 4 This is an example diagram of the scaling correction process in this invention.
[0040] Figure 5 This is an example diagram of the distortion correction process in this invention.
[0041] Figure 6 This is a flowchart illustrating the overall process of automatic laser galvanometer calibration in an example of the present invention.
[0042] Figure 7 This is an example diagram of the overall structure of the automatic laser galvanometer correction system in this invention.
[0043] In the diagram, the components are: control host-1, combined bracket-2, galvanometer control board-3, adapter board A-4, adapter board B-5, correction light indicator-6, galvanometer assembly-7, camera assembly-8, and calibration plane-9. Detailed Implementation
[0044] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below with reference to specific illustrations.
[0045] The deviation and zero-point drift caused by the internal X and Y deflection motor assembly scheme of the galvanometer product are specifically manifested in the fact that the mechanical zero point position of the rotor of the X and Y deflection motor has a slight angular deviation from the ideal electrical zero point position during assembly. At the same time, the analog drive circuit that drives the deflection of the motor may have zero-point voltage drift, which causes the motor to have a slight deflection even when the control signal is zero.
[0046] This invention presents an automatic calibration scheme for laser galvanometers based on computer vision and coaxial reference light. It introduces base_x, base_y parameters and k_x_array, k_y_array parameters to construct the core of the galvanometer coordinate transformation model, and achieves high-precision calibration through hierarchical optimization.
[0047] The base_x and base_y parameters are used to compensate for the zero-point offset of the galvanometer, while the k_x_array and k_y_array parameters are used to correct scaling and distortion errors.
[0048] Based on this, this solution further introduces a reference light source coaxial with the galvanometer to map the deflection state of the galvanometer onto the calibration plane. Then, based on computer vision, it collects the position of the light spot formed by the reference light source on the calibration plane, calculates the light spot deviation, and automatically corrects the coordinate transformation parameters of the galvanometer.
[0049] Accordingly, this invention provides an automatic calibration scheme for laser galvanometers based on computer vision and coaxial reference light. This scheme introduces a reference light source coaxial with the galvanometer to map the deflection state of the galvanometer onto a calibration plane. Then, based on computer vision, it collects the light spot and position formed by the reference light source on the calibration plane and further calculates the light spot deviation, thereby automatically correcting the coordinate transformation parameters of the galvanometer.
[0050] Accordingly, the present invention specifically provides an automatic laser galvanometer calibration system based on computer vision and coaxial reference light, for the purpose of automatically detecting and correcting galvanometer deviations.
[0051] See Figure 7 The automatic laser galvanometer calibration system is mainly composed of a calibration plane 9, a combination bracket 2, a calibration light indicator 6, a camera assembly 8, and a control assembly.
[0052] The calibration plane 9 in the system is set together with the combined support 2 to form a calibration environment.
[0053] The combined support 2 in the system is used to support the galvanometer assembly 7 and the camera assembly 8 to be calibrated, so that the galvanometer assembly 7 and the camera assembly 8 are respectively distributed and arranged relative to the calibration plane, so that the calibration light indicator 6, which is coaxially arranged with the galvanometer assembly to be calibrated, can generate a light spot on the calibration plane 9, and so that the camera assembly 8 can acquire the light spot generated by the calibration light indicator 6, which is coaxially arranged with the galvanometer assembly to be calibrated, on the calibration plane 9.
[0054] The calibration light indicator 6 in the system is used to be coaxially mounted with the galvanometer in the galvanometer assembly 7 to be calibrated. The light propagation direction of the calibration light indicator 6 is facing the calibration plane 9, and it can generate calibration light along the coaxial direction of the galvanometer to form a light spot on the calibration plane.
[0055] The camera component 8 in the system is mounted on the combined support 2 and can acquire images of the calibration plane 9 and the light spot formed thereon for subsequent analysis and calculation.
[0056] The control component in the system serves as the control and calculation center of the entire system, and it is configured to control and connect the camera component 8, the correction light indicator 6, and the galvanometer component 7 to be corrected.
[0057] Based on this, the control component is also equipped with a galvanometer correction module. This galvanometer correction module is based on computer vision and can control the camera component to perform distortion parameter correction, thereby obtaining the mapping relationship between pixel coordinates and physical calibration plane coordinates. It controls the galvanometer in the galvanometer component to be corrected to drive the coaxially mounted correction light indicator to deflect, and controls the correction light indicator to work on the light spot generated on the calibration plane. After the galvanometer is deflected into place, it controls the camera component to acquire a calibration plane image with the light spot. Based on the acquired image and the mapping relationship between pixel coordinates and physical calibration plane coordinates, it calculates the deviation between the actual light spot coordinates and the target position, and controls the galvanometer in the galvanometer component to complete the correction accordingly.
[0058] Regarding the above system solution, the following details the specific configuration of each component and the equipment that may be involved.
[0059] In some embodiments of the present invention, the calibration plane 9 in this scheme adopts a high-precision calibration plate, the surface of which has reference points with known physical coordinates pre-marked (e.g., four symmetrically distributed corner points or center points), the calibration plate plane is perpendicular to the light output direction of the galvanometer, and the center position of the calibration plate is geometrically aligned with the origin of the galvanometer coordinate system.
[0060] The calibration plane 9 here can be composed of a standard reflector or a diffuse reflective target surface to ensure clear image formation and facilitate visual inspection. At the same time, the high flatness and high reflectivity or diffuse reflective surface of the standard reflector or diffuse reflective target surface can reduce ambient light interference and improve image acquisition accuracy.
[0061] In some embodiments of the present invention, the combined bracket 2 is used to support the galvanometer assembly and the camera assembly to be calibrated, enabling the galvanometer assembly and the camera assembly to be calibrated to be respectively distributed and arranged relative to the calibration plane. The combined bracket is made of a rigid material (such as aluminum alloy) and has an adjustable mounting position to ensure that the relative positions of the galvanometer assembly, the camera assembly and the calibration plane are fixed.
[0062] The specific composition of the combined support is not limited here and can be determined according to actual needs. The main requirement is that the overall structure is stable and reliable and easy to adjust and set.
[0063] As a further explanation, in order to facilitate the installation of the camera assembly 8, the calibration light indicator 6, and the galvanometer assembly 7 to be calibrated, two sets of adapter plates can be set on the combined bracket 2: adapter plate A 4 and adapter plate B 5. The adapter plate A 4 and adapter plate B 5 are combined to form a telescopic and adjustable mounting part, thereby adapting to different working conditions.
[0064] In some embodiments of the present invention, the correction light indicator 6 in this solution is a red light indicator, which can generate a red light spot on the calibration plane, thereby improving the recognition accuracy of the image formed by the camera component by the control component.
[0065] Furthermore, the calibration light indicator 6 is specifically installed coaxially with the galvanometer in the galvanometer assembly to be calibrated, ensuring that the light output direction is parallel to the galvanometer deflection axis.
[0066] In some embodiments of the present invention, the camera component 8 in this solution can be an industrial camera, which can efficiently acquire high-definition images of the calibration plane for subsequent identification and calculation by the control components.
[0067] Furthermore, the camera assembly uses an industrial camera and can be equipped with a fixed-focus lens as needed to ensure that the image resolution and field of view cover the entire calibration plane.
[0068] Furthermore, when installing the industrial camera, it is preferable to align the optical axis of the industrial camera perpendicular to the calibration plane to reduce perspective distortion, and to correct lens distortion using software.
[0069] In some embodiments of the present invention, the control components of this solution mainly include two parts: a control host 1 and a galvanometer control board 3.
[0070] Among them, the galvanometer control board 3 serves as a relay component, used to connect the control host 1 and the galvanometer assembly 7 to be calibrated, so as to convert the digital instructions of the control host 1 into corresponding board instructions and transmit them to the deflection motor in the galvanometer assembly 7 to control the working state of the deflection motor.
[0071] As an example, the galvanometer control board 3 here is based on an FPGA or a dedicated processor, supports galvanometer control protocols such as XY2-100, and converts the digital commands from the control host into galvanometer drive signals. Furthermore, this galvanometer control board is preferably connected via shielded cables during setup and installation to reduce electromagnetic interference.
[0072] Correspondingly, the control host 1 is configured to control the connected camera assembly 8, the correction light indicator 6, and the connected galvanometer control board 3, which is connected to the galvanometer assembly 7 to be calibrated. The control host also runs a galvanometer calibration module, which generates galvanometer calibration commands to control the camera assembly, the correction light indicator, and the galvanometer assembly to be calibrated to work together to automatically detect and correct galvanometer deviations.
[0073] Specifically, this galvanometer correction module is composed of a calibration submodule, a zero-point reference correction submodule, a scaling parameter correction submodule, and a distortion parameter correction submodule working together.
[0074] The calibration submodule is configured to control the camera component to calibrate relative to the calibration plane and establish a pixel-to-plane coordinate mapping relationship.
[0075] The zero-point reference correction submodule is configured to interact with the calibration submodule, and can control and adjust the Base parameters of the galvanometer assembly to be calibrated to complete the zero-point reference correction based on the mapping relationship established by the calibration submodule.
[0076] The scaling parameter correction submodule is configured to interact with the zero-point reference correction submodule, enabling it to control and adjust the scaling parameters of the galvanometer assembly to be corrected after the zero-point reference correction submodule has completed its correction.
[0077] The distortion parameter correction submodule is configured to interact with the scaling parameter correction submodule and the zero-point reference correction submodule. This allows distortion parameter correction to be completed based on the corrected Base parameter and scaling parameter after the scaling parameter correction submodule has completed its correction.
[0078] Based on the above-mentioned scheme, the present invention further provides an automatic laser galvanometer calibration method for the laser galvanometer based on computer vision and coaxial reference light.
[0079] See Figure 1 This automatic laser galvanometer calibration method is implemented based on the aforementioned automatic laser galvanometer calibration system based on computer vision and coaxial reference light, and it consists of the following steps:
[0080] S1: Calibrate the camera component relative to the calibration plane and obtain the mapping relationship between pixel coordinates and physical calibration plane coordinates.
[0081] S2: Controls the galvanometer in the galvanometer assembly to be calibrated to drive the coaxially mounted calibration light indicator to deflect, and controls the light spot generated by the calibration light indicator working on the calibration plane.
[0082] S3: After the galvanometer is deflected into place, the camera module acquires an image of the calibration plane with the light spot, and calculates the deviation between the actual light spot coordinates and the target position based on the acquired image and the mapping relationship between pixel coordinates and physical calibration plane coordinates.
[0083] S4: According to the deviation adjustment command, control the galvanometer in the galvanometer assembly to be corrected to drive the coaxially mounted correction light indicator to deflect, and repeat steps S2-S3 until the deviation between the actual light spot coordinates and the target position is less than the preset threshold, thereby completing the correction of the galvanometer in the galvanometer assembly.
[0084] The following details the implementation scheme of each step in this automatic laser galvanometer calibration method.
[0085] In some embodiments, during step S1, when calibrating the camera component, the automatic correction method for this laser galvanometer obtains the mapping relationship between pixel coordinates and physical plane coordinates by correcting the distortion parameters of the camera component.
[0086] See Figure 2 This method completes the calibration of the camera components through a series of steps, including solving the camera intrinsic parameters and distortion parameters, and calculating the spatial mapping based on the feature points of the calibration plane, thereby establishing the mapping relationship between pixel coordinates and the calibration plane coordinate system.
[0087] Step 1.1: System initialization;
[0088] This step mainly involves hardware deployment and initial setup. First, the camera assembly (such as an industrial camera and a fixed-focus lens) and the calibration plane are fixed to the combined support. The calibration plane is spatially aligned with the laser galvanometer using a test fixture, ensuring that the coordinate system of the calibration plane is consistent with the coordinate system of the galvanometer. Simultaneously, the control assembly is activated and the geometric parameter information of the calibration plane is loaded.
[0089] Step 1.2: Calibration image acquisition and camera model establishment;
[0090] The camera module is controlled to acquire multiple calibration planar images, including images from different shooting postures and angles to cover the entire field of view of the camera module. Based on the acquired calibration images, a camera calibration algorithm is executed to solve for the intrinsic parameter matrix of the camera module and correct lens distortion parameters. Distortion correction processing is then performed on the images to establish a mapping relationship F1 between pixel coordinates and the camera space coordinate system, thus realizing the transformation from pixel coordinates to camera space coordinates.
[0091] The first step is to calculate the parameters. The collected multiple sets of (pixel coordinates, world coordinates) pairs are processed by the camera calibration algorithm to obtain two sets of core parameters: the camera component intrinsic parameter matrix and the distortion coefficients.
[0092] The intrinsic parameter matrix includes focal length (f_x, f_y), principal point (c_x, c_y), etc.; the distortion coefficients include radial distortion parameters (k_1, k_2, k_3, p_1, p_2). These parameters together define the imaging geometry model and distortion characteristics of the lens.
[0093] Next, establish the mapping relationship from pixels to the camera reference plane. For the camera reference plane (Z=0), form a homography matrix H from pixel coordinates (u, v) to camera reference plane coordinates (x_c, y_c), or establish an accurate mapping function (x_c, y_c) = F1(u, v) through intrinsic parameters and distortion parameters.
[0094] Step 1.3: Detect the pixel coordinates of feature points on the calibration plane;
[0095] This step uses computer vision algorithms (such as the findChessboardCorners or findCirclesGrid functions in OpenCV) to automatically detect and precisely calibrate the pixel coordinates (u_i, v_i) of preset feature points (such as corners or centers) of a planar pattern at the subpixel level.
[0096] Step 1.4: Establishing the mapping from the camera coordinate system to the calibration plane coordinate system:
[0097] Based on the mapping relationship F1, the feature point pixel coordinates (u, v) obtained in step 1.3 are converted into camera space coordinates (x_c, y_c); combined with the known physical position of the feature point in the calibration plane coordinate system, the spatial mapping relationship (x_r, y_r) = F2(x_c, y_c) between the camera space coordinate system and the calibration plane coordinate system is calculated, thereby obtaining the transformation model from the camera coordinate system to the calibration plane coordinate system.
[0098] Furthermore, the mapping relationships F1 and F2 are combined to obtain the overall mapping relationship (x_r, y_r) = F(u, v) from the pixel coordinates to the calibration plane coordinate system, which is used for the subsequent automatic correction and control of the laser galvanometer.
[0099] This method employs sub-pixel level corner detection, which provides a feature point localization accuracy far exceeding that of a single pixel, laying a sub-pixel level precision foundation for mapping relationships. Simultaneously, fully automated feature point extraction and matching avoids the subjective errors and inefficiencies of manual point selection, resulting in good repeatability.
[0100] This method preferably utilizes statistical algorithms such as Zhang Zhengyou's calibration method to solve lens distortion correction and coordinate mapping modeling simultaneously within the same optimization framework. This is more accurate than the existing two-step method of first correcting distortion and then calculating the mapping, because distortion affects the extraction position of feature points. Coupled calculation of the two can obtain the global optimal solution.
[0101] The distortion coefficients (such as k_1, k_2) obtained by calibration in this method can accurately describe the radial and tangential distortion of the lens. The undistort function can be used to perform real-time geometric correction on any subsequently acquired image to eliminate image distortion caused by the lens itself.
[0102] This method establishes a mapping relationship between pixel coordinates and the camera imaging coordinate system after completing camera intrinsic parameter calibration and lens distortion correction.
[0103] Based on the premise that the calibration plane has been aligned with the galvanometer coordinate system, computer vision methods are used to automatically identify preset feature points on the calibration plane, obtain the pixel coordinates of the feature points in the image, and calculate the corresponding spatial coordinates in the camera coordinate system by combining the mapping relationship.
[0104] Meanwhile, since the spatial coordinates of the feature points in the galvanometer coordinate system are known, the coordinate transformation matrix from the camera coordinate system to the galvanometer coordinate system is calculated by using a fitting algorithm based on the correspondence between the feature points in the camera coordinate system and the galvanometer coordinate system.
[0105] In some implementations, the camera and galvanometer are aligned in attitude through a precision mounting structure, and the rotation matrix is a fixed parameter or an approximate identity matrix, with only the translation parameter being solved; in another implementation, the rotation matrix and the translation matrix are solved simultaneously.
[0106] Furthermore, based on the aforementioned camera calibration and coordinate transformation process, a mapping relationship between pixel coordinates and physical coordinates in the galvanometer coordinate system is established, enabling the direct conversion of pixel coordinates to galvanometer control coordinates, i.e., physical calibration plane coordinates.
[0107] In some embodiments, the automatic laser galvanometer correction method completes the deviation calculation between the actual spot coordinates and the target position in step S3 through the following steps.
[0108] Step S3.1: Image preprocessing and detection of the center pixel coordinates of the light spot.
[0109] First, image acquisition and preprocessing:
[0110] The control component gradually sends commands to the camera to acquire an image of the calibration board containing a red reference light spot, and then performs color space conversion on the acquired RGB image (e.g., from RGB to HSV color space). Using the specific hue and saturation range of red light, a color threshold is set, and threshold segmentation is performed to generate a binarized image. In this image, the red light spot area is white (pixel value 255), and the background is black (pixel value 0).
[0111] Next, the center pixel coordinates of the light spot are extracted:
[0112] In a binary image, connected components are identified, and the spot region is located. First, the gray-level centroid method is used to calculate the weighted center position of the gray values of all pixels within the spot region, as shown in the following formula:
[0113] ;
[0114] Where I(u,v) is the grayscale value of pixel (u,v), and R represents the spot area. This method is fast and has higher accuracy than pixel-level calculation.
[0115] Next, the Gaussian fitting method is used to approximate the gray distribution of the light spot as a two-dimensional Gaussian surface, and the center point of the surface is obtained by fitting.
[0116] Step S3.2: Map the center pixel coordinates of the light spot to the physical coordinates in the actual galvanometer coordinate system.
[0117] First, coordinate mapping is performed. The sub-pixel coordinates (uc, vc) of the spot center calculated in step S3.1 are mapped based on the mapping function F from pixel coordinates to physical calibration plane coordinates established in step S1.
[0118] ,
[0119] Thus, the coordinates (xr, yr) of the center of the light spot in the calibration plane physical coordinate system are obtained.
[0120] Since the physical coordinate system of the calibration plate was aligned with the target working coordinate system of the galvanometer during S1 calibration using tooling, the calculated (x) here... r ,y r This directly represents the coordinates of the light spot in the actual galvanometer coordinate system. This mapping process can resolve image lens distortion and perspective transformation issues in one step.
[0121] Step S3.3: Calculate the deviation between the actual spot coordinates and the target position;
[0122] This step calculates the physical coordinates (x, y) of the actual light spot obtained in step S3.2. r ,y r ) and the target position coordinates of the galvanometer deflection (x origin ,y origin The difference between the coordinates (i.e., the command coordinates initially sent by the control component to the galvanometer component) and the coordinates of the galvanometer component:
[0123] Technical means: The deviation calculation formula is as follows:
[0124] Δ x =x r -x origin ;
[0125] Δ y =y r -y origin ;
[0126] Therefore, the deviation values (Δ) in the X and Y axis directions are obtained. x ,Δ y ).
[0127] In some embodiments, the automatic laser galvanometer calibration method includes a zero-point reference calibration process in step S4. In this zero-point reference calibration process, the Base parameter is adjusted according to the calculated deviation between the actual spot coordinates and the target position by a set minimum step adjustment amount. Based on this, an adjustment command is generated to control the galvanometer in the galvanometer assembly to be calibrated to drive the coaxially mounted calibration light indicator to deflect, and repeated detection and correction are performed until the error is lower than the threshold.
[0128] The zero-point reference calibration in this method is the foundation of the entire automatic galvanometer calibration scheme. It is used to correct the zero-point offset error of the galvanometer assembly, that is, to ensure that when the control system sends the target coordinates (0, 0), the laser beam (represented by the coaxial reference light) can accurately hit the theoretical origin of the calibration plane.
[0129] This method takes the initial Base parameters x_base and y_base (which may be 0 or the previous correction value) as an example, and iterates through the iteration step coefficient α until the accuracy threshold E_th is reached, thereby completing the correction.
[0130] See Figure 3 This method specifically completes the zero-point reference calibration process through the following steps:
[0131] Step 4.1.1: Set the target, clarifying that the target position for this iteration is the theoretical origin of the galvanometer coordinate system:
[0132] x origin =0, y origin =0.
[0133] Step 4.1.2: Calculate the drive coordinates. The control component combines the target coordinates with the current zero-point compensation parameters (x_base, y_base) and multiplies them by the current scaling composite parameter k_array to calculate the actual command coordinates sent to the galvanometer driver.
[0134] .
[0135] Step 4.1.3: Execute and generate the light spot; the galvanometer is based on (x) correct , y correct The light source is deflected and illuminated by a coaxial reference light source (such as a red LED), forming a visible light spot on the calibration plane.
[0136] Step 4.1.4: Detection of the actual position of the light spot;
[0137] Image acquisition: The camera component is triggered to capture an image of the calibration board containing a red light spot.
[0138] Spot center detection: The spot region is extracted using computer vision algorithms (such as color thresholding and morphological processing), and the pixel coordinates (u, v) of the spot center are accurately calculated using sub-pixel localization techniques (such as gray-scale centroid method or Gaussian fitting method).
[0139] Coordinate mapping: Utilizing the pixel coordinate-to-physical coordinate mapping relationship F established in the initialization phase S1, the pixel coordinates (u, v) are converted into actual physical coordinates (x_r, y_r) on the calibration board plane.
[0140] (x r ,y r )=F(u,v);
[0141] Since the calibration plate coordinate system is aligned with the galvanometer target working coordinate system, (x_r, y_r) is the actual position of the light spot in the galvanometer coordinate system.
[0142] Step 4.1.5: Deviation Judgment and Parameter Iteration;
[0143] This step is the decision-making stage of the zero-point reference calibration process, including:
[0144] First, calculate the deviation: compare the measured actual position (x_r, y_r) with the target position (0, 0) and calculate the deviation value.
[0145] ;
[0146] The (Δ) calculated here x , Δ y It can directly and intuitively represent the offset of the current zero point in the X and Y directions.
[0147] Next, deviation judgment: Calculate the Euclidean norm of the deviation (i.e., the length of the deviation vector) and compare it with a preset accuracy threshold E_th (e.g., 0.2mm).
[0148] ;
[0149] If the condition is met: it means that the current zero-point accuracy has met the standard, then proceed to step 4.1.6;
[0150] If the conditions are not met, it indicates that there is still a significant deviation at the zero point, and it is necessary to proceed to the subsequent iterative update stage.
[0151] Next, the parameters are iteratively updated: In this scheme, the zero-point compensation parameters are updated based on gradient descent. The new parameter value is obtained by subtracting a small amount proportional to the deviation from the current parameter value.
[0152] ;
[0153] The step coefficient α is a key hyperparameter (usually a positive number less than 1, such as 0.1). It is used to control the magnitude of each adjustment, preventing drastic parameter oscillations caused by excessive single deviations, thereby ensuring the stability of the iteration.
[0154] Therefore, through multiple fine adjustments, (Δ) x , Δ y It gradually decreases until it smoothly approaches zero.
[0155] Step 4.1.6: Return to the iteration and update ( , The parameters are loaded into the control component. The target coordinates can be sent again using the new parameters to start the next loop or proceed to the next stage (such as scaling correction).
[0156] In some embodiments, the automatic laser galvanometer calibration method further includes a scaling parameter calibration step in step S4. This scaling parameter calibration step is based on the Base parameter that has been corrected in the zero-point reference calibration step. Multiple test point coordinates are selected on the calibration plane, and the galvanometers in the galvanometer assembly to be calibrated are controlled to point sequentially to the selected test point coordinates. At the same time, a light spot is generated on the calibration plane by a coaxial calibration light indicator, and the deviation between the actual light spot coordinates and the target position is calculated.
[0157] In this method, the scaling parameters in the scaling section are adjusted according to the set minimum step adjustment amount, thereby generating an adjustment command to control the galvanometer in the galvanometer assembly to be calibrated to drive the coaxially mounted calibration light indicator to deflect, and to perform repeated detection and correction until the error at each point is lower than the threshold.
[0158] The scaling parameter correction process in this method is the second layer of optimization after the "zero-point reference correction". Its purpose is to accurately calibrate the linear scaling ratio of the galvanometer system and ensure that the commanded movement distance and the actual spot movement distance are in precise proportional relationship in all directions.
[0159] This method, based on the x_base and y_base parameters that have already undergone zero-point offset calibration (ensuring zero-point accuracy), uses gradient descent to iteratively update the scaling parameters a_zoom_x and a_zoom_y, a preset accuracy threshold E_th, and step coefficients β_x and β_y, until the overall error converges below the preset threshold E_th. This completes the correction, resulting in optimized a_zoom_x and a_zoom_y parameters that meet the scaling error requirements.
[0160] See Figure 4 This method specifically completes the scaling parameter correction process through the following steps:
[0161] Step S4.2.1: Select calibration points to form a scaling correction point set;
[0162] This step is used to select a set of measurement points for scaling correction. Specifically, on the calibration plane, four reference points with known physical coordinates are selected to form the scaling correction point set P. scale :
[0163] ;
[0164] The four points selected here need to be symmetrically distributed relative to the origin of the galvanometer coordinate system. For example, points with the same displacement (e.g., ±Δd) from the origin in the positive and negative directions of the X and Y axes can be selected to form a "cross" or "square" point set.
[0165] Since this process is performed after the zero-point reference calibration has been completed (i.e., the base_x and base_y parameters have been optimized), the origin of the galvanometer's coordinate system is now accurate. By selecting symmetrical points, it can be ensured that during measurement, the deviation of each point pair primarily reflects the "distance" error from the origin to that point (i.e., the scaling factor), rather than the positional error of the origin. For example, if the deviations of points (Δd, 0) and (-Δd, 0) have opposite signs but similar magnitudes, it strongly indicates a scaling error on the X-axis.
[0166] Furthermore, the symmetrically distributed point set allows for the calculation of the average deviations in the X and Y axes separately, thus enabling independent and robust optimization of the a_zoom_x and a_zoom_y parameters.
[0167] Step S4.2.2: Execute and obtain the actual location;
[0168] This step is used to process the formed point set P. scale The actual spot position is obtained by traversing and measuring each point in the array. For each point... Execute the following sub-steps in sequence:
[0169] First, set the original target coordinates:
[0170] The physical coordinates of the selected calibration point are directly sent as the original target command to the galvanometer control component for this iteration:
[0171] ;
[0172] This coordinate is the ideal target value, a known and precise physical position in the calibration plate coordinate system (already aligned with the galvanometer coordinate system).
[0173] Next, the corrected coordinates are calculated and the galvanometer is driven:
[0174] The control component inputs the original target coordinates into the galvanometer's unified coordinate correction formula, and, combined with all correction parameters in the current iteration, calculates the actual command coordinates sent to the galvanometer driver board:
[0175] ;
[0176] Where x_base and y_base are fixed and are the optimized values from the previous process (zero-point calibration);
[0177] a_zoom_x, a_zoom_y: to be optimized, which is the core objective of this process, and its value is the value of the current iteration;
[0178] b_distortion_x, b_distortion_y: can be set to 0.
[0179] Next, the galvanometer calculates (x) correct, i , y correct, i The deflection is performed and the coaxial reference light (such as red light) is lit simultaneously to form a light spot on the calibration plate.
[0180] Next, visually measure the center of the light spot:
[0181] The camera component is triggered to acquire an image of the calibration board containing a red light spot. The light spot region is extracted using image processing algorithms (such as color thresholding and morphological operations), and the pixel coordinates (u) of the light spot center are accurately calculated using sub-pixel localization methods (such as grayscale centroid method). i ,v i ).
[0182] Finally, mapped to actual physical coordinates:
[0183] Based on the pixel coordinate to physical coordinate mapping function F established in step S1 (which already includes camera lens distortion correction), the pixel coordinates are transformed back to the actual physical coordinates in the calibration board coordinate system:
[0184] ;
[0185] The calculation obtained here It can effectively reflect the actual landing point of the light spot after the galvanometer executes the command under the current correction parameters.
[0186] Step S4.2.2 will obtain a high-precision target value-actual value data pair for each calibration point. and :
[0187] Step S4.2.3: Calculate scaling error;
[0188] First, calculate the positional deviation of each of the four calibration points:
[0189] ;
[0190] Next, an overall scaling error evaluation index E is constructed. scale Using the sum of squared errors:
[0191] ;
[0192] This indicator can sensitively reflect the overall level of deviation.
[0193] Step S4.2.4: Iterative parameter update;
[0194] This step employs batch gradient descent, which updates only the scaling parameters a_zoom_x and a_zoom_y while strictly maintaining the calibrated Base parameters and the inactive b_distortion parameters unchanged.
[0195] ;
[0196] Wherein, β_x and β_y are step adjustment coefficients (learning rate), which are preset small positive numbers used to control the magnitude of parameter updates, ensuring smooth convergence of the iteration process and avoiding oscillations.
[0197] and These represent the systematic offset trends of the four points in the X and Y directions, respectively. If the sum is positive, it indicates that the current scaling ratio is generally too large, and the a_zoom parameter needs to be reduced to shrink the zoom; otherwise, it should be increased.
[0198] Step S4.2.5: Convergence judgment and loop;
[0199] This step compares the calculated overall error index E_scale with the preset accuracy threshold E_th:
[0200] ;
[0201] If the conditions are not met, the process returns to step S4.2.1, using the updated a_zoom parameter to generate the same set of test points and start a new round of measurement and optimization loop;
[0202] If the conditions are met, it means that the scaling ratio has been accurately calibrated, the process is complete, and the system enters the "scaling correction complete" state, returning to the overall process to prepare for the next stage of distortion parameter correction.
[0203] In some embodiments, the automatic laser galvanometer calibration method further includes a distortion parameter correction step in step S4. This distortion parameter correction step is based on the Base parameter that has been corrected in the zero-point reference calibration step and the scaling parameter that has been corrected in the scaling parameter correction step. Four corner points are selected on the calibration plane, and the galvanometers in the galvanometer assembly to be calibrated are controlled to point to the selected corner point coordinates in sequence. At the same time, a light spot is generated on the calibration plane by a coaxial calibration light indicator.
[0204] For each corner point, the deviation between the actual spot coordinates and the target position is calculated. The distortion parameters in the scaling part are adjusted according to the set minimum step adjustment amount. Repeated detection and correction are performed, and the distortion parameters are iteratively optimized until the error of each corner point is lower than the threshold.
[0205] This distortion parameter correction process is the final optimization stage of the entire galvanometer automatic correction process. Its goal is to compensate for the nonlinear distortion errors of the galvanometer system (such as pincushion or barrel distortion) and ensure the positioning accuracy of the laser beam across the entire working plane, especially in the edge regions. This process is performed after zero-point and scaling corrections are completed, thus forming the final closed loop of the "reference first, then linear, then nonlinear" layered correction strategy.
[0206] This distortion parameter correction process, based on the accurate calibration and locking of the zero-point offset (base_x, base_y) and scaling parameters (a_zoom_x, a_zoom_y), measures the residual nonlinear error by setting up test points in the edge region (corner points) of the calibration plane, and uses the gradient descent method to iteratively update and optimize the distortion parameters b_distortion_x and b_distortion_y in the galvanometer coordinate transformation model to correct the nonlinear geometric distortion.
[0207] See Figure 5 This method specifically completes the distortion parameter correction process through the following steps:
[0208] Step 4.3.1: Selection of calibration points;
[0209] In this step, four corner points with known physical coordinates are selected on the calibration plane to form a distortion correction point set P. distort Used for distortion correction, covering the edge area of the calibration plane:
[0210] ;
[0211] Since optical distortions (such as those caused by scanning lenses) are usually most significant at the edges of the field of view, corner points are chosen as test points to most effectively excite and measure the nonlinear distortion error of the system.
[0212] Step 4.3.2: Execute and obtain the actual location;
[0213] This step applies to the point set P. distor Each corner point in t Execute the following sub-steps in sequence:
[0214] First, set the original target coordinates:
[0215] ;
[0216] Next, the corrected coordinates are calculated and the galvanometer is driven:
[0217] Input the target coordinates into the galvanometer's unified coordinate correction formula, and combine them with all correction parameters in the current iteration to calculate the actual command coordinates sent to the galvanometer driver board:
[0218] ;
[0219] in,
[0220] x_base, y_base: are fixed and represent the results of zero-point correction optimization;
[0221] a_zoom_x, a_zoom_y: Fixed, representing the results of scaling correction optimization;
[0222] b_distortion_x, b_distortion_y: To be optimized, this is the core of this process, and the current iteration value is taken.
[0223] Next, the galvanometer calculates (x) correct, j , y correct, j The deflection is performed and the coaxial reference light (such as red light) is lit simultaneously to form a light spot on the calibration plate.
[0224] Next, visually measure the center of the light spot:
[0225] The camera component is triggered to acquire an image of the calibration board containing a red light spot. The light spot region is extracted using image processing algorithms (such as color thresholding and morphological operations), and the pixel coordinates (u) of the light spot center are accurately calculated using sub-pixel localization methods (such as grayscale centroid method). j ,v j ).
[0226] Finally, mapped to actual physical coordinates:
[0227] Based on the pixel coordinate to physical coordinate mapping function F established in step S1 (which already includes camera lens distortion correction), the pixel coordinates are transformed back to the actual physical coordinates in the calibration board coordinate system:
[0228] .
[0229] The calculation obtained here It can effectively reflect the actual landing point of the light spot after the galvanometer executes the command under the current correction parameters.
[0230] Step S4.3.3: Calculate scaling error;
[0231] This step first calculates the positional deviation of each corner point:
[0232] ;
[0233] Next, an overall distortion error evaluation index E is constructed. distort (Sum of squared errors):
[0234] ;
[0235] This indicator effectively quantifies the overall nonlinear error at the four corner points.
[0236] Step S4.3.4: Iterative update of distortion parameters;
[0237] This step employs batch gradient descent, which allows for updating only the distortion parameters b_distortion_x and b_distortion_y while strictly maintaining the locked Base and a_zoom parameters unchanged.
[0238] ;
[0239] Wherein, γ_x and γ_y are step adjustment coefficients for the distortion parameters, which are preset small positive numbers used to control the update step size and ensure stable convergence.
[0240] and These represent the systematic nonlinear offset trends of the four corner points in the X and Y directions, respectively.
[0241] Step S4.3.5: Convergence judgment and loop;
[0242] The calculated overall error index E distort Compared with the preset accuracy threshold E th Comparison:
[0243] ;
[0244] If the conditions are not met, the process returns to step 4.3.2, and all corner points are remeasured using the updated b_distortion parameter to start a new round of iteration.
[0245] If the condition is met, it means that the nonlinear distortion has been corrected to the required accuracy, the process ends, and the system enters the "distortion correction completed" state and "returns to the overall process", thus completing the entire automatic correction process.
[0246] The automatic correction system and method for laser galvanometers based on computer vision and coaxial reference light, formed by the above scheme, can realize the correction of the zero-point offset of the galvanometer base_x and base_y, as well as the automatic correction of the scaling and distortion parameters of k_x_array and k_y_array, so that the output coordinates of the galvanometer are consistent with the actual spot position, achieving a precision control of less than 0.2 mm.
[0247] Furthermore, this automatic laser galvanometer calibration system and method based on computer vision and coaxial reference light also has the following technical features:
[0248] (1) Automatic calibration structure based on coaxial red light: using red light as a visible reference to achieve non-contact accurate detection.
[0249] (2) Two-layer parameter hierarchical optimization mechanism: First, correct the zero-point offset (Base parameter), then correct the scaling and distortion (k parameter) to gradually approach the ideal model.
[0250] (3) Visual feedback closed-loop control algorithm: Automatic iterative optimization through real-time image detection and minimum step adjustment.
[0251] (4) Multi-stage mapping correction model: Combine the camera calibration results to achieve accurate mapping between pixel space and actual physical space.
[0252] (5) Highly versatile system structure: No specific hardware interface is required, and it can be adapted to different models of galvanometers and cameras.
[0253] The following specific examples illustrate the application and implementation process of the automatic laser galvanometer calibration scheme based on computer vision and coaxial reference light provided in this invention.
[0254] See Figure 7 In this example, an automatic laser galvanometer calibration system based on computer vision and coaxial reference light is first constructed based on the scheme of the present invention.
[0255] The calibration plane in the system uses a standard reflector or a diffuse reflective target surface;
[0256] The calibration light indicator uses a red light indicator;
[0257] The camera module uses an industrial camera;
[0258] The control components consist of a galvanometer control board, a PC, and calibration control software running on the PC.
[0259] Based on this, an automatic calibration environment is built according to the present invention, and the galvanometer to be calibrated is placed on the combined support.
[0260] After completing the above preparations, the automatic calibration phase begins.
[0261] See Figure 6 The automatic calibration stage completes the automatic detection and correction of galvanometer deviations through the following steps.
[0262] Step 1: Camera calibration.
[0263] In this step, the system automatically calibrates the intrinsic and extrinsic parameters of the industrial camera, obtains the camera's distortion parameter correction, and obtains the mapping relationship between pixel coordinates and physical plane coordinates to ensure that the subsequent spot detection results can be accurately mapped to the calibration plane coordinates.
[0264] Step 2: Zero-point reference calibration (Base parameter).
[0265] In this step, the control software in the system first sends the (0,0) coordinate command of the calibration plane to the galvanometer through the board. Specifically, the control software converts the coordinate command into a board command, and the board converts the command into the XY2-100 protocol command specific to the galvanometer.
[0266] Next, after receiving the command, the galvanometer deflects according to the XY2-100 command, which synchronously drives the coaxially mounted red light indicator to illuminate the calibration plane.
[0267] Next, the control software in the system controls the industrial camera to acquire images. The control software then uses computer vision algorithms to detect the center of the red spot.
[0268] Next, the control software in the system maps the center pixel of the light spot to the coordinates in the actual galvanometer coordinate system, that is, the actual light spot coordinates.
[0269] Next, the control software in the system calculates the deviation between the actual spot coordinates and the target position.
[0270] Next, the control software in the system adjusts the base_x and base_y parameters according to the set minimum step adjustment amount.
[0271] Next, the control software in the system generates corresponding instructions based on the adjusted base_x and base_y parameters, resends the coordinates, and repeats the detection and correction until the error is lower than the threshold (e.g., 0.2 mm).
[0272] Step 3: Scaling parameter correction (scaling part of k_x_array, scaling part of k_y_array).
[0273] In this step, the control software in the system first selects multiple test point coordinates (x_center, y_center+△d), (x_center, y_center-△d), (x_center+△d,y_center)(x_center-△d,y_center) based on the corrected base_x and base_y parameters.
[0274] Next, the control software sends the selected test point coordinates to the galvanometer. After receiving the instructions, the galvanometer points to these coordinates in sequence and illuminates them with red light [see step 2 for details].
[0275] Next, the control software in the system uses an industrial camera to acquire and detect the center of the light spot, and calculates the deviation between the target and the actual position [see step 2 for details].
[0276] Next, the control software in the system adjusts the scaling parameters in k_x_array and k_y_array according to the calculated deviation value and the set minimum step size. Based on the adjusted scaling parameters in k_x_array and k_y_array, it generates corresponding instructions, resends the coordinates, and repeats the detection and correction until the error of each test point is lower than the threshold (e.g., 0.2mm).
[0277] Step 4: Distortion parameter correction (k_x_array distortion part, k_y_array distortion part).
[0278] In this step, the control software in the system first selects four corner points (X1, Y1), (X2, Y2), (X3, Y3), and (X4, Y4) on the calibration plane based on the corrected base_x and base_y parameters and the scaling parameters in the corrected k_x_array and k_y_array.
[0279] Next, for each corner point, the following steps are performed: coordinates are executed, spot is captured, the center pixel position of the spot is calculated, the actual coordinates of the spot center are calculated, the error is calculated, and the distortion parameters are iteratively optimized according to the minimum step size.
[0280] Next, the distortion terms of k_x_array and k_y_array are optimized to minimize the overall system error.
[0281] Step 5: Generate compensation results.
[0282] In this step, after completing the above calibration steps, the control software in the system will save the optimization parameters locally, including the galvanometer number, test time, test personnel, and all calibration parameters, and save them to the log file.
[0283] Next, verify whether the error is less than the threshold (0.2 mm).
[0284] Finally, after successful verification, the automatic correction is completed and the compensation result is output.
[0285] Experiments conducted using the scheme described in this embodiment demonstrate that the coordinate transformation optimization of the galvanometer can be automatically completed without human intervention; simultaneously, experimental results show that:
[0286] The galvanometer with factory deviation can deviate by up to 1 cm to 2 cm before calibration.
[0287] The residual error after correction is less than 0.2 mm;
[0288] The calibration time is reduced by more than 70% compared to manual adjustment;
[0289] Furthermore, it significantly improves the consistency between different galvanometers.
[0290] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.
Claims
1. An automatic laser galvanometer calibration system based on computer vision and coaxial reference light, characterized in that, The system includes: A calibration plane is provided in conjunction with a combined support frame to form a calibration environment. A combined support bracket is used to support the galvanometer assembly to be calibrated and the camera assembly. The camera assembly is capable of acquiring the light spot generated on the calibration plane by the calibration light indicator, which is coaxially set with the galvanometer assembly to be calibrated. A calibration light indicator is used to be coaxially mounted with the galvanometer in the galvanometer assembly to be calibrated, and is capable of generating a calibration light beam facing the calibration plane along the coaxial direction of the galvanometer to form a light spot on the calibration plane. A camera assembly, mounted on a combined support, is capable of acquiring images of a calibration plane and the light spots formed thereon; A control component is configured to control a camera assembly, a correction light indicator, and a galvanometer assembly to be calibrated. The control component includes a galvanometer calibration module. This module controls the camera assembly to perform distortion parameter correction, obtains the mapping relationship between pixel coordinates and physical calibration plane coordinates, controls the galvanometer in the galvanometer assembly to be calibrated to drive the coaxially mounted correction light indicator to deflect, and controls the correction light indicator to operate on the calibration plane to generate a light spot. After the galvanometer is deflected into position, the control component acquires an image of the calibration plane with the light spot. Based on the acquired image and the mapping relationship between pixel coordinates and physical calibration plane coordinates, the deviation between the actual light spot coordinates and the target position is calculated, and the galvanometer in the galvanometer assembly is calibrated accordingly.
2. The automatic laser galvanometer calibration system according to claim 1, characterized in that, The calibration plane is composed of a standard reflector or a diffuse reflective target surface.
3. The automatic laser galvanometer calibration system according to claim 1, characterized in that, The control component includes a control host and a galvanometer control board. The control host runs a galvanometer calibration module and controls the galvanometer control board. The galvanometer control board is connected to the galvanometer assembly to be calibrated.
4. The automatic laser galvanometer calibration system according to claim 1, characterized in that, The galvanometer correction module includes a calibration submodule, a zero-point reference correction submodule, a scaling parameter correction submodule, and a distortion parameter correction submodule. The calibration submodule is configured to control the camera component to calibrate relative to the calibration plane and establish a pixel-to-plane coordinate mapping relationship. The zero-point reference correction submodule is configured to control and adjust the zero-point reference parameters of the galvanometer assembly to be corrected based on the mapping relationship established by the calibration submodule to complete the zero-point reference correction. The scaling parameter correction submodule is configured to control and adjust the scaling parameter of the galvanometer assembly to be corrected after the zero-point reference correction submodule has completed the correction. The distortion parameter correction submodule is configured to perform distortion parameter correction based on the already corrected zero-point reference parameters and scaling parameters after the scaling parameter correction submodule has completed the correction.
5. A method for automatic calibration of laser galvanometers based on computer vision and coaxial reference light, characterized in that, The method is based on the automatic laser galvanometer calibration system according to any one of claims 1-4, comprising: S1: Calibrate the camera component relative to the calibration plane and obtain the mapping relationship between pixel coordinates and physical calibration plane coordinates; S2: Controls the galvanometer in the galvanometer assembly to be calibrated to drive the coaxially mounted calibration light indicator to deflect, and controls the light spot generated by the calibration light indicator working on the calibration plane. S3: After the galvanometer is deflected into place, the camera module acquires an image of the calibration plane with the light spot, and calculates the deviation between the actual light spot coordinates and the target position based on the acquired image and the mapping relationship between pixel coordinates and physical calibration plane coordinates. S4: According to the deviation adjustment command, control the galvanometer in the galvanometer assembly to be corrected to drive the coaxially mounted correction light indicator to deflect, and repeat steps S2-S3 until the deviation between the actual light spot coordinates and the target position is less than the preset threshold, thereby completing the correction of the galvanometer in the galvanometer assembly.
6. The automatic laser galvanometer calibration method according to claim 5, characterized in that, In step S1, when calibrating the camera component, the distortion parameters of the camera component are corrected, and the mapping relationship between pixel coordinates and physical plane coordinates is obtained.
7. The automatic laser galvanometer calibration method according to claim 6, characterized in that, In step S3, the center pixel coordinates of the light spot are first calculated based on the acquired calibration plane image. Then, the center pixel coordinates of the light spot are mapped to the physical coordinates in the actual galvanometer coordinate system. Finally, the deviation between the actual light spot coordinates and the target position is calculated.
8. The automatic laser galvanometer calibration method according to claim 7, characterized in that, Step S4 includes a zero-point reference calibration process. In the zero-point reference calibration process, the zero-point reference parameters are adjusted according to the calculated deviation between the actual spot coordinates and the target position, and the adjustment command is generated accordingly to control the galvanometer in the galvanometer assembly to be calibrated to drive the coaxially mounted calibration light indicator to deflect. Repeated detection and correction are performed until the error is lower than the threshold.
9. The automatic laser galvanometer calibration method according to claim 8, characterized in that, Step S4 also includes a scaling parameter correction process. The scaling parameter correction process is based on the zero-point reference parameters that have been corrected in the zero-point reference correction process. Multiple test point coordinates are selected on the calibration plane, and the galvanometers in the galvanometer assembly to be corrected are controlled to point to the selected test point coordinates in sequence. At the same time, a light spot is generated on the calibration plane by a coaxial correction light indicator, and the deviation between the actual light spot coordinates and the target position is calculated. Adjust the scaling parameters in the scaling section according to the set minimum step adjustment amount, thereby generating adjustment commands to control the galvanometer in the galvanometer assembly to be calibrated to drive the coaxially mounted calibration light indicator to deflect, and perform repeated detection and correction until the error at each point is lower than the threshold.
10. The automatic laser galvanometer calibration method according to claim 9, characterized in that, Step S4 further includes a distortion parameter correction process, which selects four corner points on the calibration plane based on the zero-point reference parameters corrected in the zero-point reference correction process and the scaling parameters corrected in the scaling parameter correction process. The galvanometers in the galvanometer assembly to be calibrated are controlled to point sequentially to the selected corner coordinates, while a light spot is generated on the calibration plane by a coaxial calibration light indicator; For each corner point, the deviation between the actual spot coordinates and the target position is calculated. The distortion parameters in the scaling part are adjusted according to the set minimum step adjustment amount. Repeated detection and correction are performed, and the distortion parameters are iteratively optimized until the error of each corner point is lower than the threshold.