Space calibration method and device of laser galvanometer, computer device and storage medium

By marking calibration points on calibration media at different heights and constructing a reference coordinate system, and combining a five-axis machine tool and a template matching algorithm, the problem of cumbersome and low-precision traditional laser galvanometer calibration is solved, and fast and high-precision laser galvanometer calibration is achieved.

CN118699543BActive Publication Date: 2026-11-24SHENZHEN SHUMA ELECTRONICS TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410896954.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2026-11-24
Estimated Expiration
2044-07-04

AI Technical Summary

Technical Problem

Traditional laser galvanometer spatial calibration methods are cumbersome and require high precision, making it difficult to achieve fast and high-precision calibration.

Method used

By marking the first and second calibration points on calibration media at different heights, a reference coordinate system is constructed using the second calibration point to determine the actual marking position of the first calibration point, and the position of the point to be processed is corrected based on spatial data relationships. The calibration point is then extracted by combining a high-precision five-axis machine tool and a template matching algorithm.

Benefits of technology

The calibration process has been simplified, the calibration speed and accuracy have been improved, and the cost has been reduced, enabling efficient and accurate calibration of laser galvanometers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118699543B_ABST
    Figure CN118699543B_ABST
Patent Text Reader

Abstract

This application relates to a spatial calibration method, apparatus, computer equipment, and storage medium for a laser galvanometer. The method includes: acquiring a target calibration position for marking a first calibration point; controlling the laser galvanometer to mark the first calibration point on a calibration medium at different heights based on the target calibration position; controlling a machine tool to move so that the laser galvanometer marks a second calibration point on the calibration medium at different heights; using a reference coordinate system constructed from the second calibration point as a reference, determining the actual calibration position of the marked first calibration point; for each first calibration point on the calibration medium at different heights, determining a spatial data relationship based on the target calibration position and the actual calibration position of the first calibration point, and using the spatial data relationship to correct the calibration position of the point to be processed. This method simplifies the laser galvanometer calibration process and enables rapid calibration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a spatial calibration method, apparatus, computer equipment, and storage medium for a laser galvanometer. Background Technology

[0002] A laser galvanometer system is an optical reflection device capable of precisely controlling the path of a laser beam. Thanks to advancements in laser galvanometer manufacturing, current processing technology has made a qualitative leap, expanding its applications from early planar laser marking to high-precision three-dimensional curved surface laser processing, laser 3D scanning, laser 3D positioning projection, laser dynamic tracking, and many other areas. Laser marking, with its advantages of precision, speed, and high clarity, is widely used in various industries such as medical, electronics, and automotive. During laser marking, a laser emits a laser beam, and a galvanometer controls its emission direction to mark specific target locations. Before laser marking, the galvanometer needs to be calibrated to ensure marking accuracy and complete the specific tasks in each application. However, traditional spatial calibration methods for laser galvanometers require steps such as correcting camera distortion and demand high precision in device installation, resulting in a cumbersome calibration process. Summary of the Invention

[0003] Therefore, it is necessary to provide a spatial calibration method, apparatus, computer equipment, and storage medium for laser galvanometers to address the aforementioned technical problems, which can simplify the calibration process of laser galvanometers and enable rapid calibration.

[0004] A spatial calibration method for a laser galvanometer, the method comprising:

[0005] Obtain the target marking position for marking the first calibration point, and control the laser galvanometer to mark the first calibration point on the calibration medium at different heights based on the target marking position;

[0006] Control the machine tool to move so that the laser galvanometer marks the second calibration point on the calibration medium at different heights;

[0007] Using the reference coordinate system constructed by the second calibration point as a reference, the actual calibration position of the first calibration point is determined;

[0008] For each of the first calibration points on the calibration medium at different heights, a spatial data relationship is determined based on the target marking position and the actual marking position of the first calibration point. The spatial data relationship is used to correct the marking position of the point to be processed.

[0009] A laser marking method, the method comprising:

[0010] Obtain the target marking position of the point to be processed;

[0011] The spatial offset corresponding to the target marking position of the point to be processed is determined based on the spatial data relationship;

[0012] Laser marking is performed by controlling the laser galvanometer based on the target marking position of the point to be processed and the spatial offset.

[0013] The spatial data relationship is determined based on the target marking position and the actual marking position of the first calibration point; the actual marking position of the first calibration point is determined based on the reference coordinate system constructed with the second calibration point as a reference; the first calibration point is marked by the laser galvanometer on calibration media at different heights based on the target marking position of the first calibration point; the second calibration point is determined by controlling the movement of the machine tool so that the laser galvanometer is marked on calibration media at different heights.

[0014] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of an embodiment of a spatial calibration method for each laser galvanometer.

[0015] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of an embodiment of a spatial calibration method for each laser galvanometer.

[0016] The aforementioned spatial calibration method, apparatus, computer equipment, and storage medium for laser galvanometers obtain a spatial calibration point by acquiring the target calibration position for marking the first calibration point and controlling the laser galvanometer to mark the first calibration point on calibration media at different heights. By controlling the movement of a machine tool, the laser galvanometer marks a second calibration point on calibration media at different heights. Using the reference coordinate system constructed by the second calibration point as a reference, the actual calibration position of the first calibration point is determined. That is, regardless of the tilt of the calibration media, controlling the movement of the machine tool on calibration media at different heights allows for the marking of an accurate and referable coordinate system, which can serve as a unified reference for locating the calibration point. The obtained actual calibration position is more accurate. Finally, based on the target calibration position and the actual calibration position of the first calibration point, a spatial data relationship is determined to correct the calibration position of the point to be processed. Through machine tool cooperation, the calibration process is greatly simplified, calibration speed is increased, calibration accuracy is high, and cost is low. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of a laser spatial scanning device in one embodiment;

[0018] Figure 2 This is a flowchart illustrating a spatial calibration method for a laser galvanometer in one embodiment;

[0019] Figure 3 This is a schematic diagram of the calibration pattern of the calibration points in one embodiment;

[0020] Figure 4 This is a schematic diagram of the calibration medium in one embodiment;

[0021] Figure 5 This is a schematic diagram of calibration points of the calibration medium at different heights in one embodiment;

[0022] Figure 6 This is a flowchart illustrating a laser marking method in one embodiment;

[0023] Figure 7 This is a flowchart illustrating the spatial calibration method for a laser galvanometer in another embodiment;

[0024] Figure 8 This is a schematic diagram of the process for extracting a pattern template in one embodiment;

[0025] Figure 9 This is a schematic diagram showing the location of the theoretical marking position on a plane in one embodiment.

[0026] Figure 10 This is a schematic diagram illustrating the acquisition of linear offsets in one embodiment;

[0027] Figure 11 This is a schematic diagram illustrating the acquisition of planar offset in one embodiment;

[0028] Figure 12 This is a schematic diagram illustrating the acquisition of spatial offset in one embodiment;

[0029] Figure 13 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0030] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0031] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0032] It should be noted that all directional indicators (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicator will also change accordingly. The connection can be a direct connection or an indirect connection.

[0033] Furthermore, the use of terms such as "first" and "second" in this application is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. If the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed in this application.

[0034] The terms "first," "second," etc., used in this application may be used herein to describe various data, but such data are not limited by these terms. These terms are only used to distinguish one set of data from another. For example, without departing from the scope of this application, a first calibration point may be referred to as a second calibration point, and similarly, a second calibration point may be referred to as a first calibration point. Both the first and second calibration points are calibration points, but they are not the same calibration point.

[0035] It is understood that the term "connection" in the following embodiments should be understood as "electrical connection," "communication connection," etc., if the connected circuits, modules, units, etc., have electrical signal or data transmission with each other.

[0036] The spatial calibration method for laser galvanometers provided in this application can be applied to, for example... Figure 1 In the application environment. Figure 1 This is a schematic diagram of a laser spatial scanning device in one embodiment. Figure 1 The system includes 1-a calibration medium, 2-a laser galvanometer system, and 3-a five-axis machine tool. The laser galvanometer system 2 includes a laser galvanometer and a scanner. The calibration medium is located on the five-axis machine tool, which moves the calibration medium. The scanner is used to acquire calibration images of the calibration medium. Figure 1 The coordinate system represented in the figure can be the machine tool coordinate system.

[0037] Figure 2 This is a flowchart illustrating a spatial calibration method for a laser galvanometer in one embodiment, demonstrating the application of this method... Figure 1 Taking a laser spatial scanning device as an example, the following steps are included:

[0038] Step 202: Obtain the target marking position for marking the first calibration point, and control the laser galvanometer to mark the first calibration point on the calibration medium at different heights based on the target marking position.

[0039] The target calibration position of the first calibration point is the spatial calibration position desired by the user, and also the theoretical spatial calibration position. The calibration medium itself represents a plane, such as the XY plane. Calibration media at different heights result in different z-values ​​for the calibration medium. The calibration medium is positioned at different heights by moving the motion platform along the z-axis.

[0040] Specifically, the laser spatial scanning device acquires the target marking position for marking the first calibration point. This target marking position can be input by the user in real time or pre-stored. For each calibration medium at different heights, during marking, the laser spatial scanning device changes the galvanometer control data of the laser galvanometer, controlling the laser galvanometer to mark the first calibration point on the calibration medium based on the target marking position.

[0041] Step 204: Control the machine tool to move so that the laser galvanometer marks the second calibration point on the calibration medium at different heights.

[0042] The pattern of the second calibration point differs from that of the first calibration point. The image includes both the first and second calibration points, and the calibration medium contains at least three non-collinear second calibration points. Specifically, these three second calibration points can represent the origin, the first axis direction, and the second axis direction, respectively.

[0043] like Figure 3 The figure shown is a schematic diagram of the calibration pattern of the calibration point in one embodiment. Figure 3 Figure (1) is the first calibration pattern used to characterize the first calibration point, and Figure (2) is the second calibration pattern used to characterize the second calibration point. It is understood that the patterns for the first and second calibration points are not the same. Furthermore, the patterns for the first and second calibration points may, but are not limited to, be... Figure 3 The pattern shown can also be a circle and square dot, a triangle and a rhombus dot, a flower-shaped dot and a triangle dot, etc., used to distinguish the first calibration point from the second calibration point.

[0044] like Figure 4 The diagram shown is a schematic of a calibration medium in one embodiment. Figure 4 This includes the first calibration point marked by the laser galvanometer in the laser coordinate system, and the second calibration point based on the machine tool coordinate system after the machine tool moves.

[0045] Figure 5This is a schematic diagram of calibration points on the calibration medium at different heights in one embodiment. Since the calibration space is three-dimensional, the area to be calibrated is divided into multiple two-dimensional calibration planes (i.e., calibration mediums) at specified intervals. Each calibration medium has multiple first calibration points and multiple second calibration points. The layout of the second calibration points can represent the origin, the first axis direction, and the second axis direction.

[0046] Specifically, the laser galvanometer system is fixedly set up. The laser galvanometer emits a laser beam. For each calibration medium at various heights, a motion platform holding the calibration medium moves. The direction of movement of the motion platform when calibrating the second calibration point on each calibration medium is the same. Thus, the laser galvanometer marks at least three non-collinear second calibration points on the calibration medium. The reference coordinate system represented by each second calibration point on the calibration medium is the same, for example, the origin, the first axis direction, and the second axis direction. It can be understood that the number of second calibration points on each calibration medium can be different. Similarly, the number of first calibration points on each calibration medium can also be different.

[0047] Step 206: Using the reference coordinate system constructed by the second calibration point as a reference, determine the actual calibration position of the first calibration point.

[0048] The actual marking position refers to the spatial marking position of the point marked by the laser galvanometer in the laser coordinate system. For example, the laser coordinate system can be a real-world coordinate system, such as a world coordinate system, a workpiece coordinate system, or a machine tool coordinate system. The actual marking position of the first calibration point is (x, y, z).

[0049] Specifically, using the reference coordinate system constructed by the second calibration point as a reference, the laser spatial scanning device determines the actual calibration position of the first calibration point on the laser coordinate system. The reference coordinate system can be an XY plane rectangular coordinate system, which is the XY plane under the laser coordinate system, thereby allowing the calculation of the actual calibration position of the first calibration point.

[0050] Step 208: Determine the spatial data relationship based on the target marking position and the actual marking position of the first calibration point. The spatial data relationship is used to correct the marking position of the point to be processed.

[0051] Specifically, the spatial data relationship can include the target marking position and the corresponding spatial offset. The laser spatial scanning device determines the spatial offset based on the target marking position and the actual marking position of the first calibration point, thus establishing the spatial data relationship between the target marking position and the spatial offset. It can be understood that the difference between the target marking position and the actual marking position is the spatial offset. After successful calibration, during laser marking, the laser spatial scanning device searches the spatial data relationship based on the user-input position of the point to be processed, obtains the spatial offset corresponding to the point to be processed, corrects the position of the point to be processed based on the position and the corresponding spatial offset, and controls the laser galvanometer to perform laser marking based on the modified position of the point to be processed.

[0052] Optionally, the spatial data relationship can include the target marking position and the actual marking position. Therefore, after successful calibration, during laser marking, the laser spatial scanning device searches the spatial data relationship based on the user-input position of the point to be processed, uses the position of the point to be processed as the actual marking position, determines the corresponding target marking position based on the position of the point to be processed, and controls the laser galvanometer to perform laser marking based on the target marking position corresponding to the point to be processed.

[0053] In this embodiment, by obtaining the target marking position for marking the first calibration point, the laser galvanometer is controlled to mark the first calibration point on the calibration medium at different heights, thus obtaining the spatial calibration point. By controlling the movement of the machine tool, the laser galvanometer marks the second calibration point on the calibration medium at different heights. Using the reference coordinate system constructed by the second calibration point as a reference, the actual marking position of the first calibration point is determined. That is, regardless of how skewed the calibration medium is, controlling the movement of the machine tool on the calibration medium at different heights can mark an accurate and referable coordinate system, which can be used as a unified reference to locate the position of the calibration point. The actual marking position of the obtained calibration point is more accurate. Then, based on the target marking position and the actual marking position of the first calibration point, the spatial data relationship is determined to correct the marking position of the point to be processed. With the cooperation of the machine tool, the calibration process is greatly simplified, the calibration speed is improved, the calibration accuracy is high, and the cost is low.

[0054] In one embodiment, determining the actual marking position of the first calibration point using a reference coordinate system constructed from the second calibration point as a reference includes: acquiring calibration images of each calibration medium; extracting a first pattern template and a second pattern template from the calibration images; the first pattern template is used to characterize the first calibration point, and the second pattern template is used to characterize the second calibration point; extracting corner points of each first calibration point based on the first pattern template; extracting corner points of each second calibration point based on the second pattern template; and determining the actual marking position of the corner point of the first calibration point using a reference coordinate system constructed from the corner points of the second calibration points as a reference.

[0055] The calibration image includes a first pattern template representing the first calibration point and a second pattern template representing the second calibration point. That is, all patterns for the first calibration point are identical, all being the first pattern; the first pattern template is the template for the first calibration point. The second calibration point is similarly described, and will not be elaborated further.

[0056] Specifically, the laser spatial scanning device acquires calibration images of the calibration medium at various altitudes using a scanner. The laser spatial scanning device extracts a first pattern template and a second pattern template from the calibration images using a template extraction algorithm. Based on the first pattern template, the laser spatial scanning device matches each first calibration point and then extracts the corner points of each first calibration point. Similarly, based on the second pattern template, the laser spatial scanning device matches each second calibration point and then extracts the corner points of each second calibration point. These corner points can be sub-pixel points. On the calibration image, using the reference coordinate system constructed from the corner points of the second calibration points as a reference, the actual marking position of the corner points of the first calibration points is determined.

[0057] In this embodiment, by extracting the first pattern template and the second pattern template from the calibration image, corner points of each first calibration point are extracted based on the first pattern template, and corner points of the second calibration point are extracted based on the second pattern template. Using the reference coordinate system constructed by the corner points of the second calibration point as a reference, the actual marking position of the corner points of the first calibration points is determined. Compared with the traditional method of directly extracting corner points, this embodiment first extracts the pattern template and then locates the corner points of the calibration points based on the pattern template. This can greatly reduce the probability of false detection and missed detection, greatly improve the accuracy of corner point extraction, and thus improve the accuracy of obtaining the calibration point position. At the same time, it simplifies the operation of preparing templates in advance and ensures that more accurate templates are used when extracting calibration points.

[0058] In one embodiment, extracting a first pattern template and a second pattern template from a calibration image includes: extracting a pattern template from the calibration image to obtain a first pattern template; matching the first pattern template with a pattern in the calibration image, and obtaining a first calibration point when the match is successful; and extracting a pattern template from the portion of the calibration image other than the first calibration point to obtain a second pattern template.

[0059] Specifically, the number of first calibration points is much greater than the number of second calibration points. Therefore, when the laser spatial scanning device extracts pattern templates from the calibration image, it extracts the first pattern template. After obtaining the first pattern template, it matches it with the pattern in the calibration image. When a similarity threshold is reached, i.e., a successful match is achieved, the first calibration point is obtained. The laser spatial scanning device can cover or remove the first calibration points, thus enabling it to extract pattern templates from the portion of the calibration image excluding the first calibration points, thereby obtaining the second pattern template.

[0060] In this embodiment, pattern templates are extracted from the calibration image to obtain a first pattern template, and pattern templates are extracted from the portion of the calibration image other than the first calibration point to obtain a second pattern template. Thus, two templates can be extracted from the calibration image to obtain the positions of the first calibration point and the second calibration point.

[0061] In one embodiment, extracting a pattern template from a calibration image to obtain a first pattern template includes: performing binarization processing on the calibration image to obtain a binarized calibration image; using each pattern in the binarized calibration image as a template, determining the intersection-union ratio (IU / R) of the remaining patterns with the templates respectively, and adding them together to obtain the sum of IU / Rs corresponding to each pattern; and using the pattern with the largest sum of IU / Rs as the first pattern template.

[0062] Specifically, since the calibration image contains an array of calibration patterns, the calibration image is binarized and filtered to obtain a binarized calibration image. The laser spatial scanning device uses each pattern in the binarized calibration image as a template, determines the intersection-union ratio (IU / U) of the remaining patterns with the templates, and adds them together to obtain the sum of IU / U. The laser spatial scanning device then determines the pattern with the maximum IU / U.S. and uses it as the first pattern template.

[0063] For example, if the calibration image includes patterns A, B, and C, then first, using pattern A as a template, determine the cross-union ratio (CUP) between patterns A and B, and between patterns A and C. The sum of these two CUP ratios yields the CUP ratio of pattern A. Then, using pattern B as a template, determine the CUP ratio between pattern B and A, and between pattern B and C. The sum of these two CUP ratios yields the CUP ratio of pattern B. Next, using pattern C as a template, determine the CUP ratio between pattern C and A, and between pattern C and B. The sum of these two CUP ratios yields the CUP ratio of pattern C. Finally, determine the pattern with the largest CUP ratio among the sums of CUP ratios for patterns A, B, and C, and use the pattern with the largest CUP ratio, such as pattern B, as the first pattern template.

[0064] In this embodiment, the calibration image is binarized, and each pattern in the binarized calibration pattern is used as a template. The intersection-union ratio (IUR) of the remaining patterns with the templates is determined and summed to obtain the sum of IURs for each pattern. The pattern with the largest sum of IURs is used as the first pattern template. Pattern extraction is performed using the first pattern template, which can extract all patterns in the calibration image that are similar to or the same as the template, thereby extracting the calibration points on the calibration image and avoiding missed or incorrect extraction.

[0065] In one embodiment, the pattern of the first calibration point includes intersecting first lines and second lines; extracting the corner points of each first calibration point based on the first pattern template includes: matching the first pattern template with the pattern in the calibration image, and obtaining the first calibration point when the match is successful; extracting lines from the first calibration point to obtain the first line and the second line; and determining the intersection point of the lines based on the first line and the second line to obtain the corner points of the first calibration point.

[0066] Specifically, both the first pattern template and the first calibration point include patterns formed by the intersection of the first and second lines. The intersection of the first and second lines results in corner points. Therefore, after extracting the first pattern template, it is matched with the pattern in the calibration image. When a similarity threshold is reached, i.e., a successful match, the first calibration point is obtained. The Steger algorithm is used to extract lines from the first calibration point, obtaining the first and second lines. For the first line, the intersection point with the second line is calculated, and the coordinates of this intersection point are extracted as sub-pixel corner points.

[0067] In this embodiment, by setting the pattern of the first calibration point as two intersecting lines, the first line and the second line are obtained by extracting the lines from the first calibration point, and the intersection point of the lines is determined. This makes it easier to obtain the corner point of the first calibration point, and the position of the extracted first calibration point is more accurate.

[0068] In one embodiment, determining the actual marking position of the corner point of the first calibration point by using the reference coordinate system constructed by the corner point of the second calibration point as a reference includes: using the reference coordinate system constructed by the corner point of the second calibration point as a reference to obtain the image marking position of the corner point of the first calibration point in the reference coordinate system; and converting the image marking position in the reference coordinate system into the actual marking position in the laser coordinate system.

[0069] The image marking position refers to the marked position shown on the image. The actual marking position is the marking position in the laser coordinate system. The laser coordinate system can be the world coordinate system, the workpiece coordinate system, the machine tool coordinate system, or other user-defined coordinate systems.

[0070] Specifically, the reference coordinate system constructed by the corner points of the second calibration point defines the origin, first axis direction, and second axis direction of the image. The position of the first calibration point in this reference coordinate system is the image marking position. The scanner has DPI (Dots Per Inch), and since the distance (mm) corresponding to one pixel is known, the actual marking position can be determined based on the image. The image marking position in the reference coordinate system, combined with the height of the calibration medium, can be converted into the actual marking position in the laser coordinate system.

[0071] In this embodiment, the reference coordinate system constructed by the corner point of the second calibration point is used as a reference to obtain the image marking position of the corner point of the first calibration point in the reference coordinate system. The image marking position in the reference coordinate system is converted into the actual marking position in the laser coordinate system. Since the plane of the reference coordinate system coincides with the plane in the laser coordinate system, the image marking position can be converted into the actual marking position in the laser coordinate system without affecting the calibration accuracy.

[0072] In one embodiment, such as Figure 6 The diagram shown is a flowchart of a laser marking method in one embodiment, including the following steps:

[0073] Step 602: Obtain the target marking position of the point to be processed.

[0074] Specifically, the location of the point to be processed refers to the target location in space required by the user. For example, it can be the location in the laser coordinate system, which can be the world coordinate system, machine tool coordinate system, workpiece coordinate system, or other custom coordinate system.

[0075] Step 604: Determine the spatial offset corresponding to the target marking position of the point to be processed based on the spatial data relationship.

[0076] Among them, the spatial data relationship is determined based on the target marking position and the actual marking position of the first calibration point; the actual marking position of the first calibration point is determined with reference to the reference coordinate system constructed by the second calibration point; the first calibration point is marked by the laser galvanometer on the calibration medium at different heights based on the target marking position of the first calibration point; the second calibration point is determined by controlling the movement of the machine tool so that the laser galvanometer is marked on the calibration medium at different heights.

[0077] Specifically, the laser spatial scanning device determines the spatial offset based on the target marking position and the actual marking position of the first calibration point, and establishes the spatial data relationship between the target marking position and the spatial offset. Therefore, the spatial data relationship includes the mapping relationship between the target marking position and the spatial offset of the point to be processed. Thus, the laser spatial scanning device performs trilinear interpolation based on the spatial data relationship and the target marking position of the point to be processed to obtain the spatial offset corresponding to the target marking position of the point to be processed.

[0078] Step 606: Control the laser galvanometer to perform laser marking based on the target marking position and spatial offset of the point to be processed.

[0079] Specifically, the laser spatial scanning device adds the target marking position and spatial offset of the point to be processed to obtain the compensated position, and controls the laser galvanometer to perform laser marking based on the compensated position so that the marking position is located at the target marking position.

[0080] In this embodiment, the target marking position of the point to be processed is obtained, the corresponding spatial offset is determined based on the spatial data relationship, the laser galvanometer is controlled to perform laser marking based on the target marking position and spatial offset of the point to be processed, and the offset is corrected using the spatial data relationship. The offset is corrected with a more accurate spatial offset, which improves the accuracy of laser marking.

[0081] In one embodiment, the difficulty of laser galvanometer calibration mainly lies in three aspects: (1) the laser galvanometer itself does not have the ability to interact with external information; (2) the calibration of the laser galvanometer requires the aid of external measurement equipment such as visual measurement; (3) when the laser galvanometer needs to scan in three-dimensional space, the position of the three-dimensional object is no longer fixed, and the galvanometer cannot be calibrated solely by establishing the correspondence between the galvanometer deflection and a point on a certain plane. Therefore, this embodiment provides a spatial calibration method for laser galvanometers. By combining a high-precision five-axis machine tool with a laser galvanometer system to mark calibration points, and using template matching and line segment extraction algorithms to extract calibration points, the error between the target calibration point and the actual calibration point is calculated, thereby correcting the error of the laser galvanometer's marking points. Taking the calibration medium as a calibration sheet as an example, such as Figure 7 The diagram shown is a flowchart of a spatial calibration method for a laser galvanometer in another embodiment, including the following steps:

[0082] Step 1: Control the five-axis machine tool to mark calibration points on the calibration plate at given intervals along the z-axis direction.

[0083] The spatial calibration of the galvanometer system is corrected by defining calibration points along the z-axis of the machine tool spindle on multiple height planes in the [-z, z] space. For example... Figure 4 As shown, two sets of patterns are marked on the calibration plate when marking calibration points: one set is a square array pattern in the laser coordinate system, and the other set is a linear array pattern in the high-precision machine tool coordinate system. The purpose of marking the square array in the laser coordinate system is to obtain the actual marking situation of the laser galvanometer. The purpose of marking the points in the machine tool coordinate system is to mark the patterns in the horizontal and vertical directions on the calibration plate under the five-axis machine tool movement marking, thereby constructing an XY plane rectangular coordinate system on the calibration card, that is, the theoretical XY plane in the laser coordinate system (when aligned, the XY plane in the laser coordinate system coincides with the XY plane in the machine tool coordinate system), so as to calculate the error between the actual marking points and the theoretical marking points of the current laser galvanometer system.

[0084] like Figure 3As shown: To facilitate the extraction of calibration points in subsequent steps, two calibration patterns were used during calibration to distinguish between calibration points in the laser coordinate system and calibration points in the machine tool coordinate system. The specific calibration steps are as follows: First, control the machine tool equipped with the laser galvanometer system to reach the target calibration position. Then, activate the laser galvanometer system to calibrate the points in the laser coordinate system. After calibration, control the machine tool to move the calibrated points in the machine tool coordinate system. (See diagram). Figure 5 The diagram shows the marking of two different patterns. After marking the two patterns, a QR code pattern at the corresponding height needs to be marked to store the marking depth information and obtain 3D points. Once one marking cycle is complete, the machine tool is moved a specified step length to another plane at a different height for marking. The above steps are repeated until the desired image is acquired, completing the pattern marking process.

[0085] Step 2: Scan the image and extract the corner points of the calibration points using template matching and line segment extraction methods.

[0086] The corresponding image is obtained by scanning the calibration plate and the depth information of the image is obtained by detecting the QR code of the image. The images are then sorted according to the size of the z value.

[0087] Because traditional corner detection algorithms can produce false positives and false negatives, this invention employs a template matching algorithm combined with line segment endpoint extraction to extract sub-pixel corner points of the pattern in order to achieve high-precision corner point extraction. Before pattern extraction, a template for template matching is extracted. The template is automatically generated using existing algorithms, simplifying the pre-preparation of templates and ensuring that a relatively accurate template is used for each matching operation. The template extraction algorithm is implemented as follows:

[0088] Since the image is an array pattern composed of a series of calibration images, this paper extracts the template based on the idea of ​​cross-union ratio (CUR). First, an CUR calculation algorithm is defined:

[0089]

[0090] In the above formula, Given two identical binary image matrices, the IOU integral for each region is calculated using this method.

[0091]

[0092] Finally, when extracting the template region, the following conditions must be met:

[0093]

[0094] In general, the implementation steps are as follows: Figure 8 The diagram shown is a flowchart illustrating the process of extracting a pattern template in one embodiment:

[0095] a. Input spatial calibration image: Perform adaptive threshold segmentation on the spatial calibration image to obtain a binary image.

[0096] b. Traverse all regions in the binary image and filter out noise regions that are too large or too small.

[0097] c. Treat each region as a mother plate in turn, and calculate the sum of the intersection and union ratios of the remaining regions with the mother plate.

[0098] d. Find the region with the maximum sum of intersection-to-union ratios.

[0099] e. Template extraction successful: The region with the maximum sum of intersection-union ratios is used as the template for the pattern array, and the template extraction is successful.

[0100] f. Template matching to obtain N calibration pattern regions: After template extraction is completed, the template is used for calibration pattern extraction. Template matching is performed to extract all N calibration pattern regions in the calibration image.

[0101] g. Input the i-th calibration pattern region: Extract sub-pixel corner points for each calibration pattern region i. The specific implementation method is as follows:

[0102] h. Steger algorithm for extracting corner lines: The Steger algorithm is used to extract straight lines from the i-th calibration pattern region.

[0103] i. Among the extracted lines, filter out the horizontal and vertical lines.

[0104] j. For each horizontal line, calculate its intersection with the vertical line.

[0105] k. Extract the coordinates of the intersection point as the sub-pixel corner coordinates.

[0106] l. Corner point sorting: When i > N, sort the sub-pixel corner point coordinates and output the sub-pixel corner point coordinates.

[0107] Step 3: Combine the calibration points in the machine tool coordinate system to obtain a correction table based on the target marking position and the actual marking position.

[0108] After completing the above-described steps of extracting calibration points for each plane's calibration image, a coordinate system is constructed by combining the extracted calibration points in the machine tool coordinate system, thus obtaining the actual marking position on each plane. Combined with the target marking position obtained when calibrating the laser coordinate system in step one, a calibration table is obtained. By reading the data from the calibration table, the offset of the galvanometer system at any position in the [-z, z] space can be calculated.

[0109] Step 4: Calculate the error between the ideal calibration point and the actual calibration point.

[0110] The aforementioned ideal calibration point is the target calibration point. After completing the above calibration point extraction steps for each plane calibration diagram, a coordinate system is constructed by combining the extracted calibration points in the machine tool coordinate system. To calculate the error between the ideal coordinate point and the actual coordinate point, it is first necessary to define the error calculation method. Common error calculation methods include root mean square error (RMSE), mean absolute error (MAE), and mean square error (MSE). Taking root mean square error as an example, assuming the ideal coordinate point is (xi,yi,zi) and the actual coordinate point is (xi', yi',zi'), then RMSE can be calculated using the following formula:

[0111] RMSE = sqrt((∑(xi-xi')^2+∑(yi-yi')^2+∑(zi-zi')^2) / n)

[0112] Where n is the number of coordinate points. This allows us to obtain the error between the actual and theoretical marked positions on each plane.

[0113] Step 5: During the marking process, correct the position of the point to be processed according to the calibration table.

[0114] During subsequent calibration, the position of the theoretical point in space can be calculated, and the compensation offset data can be calculated using a correction table, making the calibration closer to the theoretical position. This invention calculates the compensation offset data based on the idea of ​​linear interpolation, and its specific implementation is as follows:

[0115] like Figure 9 The diagram shows the position of the theoretical marking location on a plane in one embodiment. The known offsets are in both the X and Y directions. For a processing point PΔ with an unknown offset, it will fall into a cell in a correction table as follows: the four vertices of this cell are the four theoretical marking points, and the offsets of each point from the actual marking points have been measured.

[0116] For the offset in a single direction, the offset between two adjacent positions can be obtained through measurement. A one-dimensional linear function can be constructed to predict the offset at a certain position between the two points, such as... Figure 10 The image shown is a schematic diagram illustrating the acquisition of linear offsets in one embodiment:

[0117] Given that the offsets of x0 and x1 in the x-direction are b0 and b1 respectively, the following relationship can be established:

[0118]

[0119] This allows us to estimate the positional offset in the x-direction. Similarly, the offset in the y-direction can be obtained in the same way, as shown in the following implementation method. Figure 11 The diagram shown is a schematic diagram of obtaining the plane offset in one embodiment: When calculating the offset of PΔ, the offsets of Pa, Pb, Pc, and Pd are calculated along the directions of P1P2, P4P3, P4P1, and P3P2 respectively, and then the offset of PΔ is calculated using PbPa and PcPd.

[0120] The above describes the process of obtaining the offset of the point to be processed on a plane. However, the marking method is spatial marking. For the spatial compensation offset solution, the same approach can be used. First, analyze how the spatial marking points fall into the correction table, such as... Figure 12 The diagram illustrates the acquisition of spatial offset in one embodiment: Based on the planar offset calculation process in the two-dimensional coordinate system described above, the offset errors of Pa and Pb are calculated respectively. Then, the error offset of PΔ is calculated along the PbPa direction. This is the process by which the compensation offset of the point to be processed is calculated using a correction table. During calibration, the compensation offset of each point to be processed is predicted in real time through this calculation process, thereby improving the accuracy of the calibration.

[0121] This embodiment proposes a spatial calibration method and system for laser galvanometers. The laser galvanometer system is mounted on a high-precision five-axis machine tool. By controlling the machine tool's movement and marking calibration points on a calibration plate, the coordinates of these calibration points are extracted after image scanning. The calibration error is then calculated to correct the galvanometer. The method proposed in this embodiment solves problems such as poor calibration quality, long calibration time, and high calibration difficulty. The entire calibration process is fully automated and intelligent, improving the calibration efficiency and accuracy of the laser galvanometer system, significantly reducing calibration time, and lowering the technical requirements for operators.

[0122] The method proposed in this embodiment is mounted on a high-precision five-axis machine tool, thus ensuring the positional accuracy of the laser galvanometer during moving and marking, and enabling large-scale calibration. The marking and calibration process is stable and fast. Compared to the problems of small machine tool movement range and blurred images caused by using monocular or binocular cameras to acquire images, this embodiment perfectly solves these problems by using a high-precision scanner to scan images and store depth information using QR codes. This embodiment also perfectly solves the problems of inaccurate corner detection and false positives / false negatives caused by traditional corner detection algorithms by combining template matching and line segment extraction methods. Therefore, the method proposed in this embodiment has wide applicability, a simple and stable calibration process, and a small amount of computational data. The entire calibration process is fully automated and intelligent, improving the calibration efficiency and accuracy of the laser galvanometer system.

[0123] In one embodiment, a spatial calibration method for a laser galvanometer includes:

[0124] Step (a1): Obtain the target marking position for marking the first calibration point, and control the laser galvanometer to mark the first calibration point on the calibration medium at different heights based on the target marking position.

[0125] Step (a2): Control the machine tool to move so that the laser galvanometer marks the second calibration point on the calibration medium at different heights.

[0126] Step (a3): Obtain calibration images of each calibration medium captured by the scanner.

[0127] Step (a4): Binarize the calibration image to obtain a binarized calibration image.

[0128] Step (a5): Using each pattern in the binarized calibration image as a template, determine the intersection-union ratio (IU) of the remaining patterns with the templates, and add them together to obtain the sum of the IU of each pattern.

[0129] Step (a6) uses the pattern with the maximum sum of intersection-to-union ratios as the first pattern template.

[0130] Step (a7): Match the first pattern template with the pattern in the calibration image. When the match is successful, obtain the first calibration point.

[0131] Step (a8): Extract lines from the first calibration point to obtain the first line and the second line.

[0132] Step (a9): Determine the intersection point of the lines based on the first line and the second line to obtain the corner point of the first calibration point.

[0133] Step (a10): Extract pattern templates from the portion of the calibration image other than the first calibration point to obtain a second pattern template; the first pattern template is used to represent the first calibration point, and the second pattern template is used to represent the second calibration point.

[0134] Step (a11): Extract the corner points of each second calibration point based on the second pattern template.

[0135] Step (a12): Using the reference coordinate system constructed by the corner point of the second calibration point as a reference, obtain the image marking position of the corner point of the first calibration point in the reference coordinate system.

[0136] Step (a13) converts the image marking position in the reference coordinate system into the actual marking position in the laser coordinate system.

[0137] Step (a14): For each first calibration point on the calibration medium at different heights, determine the spatial data relationship based on the target calibration position and the actual calibration position of the first calibration point. The spatial data relationship is used to correct the calibration position of the point to be processed.

[0138] In this embodiment, regardless of the tilt of the calibration medium, controlling the machine tool movement on calibration media at different heights allows for the marking of a precise and referable coordinate system, which can serve as a unified reference for locating calibration points. The actual marked positions of the obtained calibration points are more accurate. Then, based on the target marked position and the actual marked position of the first calibration point, a spatial data relationship is determined to correct the marked position of the point to be processed. Through machine tool cooperation, the calibration process is greatly simplified, calibration speed is increased, and calibration accuracy is high while cost is low. By combining template matching with line segment extraction, the problems of inaccurate corner detection and false positives / missed negatives caused by traditional corner detection algorithms are perfectly solved. Therefore, the method proposed in this embodiment has wide applicability, a simple and stable calibration process, and a small amount of computational data. The entire calibration process is fully automated and intelligent, improving the calibration efficiency and accuracy of the laser galvanometer system.

[0139] It should be understood that, although the above Figure 2 , Figure 6 , Figure 7 and Figure 8 In the flowchart, the steps are shown sequentially according to the arrows, and the steps (a1) to (a14) are shown sequentially according to their numbers. However, these steps are not necessarily executed in the order indicated by the arrows or numbers. Unless otherwise specified in this document, there is no strict order requirement for the execution of these steps; they can be executed in other orders. Figure 2 , Figure 6 , Figure 7 and Figure 8 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.

[0140] In one embodiment, a laser galvanometer calibration apparatus includes a processor, a laser galvanometer, a motion platform, and a scanner. The processor is connected to the laser galvanometer, the motion platform, and the scanner. A calibration medium is mounted on the motion platform. When the processor executes a computer program, it implements the steps of the above-described method embodiments. Specific limitations regarding the laser galvanometer calibration apparatus can be found in the limitations of the laser galvanometer calibration methods described above, and will not be repeated here.

[0141] In one embodiment, a computer device is provided, which may be a terminal device, and its internal structure diagram may be as follows: Figure 13As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a spatial calibration method for a laser galvanometer. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0142] Those skilled in the art will understand that Figure 13 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0143] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method embodiments.

[0144] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method embodiments.

[0145] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the steps in the above method embodiments.

[0146] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes described in the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0147] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A spatial calibration method for a laser galvanometer, characterized in that, The method includes: Obtain the target marking position for marking the first calibration point, and control the laser galvanometer to mark the first calibration point on the calibration medium at different heights based on the target marking position; Control the machine tool to move so that the laser galvanometer marks the second calibration point on the calibration medium at different heights; Using the reference coordinate system constructed by the second calibration point as a reference, the actual calibration position of the first calibration point is determined; For each of the first calibration points on the calibration medium at different heights, a spatial data relationship is determined based on the target marking position and the actual marking position of the first calibration point. The spatial data relationship is used to correct the marking position of the point to be processed.

2. The method according to claim 1, characterized in that, The step of determining the actual marking position of the first marking point by using the reference coordinate system constructed with the second calibration point as a reference includes: Acquire the calibration images of each of the calibration media; Extract a first pattern template and a second pattern template from the calibration image; the first pattern template is used to represent the first calibration point, and the second pattern template is used to represent the second calibration point; Extract the corner points of each of the first calibration points based on the first pattern template; Extract the corner points of each of the second calibration points based on the second pattern template; Using the reference coordinate system constructed by the corner point of the second calibration point as a reference, the actual marking position of the corner point of the first calibration point is determined.

3. The method according to claim 2, characterized in that, The extraction of the first pattern template and the second pattern template from the calibration image includes: The calibration image is subjected to pattern template extraction to obtain a first pattern template; The first pattern template is matched with the pattern in the calibration image. When the match is successful, the first calibration point is obtained. The second pattern template is obtained by extracting the pattern template from the portion of the calibration image excluding the first calibration point.

4. The method according to claim 3, characterized in that, The step of extracting a pattern template from the calibration image to obtain a first pattern template includes: The calibration image is binarized to obtain a binarized calibration image; Each pattern in the binarized calibration image is used as a template. The intersection-union ratio (IUU) of the remaining patterns with the templates is determined and summed to obtain the sum of IUU for each pattern. The pattern with the largest sum of intersection-to-union ratios is used as the first pattern template.

5. The method according to claim 2, characterized in that, The pattern of the first calibration point includes intersecting first and second lines; The step of extracting corner points of each of the first calibration points based on the first pattern template includes: The first pattern template is matched with the pattern in the calibration image. When the match is successful, the first calibration point is obtained. Line extraction is performed on the first calibration point to obtain the first line and the second line; Based on the first line and the second line, the intersection point of the lines is determined, and the corner point of the first calibration point is obtained.

6. The method according to claim 2, characterized in that, The step of determining the actual marked position of the corner point of the first calibration point by using the reference coordinate system constructed with the corner point of the second calibration point as a reference includes: Using the reference coordinate system constructed by the corner point of the second calibration point as a reference, the image marking position of the corner point of the first calibration point in the reference coordinate system is obtained; The image marking position in the reference coordinate system is converted into the actual marking position in the laser coordinate system.

7. A laser marking method, characterized in that, The method includes: Obtain the target marking position of the point to be processed; The spatial offset corresponding to the target marking position of the point to be processed is determined based on the spatial data relationship; Laser marking is performed by controlling the laser galvanometer based on the target marking position of the point to be processed and the spatial offset. The spatial data relationship is determined based on the target marking position and the actual marking position of the first calibration point; the actual marking position of the first calibration point is determined with reference to the reference coordinate system constructed by the second calibration point; the first calibration point is marked by the laser galvanometer on calibration media at different heights based on the target marking position of the first calibration point; the second calibration point is determined by controlling the movement of the machine tool so that the laser galvanometer is marked on calibration media at different heights.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Calibration method, device and equipment of laser galvanometer system and medium

    CN117788607A