Automatic focusing control method and system for laser processing system and laser processing equipment
By designing an autofocus control system in laser processing equipment, and using stepper motors and visual autofocus control systems to achieve automatic focus, the problems of long artificial focus time and low accuracy in the prior art are solved, and fast and accurate autofocus is achieved.
Patent Information
- Application Number
- CN202211033652.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2042-08-26
AI Technical Summary
The focus process of existing laser processing equipment relies on manual adjustment of adjustable collimator, which leads to long focus time, prone to errors, is not suitable for mass production, and manual operation can easily lead to loose collimator and unstable focal length.
An automatic focus control system for laser processing equipment is designed, including a control module, a stepper motor and a collimator. The reference image is collected and analyzed through the visual automatic focus control system, and the optimal focal length is automatically determined, and the automatic focus of the collimator is achieved through the stepper motor.
Automatic focus is realized, which significantly shortens the focus time, improves focus accuracy, reduces manual errors, is suitable for mass production, and avoids the problems of loose collimator and unstable focal length.
Smart Images

Figure CN115178857B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of lasers, and particularly relates to an automatic focusing control method and system for a laser processing system and a laser processing device. Background Art
[0002] At present, the focusing scheme of laser processing equipment uses an adjustable collimator, and the focal length is adjusted by manually adjusting the adjustable collimator. After adjusting the focal length, marking is performed on a reference image. By comparing the reference images marked with different focal lengths and manually judging which focal length is the best focal length. However, the disadvantages of manually adjusting the adjustable collimator to adjust the focal length are as follows: First, the focusing time is long. It is necessary to manually mark at different focal lengths. Each manual adjustment of the focal length is not fixed, and errors require repeated focusing. Generally, the average focusing test time (about 15 minutes) and marking time (about 5 minutes) of general workers take about 20 minutes, which is not convenient for mass production; Second, there are artificial visual errors or fatigue. When manually distinguishing the reference images marked with different focal lengths, subjective factors are too large, and it is easy to occur that the adjusted focal length is not the best focal length; Third, manual focusing will cause the adjustable collimator to be easily loosened, and there is a risk of focal length movement. Therefore, it is also necessary to fix it with glue. Once fixed, the focal length cannot be adjusted later. Summary of the Invention
[0003] The purpose of the present invention is to provide an automatic focusing control method and system for a laser processing system and a laser processing device, aiming to solve the problems existing in manually adjusting the adjustable collimator to adjust the focal length.
[0004] In a first aspect, the present invention provides an automatic focusing control system for a laser processing device, including a control module, a stepping motor, and a collimator that are electrically connected in sequence. The control module is connected to a host computer;
[0005] The control module is used to receive the signal from the host computer to generate a control signal for controlling the pulse and direction of the stepping motor; it is also used to generate a fixed interruption period, so that after the host computer receives the interruption, a control signal for the pulse and direction is sent to the control module in each interruption period; it is also used to receive the control signal for the pulse and direction and output a pulse to the stepping motor according to the control signal for the pulse and direction;
[0006] The stepping motor is used to control the focusing of the collimator according to the control signal of the control module.
[0007] In a second aspect, the present invention provides an automatic focusing control system for a laser processing device, including a control module, a stepping motor, and a collimator that are electrically connected in sequence. It also includes a visual automatic focusing control system. The visual focusing control system includes a processor and a video acquisition module electrically connected to the processor. The processor is electrically connected to the control module;
[0008] The video acquisition module is used to acquire all reference images of the marking area;
[0009] The processor is used to mark the corresponding relationship between the pixel coordinate positions and the stepping positions of each reference image through a contour search algorithm, perform image analysis on all reference images of the marking area, find the reference image with the largest gray value as the reference image of the best focal length, and obtain the stepping position of the reference image of the best focal length according to the corresponding relationship between the pixel coordinate positions and the stepping positions, and send it to the control module;
[0010] The control module is used to receive the stepping position of the reference image of the best focal length sent by the processor, and control the stepping motor to run to the specified focusing position according to the stepping position of the reference image of the best focal length; The control module is also used to generate a fixed interruption period, so that after the processor receives the interruption, a control signal of pulse and direction is sent to the control module every interruption period; The control module is also used to receive the control signal of pulse and direction, and output a pulse to the stepping motor according to the control signal of pulse and direction;
[0011] The stepping motor is used to control the focusing of the collimator according to the control signal of the control module.
[0012] In a third aspect, the present invention provides an automatic focusing control method for a laser processing device, including the following steps:
[0013] S201. Initialize the position of the collimator;
[0014] S202. The control module controls the stepping motor to mark a reference image every other stepping value in the marking area according to a fixed stepping value until the first preset number of reference images are marked. The marking area can accommodate the first preset number of reference images;
[0015] S203. The video acquisition module acquires all reference images of the marking area;
[0016] S204. The processor marks the corresponding relationship between the pixel coordinate positions and the stepping positions of each reference image through a contour search algorithm;
[0017] S205. The processor performs image analysis on all reference images of the marking area, finds the reference image with the largest gray value as the reference image of the best focal length, and obtains the stepping position of the reference image of the best focal length according to the corresponding relationship between the pixel coordinate positions and the stepping positions, and sends it to the control module;
[0018] S206. The control module controls the stepping motor to run to the specified focusing position according to the stepping position of the reference image of the best focal length.
[0019] Fourthly, the present invention provides a laser processing system, including the auto-focus control system of the laser processing equipment described in any one of the above.
[0020] In the present invention, since the auto-focus control system of the laser processing equipment includes a stepper motor, and the stepper motor controls the focusing of the collimator according to the control signal of the control module. Therefore, auto-focus can be achieved, the focusing time is short, which is convenient for mass production, and it is easy to adjust to the optimal focal length, and there is no need to apply glue to fix the collimator. Also, since it further includes a vision auto-focus control system, the video acquisition module is used to acquire all reference images of the marking area; the processor is used to mark the corresponding relationship between the pixel coordinate positions and the stepper positions corresponding to each reference image through a contour search algorithm, perform image analysis on all reference images of the marking area, find the reference image with the largest gray value as the reference image of the optimal focal length, and obtain the stepper position of the reference image of the optimal focal length according to the corresponding relationship between the pixel coordinate positions and the stepper positions, and send it to the control module. Therefore, only one photo identification is needed to find the optimal focal length position, which saves the time of photo identification and can also reduce the interference of light and shadow. Because at different times or in an interfering environment, the light and shadow will be different, which will greatly affect the result of image recognition and may bring incorrect detection results due to light and shadow. And the present application uses the same reference image, and all environmental conditions are exactly the same, thereby reducing the influence of external interference and making the recognition more accurate and rapid. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of the auto-focus control system of the laser processing equipment provided by an embodiment of the present invention.
[0022] Figure 2 It is a schematic diagram of the auto-focus control system of the laser processing equipment provided by another embodiment of the present invention.
[0023] Figure 3 It is a flowchart of the auto-focus control method of the laser processing equipment provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0024] In order to make the objectives, technical solutions and beneficial effects of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0025] In order to illustrate the technical solutions described in the present invention, the following will be described through specific embodiments.
[0026] Please refer to Figure 1, the automatic focusing control system of the laser processing equipment provided by an embodiment of the present invention includes a control module 11, a stepping motor 12, and a collimator 13 that are electrically connected in sequence. The control module 11 is connected to the host computer. The control module 11 is used to receive the signal from the host computer to generate a control signal for controlling the pulse and direction of the stepping motor. The control module 11 generates a fixed interrupt period. For example, 1 ms is selected as the interrupt period. After the host computer receives the interrupt, a control signal for the pulse and direction is sent to the control module 11 in each interrupt period; the control module 11 receives the control signal for the pulse and direction, and outputs a pulse to the stepping motor 12 according to the control signal for the pulse and direction; the stepping motor 12 is used to control the focusing of the collimator according to the control signal of the control module 11.
[0027] In an embodiment of the present invention, the number of pulses in each interrupt period is evenly distributed, so as to ensure the stability of the frequency and ensure the smooth operation of the stepping motor.
[0028] In an embodiment of the present invention, the control module 11 may be an FPGA module.
[0029] Please refer to Figure 2 , the automatic focusing control system of the laser processing equipment provided by another embodiment of the present invention includes a control module 21, a stepping motor 22, and a collimator 23 that are electrically connected in sequence, and further includes a visual automatic focusing control system 24. The visual focusing control system 24 includes a processor 241, a video acquisition module 242, and a video output module 243 that are electrically connected to the processor 241 respectively. The processor 241 is electrically connected to the control module 21;
[0030] The video acquisition module 242 is used to acquire all reference images of the marking area; the processor 241 is used to mark the corresponding relationship between the pixel coordinate position and the stepping position of each reference image through a contour search algorithm, perform image analysis on all reference images in the marking area, find the reference image with the largest gray value as the reference image of the best focal length, and obtain the stepping position of the reference image of the best focal length according to the corresponding relationship between the pixel coordinate position and the stepping position, and send it to the control module; the video output module 243 is used to output the video of the reference image marked with the best focal length; the control module 21 is used to receive the stepping position of the reference image of the best focal length sent by the processor 241, and control the stepping motor to run to the specified focusing position according to the stepping position of the reference image of the best focal length; the control module 21 generates a fixed interrupt period. For example, 1 ms is selected as the interrupt period. After the processor 241 receives the interrupt, a control signal for the pulse and direction is sent to the control module 21 in each interrupt period; the control module 21 receives the control signal for the pulse and direction, and outputs a pulse to the stepping motor 22 according to the control signal for the pulse and direction; the stepping motor 22 is used to control the focusing of the collimator according to the control signal of the control module 21.
[0031] In another embodiment of the present invention, the control module 21, the stepper motor 22, and the collimator 23 are built into the laser
[0032] processing equipment. The vision autofocus control system 24 and the laser processing equipment can be two independent devices. The vision autofocus control system 24 can also be built into the laser processing equipment, so as to play a role in fields such as curved surface marking in the future.
[0033] Please refer to Figure 3 , the autofocus control method for the laser processing equipment provided by an embodiment of the present invention includes the following steps:
[0034] S201. Initialize the position of the collimator.
[0035] In another embodiment of the present invention, S201 may specifically be: Initialize the position of the collimator through the limit switch.
[0036] S202. The control module controls the stepper motor to mark a reference image at each step value in the marking area at a fixed step value until the first preset number of reference images are marked. The marking area can accommodate the first preset number of reference images.
[0037] S203. The video acquisition module acquires all the reference images in the marking area.
[0038] S204. The processor marks the corresponding relationship between the pixel coordinate position and the step position of each reference image through the contour search algorithm.
[0039] S205. The processor performs image analysis on all the reference images in the marking area, finds the reference image with the largest gray value as the reference image of the best focal length, and obtains the step position of the reference image of the best focal length according to the corresponding relationship between the pixel coordinate position and the step position, and sends it to the control module.
[0040] S206. The control module controls the stepper motor to run to the specified focusing position according to the step position of the reference image of the best focal length.
[0041] In another embodiment of the present invention, S205 may specifically include the following steps:
[0042] Store all the reference images in the marking area into the BRAM (Block RAM);
[0043] For each reference image in the BRAM, find the circumscribed rectangle of each reference image using the contour search algorithm and record the corresponding step value;
[0044] Adopt a grayscale contrast algorithm to identify the circumscribed rectangle and the stepping position corresponding to the reference image with the largest cumulative grayscale value, and use the stepping position as the stepping position of the reference image with the best focal length.
[0045] In another embodiment of the present invention, S205 further includes the following steps:
[0046] The video output module marks the reference image with the best focal length in the video.
[0047] In another embodiment of the present invention, the step of adopting a grayscale contrast algorithm to identify the circumscribed rectangle and the stepping position corresponding to the reference image with the largest cumulative grayscale value, and using the stepping position as the stepping position of the reference image with the best focal length may specifically include the following steps:
[0048] Adopt a grayscale contrast algorithm to identify the circumscribed rectangle and the stepping position corresponding to the second preset number of reference images with the largest cumulative grayscale value;
[0049] Based on the stepping positions corresponding to the second preset number of reference images, calculate the start and end positions of the second preset number of stepping positions, subdivide and adjust with a smaller stepping value, rescreen once according to S202, S203, S204 and S205, record the stepping position of the reference image with the largest grayscale value, and use the stepping position as the stepping position of the reference image with the best focal length.
[0050] Since the best focus position during actual testing may be affected by light and accuracy, there may be several reference images with similar grayscale values, and the recognition is not stable enough. In another embodiment of the present invention, to solve this problem, S205 may include the following steps:
[0051] The processor performs image analysis on all reference images in the marking area, finds multiple reference images with grayscale values greater than or equal to the preset grayscale threshold, sorts the grayscale values of the multiple reference images, selects the reference image with the grayscale value in the middle as the reference image with the best focal length, and obtains the stepping position of the reference image with the best focal length according to the corresponding relationship between the pixel coordinate position and the stepping position, and sends it to the control module. Thus, the result can be made more accurate and reliable.
[0052] The embodiment of the present invention also provides a laser processing system, including the automatic focusing control system of the laser processing equipment provided by an embodiment or another embodiment of the present invention.
[0053] It should be noted that the processor 241 in the embodiments of the present invention is one of FPGA or MCU, and preferably FPGA is adopted. This is because, through experimental verification, the adoption of FPGA in this embodiment can complete all image algorithm designs (such as image acquisition algorithm, preprocessing algorithm, contour search algorithm, grayscale comparison algorithm, and marker display algorithm, etc.), and its performance is better than that of the commonly used MCU, and the recognition speed is faster.
[0054] In the present invention, since the autofocus control system of the laser processing equipment includes a stepper motor, and the stepper motor controls the focusing of the collimator according to the control signal of the control module. Therefore, automatic focusing can be achieved, the focusing time is short, it is convenient for mass production, and it is easy to adjust to the best focal length, and there is no need to glue and fix the collimator. Also, since it further includes a vision autofocus control system, the video acquisition module is used to acquire all reference images of the marking area; the processor is used to mark the corresponding relationship between the pixel coordinate positions and the stepper positions corresponding to each reference image through the contour search algorithm, perform image analysis on all reference images of the marking area, find the reference image with the largest grayscale value as the reference image of the best focal length, and obtain the stepper position of the reference image of the best focal length according to the corresponding relationship between the pixel coordinate positions and the stepper positions, and send it to the control module. Therefore, only one photo recognition is needed to find the best focal length position, which saves the time of photo recognition and can also reduce the interference of light and shadow, because at different times or in an interfering environment, the light and shadow will be different, which will greatly affect the result of image recognition and may bring incorrect detection results due to light and shadow. And the application adopts the same reference image, and all environmental conditions are exactly the same, thereby reducing the influence of external interference, and the recognition is more accurate and rapid.
[0055] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An automatic focusing control system for a laser processing device, characterized in that, It includes a control module, a stepper motor, and a collimator that are electrically connected in sequence, and also includes a visual autofocus control system. The visual autofocus control system includes a processor and a video acquisition module electrically connected to the processor, and the processor is electrically connected to the control module; The video acquisition module is used to collect all the reference images in the marking area when the control module controls the stepper motor to mark a reference image at each step value in the marking area at fixed step values until the first preset number of reference images are marked. The marking area can accommodate the first preset number of reference images; The processor is used to mark the corresponding relationship between the pixel coordinate position and the step position of each reference image through a contour search algorithm, perform image analysis on all the reference images in the marking area, find the reference image with the largest gray value as the reference image of the best focal length, and obtain the step position of the reference image of the best focal length according to the corresponding relationship between the pixel coordinate position and the step position, and send it to the control module; specifically including: storing all the reference images in the marking area into the BRAM; using the contour search algorithm to find the circumscribed rectangle of each reference image in the BRAM and record the corresponding step value; adopting a gray scale comparison algorithm to identify the circumscribed rectangle and step position corresponding to the reference image with the largest cumulative gray value, and taking the step position as the step position of the reference image of the best focal length; The control module is used to receive the step position of the reference image of the best focal length sent by the processor, and control the stepper motor to run to the specified focusing position according to the step position of the reference image of the best focal length; the control module is also used to generate a fixed interruption period so that after the processor receives the interruption, a control signal of pulse and direction is sent to the control module every interruption period; the control module is also used to receive the control signal of pulse and direction, and output a pulse to the stepper motor according to the control signal of pulse and direction; The stepper motor is used to control the focusing of the collimator according to the control signal of the control module.
2. The automatic focusing control system for a laser processing device according to claim 1, characterized in that, The autofocus control system further includes a video output module electrically connected to the processor, which is used to output the video of the reference image marked with the best focal length.
3. The automatic focusing control system for a laser processing device according to claim 1, characterized in that, The FPGA module, the stepper motor, and the collimator are built in the laser processing equipment. The visual autofocus control system and the laser processing equipment are two independent devices, or the visual autofocus control system is built in the laser processing equipment.
4. An automatic focusing control method for a laser processing device, characterized in that, It includes the following steps: S201. Initialize the position of the collimator; S202. The control module controls the stepper motor to mark a reference image at each step value in the marking area at fixed step values until the first preset number of reference images are marked. The marking area can accommodate the first preset number of reference images; S203. The video acquisition module collects all the reference images in the marking area; S204. The processor marks the corresponding relationship between the pixel coordinate position and the step position of each reference image through a contour search algorithm; S205. The processor performs image analysis on all reference images in the marking area, finds the reference image with the largest gray value as the reference image for the best focal length, obtains the stepping position of the reference image for the best focal length according to the corresponding relationship between the pixel coordinate position and the stepping position, and sends it to the control module; S206. The control module controls the stepping motor to run to the specified focusing position according to the stepping position of the reference image for the best focal length; S205 specifically includes the following steps: Store all reference images in the marking area in the BRAM; For each reference image in the BRAM, use the contour search algorithm to find the circumscribed rectangle of each reference image and record the corresponding stepping value; Adopt the gray-scale comparison algorithm to identify the circumscribed rectangle and the stepping position corresponding to the reference image with the largest cumulative gray value, and use the stepping position as the stepping position of the reference image for the best focal length.
5. The automatic focusing control method for a laser processing device according to claim 4, characterized in that, S201 is specifically: Initialize the position of the collimator through the limit switch.
6. The automatic focusing control method for a laser processing device according to claim 5, characterized in that, S205 further includes the following steps: The video output module marks the reference image for the best focal length in the video.
7. The automatic focusing control method for a laser processing device according to claim 5, characterized in that, The step of adopting the gray-scale comparison algorithm to identify the circumscribed rectangle and the stepping position corresponding to the reference image with the largest cumulative gray value, and using the stepping position as the stepping position of the reference image for the best focal length specifically includes the following steps: Adopt the gray-scale comparison algorithm to identify the circumscribed rectangle and the stepping position corresponding to the second preset number of reference images with the largest cumulative gray value; Calculate the start and end positions of the second preset number of stepping positions through the stepping positions corresponding to the second preset number of reference images, perform fine adjustment with a smaller stepping value, re-screen according to S202, S203, S204 and S205, record the stepping position of the reference image with the largest gray value, and use the stepping position as the stepping position of the reference image for the best focal length.
8. The automatic focusing control method for a laser processing device according to claim 5, characterized in that, S205 includes the following steps: The processor performs image analysis on all reference images in the marking area, finds multiple reference images with gray values greater than or equal to the preset gray threshold, sorts the gray values of the multiple reference images, selects the reference image with the gray value in the middle as the reference image for the best focal length, obtains the stepping position of the reference image for the best focal length according to the corresponding relationship between the pixel coordinate position and the stepping position, and sends it to the control module.
9. A laser processing system, characterized in that, An automatic focusing control system for a laser processing device according to any one of claims 1 to 3.
Citation Information
Patent Citations
Laser marking machine and adjusting method
CN113319423A
Laser head focusing control device and system
CN114406510A