Galvanometer correction method and device, laser marking machine and storage medium

By extracting and fitting the coordinate point set of the feature pattern region of the target image in the laser marking machine, constructing a mapping map and performing weighted processing, the problem of deviation between theoretical commands and actual positions in the galvanometer control system is solved, thereby improving the processing accuracy and yield of the laser marking machine.

CN120985153BActive Publication Date: 2026-01-06SHENZHEN ZHENHUAXING INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511539048.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-01-06
Estimated Expiration
2045-10-27

AI Technical Summary

Technical Problem

In applications such as laser marking, laser welding, and PCB micromachining, the theoretical command coordinates and the actual laser action position in the galvanometer control system are significantly deviated due to factors such as nonlinear distortion of the optical system, mechanical installation errors, and temperature drift, which affects the yield and precision of the workpiece.

Method used

By extracting the contour coordinate point sets of the first and second target regions of the feature pattern in the target image, performing fitting processing, constructing a mapping map and performing weighted processing, the final coordinate information of the coordinate point to be laser-etched in the corresponding coordinate system of the target image is determined, so as to correct the position deviation of the galvanometer.

Benefits of technology

It improves the precision of workpiece processing and yield, reduces positional deviations caused by optical distortion and mechanical errors, and ensures the processing accuracy of laser marking machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120985153B_ABST
    Figure CN120985153B_ABST
Patent Text Reader

Abstract

The application discloses a galvanometer correction method and device, a laser marking machine and a storage medium, comprising: extracting the contour coordinate point set of the first target region and the second target region in each feature pattern in the target image; fitting the fitting straight line of the first target region and the second target region according to the contour coordinate point set, and determining the actual coordinate information of each feature pattern in the target image corresponding coordinate system according to the intersection of the fitting straight line; constructing a mapping diagram according to the corresponding mapping relationship between the actual coordinate information and the theoretical coordinate information of each feature pattern; determining the target coordinate information of the multiple points in the target image corresponding coordinate system according to the mapping diagram and the coordinate information of the multiple points associated with the to-be-radiation coordinate point in the theoretical drawing corresponding coordinate system; and determining the final coordinate information of the to-be-radiation coordinate point in the target image corresponding coordinate system according to the target coordinate information. The final coordinate information is determined by the multiple points associated with the to-be-radiation coordinate point.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of laser marking machine control, and more specifically, to a galvanometer correction method, apparatus, laser marking machine, and storage medium. Background Technology

[0002] In modern precision machining, especially in applications such as laser marking, laser welding, and PCB micromachining, galvanometer scanning systems are widely used to achieve high-speed, high-precision beam positioning. The galvanometer guides the laser beam across the machining plane by controlling the angle of the reflector, thereby completing processing operations such as pattern inscription or material handling.

[0003] However, due to factors such as nonlinear distortion of the optical system (e.g., barrel distortion, pincushion distortion), mechanical installation errors, platform unevenness, and temperature drift, there is often a significant deviation between the theoretical command coordinates and the actual laser action position in the galvanometer control system. For example, according to the theoretical command coordinates, machining should be performed at position A on the workpiece, but in reality, machining occurs at a position deviating from A. This affects the yield or precision of the workpiece. Summary of the Invention

[0004] In view of the above problems, this application proposes a galvanometer correction method, device, laser marking machine and storage medium to solve the above technical problems.

[0005] In a first aspect, embodiments of this application provide a galvanometer calibration method applied to a laser marking machine. The laser marking machine includes a laser, a galvanometer, a worktable, and an image acquisition device. The laser emits laser light to the galvanometer, which reflects the laser light onto a workpiece on the worktable according to a theoretical drawing, to process multiple feature patterns on the workpiece. The image acquisition device acquires a target image of the workpiece containing multiple feature patterns. The method includes: extracting the contour coordinate point sets corresponding to a first target region and a second target region in each feature pattern of the target image according to a preset extraction algorithm and a theoretical drawing; wherein the first target region and the second target region are interleaved; and performing fitting processing on the contour coordinate point sets corresponding to the first target region and the second target region respectively to obtain... Fitted lines are obtained for the first and second target regions, respectively. The actual coordinates of each feature pattern in the target image coordinate system are determined based on the intersection of the fitted lines corresponding to each feature pattern. A mapping diagram is constructed based on the mapping relationship between the actual coordinates and theoretical coordinates of each feature pattern. The theoretical coordinates are the coordinates of each feature pattern in the theoretical image in the coordinate system corresponding to the theoretical image. Based on the mapping diagram and the coordinates of multiple points associated with the laser-to-be-lased coordinate points in the coordinate system corresponding to the theoretical image, the target coordinates of multiple points in the target image coordinate system are determined. The target coordinates are weighted to determine the final coordinates of the laser-to-be-lased coordinate points in the target image coordinate system.

[0006] Secondly, embodiments of this application also provide a laser marking machine, including a laser, a galvanometer, a worktable, and an image acquisition device; the laser is used to emit laser light to the galvanometer; the galvanometer is used to reflect the laser light onto a workpiece on the worktable according to a theoretical drawing, so as to laser process multiple feature patterns on the workpiece; the image acquisition device is used to acquire a target image of the workpiece containing multiple feature patterns; the controller is used to extract the contour coordinate point sets corresponding to the first target region and the second target region in each feature pattern of the target image according to a preset extraction algorithm and a theoretical drawing; wherein the first target region and the second target region are interleaved; the controller is also used to perform fitting processing on the contour coordinate point sets corresponding to the first target region and the second target region respectively to obtain the first target region and the second target region. The controller is used to determine the actual coordinates of each feature pattern in the coordinate system corresponding to the target image based on the intersection of the fitted lines corresponding to each feature pattern. It also constructs a mapping diagram based on the mapping relationship between the actual coordinates and theoretical coordinates of each feature pattern. The theoretical coordinates are the coordinates of each feature pattern in the theoretical drawing file in the coordinate system corresponding to the theoretical drawing file. Furthermore, the controller determines the target coordinates of multiple points in the coordinate system corresponding to the target image based on the mapping diagram and the coordinates of multiple points associated with the laser-to-be-lased point in the coordinate system corresponding to the theoretical drawing file. Finally, the controller performs weighted processing based on the target coordinates to determine the final coordinates of the laser-to-be-lased point in the coordinate system corresponding to the target image.

[0007] Thirdly, this application also provides a galvanometer correction device applied to a laser marking machine. The laser marking machine includes a laser, a galvanometer, a worktable, and an image acquisition device. The laser emits laser light to the galvanometer, which reflects the laser light onto a workpiece on the worktable according to a theoretical drawing, to process multiple feature patterns on the workpiece. The image acquisition device acquires a target image of the workpiece containing multiple feature patterns. The device includes: an extraction module, used to extract the contour coordinate point sets corresponding to a first target region and a second target region in each feature pattern of the target image according to a preset extraction algorithm and a theoretical drawing; wherein the first target region and the second target region are interleaved; and a fitting module, used to perform fitting processing on the contour coordinate point sets corresponding to the first target region and the second target region to obtain a first... The system consists of a target region and a second target region, each with its corresponding fitted straight lines. The actual coordinates of each feature pattern in the target image's coordinate system are determined based on the intersection of the fitted straight lines. A construction module is used to construct a mapping diagram based on the mapping relationship between the actual and theoretical coordinates of each feature pattern. The theoretical coordinates are the coordinates of each feature pattern in the theoretical drawing file in the coordinate system corresponding to that point. A conversion module is used to determine the target coordinates of multiple points in the target image's coordinate system based on the mapping diagram and the coordinates of multiple points associated with the laser-to-be-lased point in the coordinate system corresponding to that point. A determination module is used to perform weighted processing based on the target coordinates to determine the final coordinates of the laser-to-be-lased point in the target image's coordinate system.

[0008] Fourthly, embodiments of this application also provide a laser marking machine, including a processor, a memory, and one or more application programs; the one or more application programs are stored in the memory and configured to be executed by the processor to implement the above-described galvanometer correction method.

[0009] Fifthly, embodiments of this application also provide a computer-readable storage medium storing program code, wherein the above-described galvanometer correction method is executed when the program code is run by a processor.

[0010] The technical solution provided in this application is applied to a laser marking machine, which includes a laser, a galvanometer, a worktable, and an image acquisition device. The laser emits laser light into the galvanometer, which reflects the laser light onto a workpiece on the worktable according to a theoretical drawing, thereby processing multiple feature patterns on the workpiece. The image acquisition device acquires a target image of the workpiece containing multiple feature patterns. The method includes: extracting the contour coordinate point sets corresponding to a first target region and a second target region in each feature pattern of the target image according to a preset extraction algorithm and a theoretical drawing; wherein the first target region and the second target region are interleaved; and performing fitting processing on the contour coordinate point sets corresponding to the first target region and the second target region to obtain the first target region. The fitted lines corresponding to the domain and the second target region are respectively used to determine the actual coordinate information of each feature pattern in the coordinate system corresponding to the target image based on the intersection of the fitted lines corresponding to each feature pattern. A mapping map is constructed based on the mapping relationship between the actual coordinate information and the theoretical coordinate information of each feature pattern. The theoretical coordinate information is the coordinates of each feature pattern in the theoretical image file in the coordinate system corresponding to the theoretical image file. Based on the mapping map and the coordinate information of multiple points associated with the laser-to-be-lased coordinate point in the coordinate system corresponding to the theoretical image file, the target coordinate information of multiple points in the coordinate system corresponding to the target image is determined. Weighted processing is performed based on the target coordinate information to determine the final coordinate information of the laser-to-be-lased coordinate point in the coordinate system corresponding to the target image. Thus, the final coordinate information of the laser-to-be-lased coordinate point in the coordinate system corresponding to the target image is determined by multiple points associated with the laser-to-be-lased coordinate point. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments and drawings obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0012] Figure 1 A schematic diagram of the structure of a laser marking machine according to an embodiment of this application is shown.

[0013] Figure 2 A schematic diagram of the structure of a target image according to an embodiment of this application is shown.

[0014] Figure 3 A schematic flowchart of a galvanometer correction method provided in an embodiment of this application is shown.

[0015] Figure 4 A schematic diagram of the structure of another target image involved in an embodiment of this application is shown.

[0016] Figure 5 A schematic diagram of a mapping diagram according to an embodiment of this application is shown.

[0017] Figure 6 A schematic diagram of a galvanometer correction device provided in an embodiment of this application is shown.

[0018] Figure 7 A schematic diagram of the structure of a laser marking machine provided in an embodiment of this application is shown.

[0019] Figure 8 This illustration shows a schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation

[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0021] The following describes the application scenarios of the galvanometer correction method provided in the embodiments of the present invention.

[0022] Please see Figure 1 , Figure 1 A schematic diagram of the structure of a laser marking machine according to an embodiment of this application is shown, as follows: Figure 1 As shown, the laser marking machine 100 includes a laser 110, a galvanometer 120, a worktable 130, and an image acquisition device 140.

[0023] The laser 110 is used to emit laser light to the galvanometer 120; the galvanometer 120 is used to reflect the laser light onto the workpiece on the worktable 130 according to the theoretical drawing, so as to form multiple feature patterns on the surface of the workpiece; and the image acquisition unit 140 is used to acquire the target image of the workpiece containing multiple feature patterns.

[0024] The theoretical image file includes multiple uniformly distributed feature patterns with identical dimensions and other information. These feature patterns can be white crosses, white dots, or white squares, etc. This application uses a white cross as an example for illustration. The target image also includes multiple uniformly distributed white crosses, and normally the white crosses in the target image have identical dimensions and other information.

[0025] In some implementations, the image acquisition device 140 can be a camera.

[0026] In some embodiments of this application, the workpiece can be black ink paper. In other embodiments, the workpiece can be an FPC flexible circuit board. It is understood that this application does not limit the specific material of the workpiece.

[0027] For example, a user can input a theoretical drawing file containing multiple feature patterns into the laser marking machine 100. The laser marking machine 100 processes the workpiece at the position corresponding to the theoretical coordinate information by means of the cooperation between the laser 110 and the galvanometer 120, based on the theoretical coordinate information of each feature pattern in the theoretical drawing file (e.g., CAD drawing file).

[0028] The coordinate system corresponding to the theoretical drawing is the ideal coordinate system or design coordinate system, also known as the nominal coordinate system. This coordinate system is defined based on design parameters (such as processing area, marker spacing, etc.), assuming that the system is free from optical distortion, mechanical errors, or installation deviations, and that all feature points are precisely distributed according to a preset layout. The theoretical coordinate information of a point or a feature pattern is its expected position on the processing plane under this coordinate system.

[0029] In some implementations, the workpiece is black. Multiple feature patterns machined onto the workpiece are white.

[0030] Through the cooperation between the laser 110 and the galvanometer 120, each of the multiple feature patterns is processed on the workpiece. Since the system is free from optical distortion, mechanical errors or installation deviations, the actual coordinate information of each feature pattern on the workpiece deviates from its corresponding theoretical coordinate information.

[0031] The aforementioned actual coordinate information is extracted from the actual captured image using image processing techniques. This reflects the real-world situation, including deviations caused by factors such as optical distortion, mechanical errors, and platform unevenness. The coordinate system corresponding to the actual coordinate information can be called the physical coordinate system or the camera coordinate system. It is based on the real image captured by the camera and determined through a series of image processing steps (such as binarization, contour extraction, and center localization).

[0032] Image acquisition device 140 acquires images of a workpiece containing multiple feature patterns to obtain a target image. Then, through a series of image processing steps, the actual position information corresponding to each feature pattern is determined. For example, please refer to... Figure 2 , Figure 2 This illustration shows a structural diagram of a target image according to an embodiment of this application, such as... Figure 2 As shown, the target image contains nine crosses. Through a series of image processing steps, the actual position coordinates of the nine crosses are determined.

[0033] Then, by using the relationship between the actual position coordinates corresponding to the feature pattern and its corresponding theoretical position coordinates, the coordinates of the point to be laser-etched, located in the coordinate system corresponding to the theoretical image, are corrected, thereby obtaining the final coordinate information of the point to be laser-etched in the coordinate system corresponding to the target image. Specifically:

[0034] Please see Figure 3 , Figure 3 A schematic flowchart of a galvanometer correction method provided in an embodiment of this application is shown, which can be applied to the aforementioned laser marking machine. Figure 3 As shown, the method may include steps 210 to 250.

[0035] In step 210, according to the preset extraction algorithm and theoretical image file, the contour coordinate point set corresponding to the first target region and the second target region in each feature pattern of the target image is extracted respectively.

[0036] The first target area and the second target area are set up in an overlapping manner.

[0037] In some implementations, the preset extraction algorithm can be the Canny edge detection algorithm. In some implementations, the preset extraction algorithm can be the Sobel operator. It is understood that this application does not limit the specific algorithm of the preset extraction algorithm.

[0038] In some embodiments, the feature pattern can be a cross mark. It is understood that this application does not limit the specific shape of the feature pattern. For ease of description, this application uses a cross mark as an example. The first target area of ​​a feature pattern (i.e., the feature pattern on the theoretical drawing and the target image) can be the horizontal area of ​​the cross mark. The second target area of ​​a feature pattern (i.e., the feature pattern on the theoretical drawing and the target image) can be the vertical area of ​​the cross mark.

[0039] For example, please refer to Figure 4 , Figure 4 This illustration shows a structural schematic diagram of another target image involved in an embodiment of this application, such as... Figure 4 As shown, the target image includes feature pattern A and feature pattern B. The first target region in feature pattern A is A1 (the entire horizontal region of feature pattern A), and the second target region in feature pattern A is A2 (the entire vertical region of feature pattern A). The first target region in feature pattern B is B1 (the entire horizontal region of feature pattern B), and the second target region in feature pattern B is B2 (the entire vertical region of feature pattern B).

[0040] The set of contour coordinate points corresponding to the first target region is the set of coordinates of points on the contour of the first target region; the set of contour coordinate points corresponding to the second target region is the set of coordinates of points on the contour of the second target region. For example, if the points on the contour of the first target region of a certain feature pattern include first coordinate point information, second coordinate point information, third coordinate point information, ..., nth coordinate point information, then the set of contour coordinate points corresponding to the first target region is (first coordinate point information, second coordinate point information, third coordinate point information, ..., nth coordinate point information).

[0041] Furthermore, in some implementations, the step "extracting the contour coordinate point sets corresponding to the first target region and the second target region in each feature pattern according to a preset extraction algorithm and the target image" may include the following steps:

[0042] (1) Based on the position and size information of multiple feature patterns in the theoretical drawings, determine multiple regions of interest.

[0043] (2) Based on multiple regions of interest, crop out multiple images to be processed from the target image, each containing a different feature pattern.

[0044] (3) Perform binarization on multiple images to be processed to obtain multiple binarized images that correspond one-to-one with the multiple images to be processed.

[0045] (4) According to the preset extraction algorithm, extract the contour coordinate point set corresponding to the first target region and the second target region in the multiple feature patterns in the binary image.

[0046] The theoretical drawing file contains (M*N) uniformly arranged feature patterns. The dimensions (length and height) of each feature pattern are defined by a first preset value 'a'. The distance between the center coordinates of adjacent feature patterns (the center coordinates of a feature pattern represent its theoretical position) is defined by a first preset value 'b'. Taking the center coordinates of the feature pattern in the first row and first column of the (M*N) feature patterns as the origin (i.e., the center coordinates of the feature pattern in the first row and first column of the theoretical drawing file are the origin), the center coordinates of the feature pattern in the i-th row and j-th column of the (M*N) feature patterns are (b*(i-1), b*(j-1)), where i and j are the row and column indices, starting from 1. Thus, the center coordinates of each feature pattern can be obtained. Based on the dimensions of each feature pattern, the region of interest corresponding to each feature pattern can be determined. In other words, the region of one feature pattern in the theoretical drawing file is a region of interest. As can be seen from the above description, there is a deviation between the feature pattern in the target image and the feature pattern in the theoretical image file, and the deviation is small. Therefore, the size of the region of interest can be set to be slightly larger than the region corresponding to the feature pattern in the theoretical image file.

[0047] By directly locating these regions of interest in the target image, each feature pattern on the target image can be filtered out, generating multiple images to be processed. In other words, each image to be processed contains only one feature pattern from the target image, and the target image is divided into an equal number of images to be processed according to the number of feature patterns it contains.

[0048] By introducing a region of interest (ROI), multiple feature patterns can be filtered out from the target image without processing the entire target image, reducing the computational load of the laser marking machine. The laser marking machine can determine the contour coordinate point set of each feature pattern based on the image to be processed generated by the ROI, thereby effectively improving the correction efficiency.

[0049] The laser marking machine performs binarization processing on each image to be processed obtained above, so that the feature pattern in each image to be processed is separated from the background (i.e., the area of ​​the corresponding workpiece in each image to be processed), making the feature pattern more prominent.

[0050] As described above, the background of the workpiece in this application is black, and the colors of the multiple feature patterns are white. Therefore, a higher preset value can be used to extract the multiple feature patterns from multiple images to be processed. Specifically, in some embodiments, the step "performs binarization processing on multiple images to be processed respectively to obtain multiple binarized images corresponding one-to-one with the multiple images to be processed" may include the following steps:

[0051] (1) Update the pixel values ​​of pixels in the image to be processed that are greater than the preset value to the first threshold; wherein the preset value is related to the color of the feature pattern and the first threshold is the pixel value corresponding to the first color.

[0052] (2) Update the pixel values ​​of pixels in the image to be processed that are less than or equal to a preset value to the second threshold; the first threshold is the pixel value corresponding to the second color, and the first color is different from the second color.

[0053] (3) Determine the binarized image corresponding to the image to be processed based on the updated pixel points corresponding to the image to be processed.

[0054] In some implementations, the first color can be white. The second color can be black. Since the first color is white and the second color is black, the preset value can be set to a relatively high value. In one specific implementation, the preset value can be in the range of [200, 255].

[0055] In some implementations, the first threshold can be 255. The second threshold can be 0.

[0056] For example, a binarized image can be represented as:

[0057]

[0058] in," " is the coordinate point ( Updated grayscale values; " is the coordinate point ( The grayscale value before the update; " is the default value.

[0059] By binarizing the image to be processed, the feature patterns and workpieces in the image to be processed can be better distinguished, making the feature patterns in the image to be processed more prominent. This makes it easier to extract the contour coordinate point sets corresponding to the first target region and the second target region in each feature pattern of the binarized image.

[0060] However, in practical use, it is possible that the laser may not process the complete feature pattern onto the workpiece, or the image acquisition device may not capture the complete feature pattern; that is, the target image may contain incomplete feature patterns. In subsequent steps, the calibration of the galvanometer based on the contour coordinate point set determined by these incomplete feature patterns on the target image will contain errors, affecting the calibration accuracy.

[0061] Based on the above, in some embodiments, the galvanometer correction method may further include the following steps:

[0062] (1) Determine the actual area corresponding to each feature pattern in the target image based on the contour coordinate point set corresponding to the first target area and the second target area in each feature pattern in the target image.

[0063] (2) Based on the comparison results between the actual area and the preset area corresponding to each feature pattern in the target image, abnormal feature patterns are screened out from multiple feature patterns in the target image, and the contour coordinate point sets of the first target region and the second target region corresponding to the abnormal feature patterns are screened out to update the contour coordinate point sets corresponding to the first target region and the second target region in each feature pattern in the target image.

[0064] (3) Based on the comparison results of the actual area and the preset area corresponding to the multiple feature patterns, abnormal feature patterns are screened out from the multiple feature patterns, and the abnormal feature patterns are removed from the feature patterns included in the target image, and the feature patterns included in the target image are updated.

[0065] (4) Perform fitting processing based on the contour coordinate point sets corresponding to the first target area and the second target area respectively to obtain the fitting lines corresponding to the first target area and the second target area respectively, and determine the actual coordinate information of each feature pattern on the worktable based on the intersection of the fitting lines corresponding to each feature pattern.

[0066] The laser marking machine extracts the contour coordinate point sets of the first and second target regions from each feature pattern on the target image. It determines the area of ​​the first target region based on the number of pixels enclosed by the contour coordinate point set, and the area of ​​the second target region based on the number of pixels enclosed by the contour coordinate point set. This method determines the actual area of ​​each feature pattern on the target image. The laser marking machine then uses the actual area of ​​each feature pattern on the target image to determine whether to filter out the contour coordinate point sets of the corresponding first and second target regions.

[0067] In some implementations, the preset area can be the theoretical area corresponding to the feature pattern on the theoretical drawing file (i.e., the preset area is the area determined by the pixels included in the first target area and the second target area corresponding to any feature pattern on the theoretical drawing file).

[0068] If the actual area of ​​a feature pattern in the target image is smaller than a preset area, it is identified as an abnormal feature pattern. The contour coordinate point sets of the first and second target regions corresponding to the abnormal feature patterns are then filtered.

[0069] After the laser marking machine filters out abnormal feature patterns on the target image, it then performs fitting processing based on the updated contour coordinate point sets corresponding to the first and second target regions, thereby determining the actual coordinate information corresponding to multiple feature patterns in the target image. Specifically:

[0070] In step 220, the contour coordinate point sets corresponding to the first target region and the second target region are fitted to obtain the fitted straight lines corresponding to the first target region and the second target region, and the actual coordinate information of each feature pattern in the coordinate system corresponding to the target image is determined according to the intersection of the fitted straight lines corresponding to each feature pattern.

[0071] Based on the contour coordinate point set of the first target region and the contour coordinate point set of the second target region, a fitting process is performed. For each feature pattern on the target image, the first target region and the second target region respectively correspond to a fitting line. The fitting line can be expressed as:

[0072]

[0073]

[0074] in," "The fitted straight line corresponding to the first target region of any feature pattern on the target image;" "This is the fitted straight line corresponding to the second target region of the feature pattern;" " "and" "These are the coefficients on the fitted line corresponding to the first target region;" " "and" " represents the coefficients on the fitted line corresponding to the second target region.

[0075] The laser marking machine uses the fitted straight line obtained by fitting the contour coordinate point set corresponding to the first target area and the second target area respectively, and uses Cramer's rule to solve for the intersection point of the first target area and the second target area of ​​each feature pattern on the target image, that is, the intersection point of the fitted straight line of the first target area and the fitted straight line of the second target area.

[0076] First, calculate the determinant D of the coefficient matrix (this determinant D represents the directional relationship between the two fitted lines. If D ≠ 0, then the two lines intersect at a single point). The determinant D can be expressed as:

[0077] = ;

[0078] The first column of the coefficient matrix ( , Replace with a constant term () This yields the numerator determinant Dx of the x-coordinate in the camera coordinate system, which is used to calculate the x-coordinate of the intersection point. The numerator determinant Dx can be expressed as:

[0079] =

[0080] Take the second column of the coefficient matrix ( , Replace with a constant term () This yields the numerator determinant Dy of the y-coordinate in the camera coordinate system, which is used to calculate the ordinate of the intersection point. The numerator determinant Dy can be expressed as:

[0081] =

[0082] Based on the above expression, the x and y coordinates of a certain feature pattern in the target image can be obtained as follows:

[0083]

[0084]

[0085] After determining the actual coordinates of each feature pattern in the target image, the laser marking machine constructs a mapping between the two corresponding coordinate systems based on the correspondence between the theoretical coordinates of each feature pattern in its theoretical drawing file. Specifically:

[0086] In step 230, a mapping diagram is constructed based on the corresponding mapping relationship between the actual coordinate information and the theoretical coordinate information of each feature pattern.

[0087] The theoretical coordinate information refers to the coordinates of each feature pattern in the theoretical image file within the corresponding coordinate system of the theoretical image file. The theoretical coordinate information for each feature pattern in the theoretical image file is the center coordinate of each feature pattern. The actual coordinate information refers to the coordinate information for each feature pattern in the target image.

[0088] Laser marking machines construct mapping diagrams by converting the theoretical coordinate information corresponding to the feature patterns in the theoretical drawing file to their actual theoretical coordinate information on the target image.

[0089] For example, please refer to Figure 5 , Figure 5 This illustration shows a structural schematic diagram of a mapping diagram according to an embodiment of this application, such as... Figure 5 As shown, the theoretical drawing file includes nine feature patterns, and the center coordinates (i.e., theoretical coordinate information) of the nine feature patterns are respectively ( , ), ( , ), ( , ), ( , ), ( , ), ( , ), ( , ), ( , )and( , The target image also contains nine feature patterns, and there is a one-to-one correspondence between the feature patterns in the two images. The actual coordinate information of the nine feature patterns in the target image are as follows: , ), ( , ), ( , ), ( , ), ( , ), ( , ), ( , ), ( , )and( , ).

[0090] Therefore, the mapping diagram can be represented as:

[0091] ( , )

[0092] ( , )

[0093] ( , )

[0094] ( , )

[0095] ( , )

[0096] ( , )

[0097] ( , )

[0098] ( , )

[0099] ( , )

[0100] The laser marking machine constructs a mapping diagram between the ideal coordinate system and the physical coordinate system based on actual and theoretical coordinate information. Then, multiple points associated with the point to be laser-marked are used to determine their coordinate information in the coordinate system corresponding to the target image through the mapping diagram. These coordinates are then weighted to obtain the final coordinate information of the point to be laser-marked in the coordinate system corresponding to the target image, thus completing the galvanometer calibration. Specifically:

[0101] In step 240, the target coordinate information of multiple points in the coordinate system corresponding to the target image is determined based on the mapping diagram and the coordinate information of multiple points associated with the laser coordinate points located in the coordinate system corresponding to the theoretical drawing file.

[0102] In some implementations, the coordinates of the point to be laser-etched can be the points to be processed in the theoretical drawing file.

[0103] In some implementations, the center coordinates of the four feature patterns closest to the point to be laser-etched are found in the theoretical drawing file. These four feature patterns represent the coordinate information of multiple points associated with the point to be laser-etched, i.e., the coordinate information of the four points. Then, based on these four points, the target coordinate information of these four points in the coordinate system corresponding to the target image is determined through a mapping diagram.

[0104] After determining the target coordinates of multiple points associated with the laser-marked point in the coordinate system corresponding to the target image, the laser marking machine performs weighted processing on the target coordinates to obtain the final coordinates of the laser-marked point in the coordinate system corresponding to the target image. This process corrects the laser-marked point, making the final coordinates more accurate. Specifically:

[0105] In step 250, weighted processing is performed based on the target coordinate information to determine the final coordinate information of the laser-to-be-lased coordinate point in the coordinate system corresponding to the target image.

[0106] By weighting the coordinate information of multiple points associated with the laser-to-be-lased point in the coordinate system corresponding to the target image, the final coordinate information of the laser-to-be-lased point in the target image's coordinate system is determined through the combined coordinate information of multiple points, thus completing the correction of the laser-to-be-lased point in the target image's coordinate system. Specifically:

[0107] In some embodiments, the galvanometer correction method may further include the following steps:

[0108] (1) Normalize the coordinate information of multiple points in the coordinate system corresponding to the theoretical drawing file, and determine the weight parameters corresponding to the target coordinate information.

[0109] (2) Determine the final coordinate information based on the target coordinate information and weight parameters.

[0110] The laser marking machine normalizes the coordinates of multiple points associated with the point to be laser-marked within the coordinate system of the theoretical image to determine the weight parameters for each point. Then, based on the coordinates of each point and the weight parameters, the laser marking machine determines the final coordinates. In other words, the final coordinates of the point to be laser-marked within the coordinate system of the target image are determined by the combined efforts of multiple points.

[0111] In one specific implementation, the multiple points associated with the laser coordinate points include a first target point, a second target point, a third target point, and a fourth target point. The step "determine the final coordinate information based on the target coordinate information and weight parameters" may include: determining the final coordinate information based on the coordinate information and weights of the first target point, the second target point, the third target point, and the fourth target point in the coordinate system corresponding to the target image.

[0112] For example, the coordinates of the point to be laser-illuminated (i.e., in the coordinate system corresponding to the theoretical drawing) are ( The theoretical coordinate information of the multiple points associated with the laser coordinate point are as follows: , ), ( , ), ( , )and( , The actual coordinates of these four points in the coordinate system corresponding to the target image are as follows: , ), ( , ), ( , )and( , The weighting parameters determined by the laser marking machine can be expressed as:

[0113]

[0114]

[0115]

[0116]

[0117] The laser marking machine determines the final coordinate information (x, y) using the weight parameters calculated above and the target coordinate information. The final coordinate information can be expressed as:

[0118]

[0119]

[0120] In other words, the laser marking machine first determines the actual coordinates of multiple feature patterns in the coordinate system corresponding to the target image. Then, based on the mapping relationship between the theoretical and actual coordinates of these feature patterns in the coordinate system corresponding to the theoretical drawing, it constructs a mapping map. The laser marking machine then determines multiple points associated with the laser-to-be-lased coordinate point in the coordinate system corresponding to the theoretical drawing. Using the target coordinates of these points in the coordinate system corresponding to the target image, and weighting these target coordinates, it obtains the final coordinates of the laser-to-be-lased coordinate point in the coordinate system corresponding to the target image, thus completing the galvanometer correction of the laser-to-be-lased coordinate point.

[0121] Please see Figure 6 , Figure 6 This illustration shows a schematic diagram of a galvanometer correction device provided in an embodiment of this application, applied to the aforementioned laser marking machine. The galvanometer correction device 300 includes: an extraction module 310, a fitting module 320, a construction module 330, a conversion module 340, and a determination module 350. Specifically:

[0122] The extraction module 310 is used to extract the contour coordinate point set corresponding to the first target region and the second target region in each feature pattern of the target image according to the preset extraction algorithm and theoretical image file; wherein the first target region and the second target region are interleaved.

[0123] The fitting module 320 is used to perform fitting processing based on the contour coordinate point sets corresponding to the first target region and the second target region respectively, to obtain the fitting straight lines corresponding to the first target region and the second target region respectively, and to determine the actual coordinate information of each feature pattern in the coordinate system corresponding to the target image based on the intersection of the fitting straight lines corresponding to each feature pattern.

[0124] The construction module 330 is used to construct a mapping diagram based on the corresponding mapping relationship between the actual coordinate information and the theoretical coordinate information of each feature pattern; the theoretical coordinate information is the coordinates of each feature pattern in the theoretical drawing file in the corresponding coordinate system of the theoretical drawing file.

[0125] The conversion module 340 is used to determine the target coordinate information of multiple points in the coordinate system corresponding to the target image based on the mapping diagram and the coordinate information of multiple points associated with the laser coordinate points located in the coordinate system corresponding to the theoretical drawing file.

[0126] The determination module 350 performs weighted processing based on the target coordinate information to determine the final coordinate information of the laser-to-be-lased point in the coordinate system corresponding to the target image.

[0127] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0128] In the several embodiments provided in this application, the coupling or direct coupling or communication connection between the modules shown or discussed may be an indirect coupling or communication connection through some interface, device or module, and may be electrical, mechanical or other forms.

[0129] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0130] Please see Figure 7 , Figure 7 The diagram shows a schematic of the structure of a laser marking machine provided in an embodiment of this application. The laser marking machine in this application may include one or more of the following components: a processor 410, a memory 420, and one or more application programs. The one or more application programs may be stored in the memory 420 and configured to be executed by one or more processors 410. The one or more programs are configured to perform the galvanometer correction method as described in the foregoing method embodiments.

[0131] The processor 410 may include one or more processing cores. The processor 410 connects to various parts of the laser marking machine using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 420, and by calling data stored in the memory 420. Optionally, the processor 410 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 410 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 410 and may be implemented separately using a communication chip.

[0132] The memory 420 may include random access memory (RAM) or read-only memory (ROM). The memory 420 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 420 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the various method embodiments described below, etc. The data storage area may also store data created during the use of the laser marking machine.

[0133] Please see Figure 8 , Figure 8 The diagram shows a computer-readable storage medium 500 provided in an embodiment of this application. The computer-readable storage medium 500 stores program code, which can be called by a processor to execute the galvanometer correction method described in the above method embodiment.

[0134] The computer-readable storage medium 500 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 500 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 500 has storage space for program code 510 that performs any of the method steps described above. This program code can be read from or written to one or more computer program devices. The program code 510 may, for example, be compressed in a suitable form.

[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A galvanometer correction method, characterized by, The application is applied to a laser marking machine, the laser marking machine comprises a laser, a galvanometer, a workbench and an image collector; the laser is used for emitting laser to the galvanometer, the galvanometer is used for reflecting the laser to a workpiece on the workbench according to a theoretical drawing to process a plurality of characteristic patterns on the workpiece, and the image collector is used for collecting a target image of the workpiece containing the plurality of characteristic patterns; the method comprises: According to a preset extraction algorithm and the theoretical drawing, extracting a contour coordinate point set corresponding to a first target region and a second target region in each of the characteristic patterns in the target image; wherein the first target region and the second target region are arranged in intersection; According to the contour coordinate point set corresponding to the first target region and the second target region, fitting processing is performed to obtain a fitting straight line corresponding to the first target region and the second target region, and the actual coordinate information of each of the characteristic patterns in the target image corresponding coordinate system is determined according to the intersection of the fitting straight line corresponding to each of the characteristic patterns; According to the corresponding mapping relationship between the actual coordinate information of each of the characteristic patterns and the theoretical coordinate information, a mapping graph is constructed; the theoretical coordinate information is the coordinate of each characteristic pattern in the theoretical drawing in the theoretical drawing corresponding coordinate system; According to the mapping graph and the coordinate information of a plurality of points associated with the to-be-radiation coordinate point in the theoretical drawing corresponding coordinate system, the target coordinate information of the plurality of points in the target image corresponding coordinate system is determined; According to the target coordinate information, weighted processing is performed to determine the final coordinate information of the to-be-radiation coordinate point in the target image corresponding coordinate system.

2. The galvanometer correction method according to claim 1, wherein According to the preset extraction algorithm and the theoretical drawing, the contour coordinate point set corresponding to the first target region and the second target region in each of the characteristic patterns in the target image is extracted, comprising: According to the position information and size information of a plurality of characteristic patterns in the theoretical drawing, a plurality of regions of interest are determined; According to the plurality of regions of interest, a plurality of to-be-processed images including only one characteristic pattern are cropped out in the target image, and the plurality of to-be-processed images respectively include different characteristic patterns; The plurality of to-be-processed images are respectively subjected to binarization processing to obtain a plurality of binarization images corresponding one-to-one to the plurality of to-be-processed images; According to the preset extraction algorithm, the contour coordinate point set corresponding to the first target region and the second target region in a plurality of characteristic patterns is extracted in the binarization image.

3. The galvanometer correction method according to claim 2, wherein The method further comprises: The pixel value of a pixel point with a pixel value greater than a preset value in the to-be-processed image is updated to a first threshold value; wherein the preset value is related to the color of the characteristic pattern, and the first threshold value is a pixel value corresponding to a first color; The pixel value of a pixel point with a pixel value less than or equal to the preset value in the to-be-processed image is updated to a second threshold value; the first threshold value is a pixel value corresponding to a second color, and the first color is different from the second color; According to the updated pixel points corresponding to the to-be-processed image respectively, the binary image corresponding to the to-be-processed image is determined.

4. The galvanometer correction method according to claim 1, characterized by, The method further comprises: According to the contour coordinate point sets respectively corresponding to the first target region and the second target region in each of the feature patterns in the target image, the actual areas respectively corresponding to each of the feature patterns in the target image are determined. According to a comparison result of the actual areas respectively corresponding to each of the feature patterns in the target image and the preset areas, an abnormal feature pattern is screened out from the multiple feature patterns in the target image, and the contour coordinate point sets of the first target region and the second target region corresponding to the abnormal feature pattern are screened out, so as to update the contour coordinate point sets respectively corresponding to the first target region and the second target region in each of the feature patterns in the target image. According to the contour coordinate point sets respectively corresponding to the first target region and the second target region, fitting processing is performed to obtain the fitting straight lines respectively corresponding to the first target region and the second target region, and the actual coordinate information of each of the feature patterns in the coordinate system corresponding to the target image is determined according to the intersection points of the fitting straight lines corresponding to each of the feature patterns.

5. The galvanometer correction method according to claim 1, wherein The weighting processing according to the target coordinate information is performed to determine the final coordinate information of the to-be-lasered coordinate point in the coordinate system corresponding to the target image, comprising: The coordinate information of the multiple points in the coordinate system corresponding to the theoretical drawing is normalized to determine the weight parameter corresponding to the target coordinate information; The final coordinate information is determined according to the target coordinate information and the weight parameter.

6. The galvanometer correction method according to claim 5, wherein The multiple points include a first target point, a second target point, a third target point and a fourth target point. The final coordinate information is determined according to the coordinate information of the first target point, the second target point, the third target point and the fourth target point in the coordinate system corresponding to the target image and the weight. It comprises a laser, a galvanometer, a workbench and an image collector.

7. A laser marking machine characterized by, The laser is used to emit laser to the galvanometer. The galvanometer is used to reflect the laser to a workpiece on the workbench according to a theoretical drawing, so as to laser process multiple feature patterns on the workpiece. The image collector is used to collect a target image of the workpiece containing the multiple feature patterns. A controller is used to extract contour coordinate point sets respectively corresponding to a first target region and a second target region in each of the feature patterns in the target image according to a preset extraction algorithm and the theoretical drawing; wherein the first target region and the second target region are cross arranged. The controller is further used to perform fitting processing on the contour coordinate point sets respectively corresponding to the first target region and the second target region to obtain fitting straight lines respectively corresponding to the first target region and the second target region, and determine actual coordinate information of each of the feature patterns in the coordinate system corresponding to the target image according to intersection points of the fitting straight lines corresponding to each of the feature patterns. ​ The controller is further configured to construct a mapping diagram according to a corresponding mapping relationship between the actual coordinate information and theoretical coordinate information of each feature pattern; the theoretical coordinate information is a coordinate of each feature pattern in the theoretical drawing file in a corresponding coordinate system of the theoretical drawing file; The controller is further configured to determine target coordinate information of a plurality of points associated with the to-be-lasered coordinate point in the corresponding coordinate system of the target image according to the mapping diagram and coordinate information of the plurality of points in the corresponding coordinate system of the theoretical drawing file; The controller is further configured to determine final coordinate information of the to-be-lasered coordinate point in the corresponding coordinate system of the target image by performing weighted processing on the target coordinate information.

8. A galvanometer correction device, characterized by, The application is applied to a laser marking machine, and the laser marking machine comprises a laser, a galvanometer, a workbench and an image collector; the laser is configured to emit laser to the galvanometer; the galvanometer is configured to reflect the laser to a workpiece on the workbench according to a theoretical drawing file, so as to process a plurality of feature patterns on the workpiece; and the image collector is configured to collect a target image of the workpiece containing the plurality of feature patterns; and the device comprises: An extraction module is configured to extract a set of contour coordinate points corresponding to a first target region and a second target region in each feature pattern in the target image according to a preset extraction algorithm and the theoretical drawing file; and the first target region and the second target region are arranged in an intersecting manner. A fitting module is configured to perform fitting processing on the sets of contour coordinate points corresponding to the first target region and the second target region, respectively, to obtain fitting straight lines corresponding to the first target region and the second target region, respectively, and determine actual coordinate information of each feature pattern in a corresponding coordinate system of the target image according to an intersection point of the fitting straight lines corresponding to each feature pattern. A construction module is configured to construct a mapping diagram according to a corresponding mapping relationship between the actual coordinate information and theoretical coordinate information of each feature pattern; the theoretical coordinate information is a coordinate of each feature pattern in the theoretical drawing file in a corresponding coordinate system of the theoretical drawing file. A conversion module is configured to determine target coordinate information of a plurality of points associated with the to-be-lasered coordinate point in the corresponding coordinate system of the target image according to the mapping diagram and coordinate information of the plurality of points in the corresponding coordinate system of the theoretical drawing file. A determination module is configured to determine final coordinate information of the to-be-lasered coordinate point in the corresponding coordinate system of the target image by performing weighted processing on the target coordinate information.

9. A laser marking machine characterized by, The device comprises: one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the galvanometer correction method according to any one of claims 1-6.

10. A computer readable storage medium, characterized in that, The computer-readable storage medium stores program codes, and the program codes can be called and executed by a processor to execute the galvanometer correction method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Galvanometer system correction table construction method, galvanometer system correction table construction system and galvanometer system correction method

    CN112435303A

  • Method and device for calibrating and using three-dimensional laser

    CN117259963A