Automatic focusing method, device, equipment and system of laser processing equipment and medium

By using the first light output module and the second light output module in the laser processing equipment, the laser focus is automatically adjusted to the workpiece processing surface, and the problem of manual focus operation is solved, and high-precision laser processing is achieved.

CN120395111APending Publication Date: 2025-08-01SHENZHEN MAKER WORKS TECH CO LTD

Patent Information

Application Number
CN202510299056.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-04-25
Filing Date
2025-03-13
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The existing laser focus focus method requires manual adjustment of the distance between the optical output module and the processing platform, which leads to troublesome operation, especially when facing workpieces of different thicknesses, it is difficult to achieve automatic focus.

Method used

By using the first light output module and the second light output module, the first light output module outputs the light spot for laser processing and the light spot for indication output of the second light output module, the workpiece images at different distances are obtained, and the focus of the first light output module is calculated and adjusted so that it is located on the processing surface of the workpiece.

Benefits of technology

It realizes automatic focus of laser focus, reduces manual participation, reduces operation errors, improves machining accuracy and efficiency, optimizes machining effects, and reduces the use of detection components and ranging hardware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120395111A_ABST
    Figure CN120395111A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic focusing method, device, equipment and system of laser processing equipment and a medium, the laser processing equipment comprises a first light output module and a second light output module, the first light output module is used for outputting light spots for laser processing, and the second light output module is used for outputting light spots for indication. The automatic focusing method comprises the following steps: controlling the first light output module to output a first light spot to a workpiece, and controlling the second light output module to output a second light spot to the workpiece; controlling the first light output module to descend, and acquiring a plurality of images of the workpiece comprising the first light spot and the second light spot at different distances to obtain a plurality of images; obtaining an image with the minimum distance between the first light spot and the second light spot in the plurality of images, and taking the image as a target image; and based on the target image, adjusting the focus of the first light output module to enable the focus to be located on the machining surface of the workpiece. The problem that automatic focusing cannot be achieved is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of laser processing, and particularly to an automatic focusing method, device, equipment, system and medium for a laser processing device. Background Art

[0002] Currently, most of the methods for focusing the laser focus can only achieve focusing by manually adjusting the distance between the light output module and other light-emitting components and the processing platform. However, when facing workpieces with different thicknesses, there is a problem of cumbersome operation in manually adjusting the focus.

[0003] Therefore, providing an automatic focusing method has become an urgent technical problem to be solved at present. Summary of the Invention

[0004] The main purpose of the present application is to provide an automatic focusing method, device, equipment, system and medium for a laser processing device, aiming to solve the problem of inability to automatically focus.

[0005] To achieve the above object, the present application provides an automatic focusing method for a laser processing device. The laser processing device includes a first light output module and a second light output module. The first light output module is used to output a light spot for laser processing, and the second light output module is used to output a light spot for indication. The automatic focusing method includes:

[0006] Controlling the first light output module to output a first light spot to the workpiece and controlling the second light output module to output a second light spot to the workpiece;

[0007] Controlling the first light output module to descend, and acquiring images of the workpiece including the first light spot and the second light spot at multiple different distances to obtain multiple images;

[0008] Acquiring the image with the smallest distance between the first light spot and the second light spot among the multiple images, and using it as the target image;

[0009] Based on the target image, adjusting the focus of the first light output module so that the focus is located on the processing surface of the workpiece.

[0010] In an embodiment, based on the target image, adjusting the focus of the first light output module so that the focus is located on the processing surface of the workpiece includes:

[0011] Based on the position information of the first light spot in the target image, calculating the distance between the processing surface of the workpiece and the first light output module, or the thickness of the workpiece;

[0012] Adjust the focus of the first light output module based on the distance between the processed surface of the workpiece and the first light output module or the thickness of the workpiece, so that the focus is located on the processed surface.

[0013] In one embodiment, calculating the distance between the processed surface of the workpiece and the first light output module or the thickness of the workpiece based on the position information of the first light spot in the target image includes:

[0014] Obtain the X coordinate and / or Y coordinate of the center point of the first light spot in the target image;

[0015] Calculate the distance between the processed surface of the workpiece and the first light output module or the thickness of the workpiece based on the X coordinate and / or Y coordinate of the center point of the first light spot and a preset mapping relationship.

[0016] In one embodiment, adjusting the focus of the first light output module based on the distance between the processed surface of the workpiece and the first light output module or the thickness of the workpiece so that the focus is located on the processed surface includes:

[0017] Determine the moving distance of the first light output module based on the distance between the processed surface of the workpiece and the first light output module, and control the first light output module to move up or down to adjust the focus of the first light output module so that the focus is located on the processed surface;

[0018] Alternatively, determine the moving distance of the first light output module based on the thickness of the workpiece, and control the first light output module to move up or down to adjust the focus of the first light output module so that the focus is located on the processed surface.

[0019] In one embodiment, obtaining the image with the smallest distance between the first light spot and the second light spot among the multiple images includes:

[0020] If there is an image in which the center points of the first light spot and the second light spot coincide among the multiple images, then determine this image as the image with the smallest distance;

[0021] If there is no image in which the center points of the first light spot and the second light spot coincide among the multiple images, then obtain the image with the smallest distance based on the distances between the first light spot and the second light spot in each image.

[0022] In one embodiment, obtaining the image with the smallest distance between the first light spot and the second light spot among the multiple images and using it as the target image includes:

[0023] Identify the first light spot and the second light spot in each of the images;

[0024] Based on the center points of the first light spot and the second light spot in each of the images, calculate the distance between the first light spot and the second light spot in each of the images;

[0025] Based on the distances between the first light spot and the second light spot in multiple images, obtain the target image.

[0026] In one embodiment, the calculating the distance between the first light spot and the second light spot in each of the images based on the center points of the first light spot and the second light spot in each of the images includes:

[0027] Obtain a first target pixel point in the set of pixel points corresponding to the first light spot in the image, the pixel value of the first target pixel point being greater than a first pixel threshold, and obtain the coordinates of each of the first target pixel points, and calculate the coordinate average value of all the first target pixel points to obtain the coordinates of the center point of the first light spot in the image;

[0028] Obtain a second target pixel point in the set of pixel points corresponding to the second light spot in the image, the pixel value of the second target pixel point being greater than a second pixel threshold, and obtain the coordinates of each of the second target pixel points, and calculate the coordinate average value of all the second target pixel points to obtain the coordinates of the center point of the second light spot in the image;

[0029] Based on the coordinates of the center point of the first light spot and the coordinates of the center point of the second light spot in the image, calculate the distance between the first light spot and the second light spot in the image.

[0030] In addition, to achieve the above object, the present application further provides an automatic focusing device for a laser processing device, the laser processing device including a first light output module and a second light output module, the first light output module being used to output a light spot for laser processing, the second light output module being used to output an indicating light spot, and the automatic focusing device including:

[0031] A light output control module, configured to control the first light output module to output a first light spot to a workpiece and control the second light output module to output a second light spot to the workpiece; and further configured to control the first light output module to descend;

[0032] An image acquisition module, configured to, when the first light output module descends, acquire images of the workpiece including the first light spot and the second light spot at multiple different distances to obtain multiple images; acquire the image with the smallest distance between the first light spot and the second light spot among the multiple images, and use it as the target image;

[0033] A focus adjustment module, configured to adjust the focus of the first light output module based on the target image, so that the focus is located on the processing surface of the workpiece.

[0034] In addition, to achieve the above object, the present application further provides a laser processing device, including:

[0035] A processing platform for placing a workpiece;

[0036] A first light output module, configured to output a first light spot, the laser focus of the first light output module being adjustable, the first light output module being movable up or down, and the first light output module being used for laser processing;

[0037] A second light output module for outputting a second light spot for indication;

[0038] An imaging module, configured to collect images of the workpiece including the first light spot and the second light spot at multiple different distances, where the multiple different distances are the distances between the first light output module and the processing platform;

[0039] A processor, configured to control the movement of the first light output module and control the operation of the imaging module, so as to implement the automatic focusing method of the laser processing device as described above.

[0040] In one embodiment, the direction in which the first light output module outputs the first light spot is perpendicular to the surface of the processing platform, and the direction in which the second light output module outputs the second light spot forms an inclination angle with the surface of the processing platform.

[0041] In one embodiment, the laser processing device further includes a laser head, and the first light output module and the second light output module are integrally arranged in the laser head.

[0042] In one embodiment, the laser processing device further includes a lifting module,

[0043] The lifting module is in driving connection with the laser head to drive the laser head to move up or down;

[0044] Alternatively, the lifting module is used to drive the first light output module to move up or down.

[0045] In addition, to achieve the above object, the present application further provides a laser processing system, including:

[0046] A laser processing device, the laser processing device includes a first light output module, a second light output module and a camera module, the first light output module is used to output a light spot for laser processing, the second light output module is used to output a light spot for indication, and the laser focus of the first light output module is adjustable;

[0047] A terminal device, configured to control the first light output module to output a first light spot to a workpiece and control the second light output module to output a second light spot to the workpiece; control the first light output module to descend, and control the camera module to collect images of the workpiece including the first light spot and the second light spot at multiple different distances, obtaining multiple images; acquire the image with the smallest distance between the first light spot and the second light spot among the multiple images, and use it as the target image; based on the target image, adjust the focus of the first light output module so that the focus is located on the processing surface of the workpiece.

[0048] In addition, to achieve the above object, the present application also provides a computer-readable storage medium, on which an autofocus program is stored, and when the autofocus program is executed by a processor, it implements the autofocus method of the laser processing device as described above.

[0049] The present application has the following beneficial effects:

[0050] The first light output module outputs a first light spot and the second light output module outputs a second light spot to the workpiece. By controlling the first light output module to descend and collecting images of the workpiece including the first light spot and the second light spot at multiple different distances, the different positions of the first light spot and the second light spot output to the workpiece at different distances are determined; acquire the image with the smallest distance between the first light spot and the second light spot among the multiple images, and use it as the target image; based on the target image, adjust the focus of the first light output module so that the focus is located on the processing surface of the workpiece, thereby realizing autofocus, reducing manual participation, effectively reducing operation errors, lowering the operation difficulty, controlling the processing after adjusting the focus of the first light output module, enabling more precise processing, and optimizing the processing effect. Description of the Drawings

[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on the structures shown in these drawings without creative efforts.

[0052] Figure 1 It is a flowchart of an embodiment of the autofocus method provided by the present application;

[0053] Figure 2Specific flowchart of step S300 in an embodiment of the autofocus method provided by this application;

[0054] Figure 3 Specific flowchart of step S320 in an embodiment of the autofocus method provided by this application;

[0055] Figure 4 One of the specific flowcharts of step S400 in an embodiment of the autofocus method provided by this application;

[0056] Figure 5 Specific flowchart of step S410 in an embodiment of the autofocus method provided by this application;

[0057] Figure 6 Another specific flowchart of step S400 in an embodiment of the autofocus method provided by this application;

[0058] Figure 7 Schematic diagram of a module in an embodiment of the laser processing equipment provided by this application;

[0059] Figure 8 Schematic diagram of the autofocus device of the laser processing equipment provided by this application;

[0060] Figure 9 Schematic diagram of an image in an embodiment of the autofocus method provided by this application;

[0061] Figure 10 One of the schematic diagrams of the coarse focusing process in an embodiment of the autofocus method provided by this application;

[0062] Figure 11 Another schematic diagram of the coarse focusing process in an embodiment of the autofocus method provided by this application;

[0063] Figure 12 One of the schematic diagrams of the fine focusing process in an embodiment of the autofocus method provided by this application;

[0064] Figure 13 Another schematic diagram of the fine focusing process in an embodiment of the autofocus method provided by this application;

[0065] Figure 14 Another schematic diagram of the fine focusing process in an embodiment of the autofocus method provided by this application;

[0066] Figure 15 Another schematic diagram of the fine focusing process in an embodiment of the autofocus method provided by this application;

[0067] Figure 16 Schematic diagram of the structure of an embodiment of the laser processing equipment provided by this application;

[0068] Figure 17 This is a structural schematic diagram of an embodiment of the laser processing equipment provided for this application.

[0069] Explanation of the reference numerals in the attached drawings:

[0070] 100, processing platform;

[0071] 210, first light output module; 211, first light beam; 212, first light spot; 220, second light output module; 221, second light beam; 222, second light spot; 230, laser head;

[0072] 300, camera module;

[0073] 400, processor;

[0074] 500, lifting module;

[0075] 610, light output control module; 620, image acquisition module; 630, focus adjustment module;

[0076] 700, terminal device.

[0077] The realization of the purpose of this application, functional features and advantages will be further described in conjunction with the embodiments with reference to the attached drawings. Specific embodiments

[0078] Next, the technical solutions in the embodiments of this application will be clearly and completely described in conjunction with the attached drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.

[0079] It should be noted that if all the directional indications in the embodiments of this application are only used to explain the relative position relationship and movement conditions between components in a specific posture, if this specific posture changes, then the directional indications will also change accordingly.

[0080] In this application, the descriptions involving "first", "second", etc. are for descriptive purposes only, and should not be construed as indicating or implying their relative importance, or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one such feature. If the description involving "A and / or B" is used in this application, it means including solution A or solution B, or including both solution A and solution B. Additionally, the technical solutions between various embodiments may be combined with each other, but it must be based on the ability of those of ordinary skill in the art to implement. When the combination of technical solutions results in contradictions or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0081] In the related art, most of the focusing methods for laser foci require manually adjusting the distance between the light output component such as the light output module and the processing platform to adjust the laser focus in order to achieve focusing. When facing workpieces with different thicknesses, there is a problem of troublesome operation in manual focusing adjustment.

[0082] In order to achieve automatic adjustment of the laser focus and improve the focusing accuracy, referring to Figures 1 to 17 , this application provides an automatic focusing method, device, equipment, system and medium for a laser processing device. The automatic focusing method shown in this application is used for adjusting the focus of the light output module such as the laser output module of the laser processing device, and such light output modules are optionally arranged on the laser head or separately arranged on the laser processing device. The automatic focusing method is mainly applied to other devices, systems and devices such as laser processing devices, laser processing systems, laser processing system control devices, etc. that can be used to implement laser processing. The execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, or a server, etc., or an electronic device, a laser processing control device, a control system, a control unit, a controller, etc. that can implement the above functions, and is mainly implemented with the controller as the execution subject. The controller can be arranged in other components of the laser processing device and the laser processing system, or can be arranged independently of the components of the laser processing system.

[0083] The laser processing device includes a first light output module 210 and a second light output module 220. The first light output module 210 is used to output a light spot for laser processing, and the second light output module 220 is used to output an indicating light spot. The first light output module 210 can move closer to or away from the workpiece and / or the processing platform 100 to adjust the focus of the first light output module 210 and achieve processing of workpieces with different thicknesses. Among them, the second light output module 220 can move closer to or away from the workpiece and / or the processing platform 100 together with the first light output module 210.

[0084] It should be noted that although the light spot output by the first light output module 210 is mainly used for processing, the power of the first light spot output is relatively weak and is mainly used for focusing. The high-power laser corresponding to it is used to achieve laser processing during the laser processing process. The second light output module 220 is used to output the second light spot 222, and the second light spot 222 mainly functions as an indicator.

[0085] For the convenience of description, the following mainly describes the execution subject as the processor inside the terminal device 700 or the laser processing device.

[0086] Refer to Figure 1 , the autofocus method includes the following steps S100 to S400:

[0087] Step S100, controlling the first light output module 210 to output the first light spot 212 to the workpiece, and controlling the second light output module 220 to output the second light spot 222 to the workpiece;

[0088] Step S200, controlling the first light output module 210 to descend, and obtaining images of the workpiece including the first light spot 212 and the second light spot 222 at multiple different distances, obtaining multiple images. Among them, the multiple different distances are the distances between the first light output module and the processing platform.

[0089] Step S300, obtaining the image with the smallest distance between the first light spot 212 and the second light spot 222 among the multiple images, and using it as the target image;

[0090] Step S400, based on the target image, adjusting the focus of the first light output module 210 so that the focus is located on the processing surface of the workpiece.

[0091] In some optional embodiments of the present application, the workpiece is placed on the processing platform 100. The first light output module 210 is used to output the first light beam 211, and the second light output module 220 is used to output the second light beam 221. The first light beam 211 is projected onto the workpiece to form the first light spot 212, and the second light beam 221 is projected onto the workpiece to form the second light spot 222.

[0092] Specifically, a laser or the like is used as the first light output module 210. The first light output module 210 is configured to output a first light spot 212 for laser processing to the workpiece. The first light output module 210 can move up or down in the vertical direction relative to the processing platform 100 to adapt to workpieces of different thicknesses. The second light output module 220 can be, but is not limited to, configured to emit infrared light, ultraviolet light, or the second light output module 220 is configured to output one or more visible light spots such as red, blue, yellow, etc. as a second light spot 222 to the workpiece. The second light spot 222 is mainly used as a position reference. By controlling the first light output module 210 to descend and collecting images of the workpiece including the first light spot 212 and the second light spot 222 at multiple different distances, the different positions of the first light spot 212 and the second light spot 222 output to the workpiece at different distances are determined. The image with the smallest distance between the first light spot 212 and the second light spot 222 among the multiple images is obtained and used as the target image. Based on the target image, the focus of the first light output module 210 is adjusted so that the focus is located on the processing surface of the workpiece. Thus, automatic focusing is achieved, reducing manual participation, effectively reducing operation errors, lowering the operation difficulty. After adjusting the focus of the first light output module and then controlling the processing, relatively precise processing can be achieved, and the processing effect can be optimized. After adjusting the focus of the first light output module 210 that outputs the first light spot 212 for laser processing and then controlling the processing, precise processing can also be achieved, which can speed up the processing progress, optimize the processing effect, and improve customer satisfaction. Compared with other focusing methods such as contact ranging and TOF ranging in the related art, the automatic focusing method of the present application can also reduce the use of detection components and lower the processing cost.

[0093] In this application, an imaging module such as a camera or other device with image acquisition and recognition functions can be set to obtain images of a workpiece including a first light spot 212 and a second light spot 222 at multiple different distances from the processing platform 100 during the downward movement of the first light output module 210, thereby obtaining multiple images. Specifically, by adjusting the distance between the first light output module 210 and the processing platform 100 or between the first light output module 210 and the processing surface of the workpiece placed on the processing platform 100, the distance between the first light spot 212 and the second light spot 222 is adjusted. Images at different distances between the light output module of the laser processing equipment and the workpiece are acquired by the imaging module 300 or other devices. The different positions of the first light spot 212 and the second light spot 222 projected onto the workpiece at different distances between the first light output module 210 and the workpiece are determined through the multiple acquired images. The image with the smallest distance between the first light spot 212 and the second light spot 222 among the multiple acquired images is used as the target image, and the distance between the first light output module 210 and the workpiece corresponding to the minimum distance of the target image is used as the focusing distance. Further, the focus of the first light output module 210 is adjusted according to the focusing distance so that the focus is located on the processing surface of the workpiece, making the distance between the first light spot 212 and the second light spot 222 meet the focusing requirements, realizing automatic adjustment of the laser focus, reducing the use of detection components and additional ranging hardware, and reducing the operation difficulty and processing cost.

[0094] It should be noted that this application mainly takes controlling the first light output module to move downward to obtain images of a workpiece including a first light spot 212 and a second light spot 222 at multiple different distances as an example for illustration. In other alternative solutions, images of a workpiece including a first light spot 212 and a second light spot 222 at multiple different distances can also be obtained by controlling the first light output module to move upward. The first light output module 210 and the second light output module 220 of this application can be either relatively independently arranged or integrally arranged on the same laser head 230. That is, in addition to being able to separately control the first light output module 210 to move upward or downward to obtain multiple images including the first light output module 210 and the second light output module 220 at multiple different distances. Optionally, the first light output module 210 and the second light output module 220 can be controlled to move upward or downward simultaneously to obtain multiple images of a workpiece including a first light spot 212 and a second light spot 222. At this time, when the direction of the first light output module 210 outputting the first light spot 212 is perpendicular to the surface of the processing platform 100 and the direction of the second light output module 220 outputting the second light spot 222 forms an inclination angle with the surface of the processing platform 100, the first light output module 210 and the second light output module 220 can be integrally arranged or relatively independently arranged.

[0095] Optionally, the first light output module 210 and the second light output module 220 are disposed on the laser processing device and are disposed above the laser processing device relative to the processing platform 100. When performing step S200 to control the first light output module 210 to descend and obtain images of the workpiece including the first light spot 212 and the second light spot 222 at multiple different distances, to obtain multiple images, the distance between the first light output module 210 and the workpiece needs to be adjusted. The first light output module 210 is used to output the light spot for laser processing, and the first light output module 210 can move up or down relative to the processing platform 100 (or the workpiece placed on the processing platform 100).

[0096] In addition to adjusting the distance between the first light output module 210 and the workpiece by moving the first light output module 210 up or down as described above, in some other embodiments, it can also be set that the processing platform 100 can move closer to or away from the first light output module 210, and by adjusting the position of the processing plane, the distance between the first light output module 210 and the workpiece is adjusted.

[0097] In a specific embodiment of the present application, in step S200, controlling the first light output module 210 to descend and obtaining images of the workpiece including the first light spot 212 and the second light spot 222 at multiple different distances, to obtain multiple images, includes: controlling the first light output module 210 to move from the initial position to the target position in sequence according to the preset adjustment distance, and obtaining the workpiece image including the first light spot 212 and the second light spot 222 at each target position, so as to obtain multiple images.

[0098] Specifically, controlling the first light output module 210 to move from the initial position to the target position in sequence according to the preset adjustment distance, and obtaining an image each time the first light output module 210 moves. After moving multiple times in sequence according to the set number of moves, stop moving, and obtain multiple images of the distance between the first light output module 210 and the workpiece at different distances.

[0099] When performing step S300, select the image with the smallest distance between the first light spot 212 and the second light spot 222 from the obtained multiple images, and specifically select the image with the smallest distance between the center point of the first light spot 212 and the center point of the second light spot 222 (or other calibrated positions of the first light spot 212 and other calibrated positions of the second light spot 222), and use this image as the target image. When performing step S400, use the distance between the first light output module 210 and the workpiece when the distance between the first light spot 212 and the second light spot 222 is the smallest as the focusing distance, and adjust the focus of the first light output module 210 so that the focus of the first light output module 210 is located on the processing surface of the workpiece.

[0100] In another specific embodiment of the present application, in step S200, the first light output module 210 is controlled to descend, and images of the workpiece including the first light spot 212 and the second light spot 222 at multiple different distances are acquired to obtain a plurality of images, including: controlling the first light output module 210 to move from the initial position to the target position in sequence according to a preset adjustment distance. Each time the first light output module 210 moves, an image of the workpiece including the first light spot 212 and the second light spot 222 is acquired, and the distance between the first light spot 212 and the second light spot 222 in the image is acquired, and specifically used to acquire the distance between the center points of the first light spot 212 and the second light spot 222 (or the distance between other calibrated positions of the first light spot 212 and other calibrated positions of the second light spot 222). Moving from the initial distance to the target position in sequence can be understood as moving the first light output module 210 in the same direction so that the distance between the center points of the first light spot 212 and the second light spot 222 gradually decreases. For example, controlling the first light output module 210 to move downward so that the distance between the center points of the first light spot 212 and the second light spot 222 gradually decreases.

[0101] When the direction of the first light output module 210 for outputting the first light spot 212 is perpendicular to the surface of the processing platform 100, and the direction of the second light output module 220 for outputting the second light spot 222 forms an inclination angle with the surface of the processing platform 100, the projection directions of the first light spot 212 and the second light spot 222 intersect rather than being parallel. Therefore, when the distance between the center points of the first light spot 212 and the second light spot 222 reaches the minimum, if the first light output module 210 continues to move in the same direction, the distance between the center points of the first light spot 212 and the second light spot 222 will increase. Therefore, when moving multiple times until the distance between the center points of the first light spot 212 and the second light spot 222 in the currently acquired image is greater than the distance between the center points of the first light spot 212 and the second light spot 222 in the previous acquired image, it indicates that the distance between the center points of the first light spot 212 and the second light spot 222 in the previous acquired image is the minimum distance. At this time, the acquisition of images is stopped, and the distance between the first light output module 210 and the workpiece corresponding to the previous acquired image is used as the focusing distance, and the previous acquired image is determined as the target image.

[0102] When performing step S400, taking the distance between the first light output module 210 and the workpiece when the distance between the first light spot 212 and the second light spot 222 is the smallest as the focusing distance, the focus of the first light output module 210 is adjusted so that the focus of the first light output module 210 is located on the processing surface of the workpiece.

[0103] In yet another specific embodiment of the present application, in step S200, the first light output module 210 is controlled to descend, and images of the workpiece including the first light spot 212 and the second light spot 222 at multiple different distances are acquired, obtaining multiple images, including: controlling the first light output module 210 to sequentially move from the initial position to the target position according to a preset adjustment distance, and each time the first light output module 210 moves, an image of the workpiece including the first light spot 212 and the second light spot 222 is acquired. After moving multiple times, when the distance between the center point of the first light spot 212 and the center point of the second light spot 222 in the acquired image is the smallest, the movement stops, and the distance between the first light output module 210 and the workpiece corresponding to the smallest distance between the center point of the first light spot 212 and the center point of the second light spot 222 is used as the focusing distance.

[0104] In addition, a distance threshold can be set to determine that the distance between the first light spot 212 and the second light spot 222 in the image is the smallest when the distance between the center point of the first light spot 212 and the center point of the second light spot 222 is not greater than the preset distance threshold, and stop moving when the two light spots coincide or the distance between the center point of the first light spot 212 and the center point of the second light spot 222 reaches the minimum distance (or when the distance between other calibrated positions of the first light spot 212 and other calibrated positions of the second light spot 222 reaches the minimum distance), and use the distance between the first light output module 210 and the workpiece corresponding to the coincidence or the minimum distance as the focusing distance, and determine the image as the target image. When performing step S400, the focus of the first light output module 210 is adjusted with the distance between the first light output module 210 and the workpiece when the distance between the first light spot 212 and the second light spot 222 is the smallest as the focusing distance, so that the focus of the first light output module 210 is located on the processing surface of the workpiece.

[0105] It should be noted that in the foregoing multiple examples, the smallest distance between the center point of the first light spot 212 and the center point of the second light spot 222 in the obtained image includes not only the example where the center points of the first light spot 212 and the second light spot 222 in the target image coincide when the first light output module 210 is in the current position, but also the example where the center point of the first light spot is closest to the center point of the second light spot 222 when the center points of the first light spot 212 and the second light spot 222 cannot coincide.

[0106] In some embodiments of the present application, before moving, it is necessary to obtain an image of the first light output module 210 at the initial position. If the distance between the center points of the first light spot and the second light spot 222 in the image obtained when the first light output module 210 is at the initial position reaches the minimum distance, there is no need to move further. In addition, the moving direction (in addition to the aforementioned downward movement, it can also be upward movement), the number of movements, and the size of the adjustment distance of the first light output module 210 can be determined according to the distance between the center point of the first light spot 212 and the center point of the second light spot 222 in the image of the first light output module 210 at the initial position. Specifically, it can be set according to the actual situation and is not limited herein. Among them, determining the moving direction of the first light output module 210 according to the distance between the center point of the first light spot 212 and the center point of the second light spot 222 in the image of the first light output module 210 at the initial position is specifically as follows: when the direction of the first light output module 210 for emitting the first light spot 212 is perpendicular to the surface of the processing platform 100, the second light output module 220 is arranged on the right side of the first light output module 210, and the direction of emitting the second light spot 222 forms an inclination angle with the surface of the processing platform 100. If the second light spot 222 output to the workpiece is located on the right side of the first light spot 212, the first light output module 210 is controlled to move downward; if the second light spot 222 output to the workpiece is located on the left side of the first light spot 212, the first light output module 210 is controlled to move upward; if the center points of the first light spot 212 and the second light spot 222 coincide, the first light output module 210 is controlled to remain at the current position, and the obtained image is determined as the target image.

[0107] Taking the first light output module 210 as an example of a laser or other device for emitting laser for processing, the laser emitted by the first light output module 210 has a focus after being focused. The energy at the focus is the highest, and it is easier to engrave, cut, or mark the workpiece. In order to better process the workpiece, generally, the focus of the first light output module 210 is adjusted to be located on the processing surface of the workpiece. Therefore, in order to visually adjust the focus of the laser, when installing and debugging the laser processing equipment, it is preset that when the distance between the first light spot 212 and the second light spot 222 on the processing surface of the workpiece is the smallest, the focus of the first light output module 210 is located on the surface of the workpiece.

[0108] The imaging module 300 can be specifically arranged in the light output module (the first light output module 210, the second light output module 220), or at any other position such as on or outside the laser processing device, and is used to obtain images such as the captured images of the workpiece or the processing platform 100. By identifying image features such as image pixels, image size, and image shape, the first light spot 212 and the second light spot 222 are found, and can specifically be used to find the center points of the first light spot 212 and the second light spot 222 or other calibration positions of the light spots. Specifically, the image obtained by the imaging module 300, such as Figure 9 The shown image can be directly displayed through the user interface, and the light spots output from the first light output module 210 and the second light output module 220 to the workpiece are represented by images of different colors. To distinguish the light spots output from the first light output module 210 and the second light output module 220 to the workpiece, specifically, the first light output module 210 and the second light output module 220 can be set to output the first light spot 212 and the second light spot 222 with different colors, or after the imaging module 300 identifies the first light spot 212 and the second light spot 222, different - colored images are automatically used to display the two light spots; specifically, it can be set according to the actual situation and is not limited herein.

[0109] The second light spot 222 is used as a position reference. When the light beam is radiated onto the workpiece and / or the processing platform 100 and presented in the form of a light spot, the brightness at different positions of the light spot is different, and the brightness is the highest at the center of the light beam. When controlling the first light output module 210 to output a corresponding higher - power laser for processing, the light utilization rate is the highest with the center of the light beam of the first light output module 210. Therefore, when controlling the first light output module 210 to descend (or ascend) and obtaining multiple images of the workpiece including the first light spot 212 and the second light spot 222 at multiple different distances, the distance between the first light spot 212 and the second light spot 222 is determined by the distance between the center point of the first light spot 212 and the center point of the second light spot 222. The distance between the first light output module 210 and the workpiece corresponding to the minimum distance between the center point of the first light spot 212 and the center point of the second light spot 222 is used as the focusing distance, which can maximize the focusing accuracy, further improve the processing accuracy, and reduce the processing error. Compared with the contact - type ranging, TOF ranging and other focusing methods in the related art, the automatic focusing method of the present application can also reduce the use of detection components and additional ranging hardware, and reduce the operation difficulty and processing cost.

[0110] In one embodiment, obtaining the image with the minimum distance between the first light spot 212 and the second light spot 222 among the multiple images in step S300 includes:

[0111] If there is an image in which the center point of the first light spot 212 coincides with the center point of the second light spot 222 among the multiple images, then this image is determined as the image with the minimum distance.

[0112] In this example, the first light output module 210 is controlled to move so as to stop moving the first light output module 210 when an image in which the center points of the first light spot 212 and the second light spot 222 coincide as shown exists in the currently acquired image, or directly determine that the distance between the first light output module 210 and the workpiece when the light spots coincide is the focusing distance when the center points of the first light spot 212 and the second light spot 222 coincide in multiple acquired images. Figure 10

[0113] In one embodiment, obtaining the image with the smallest distance between the first light spot 212 and the second light spot 222 in step S300 further includes:

[0114] If there is no image in which the center points of the first light spot 212 and the second light spot 222 coincide in multiple images, obtain the image with the smallest distance based on the distances between the first light spot 212 and the second light spot 222 in each image.

[0115] In this embodiment, the first light output module 210 is controlled to move, and multiple images at different distances between the first light output module 210 and the workpiece are acquired. As Figure 11 shown, compare the distances between the center points of the first light spot 212 and the second light spot 222 in the multiple acquired images, which is used to determine the image with the smallest distance as the target image, and is also used to further determine that the distance between the first light output module 210 and the workpiece at the smallest distance is the focusing distance, and is further used to control the movement of the first light output module 210 to adjust the focal position of the laser according to the focusing distance.

[0116] ​In the present application, since the direction of the first light output module 210 for outputting the first light spot 212 is perpendicular to the surface of the processing platform 100, and the direction of the second light output module 220 for outputting the second light spot 222 forms an inclination angle with the surface of the processing platform 100. Specifically, it is also possible to directly calculate whether there is a possibility of coincidence between the first light spot 212 and the second light spot 222 according to the positions of the first light spot 212 and the second light spot 222 in the image obtained when the first light output module 210 is in the initial position, and the inclination angle formed by the direction of the second light beam 221 output by the second light output module 220 and the surface of the processing platform 100. If there is a coincidence, the distance between the first light output module and the workpiece corresponding to the coincidence of the first light spot 212 and the second light spot 222 is directly used as the focusing distance, and further, the first light output module 210 is controlled to move according to the focusing distance to adjust the focal position of the first light output module 210 so that the focus of the first light output module 210 is located on the processing surface of the workpiece; if there is no coincidence, the distance between the first light spot 212 and the second light spot 222 when they are closest is directly used as the minimum distance, and the distance between the first light output module 210 and the workpiece corresponding to this minimum distance is calculated as the focusing distance, and further, the first light output module 210 is controlled to move according to this focusing distance to adjust the focal position of the first light output module 210 so that the focus of the first light output module 210 is located on the processing surface of the workpiece. Specifically, the method for adjusting the focal position of the first light output module 210 can be adjusted according to the actual settings and is not limited herein.

[0117] Referring to Figure 2 , in one embodiment, step S300, obtaining the image with the minimum distance between the first light spot 212 and the second light spot 222 among multiple images and using it as the target image, includes:

[0118] Step S321, identifying the first light spot 212 and the second light spot 222 in each image;

[0119] Step S322, calculating the distance between the first light spot 212 and the second light spot 222 in each image based on the center points of the first light spot 212 and the second light spot 222 in each image;

[0120] Step S323, obtaining the target image based on the distances between the first light spot 212 and the second light spot 222 in multiple images.

[0121] Identify the first light spot 212 and the second light spot 222 in each image through an algorithm, and calculate the distance between them using image processing techniques. Specifically, first determine the center points of the first light spot 212 and the second light spot 222 in each image, and then calculate the distance between the center point of the first light spot 212 and the center point of the second light spot 222 as the light spot distance. By comparing the light spot distances in multiple images, filter out the image with the smallest distance between the first light spot 212 and the second light spot 222, and use it as the target image for subsequent analysis or processing.

[0122] Optionally, to improve the accuracy of light spot identification, use image processing techniques (which may include preprocessing steps such as denoising, enhancement, edge detection, threshold segmentation, etc.) to analyze the features such as brightness, color, and shape of each image, so as to identify the first light spot 212 and the second light spot 222 that match the preset conditions (such as preset brightness thresholds, templates, etc.). The specific implementation method can be adjusted according to actual needs and is not limited here.

[0123] Refer to Figure 3 、 Figure 9 In one embodiment, step S322, based on the center points of the first light spot 212 and the second light spot 222 in each image, calculate the distance between the first light spot 212 and the second light spot 222 in each image, including:

[0124] Step S3221: Obtain the first target pixel points in the set of pixel points corresponding to the first light spot 212 in the image, the pixel values of the first target pixel points are greater than the first pixel threshold, obtain the coordinates of each first target pixel point, and calculate the coordinate average value of all the first target pixel points to obtain the coordinates of the center point of the first light spot 212 in the image;

[0125] Step S3222: Obtain the second target pixel points in the set of pixel points corresponding to the second light spot 222 in the image, the pixel values of the second target pixel points are greater than the second pixel threshold, obtain the coordinates of each second target pixel point, and calculate the coordinate average value of all the second target pixel points to obtain the coordinates of the center point of the second light spot 222 in the image;

[0126] The foregoing step S3221 and step S3222 can be carried out simultaneously or successively.

[0127] Step S3223: Based on the coordinates of the center point of the first light spot 212 and the coordinates of the center point of the second light spot 222 in the image, calculate the distance between the first light spot 212 and the second light spot 222 in the image.

[0128] A light spot is usually formed by a set of pixels with relatively high pixel values. To determine the center position of the light spot and calculate the distance between two light spots. First, by setting a first pixel threshold, the pixels in the image whose pixel values exceed this threshold are screened out. These pixels form the set of the first light spot 212, and then the average value of the coordinates of these pixels is calculated to obtain the center point coordinates of the first light spot 212. Similarly, by setting a second pixel threshold, the set of pixels that form the second light spot 222 is screened out, and the center point coordinates of the second light spot 222 are calculated. Specifically, any one of the pixel values 80, 85, 90 or any other arbitrary pixel value is used as the first pixel threshold. All the pixels greater than this first pixel threshold in the set of pixels corresponding to the first light spot 212 in the image are obtained and determined as the first target pixels, and the coordinates of each first target pixel are obtained. The average value of the coordinates of all the first target pixels is calculated, and the average value obtained after calculation is used as the coordinates of the center point of the first light spot 212 in the image; similarly, any one of the pixel values 80, 85, 90 or any other arbitrary pixel value is used as the second pixel threshold, and the coordinates of the center point of the second light spot 222 are further obtained. Then, according to the coordinates of these two center points, the distance between them is calculated. By identifying the center points of the first light spot 212 and the second light spot 222 in each image and calculating the distance between them, the light spot distances in multiple images can be compared, so as to screen out the image with the smallest light spot distance. This helps to determine the optimal focusing position between the workpiece processing surface and the first light output module 210.

[0129] It should be noted that when performing steps S100 to S300 of the foregoing autofocus method, the first light output module 210 and the second light output module 220 are kept turned on. When performing step S400 and related steps, the second light output module 220 is optionally turned off; or, the first light output module 210 and the second light output module 220 are kept turned on.

[0130] In some embodiments, steps S100 to S300 can complete autofocus independently without performing subsequent focusing steps. Specifically, after performing step S300, based on the target image, the lifting distance corresponding to this image is obtained, and then the focusing distance is determined. Autofocus is achieved by controlling the first light output module to move to the position corresponding to the minimum distance between the first light spot 212 and the second light spot 222, without performing subsequent fine focusing steps.

[0131] In some other embodiments, when the autofocus method further includes a fine focusing step or when there are relatively high requirements for the actual focusing accuracy, steps S100 to S300 can be used as rough focusing steps to provide accurate focusing range and distance information for the subsequent fine focusing in step S400, ensuring that the focus of the first light output module 210 can accurately fall on the processing surface of the workpiece, reducing the difficulty of subsequent fine focusing, and optimizing the processing accuracy and quality.

[0132] Specifically, to further move and adjust the focal position of the laser and improve the adjustment accuracy of the laser focus, through the above steps S100, S200, S300 and related steps, rough focusing is achieved by controlling the first light output module to move to the position corresponding to the minimum distance between the first light spot 212 and the second light spot 222, and fine focusing is achieved through relevant steps of fine focusing. By controlling the movement of the first light output during the rough focusing stage and by obtaining the target image, the distance between the first light spot 212 and the second light spot 222 is minimized to control the focus of the first light output module 210 within a certain range; then, in the fine focusing stage, based on the target image, the X coordinate and / or Y coordinate of the center point of the first light spot 212 in the target image are obtained; based on the X coordinate and / or Y coordinate of the center point of the first light spot 212 and the preset mapping relationship, the distance between the processing surface of the workpiece and the first light output module 210, or the thickness of the workpiece is calculated; and based on the distance between the processing surface of the workpiece and the first light output module 210, or the thickness of the workpiece, the moving distance of the first light output module 210 is determined, and the first light output module 210 is controlled to move up or move down to adjust the focus of the first light output module 210 so that the focus is located on the processing surface, realizing autofocus, further realizing precise processing, improving processing accuracy, and optimizing the processing effect.

[0133] Through the aforementioned rough focusing and fine focusing after rough focusing, the precise adjustment of the focus of the first light output module 210 can be realized, enabling it to adapt to workpieces of different thicknesses, and further improving the accuracy and efficiency of processing. Through rough focusing, the focusing accuracy can be ensured to be within 3 mm; through fine focusing after rough focusing, the focusing accuracy can be ensured to be about 0.5 mm.

[0134] It should be noted that when the autofocus method further includes a fine focusing step or has relatively high requirements for the actual focusing accuracy, it also includes a fine focusing step. The coarse focusing is achieved through steps S100 to S300. The coarse focusing step provides an accurate focusing range and distance information for the subsequent fine focusing in step S400, ensuring that the focus of the first light output module 210 can accurately fall on the processing surface of the workpiece, reducing the difficulty of subsequent fine focusing, and optimizing the processing accuracy and quality. In this way, the precise adjustment of the focus of the first light output module 210 can be realized to adapt to workpieces with different thicknesses, further improving the processing accuracy and efficiency.

[0135] This application realizes fine focusing based on the principle of triangulation ranging. Specifically, the direction of the first light spot 212 output by the first light output module 210 is perpendicular to the surface of the processing platform 100 for laser processing. The direction of the second light spot 222 output by the second light output module 220 forms a certain inclination angle with the surface of the processing platform 100 and is used for auxiliary positioning or indication. The imaging module captures multiple images of the workpiece including the first light spot 212 and the second light spot 222 during the downward (or upward) movement of the first light output module 210. As the light output module (the first light output module 210, the second light output module 220) moves, the positions of the first light spot 212 and the second light spot 222 will change. The principle of triangulation ranging is applied to these captured images. By analyzing the position changes of the first light spot 212 and the second light spot 222, the position change of the light output module relative to the workpiece surface is determined. Combining the known geometric relationships and system parameters (such as the inclination angle of the second light output module 220, etc.), the distance between the light output module and the workpiece surface can be calculated, and further the thickness of the workpiece can be obtained. For example, if the thickness or shape of a certain part of the workpiece is known, the thickness of the workpiece can be indirectly obtained by calculating the distance difference between this part and the light output module. Since the first light output module 210 projects the first light spot 212 vertically onto the workpiece, while the second light output module 220 projects the second light spot 222 at an inclination angle, the central position of the second light spot 222 changes with the distance from the workpiece, while the position of the first light spot 212 is relatively stable. If the second light spot 222 is selected, determining the distance between the processing surface of the workpiece and the first light output module 210 or the thickness of the workpiece from the position information of the second light spot 222 has relatively high requirements for the area of the workpiece (or the processing platform 100), the projection position of the second light spot 222, and the moving distance of the laser head 230. Moreover, simultaneously projecting the first light spot 212 and the second light spot 222 will affect the adjustment effect of the laser focus. Therefore, in the embodiments of this application, the first light spot 212 is selected, and the position information of the first light output module 210 is determined from the center point coordinate position of the first light spot 212. And mainly taking the adjustment of the focus of the first light output module 210 based on the target image to make the focus located on the processing surface of the workpiece as an example for elaboration.

[0136] Refer toFigure 4 , in a specific embodiment, step S400, adjusting the focus of the first light output module 210 based on the target image so that the focus is located on the processing surface of the workpiece, includes:

[0137] Step S410, calculating the distance between the processing surface of the workpiece and the first light output module 210, or the thickness of the workpiece, based on the position information of the first light spot 212 in the target image;

[0138] Step S420, adjusting the focus of the first light output module 210 based on the distance between the processing surface of the workpiece and the first light output module 210, or the thickness of the workpiece, so that the focus is located on the processing surface.

[0139] It can be understood that specifically, the distance between the processing surface of the workpiece and the first light output module 210 can be calculated based on the position information of the first light spot 212 in the target image; or, the thickness of the workpiece can be calculated based on the position information of the first light spot 212 in the target image; or, the distance between the processing surface of the workpiece and the first light output module 210 can be calculated based on the position information of the first light spot 212 in the target image, and the thickness of the workpiece can be further deduced.

[0140] This embodiment mainly takes calculating the distance between the processing surface of the workpiece and the first light output module 210 based on the position information of the first light spot 212 in the target image as an example for illustration. Related embodiments of calculating the thickness of the workpiece based on the position information of the first light spot 212 in the target image; and calculating the distance between the processing surface of the workpiece and the first light output module 210 based on the position information of the first light spot 212 in the target image and further deducing the thickness of the workpiece can be correspondingly referred to and will not be elaborated one by one. Specifically, by obtaining the target image (i.e., the image with the minimum distance between the first light spot 212 and the second light spot 222), the position of the first light spot 212 in the image can be accurately determined. Then, using the optical principle and known geometric relationships (such as the triangulation ranging principle), the distance between the first light output module 210 and the processing surface of the workpiece is calculated. Based on this distance (or the thickness of the workpiece), the first light output module is moved by the lifting module 500 or other means to adjust its focus so that it is located on the processing surface of the workpiece. In this way, automatic focusing can be achieved, and the accuracy and efficiency of subsequent processing can be improved.

[0141] Refer to Figure 5 , in an embodiment, step S410, calculating the distance between the processing surface of the workpiece and the first light output module 210, or the thickness of the workpiece, based on the position information of the first light spot 212 in the target image, includes:

[0142] Step S411, obtaining the X coordinate and / or Y coordinate of the center point of the first light spot 212 in the target image;

[0143] Step S412: Based on the X coordinate and / or Y coordinate of the center point of the first light spot 212 and a preset mapping relationship, calculate the distance between the processing surface of the workpiece and the first light output module 210, or the thickness of the workpiece.

[0144] By obtaining the X coordinate and / or Y coordinate of the center point of the first light spot 212 in the target image (i.e., the image with the minimum distance between the first light spot 212 and the second light spot 222), key data can be provided for subsequent distance or thickness calculation. Specifically, the coordinate values of the center point of the first light spot 212 and the preset mapping relationship are used to calculate the distance between the processing surface of the workpiece and the first light output module, or further deduce the thickness of the workpiece.

[0145] Among them, the preset mapping relationship is used to determine the corresponding relationship between the coordinate position of the center point of the light spot and the position information of the first light output module 210 according to the principle of triangulation ranging. The preset mapping relationship is usually established through experiments or calibration processes. It describes the corresponding relationship between the position of the center point of the first light spot 212 in the image (i.e., the X coordinate and / or Y coordinate) and the distance between the first light output module 210 and the processing surface of the workpiece. This relationship may be linear, non-linear, or based on a certain mathematical model; in other words, when the preset mapping relationship of the coordinate position of the center point of the first light spot 212 and the position of the first light output module 210 (corresponding to the distance between the processing surface of the workpiece and the first light output module 210, or corresponding to the thickness of the workpiece) is clear, the position information of the light output module corresponding to the coordinate position of the center point can be directly determined according to the coordinate position of the center point of the first light spot 212 (such as the distance between the processing surface of the workpiece and the first light output module 210, the thickness of the workpiece). It can be specifically determined according to the actual situation and is not limited here.

[0146] Steps S411 and S412 achieve accurate calculation of the distance between the processing surface of the workpiece and the light output module or the thickness of the workpiece by obtaining the coordinate information of the light spot and combining the preset mapping relationship. This process provides key data for subsequent focus adjustment, ensuring that the focus of the light output module can accurately fall on the processing surface of the workpiece, thereby improving the processing accuracy and efficiency.

[0147] During implementation, specifically, the preset mapping relationship between the coordinate position of the center point of the first light spot 212 and the position of the first light output module 210 can be directly obtained by calling a pre-stored calibration file or the like; alternatively, the relationship between the coordinate position of the center point of the first light spot 212 and the position of the first light output module 210 can be determined according to the principle of triangulation ranging, and the preset mapping relationship between the coordinate position of the center point of the first light spot 212 and the position of the first light output module 210 can be determined by repeatedly adjusting the focal position of the first light output module 210. In this application, the preset mapping relationship between the coordinate position of the center point of the first light spot 212 and the position of the first light output module 210 is mainly determined by directly calling a pre-stored calibration file, which can effectively reduce the operation difficulty and complexity, facilitate precise machining, and improve the machining accuracy.

[0148] Referring to Figure 6 , as an example, step S420, adjusting the focus of the first light output module 210 based on the distance between the machining surface of the workpiece and the first light output module 210, or the thickness of the workpiece, so that the focus is located on the machining surface, includes:

[0149] Step S421, determining the moving distance of the first light output module 210 based on the distance between the machining surface of the workpiece and the first light output module 210, and controlling the first light output module 210 to move up or down to adjust the focus of the first light output module 210 so that the focus is located on the machining surface;

[0150] The moving distance is determined based on the actual distance between the machining surface of the workpiece and the first light output module 210. In this process, according to the determined actual distance between the machining surface of the workpiece and the first light output module 210, the distance that the first light output module 210 needs to move up or down can be accurately calculated to ensure that the laser focus exactly falls on the machining surface of the workpiece. This method reduces the calculation process, while ensuring the accuracy and efficiency of laser machining, and is particularly suitable for application scenarios with high requirements for the accuracy of measurement equipment.

[0151] Referring to Figure 6 , as another example, step S420, adjusting the focus of the first light output module 210 based on the distance between the machining surface of the workpiece and the first light output module 210, or the thickness of the workpiece, so that the focus is located on the machining surface, includes:

[0152] Step S422, determining the moving distance of the first light output module 210 based on the thickness of the workpiece, and controlling the first light output module 210 to move up or down to adjust the focus of the first light output module 210 so that the focus is located on the machining surface.

[0153] The moving distance of the first light output module 210 is determined based on the thickness of the workpiece. In this case, it is assumed that the light spot of the first light output module 210 is located at the center (or other position) of the processing platform 100. According to this assumed position and the thickness of the workpiece, the moving distance that the first light output module 210 needs to move can be calculated so as to align the laser focus with the processing surface of the workpiece with the corresponding thickness. This method simplifies the calculation process and directly uses the workpiece thickness to determine the moving distance, and is applicable to application scenarios with certain requirements for the measurement accuracy of the workpiece thickness.

[0154] In the related art, contact ranging and TOF ranging are generally also used for focusing. However, for contact ranging, a detection component similar to a probe needs to be used for detection, and the laser focus is adjusted by detecting the distance between the light-emitting component and the processing platform 100; for TOF ranging, the laser focus is adjusted by measuring the flight time of light with a specific frequency. Since additional detection components and ranging hardware are required, the processing cost is increased and the operation difficulty is relatively high. In this embodiment, through the foregoing step S421 or step S422, by controlling the first light output module 210 to move up or move down, the focus of the first light output module 210 is adjusted so that the focus is located on the processing surface, thereby realizing automatic focusing. Different from contact ranging and TOF ranging in the related art, the embodiment of the present application can effectively reduce the use of detection components and additional ranging hardware. Based on the target image, the focus of the first light output module is adjusted so that the focus is located on the processing surface of the workpiece, thereby realizing automatic focusing, reducing manual participation, effectively reducing operation errors, reducing the operation difficulty, controlling the processing after adjusting the focus of the first light output module, and enabling relatively precise processing and optimizing the processing effect.

[0155] In the present application, the specific implementation process of determining the preset mapping relationship between the coordinate position of the center point of the first light spot 212 and the position of the first light output module 210 is as follows:

[0156] Figure 12 、 Figure 13It is shown that when the processing equipment leaves the factory, it will be calibrated to determine the preset mapping relationship between the coordinate position of the center point of the first light spot 212 and the position of the first light output module 210. When calibrating each height, a set of parameters is obtained according to the captured image, that is, the pixel position CX of the center point of the first light spot 212 of the first light output module 210 and the spatial position (X, Y, Z) of the first light output module 210 corresponding to this pixel position, and then this set of parameters is regrouped. Defining the center point of the first light spot 212 as the irradiation point. For example, when performing the calibration process for a certain height, the pixel position Cx of the obtained irradiation point and the spatial position (X, Y, Z) of the irradiation point form a set. This set is regrouped pairwise with the pixel position of the irradiation point and each coordinate value to obtain three sets of parameters, namely (CX, Z), (X, Z), and (Y, Z). By analogy for each height, three sets of parameters are obtained through regrouping. For all heights, the same set of parameters is grouped together. For example, all (CX, Z) are grouped together and linear fitting is performed. For example, linear fitting is performed on (CX0, Z0), (CX3, Z3), (CX6, Z6), (CX9, Z9), (CX12, Z12), and (CX15, Z15) to adapt to the performed regrouping. Through the performed linear fitting, the mapping from the spatial position of the irradiation point to the coordinate value is obtained. This mapping specifically includes the mapping from the spatial position to the Z-axis coordinate value, the mapping from the X-axis coordinate value to the Z-axis coordinate value, and the mapping from the Y-axis coordinate value to the Z-axis coordinate value. By analogy, the mapping from the pixel position of the irradiation point to the spatial position of the irradiation point is obtained.

[0157] The mapping from the pixel position of the irradiation point to the spatial position of the irradiation point indicates the coordinate values in the pixel position and the spatial position of the irradiation point, as well as the relationship between the coordinate values. This relationship can be characterized by a linear function and its coefficients. Therefore, the coefficients used for the linear function corresponding to the coordinate values and the coordinate values between the pixel position and the spatial position of the irradiation point will be obtained through linear fitting. From these coefficients, the corresponding linear function can be determined, and further the relationship between the spatial position of the irradiation point mapped by the pixel position of the irradiation point can be obtained, that is, the mapping relationship between the coordinate position of the center point of the first light spot 212 and the position of the first light output module 210.

[0158] The linear function obtained by linearly fitting the pixel position CX of the irradiation point and a coordinate value, i.e., the Z-axis coordinate value, is Z = a*CX + b; the linear function obtained by linearly fitting the X-axis coordinate value and the Z-axis coordinate value is X = c*Z + d; the linear function obtained by linearly fitting the Y-axis coordinate value and the Z-axis coordinate value is Y = e*Z + f. Among them, a, b, c, d, and e are coefficients read from the calibration file obtained by performing the calibration process. Therefore, the coefficients obtained by linear fitting are extracted to form the calibration file. Correspondingly, in the measurement of the measurement points, only by calling the calibration file can the calibration relationship between the pixel position of the irradiation point and the spatial position of the irradiation point (i.e., the preset mapping relationship between the coordinate position of the center point of the first light spot 212 and the position of the first light output module 210) be obtained. Since the irradiation in the numerical control machine coordinate system is located above the measurement point, the spatial position of the irradiation point is the same as the spatial position of the measurement point. Therefore, in the measurement of the measurement points in the embodiment, only by substituting the pixel position of the irradiation point into the above calibration relationship can the spatial position of the measurement point be obtained.

[0159] Figure 14 , Figure 15 Fig. shows a schematic diagram of the fine focusing measurement process. When performing specific calculations, first, the coefficients are read from the calibration file, and formulas are constructed from the read coefficients, that is, the spatial position of the measurement point and a coordinate value Z = a*CX + b, and the linear functions between the coordinate values X = c*Z + d and Y = e*Z + f are constructed.

[0160] For the image obtained by the imaging module, that is, the spatial position CX' is obtained by image recognition of the red dot (the center point of the first light spot 212), and then Z', Y', and X' are sequentially calculated from the constructed linear functions; Z', Y', and X' constitute the spatial position of the measurement point (i.e., the position of the first light output module). For obtaining the pixel position of the irradiation point according to the captured image, since the captured image is a content description of the irradiation point formed by the camera in the numerical control machine capturing the light beam, and the captured irradiation point is expressed by pixels on the captured image, the captured image can be subjected to image recognition to obtain the pixels where the irradiation point is located, and finally, the pixel position of the irradiation point can be obtained through the pixel position where the captured irradiation point is located. This is the acquisition of the pixel position of an irradiation point. By analogy, the pixel positions of the irradiation points corresponding to multiple measurement points in the multi-point array are all obtained through this process via the captured image. Through the measurement grid, the measurement of several measurement points is achieved for the processing of the workpiece, and the spatial position of the area where the measurement points are located is more accurately determined.

[0161] Figure 12 and Figure 14 It is used to explain the solution of the present application and should not be construed as a limitation of the present application. In practice, the laser output by the first light output module can be perpendicular to the workpiece, and the imaging module can be inclined relative to the workpiece.

[0162] Specifically, the position of the first light output module 210 of the present application can be obtained according to the actual settings and the specific solutions of related technologies, which is not limited herein.

[0163] As a specific embodiment of the present application, referring to Figure 7 , Figure 16 , Figure 17 , the present application further provides a laser processing device, which includes a processing platform 100, a first light output module 210, a second light output module 220, a camera module 300, and a processor 400.

[0164] The processing platform 100 is used to place the workpiece. The first light output module 210 is used to output a first light spot 212. The laser focus of the first light output module 210 is adjustable. The first light output module 210 can move up or down. The first light output module 210 is used for laser processing. The second light output module 220 is used to output an indicating second light spot 222.

[0165] The camera module 300 is used to collect images of the workpiece including the first light spot 212 and the second light spot 222 at multiple different distances. The multiple different distances are the distances between the first light output module 210 and the processing platform 100. The processor 400 is used to control the movement of the first light output module 210 and control the operation of the camera module 300 to implement the automatic focusing method of the above laser processing device.

[0166] Taking a laser or the like as the first light output module 210, the first light output module 210 is used to output the first light spot 212 for laser processing to the workpiece; the first light output module 210 can move up or down in the vertical direction relative to the processing platform 100 to adapt to workpieces of different thicknesses. The second light output module 220 can be, but is not limited to, used to emit infrared light, ultraviolet light, or the second light output module 220 is used to output one or more colored light spots such as red, blue, yellow, etc. as the second light spot 222 to the workpiece; the second light spot 222 is mainly used as a position reference. The imaging module 300 is used to collect images of the workpiece including the first light spot 212 and the second light spot 222 at multiple different distances during the movement of the first light output module 210; the imaging module 300 optionally includes a camera (such as a CMOS or CCD camera), a lens, an image acquisition card, etc. The imaging module 300 can be specifically arranged on the light output module (the first light output module 210, the second light output module 220) or at any other position such as on the laser processing equipment or outside the laser processing equipment, for obtaining images such as the shooting picture of the workpiece or the processing platform 100. The images obtained by the imaging module can be directly displayed through the user interface, and the first light spot 212 projected by the first light output module 210 onto the workpiece and the second light spot 222 output by the second light output module 220 onto the workpiece are respectively represented by images of different colors. To distinguish the light spots output by the first light output module 210 and the second light output module 220 to the workpiece, specifically, the first light output module 210 and the second light output module 220 can be set to output the first light spot 212 and the second light spot 222 with different colors, or the imaging module 300 automatically uses images of different colors to display the two light spots after identifying the first light spot 212 and the second light spot 222; specifically, it can be set according to the actual situation and is not limited here.

[0167] The processor 400 is used to control the movement of the first light output module 210 and the operation of the imaging module 300, is used to process the image data fed back by the imaging module 300, determine the optimal laser focus position, and send a control signal to the first light output module 210 to adjust the focus of the first light output module 210 to achieve autofocus. Specifically, the processor 400 controls the first light output module 210 to descend, and obtains images of the workpiece including the first light spot 212 and the second light spot 222 at multiple different distances collected by the imaging module 300, for determining the different positions of the first light spot 212 and the second light spot 222 output to the workpiece at different distances; the processor 400 is also used to obtain the image with the smallest distance between the first light spot 212 and the second light spot 222 among the multiple images and use it as the target image; based on the target image, the focus of the first light output module 210 is adjusted so that the focus is located on the processing surface of the workpiece.

[0168] In this way, automatic focusing can be achieved. By reducing manual intervention, operation errors can be effectively reduced, precise machining can be realized, and the machining effect can be optimized.

[0169] In some embodiments, the processor 400 can control the movement of the first light output module 210 and the operation of the imaging module 300 based on the machining instructions sent by the terminal device 700 to achieve automatic focusing. Specifically, it can be based on the embodiments of the above automatic focusing method.

[0170] In one embodiment, the direction of the first light spot 212 output by the first light output module 210 is perpendicular to the surface of the machining platform 100, and the direction of the second light spot 222 output by the second light output module 220 forms an inclination angle with the surface of the machining platform 100.

[0171] The first light beam 211 (such as a laser beam) output by the first light output module 210 is perpendicular to the surface of the machining platform 100, and the first light beam 211 is output to the workpiece to form the first light spot 212. The aim is to ensure that the laser energy is concentrated at a point on the workpiece to the maximum extent, realizing precise laser machining operations such as cutting, welding, and punching. The perpendicular output direction helps to maintain the stability and accuracy of the laser beam, while reducing energy loss and machining errors caused by angular deviation. The second light spot 222 (such as infrared light, ultraviolet light, or a colored light spot) output by the second light output module 220 forms a certain inclination angle with the surface of the machining platform 100. The inclination angle makes the second light spot 222 form a mark on the workpiece machining surface that is distinguishable from the first light spot 212, facilitating the operator or the device itself to identify and adjust the position of the first light output module 210 accordingly, and then precisely adjusting its focus.

[0172] Refer to Figure 16 、 Figure 17 In one embodiment, the laser processing device further includes a laser head 230, and the first light output module 210 and the second light output module 220 are integrally arranged in the laser head 230.

[0173] Integrating the first light output module 210 and the second light output module 220 in the laser head 230 can significantly reduce the overall volume of the device, making the laser processing device more compact and portable. The mechanisms such as lenses configured in the laser head 230 also help to achieve beam collimation and focusing, ensuring that the first light beam 211 and the second light beam 221 can be efficiently and intensively guided to the workpiece surface to form clear light spots, thereby reducing the loss of the light beam during transmission and improving the energy utilization rate. In addition, the integrated design also facilitates the integrated control of the positions and angles of the first light output module 210 and the second light output module 220, which is used to simplify the operation process and reduce operation errors.

[0174] Refer to Figure 16 、 Figure 17, in one embodiment, the laser processing device further includes a lifting module 500, which is drivingly connected to the laser head 230 and is used to drive the laser head 230 to move up or down; alternatively, the lifting module 500 is used to drive the first light output module 210 to move up or down.

[0175] The first light output module 210 and the second light output module 220 of the present application can be either relatively independently arranged or integrally arranged on the same laser head 230. Optionally, the lifting module 500 is used to separately drive the first light output module 210 to move up or down to obtain multiple images including the first light output module 210 and the second light output module 220 at multiple different distances; or, the lifting module 500 is used to drive the first light output module 210 and the second light output module 220 to move up or down respectively; alternatively, when the first light output module 210 and the second light output module 220 are integrally arranged in the laser head 230, the lifting module 500 is transmission-connected to the laser head 230 and is used to drive the laser head 230 to move up or down while driving the first light output module 210 and the second light output module 220 to move up or down simultaneously.

[0176] Taking the lifting module 500 driving the laser head 230 to move up or down as an example, the lifting module 500 can be specifically arranged on the processing platform 100 or other positions of the laser processing device and is drivingly connected to the laser head 230 to drive the laser head 230 to move closer to or away from the processing platform 100. The direction of the first light spot 212 output by the first light output module 210 is perpendicular to the surface of the processing platform 100, and the direction of the second light spot 222 output by the second light output module 220 forms an inclination angle with the surface of the processing platform 100. The processor 400 is connected to the lifting module 500 and is used to control the lifting module 500 to drive the laser head 230 to move to adjust the distance between the first light output module 210 and the processing platform 100. The lifting module 500 can specifically be provided with a guide rail, a conveyor belt, a slider, a pull rod, a push-pull structure or other devices that can be used to drive the laser head 230 to move, which can be specifically set according to the actual situation and are not limited herein. Embodiments in which the lifting module 500 is used to separately drive the first light output module 210 and the second light output module 220 to move up or down can be referred to correspondingly and will not be elaborated herein.

[0177] In one embodiment, the laser processing device further includes a storage module, which is used to store a preset mapping relationship; and / or, is used to store the coordinate position (X coordinate and / or Y coordinate) of the center point of the first light spot 212 and the position information of the first light output module 210 corresponding to the coordinate position of the center point of the first light spot 212 (such as the distance between the processing surface of the workpiece and the first light output module 210, the thickness of the workpiece, etc.).

[0178] Control the first light output module 210 to descend. The imaging module 300 acquires images of the workpiece including the first light spot 212 and the second light spot 222 at different distances. The multiple obtained images can also be stored in the storage module; this is not limited here.

[0179] For the specific implementation manner of the laser processing equipment shown in this application, refer to the foregoing autofocus method. Since the laser processing equipment adopts all the technical solutions of all the above embodiments, it at least has all the beneficial effects brought by the technical solutions of the above embodiments. Therefore, they will not be elaborated one by one here.

[0180] Refer to Figure 8 , this application also provides an autofocus device for a laser processing equipment. The laser processing equipment includes a first light output module 210 and a second light output module 220. The first light output module 210 is used to output a light spot for laser processing, and the second light output module 220 is used to output an indicating light spot. The autofocus device includes a light output control module 610, an image acquisition module 620, and a focus adjustment module 630.

[0181] The light output control module 610 is used for: controlling the first light output module 210 to output the first light spot 212 to the workpiece, and controlling the second light output module 220 to output the second light spot 222 to the workpiece; and is also used for controlling the first light output module 210 to descend. The light output control module 610 is used to control the output states of the first light output module 210 and the second light output module 220, and helps the image acquisition module 620 acquire light spot images at different distances by controlling the moving actions of the first light output module 210 to move down and move up.

[0182] The image acquisition module 620 is used for: when the first light output module 210 descends, acquiring images of the workpiece including the first light spot 212 and the second light spot 222 at multiple different distances to obtain multiple images; and is also used for acquiring the image with the smallest distance between the first light spot 212 and the second light spot 222 among the multiple images and using it as the target image. The image acquisition module 620 is used for: acquiring images of the workpiece including the first light spot 212 and the second light spot 222 at multiple different distances during the process of the first light output module 210 moving down, and obtaining the target image by identifying the image with the smallest distance between the first light spot 212 and the second light spot 222 to help further realize autofocus.

[0183] The focus adjustment module 630 is configured to: based on the target image, adjust the focus of the first light output module 210 so that the focus is located on the machining surface of the workpiece. The focus adjustment module 630 calculates the distance and direction by which the focus needs to be adjusted according to the positional relationship between the first light spot 212 and the second light spot 222 in the target image based on the target image provided by the image acquisition module 620, and then drives the first light output module 210 to perform corresponding adjustments to adjust the focus position of the first light output module 210 so that the focus is accurately located on the machining surface of the workpiece.

[0184] In this way, automatic focusing can be achieved, reducing manual participation, effectively reducing operation errors, lowering the operation difficulty. Controlling the machining after adjusting the focus of the first light output module can achieve more precise machining and optimize the machining effect.

[0185] For the specific implementation manner of the automatic focusing device of the laser processing equipment shown in this application, refer to the foregoing laser processing equipment. Since the automatic focusing device adopts all the technical solutions of all the above embodiments, it at least has all the beneficial effects brought by the technical solutions of the above embodiments, so they will not be elaborated herein one by one.

[0186] This application also provides a laser processing system, which includes a laser processing equipment and a terminal device 700.

[0187] The laser processing equipment includes a first light output module 210, a second light output module 220 and an imaging module 300. The first light output module 210 is configured to output a light spot for laser processing, and the second light output module 220 is configured to output an indicating light spot. The laser focus of the first light output module 210 is adjustable.

[0188] The terminal device 700 is configured to control the first light output module 210 to output the first light spot 212 to the workpiece and control the second light output module 220 to output the second light spot 222 to the workpiece; control the first light output module 210 to descend, and control the imaging module 300 to collect images of the workpiece including the first light spot 212 and the second light spot 222 at multiple different distances to obtain a plurality of images; acquire the image with the smallest distance between the first light spot 212 and the second light spot 222 among the plurality of images and use it as the target image; based on the target image, adjust the focus of the first light output module 210 so that the focus is located on the machining surface of the workpiece.

[0189] The terminal device 700 is used to receive input instructions input by a user through input devices such as control buttons, touch screens, keyboards, and mice, and issue corresponding focusing instructions to the laser processing device according to the received input instructions. The lifting module, camera module, etc. of the laser processing device perform corresponding operations to achieve one-key automatic focusing. Specifically, the terminal device 700 is responsible for controlling the output states of the first light output module 210 and the second light output module 220, including on / off, output intensity, spot position, etc.; this ensures that the first spot 212 for laser processing and the second spot 222 for indication can be accurately projected onto the processing surface of the workpiece. The terminal device 700 also controls the lowering action of the first light output module 210 by issuing a lifting control instruction. In some other embodiments, the terminal device 700 is also used to control the rising action of the first light output module 210. During the process of controlling the first light output module 210 to move up or down, the terminal device 700 sends a collection instruction to the camera module 300 to trigger the camera module 300 to start collecting and obtaining images of the workpiece including the first spot 212 and the second spot 222 at different distances. The terminal device 700 receives the image data collected by the camera module 300 and performs processing and analysis. Specifically, the terminal device is used to identify the positions of the first spot 212 and the second spot 222 according to the obtained images, calculate the distance between the two, and find the image (target image) with the smallest distance. The terminal device 700 is also used to calculate the distance and direction that the first light output module 2101 needs to be adjusted based on the positional relationship between the first spot 212 and the second spot 222 in the target image. The terminal device 700 sends a focus adjustment instruction to the first light output module 210 to control it to make corresponding adjustments so that the focus is accurately located on the processing surface of the workpiece.

[0190] Each module in the laser processing device works in cooperation with the terminal device 700 to jointly achieve the automatic focusing and precise processing functions of laser processing, which not only improves the processing accuracy and efficiency, but also reduces the operation difficulty. By controlling the processing after adjusting the focus of the first light output module, relatively precise processing can be achieved and the processing effect can be optimized.

[0191] The terminal device 700 can control each module in the laser processing device based on the automatic focusing method provided in the above embodiments, thereby achieving automatic focusing. Specifically, during the automatic focusing process, the terminal device can issue an automatic focusing instruction to the laser processing device to control each module.

[0192] This application also provides a computer-readable storage medium, on which an automatic focusing program is stored. When the automatic focusing program is executed by the processor 400, it implements the automatic focusing method of the laser processing device as described above.

[0193] The computer-readable storage medium provided by the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0194] The above computer-readable storage medium may be included in a computer device; or may exist separately without being assembled into the computer device.

[0195] The above computer-readable storage medium carries one or more programs. When the one or more programs are executed by a computer device, the computer device is caused to: control the first light output module to output a first light spot to the workpiece and control the second light output module to output a second light spot to the workpiece; control the first light output module to descend, and obtain images of the workpiece including the first light spot and the second light spot at multiple different distances, obtaining a plurality of images; obtain the image with the smallest distance between the first light spot and the second light spot among the plurality of images, and use it as the target image; based on the target image, adjust the focus of the first light output module so that the focus is located on the processing surface of the workpiece.

[0196] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, by connecting through the Internet using an Internet service provider).

[0197] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and this module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks can occur in a different order than that marked in the accompanying drawings. For example, two consecutively represented blocks can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0198] The modules involved in the embodiments of this application can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation on the unit itself in some cases.

[0199] The readable storage medium provided by this application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for performing the above-mentioned automatic focusing method of the laser processing device, and can solve the problem of inability to automatically focus. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by this application are the same as those of the automatic focusing method of the laser processing device provided in the above embodiments, and will not be elaborated here.

[0200] The present application also provides a computer device, which includes: at least one processor 400; and a memory communicatively connected to the at least one processor 400; wherein, the memory stores an autofocus program executable by the at least one processor, and the autofocus program is executed by the at least one processor to enable the at least one processor 400 to execute the autofocus method of the laser processing device in the above embodiments.

[0201] The computer device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions: tablet computers), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The computer device shown in the present application is only an example and should not impose any restrictions on the functions and usage scope of the embodiments of the present application.

[0202] The computer device may include control components such as a processing device (such as a central processing unit, a graphics processing unit, etc.), which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) or a program loaded from a storage device into a random access memory (RAM: Random Access Memory). In the RAM, various programs and data required for the operation of the computer device are also stored. The processing device, the ROM, and the RAM are connected to each other through a bus. An input / output (I / O) interface is also connected to the bus. Generally, the following systems may be connected to the I / O interface: input devices including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; storage devices including, for example, magnetic tapes, hard disks, etc.; and a communication device. The communication device may allow the computer device to communicate with other devices wirelessly or wiredly to exchange data.

[0203] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, the above-mentioned functions defined in the methods of the embodiments disclosed in the present application are executed.

[0204] The computer device provided by the present application adopts the automatic focusing method of the laser processing device in the above embodiment to solve the problem of inability to automatically focus. Compared with the prior art, the beneficial effects of the computer device provided by the present application are the same as those of the automatic focusing method of the laser processing device provided in the above embodiment, and other technical features in the computer device are the same as those disclosed in the method of the previous embodiment, which will not be elaborated here.

[0205] It should be understood that the various parts disclosed in the present application can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.

[0206] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0207] The embodiments of the present application also provide a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the automatic focusing method of the laser processing device as described above are implemented.

[0208] The computer program product provided by the present application can solve the technical problem of inability to automatically focus. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiments of the present application are the same as those of the automatic focusing method of the laser processing device provided in the above embodiment, which will not be elaborated here.

[0209] The above is only the optional embodiment of the present application, and thus does not limit the patent scope of the present application. Any equivalent structural transformation made by using the content of the specification and drawings of the present application under the inventive concept of the present application, or directly / indirectly applied to other related technical fields, is included in the patent protection scope of the present application.

Claims

1. An autofocus method for a laser processing device, characterized in that The laser processing device includes a first light output module and a second light output module. The first light output module is used to output a light spot for laser processing, and the second light output module is used to output a light spot for indication. The automatic focusing method includes: Controlling the first light output module to output a first light spot to the workpiece and controlling the second light output module to output a second light spot to the workpiece; Controlling the first light output module to descend, and acquiring images of the workpiece including the first light spot and the second light spot at multiple different distances to obtain multiple images; Acquiring the image with the smallest distance between the first light spot and the second light spot among the multiple images, and using it as the target image; Based on the target image, adjusting the focus of the first light output module so that the focus is located on the processing surface of the workpiece.

2. The automatic focusing method of the laser processing equipment according to claim 1, characterized in that, Based on the target image, adjusting the focus of the first light output module so that the focus is located on the processing surface of the workpiece, including: Based on the position information of the first light spot in the target image, calculating the distance between the processing surface of the workpiece and the first light output module, or the thickness of the workpiece; Based on the distance between the processing surface of the workpiece and the first light output module, or the thickness of the workpiece, adjusting the focus of the first light output module so that the focus is located on the processing surface.

3. The automatic focusing method of the laser processing equipment according to claim 2, characterized in that, Based on the position information of the first light spot in the target image, calculating the distance between the processing surface of the workpiece and the first light output module, or the thickness of the workpiece, including: Acquiring the X coordinate and / or Y coordinate of the center point of the first light spot in the target image; Based on the X coordinate and / or Y coordinate of the center point of the first light spot and a preset mapping relationship, calculating the distance between the processing surface of the workpiece and the first light output module, or the thickness of the workpiece.

4. The automatic focusing method of the laser processing equipment according to claim 2, characterized in that, Based on the distance between the processing surface of the workpiece and the first light output module, or the thickness of the workpiece, adjusting the focus of the first light output module so that the focus is located on the processing surface, including: Based on the distance between the processing surface of the workpiece and the first light output module, determining the moving distance of the first light output module, and controlling the first light output module to move up or move down to adjust the focus of the first light output module so that the focus is located on the processing surface; Or, based on the thickness of the workpiece, determining the moving distance of the first light output module, and controlling the first light output module to move up or move down to adjust the focus of the first light output module so that the focus is located on the processing surface.

5. The automatic focusing method of the laser processing equipment according to claim 1, characterized in that, Acquiring the image with the smallest distance between the first light spot and the second light spot among the multiple images, including: If there is an image in which the center points of the first light spot and the second light spot coincide among the multiple images, then determining this image as the image with the smallest distance; If there is no image in which the center points of the first light spot and the second light spot coincide among the multiple images, then based on the distances between the first light spot and the second light spot in each of the images, obtain the image with the smallest distance.

6. The automatic focusing method of the laser processing equipment according to any one of claims 1 to 5, characterized in that The obtaining of the image with the smallest distance between the first light spot and the second light spot among the multiple images and using it as the target image includes: Identifying the first light spot and the second light spot in each of the images; Based on the center points of the first light spot and the second light spot in each of the images, calculating the distance between the first light spot and the second light spot in each of the images; Based on the distances between the first light spot and the second light spot in the multiple images, obtaining the target image.

7. The automatic focusing method of the laser processing equipment according to claim 6, characterized in that, The calculating of the distance between the first light spot and the second light spot in each of the images based on the center points of the first light spot and the second light spot in each of the images includes: Obtaining a first target pixel point in the set of pixel points corresponding to the first light spot in the image, where the pixel value of the first target pixel point is greater than a first pixel threshold, and obtaining the coordinates of each of the first target pixel points, and calculating the average value of the coordinates of all the first target pixel points to obtain the coordinates of the center point of the first light spot in the image; Obtaining a second target pixel point in the set of pixel points corresponding to the second light spot in the image, where the pixel value of the second target pixel point is greater than a second pixel threshold, and obtaining the coordinates of each of the second target pixel points, and calculating the average value of the coordinates of all the second target pixel points to obtain the coordinates of the center point of the second light spot in the image; Based on the coordinates of the center point of the first light spot and the coordinates of the center point of the second light spot in the image, calculating the distance between the first light spot and the second light spot in the image.

8. An automatic focusing device for a laser processing equipment, characterized in that, The laser processing device includes a first light output module and a second light output module. The first light output module is used to output a light spot for laser processing, and the second light output module is used to output an indicating light spot. The automatic focusing device includes: A light output control module, which is used to control the first light output module to output a first light spot to the workpiece and control the second light output module to output a second light spot to the workpiece; and is also used to control the first light output module to descend; An image acquisition module, which is used to acquire images of the workpiece including the first light spot and the second light spot at multiple different distances when the first light output module descends, to obtain multiple images; and to obtain the image with the smallest distance between the first light spot and the second light spot among the multiple images and use it as the target image; A focus adjustment module, which is used to adjust the focus of the first light output module based on the target image so that the focus is located on the processing surface of the workpiece.

9. A laser processing device, characterized in that, Including: A processing platform for placing the workpiece; A first light output module, which is used to output a first light spot, the laser focus of the first light output module is adjustable, the first light output module can move up or down, and the first light output module is used for laser processing; A second light output module for outputting a second light spot for indication. An imaging module for collecting images of a workpiece including the first light spot and the second light spot at multiple different distances, where the multiple different distances are the distances between the first light output module and the processing platform. A processor for controlling the movement of the first light output module and controlling the operation of the imaging module to implement the autofocus method of the laser processing device according to any one of claims 1 to 7.

10. The laser processing equipment according to claim 9, characterized in that, The direction in which the first light output module outputs the first light spot is perpendicular to the surface of the processing platform, and the direction in which the second light output module outputs the second light spot forms an inclination angle with the surface of the processing platform.

11. The laser processing device according to claim 9 or 10, characterized in that, The laser processing device further includes a laser head, and the first light output module and the second light output module are integrally provided in the laser head.

12. The laser processing device according to claim 11, characterized in that, The laser processing device further includes a lifting module. The lifting module is in transmission connection with the laser head to drive the laser head to move up or down. Alternatively, the lifting module is used to drive the first light output module to move up or down.

13. A laser processing system, characterized in that, Comprising: A laser processing device including a first light output module, a second light output module and an imaging module, where the first light output module is used to output a light spot for laser processing, the second light output module is used to output a light spot for indication, and the laser focus of the first light output module is adjustable. A terminal device for: controlling the first light output module to output a first light spot to the workpiece and controlling the second light output module to output a second light spot to the workpiece; controlling the first light output module to descend and controlling the imaging module to collect images of the workpiece including the first light spot and the second light spot at multiple different distances to obtain multiple images; obtaining the image with the smallest distance between the first light spot and the second light spot among the multiple images and using it as the target image. Based on the target image, adjusting the focus of the first light output module so that the focus is located on the processing surface of the workpiece.

14. A computer-readable storage medium, on which an autofocus program is stored, characterized in that, When the autofocus program is executed by the processor, it implements the autofocus method of the laser processing device according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • System and method for calibrating laser processing parameters

    CN114160961A

  • Shooting parameter automatic adjustment method and device, storage medium and industrial camera

    CN115225820A

  • Automatic focusing device for laser beams

    CN204430557U

  • Real-time automatic focusing system for microscope

    WO2021184169A1

Cited By

  • Laser focusing method and device, laser marking machine and computer readable storage medium

    CN121010599A

  • Laser focusing method, device, laser marking machine and computer-readable storage medium

    CN121010599B