Automatic focusing grating inscribing method and device for laser
Through the image processing model and the method of automatically adjusting the position, the problem of inaccurate laser focus during fiber grating writing is solved, and efficient and high-precision automatic focus and writing grating are achieved, improving the quality and efficiency of writing.
Patent Information
- Application Number
- CN202410124672.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-29
- Publication Date
- 2025-07-29
AI Technical Summary
In the prior art, during the engraving process of optical fiber gratings, the focus between the laser and the optical fiber core relies on manual observation, and there are problems of artificial operation errors and inefficiency, resulting in inaccurate focus and affecting the quality of the engraving.
The image processing model is used to obtain the current position of the optical fiber, and the laser and the optical fiber are focused by automatically adjusting the position of the target writing platform. The convolution network and regional candidate network are combined for high-precision object detection, and the laser is controlled for grid engraving.
It realizes high-efficiency and high-precision automatic focus, reduces labor costs, improves the quality and efficiency of the engraving grating, and avoids writing failures caused by inaccurate focus.
Smart Images

Figure CN120386058A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of fiber grating manufacturing, and in particular, to a method and device for automatically focusing a laser to write a grating, a computer device, and a computer-readable storage medium. Background Art
[0002] A fiber grating is a diffraction grating formed by axially periodically modulating the refractive index of a fiber core. It has the advantages of small size, low splicing loss, and full compatibility with optical fibers, and is thus widely used in the fields of optical fiber communication, fiber lasers, fiber sensing, etc. There are various methods for manufacturing fiber gratings, such as using a laser to write on an optical fiber to form a grating structure.
[0003] However, when writing a grating, it is necessary to ensure accurate focusing of the laser on the fiber core. Focusing depends on manually observing the shape, brightness, and focusing position of the writing spot to adjust the beam focal length. This manual focusing method has problems such as human operation errors and low focusing efficiency, which may lead to inaccurate focusing, thus affecting the writing quality or preventing normal writing.
[0004] It should be noted that the above content is not necessarily prior art and does not limit the patent protection scope of this application. Summary of the Invention
[0005] This application provides a method and device for automatically focusing a laser to write a grating, a computer device, and a computer-readable storage medium to solve or alleviate one or more of the above-mentioned technical problems.
[0006] One aspect of this application provides a method for automatically focusing a laser to write a grating for automatically writing a grating on an optical fiber, where the optical fiber is placed on a target writing platform; the method includes:
[0007] Obtaining image information of the target writing platform, where the image information is obtained by photographing the target writing platform at a preset angle;
[0008] Inputting the image information into a pre-trained image processing model, and determining the current position of the optical fiber through the image processing model;
[0009] In the case where the optical fiber is outside a preset area, determining a target focusing strategy according to the current position of the optical fiber, where the target focusing strategy is used to control the pose of the target writing platform to enable the laser to focus on the optical fiber;
[0010] When the laser focuses on the optical fiber, controlling the laser to write a grating on the optical fiber.
[0011] Optionally, the target focusing strategy includes: adjusting the pose of the target writing platform along the horizontal axis direction to move the optical fiber into a preset area.
[0012] Optionally, the method further includes:
[0013] When the optical fiber is located within or adjusted to the preset area based on the target focusing strategy, adjusting the pose of the target writing platform along the height axis direction to find the transparent layer of the optical fiber;
[0014] Wherein, the transparent layer is used as the object for writing the grating.
[0015] Optionally, the method further includes:
[0016] When the optical fiber is located within or adjusted to the preset area based on the target focusing strategy, adjusting the pose of the target writing platform along the vertical axis direction, and recording the offsets of the target writing platform in the horizontal axis direction and the height axis direction during the adjustment process to determine whether the adjustment starting point and the adjustment ending point are located on the same plane;
[0017] When the adjustment starting point and the adjustment ending point are located on the same plane, controlling the laser to write the grating on the optical fiber.
[0018] Optionally, the method further includes:
[0019] When the adjustment starting point and the adjustment ending point are not located on the same plane, determining a displacement adjustment strategy according to a preset displacement adjustment formula and the recorded offsets, where the displacement adjustment strategy is used to correct the target writing platform;
[0020] Obtaining the latest image information of the corrected target writing platform;
[0021] Inputting the latest image information into a pre-trained image processing model, and determining the latest position of the optical fiber through the image processing model;
[0022] According to the latest position of the optical fiber, re-determining the focusing strategy or controlling the laser to write the grating on the optical fiber.
[0023] Optionally, the image processing model includes a convolutional network and a region candidate network; correspondingly, inputting the image information into a pre-trained image processing model, and determining the current position of the optical fiber through the image processing model includes:
[0024] Performing semantic feature extraction on the image information through the convolutional network to obtain a primary feature map;
[0025] Perform object detection on the primary feature map through a region proposal network to determine the current position of the optical fiber.
[0026] Optionally, performing object detection on the primary feature map through a region proposal network to determine the current position of the optical fiber includes:
[0027] Generate a plurality of candidate boxes in the primary feature map according to a preset rule;
[0028] Perform a pooling operation on each candidate box to obtain a plurality of candidate boxes with the same size;
[0029] Input the plurality of candidate boxes with the same size into the recognition branch and the detection branch respectively to determine the first positioning result and the second positioning result corresponding to each candidate box;
[0030] Match the first positioning result and the second positioning result of each candidate box to determine the current position of the optical fiber.
[0031] Another aspect of the present application provides a laser automatic focusing and grating writing device for automatically grating an optical fiber, and the optical fiber is placed on a target writing platform; the device includes:
[0032] An acquisition module for acquiring image information of the target writing platform, and the image information is obtained by photographing the target writing platform at a preset angle;
[0033] A determination module for inputting the image information into a pre-trained image processing model, and determining the current position of the optical fiber through the image processing model;
[0034] A first control module for determining a target focusing strategy according to the current position of the optical fiber when the optical fiber is outside a preset area, and the target focusing strategy is used to control the pose of the target writing platform so that the laser focuses on the optical fiber;
[0035] A second control module for controlling the laser to perform grating writing on the optical fiber when the laser focuses on the optical fiber.
[0036] Another aspect of the embodiments of the present application provides a computer device, including:
[0037] At least one processor; and
[0038] A memory communicatively connected to the at least one processor;
[0039] Wherein: the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.
[0040] Another aspect of the embodiments of the present application provides a computer-readable storage medium, in which computer instructions are stored, and when the computer instructions are executed by a processor, the above-described method is implemented.
[0041] The present application adopting the above technical solutions may include the following advantages:
[0042] Use a laser to irradiate a target scribing platform on which an optical fiber is placed, and perform automatic focusing of the laser and the optical fiber: obtain image information of the target scribing platform, and input it into a pre-trained image processing model to determine the current position of the optical fiber through the image processing model. In the case where the optical fiber is outside the preset area, determine a corresponding focusing strategy according to the current position of the optical fiber. Control and adjust the pose of the target scribing platform according to the focusing strategy, and the focusing of the laser and the optical fiber can be achieved. When the laser focuses on the optical fiber, control the laser to scribe a grating on the optical fiber. It can be seen that the embodiments of the present application can achieve automatic focusing with high efficiency, high precision and low labor cost, alleviate the scribing failure caused by inaccurate focusing, and thus effectively improve the scribing quality and efficiency. Description of the Drawings
[0043] The drawings exemplarily show embodiments and form a part of the specification, and are used together with the written description of the specification to explain the exemplary embodiments. The shown embodiments are only for illustrative purposes and do not limit the scope of the claims. In all the drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0044] Figure 1 Schematically shows a flowchart of a method for automatically focusing a laser to scribe a grating according to Embodiment 1 of the present application;
[0045] Figure 2 Schematically shows Figure 1 a sub-step flowchart of step S102 in
[0046] Figure 3 Schematically shows Figure 2 a sub-step flowchart of step S202 in
[0047] Figure 4 Schematically shows an additional flowchart of a method for automatically focusing a laser to scribe a grating according to Embodiment 1 of the present application;
[0048] Figure 5 is an application example diagram of a method for automatically focusing a laser to scribe a grating according to Embodiment 1 of the present application;
[0049] Figure 6 is an application example diagram of a method for automatically focusing a laser to scribe a grating according to Embodiment 1 of the present application;
[0050] Figure 7 It is an application example diagram of the laser automatic focusing and grating writing method according to Embodiment 1 of the present application;
[0051] Figure 8 Schematically shows a block diagram of the laser automatic focusing and grating writing device according to Embodiment 2 of the present application; and
[0052] Figure 9 Schematically shows a schematic diagram of the hardware architecture of the computer device according to Embodiment 3 of the present application. Detailed implementation manners
[0053] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.
[0054] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the fact that those of ordinary skill in the art can implement them. 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 protection scope required by the present application.
[0055] In the description of the present application, it should be understood that the numerical labels before the steps do not identify the order of execution of the steps, but are only used to facilitate the description of the present application and distinguish each step, and thus cannot be understood as a limitation to the present application.
[0056] First, provide the term explanations involved in the present application:
[0057] Convolutional Neural Network (CNN): A deep learning model that can be used to analyze and process data, and effectively learn and extract features in the data.
[0058] Region Proposal Network (RPN): A neural network module for object detection.
[0059] TCP (Transmission Control Protocol): A connection-oriented and reliable network communication protocol that is responsible for managing data transmission in a computer network and ensuring that data is securely and orderly transmitted from one node to another node.
[0060] Secondly, to facilitate the understanding of the technical solutions provided by the embodiments of the present application by those skilled in the art, the related technologies will be described below:
[0061] Fiber Bragg grating is an important passive optical device, which can be formed by axially periodically modulating the refractive index of the fiber core. Fiber Bragg grating has the advantages of small size, low splicing loss, and full compatibility with optical fibers, and is widely used in the fields of optical fiber communication, fiber lasers, fiber sensing, etc. Fiber Bragg grating can be manufactured by a variety of methods. For example, a grating structure is formed by writing on an optical fiber with a laser (such as a femtosecond laser). Among them, when using a laser to write a grating, it is necessary to ensure the precise focusing of the laser and the fiber core.
[0062] However, the applicant has learned that in the related technologies, it is necessary to manually observe the shape, brightness, and focusing position of the writing spot to adjust the focal length of the light beam to achieve the best writing effect. This manual focusing method has high labor costs and problems such as human operation errors and low focusing efficiency, which may lead to inaccurate focusing, resulting in a decrease in writing quality or abnormal writing.
[0063] To this end, the embodiments of the present application provide a technical solution for automatically focusing a laser to write a grating. In this technical solution: (1) A sensor or a camera is used to obtain the topography information (image information) of the area to be written (the target writing platform), and then these information are analyzed and processed by an algorithm to automatically control the focusing of the laser and the optical fiber. Automatic focusing has a higher degree of automation and accuracy compared to manual focusing, which can reduce human operation errors and improve writing efficiency and quality; (2) The PID control algorithm is used to control the pose of the writing platform to accurately achieve the automatic focusing of the laser and the optical fiber. See the following for details.
[0064] The technical solutions of the present application will be introduced through multiple embodiments. It should be noted that these embodiments can be implemented in a variety of different forms and should not be construed as being limited only to the embodiments described herein.
[0065] Embodiment 1
[0066] The laser in this embodiment is used to irradiate the optical fiber, and the optical fiber is placed (fixed) on the target writing platform.
[0067] Figure 1 The flowchart of the method for automatically focusing a laser to write a grating according to Embodiment 1 of the present application is schematically shown.
[0068] As Figure 1 shown, the method for automatically focusing and scribing a grating by a laser can include steps S100 to S106, where:
[0069] Step S100: Obtain image information of the target scribing platform, where the image information is obtained by photographing the target scribing platform at a preset angle.
[0070] Step S102: Input the image information into a pre-trained image processing model, and determine the current position of the optical fiber through the image processing model.
[0071] Step S104: When the optical fiber is outside a preset area, determine a target focusing strategy according to the current position of the optical fiber, where the target focusing strategy is used to control the pose of the target scribing platform so that the laser focuses on the optical fiber.
[0072] Step S106: When the laser focuses on the optical fiber, control the laser to scribe a grating on the optical fiber.
[0073] The method for automatically focusing and scribing a grating by a laser provided in this embodiment uses a femtosecond laser to irradiate a target scribing platform on which an optical fiber is placed, and performs automatic focusing of the femtosecond laser and the optical fiber: Obtain image information of the target scribing platform and input it into a pre-trained image processing model to determine the current position of the optical fiber through the image processing model. When the optical fiber is outside a preset area, determine a corresponding focusing strategy according to the current position of the optical fiber. By controlling and adjusting the pose of the target scribing platform according to the focusing strategy, focusing of the femtosecond laser and the optical fiber can be achieved. When the femtosecond laser focuses on the optical fiber, control the femtosecond laser to scribe a grating on the optical fiber. It can be seen that the embodiments of the present application can achieve automatic focusing with high efficiency, high precision, and low labor cost, alleviate the failure of grating scribing caused by inaccurate focusing, and thus effectively improve the quality and efficiency of grating scribing.
[0074] The following combines Figure 1 to elaborate in detail on each step in steps S100 to S106 and optional other steps.
[0075] Step S100 , obtain image information of the target scribing platform, where the image information is obtained by photographing the target scribing platform at a preset angle.
[0076] Exemplarily, a femtosecond laser or other light source can be used to irradiate an optical fiber to fabricate an optical fiber grating. During the fabrication process, the optical fiber can be pre-fixed to a target inscription platform, which can ensure stability and provide appropriate support. The method for automatically focusing and inscribing a grating with a laser provided by the embodiments of the present application can be applied to a control device, such as a motion controller. Among them, the motion controller can be used to manage the movement and pose of multiple devices (such as a femtosecond laser, a target inscription platform, etc.) to improve the inscription accuracy. Further exemplary introductions will be made below.
[0077] The control device can establish a communication connection with the femtosecond grating inscription software through the TCP communication algorithm or other communication protocols, and obtain the image information of the target inscription platform by calling the interface provided by the femtosecond grating inscription software. Among them, the image information can be multiple image information obtained by shooting the target inscription platform at multiple different angles through a sensor or a camera. The image information can be used to indicate the local or overall situation of the target inscription platform, for example: whether the optical fiber is located on the target inscription platform, etc. TCP communication is based on the TCP / IP protocol stack and is implemented using Socket programming. By creating a Socket object, various Socket methods can be used to complete all links of data transmission. For example, the femtosecond grating inscription software can provide multiple interfaces through the TCP communication algorithm, such as: using the connect() method of the Socket object to establish a connection with the control device; using the send() method of the Socket object to send data (such as the image information of the target inscription platform) to the control device; using the recv() method of the Socket object to receive data (such as a control signal) from the control device; using the close() method of the Socket object to disconnect the connection with the control device. In this embodiment, by establishing TCP communication to obtain the image information of the target inscription platform, reliable data transmission can be achieved, and relevant information about the optical fiber can be obtained in a timely manner.
[0078] Step S102 , input the image information into a pre-trained image processing model, and determine the current position of the optical fiber through the image processing model.
[0079] The image processing model can be trained with a large amount of known image information of the target inscription platform. This image information can include the situations of the optical fiber at different positions on the target inscription platform, such as the left side, the right side, or within a preset area of the preset area of the target inscription platform. Among them, the preset area can be determined according to the light spot formed by the light beam emitted by the laser on the target inscription platform. The trained image processing model has the ability to identify the position of the optical fiber. Inputting the currently obtained image information into the trained image processing model can quickly and accurately identify the current position of the optical fiber on the target inscription platform.
[0080] The image processing model can be a neural network, a decision tree, a support vector machine, etc. An exemplary image processing model will be provided below.
[0081] In an alternative embodiment, the image processing model may include a convolutional network and a region proposal network. Correspondingly, as Figure 2 shown, step S102 may include:
[0082] Step S200, extracting semantic features from the image information through the convolutional network to obtain a primary feature map.
[0083] Step S202, performing object detection on the primary feature map through the region proposal network to determine the current position of the optical fiber.
[0084] Exemplarily, semantic features can be extracted from the input image information through a convolutional network CNN. Through operations such as convolution and pooling, CNN can identify and extract higher-level features in the image information, such as edges, textures, and shapes. These features together form a primary feature map, providing a basis for subsequent object detection. Through the region proposal network (RPN), candidate regions that may contain the optical fiber can be generated in the primary feature map, improving the accuracy and efficiency of optical fiber position recognition.
[0085] In this embodiment, through the combination of the convolutional network and the region proposal network, efficient and accurate object detection can be achieved, thereby determining the current position of the optical fiber on the target scribing platform.
[0086] It should be noted that the image processing model can also be other types of models or model combinations, which can be selected according to actual application requirements.
[0087] In practical applications, the region proposal network can perform object detection in various ways, such as: SSD (SingleShotMultiBox Detector), YOLO (You Only Look Once), etc. An exemplary solution will be provided below.
[0088] In an alternative embodiment, as Figure 3 shown, step S202 may include:
[0089] Step S300, generating a plurality of candidate boxes in the primary feature map according to a preset rule.
[0090] Step S302, performing a pooling operation on each candidate box to obtain a plurality of candidate boxes with the same size.
[0091] Step S304, inputting the plurality of candidate boxes with the same size into the recognition branch and the detection branch respectively to determine the first positioning result and the second positioning result corresponding to each candidate box.
[0092] Step S306: Match the first positioning result and the second positioning result of each candidate box to determine the current position of the optical fiber.
[0093] Exemplarily, multiple candidate boxes (also called candidate regions) can be generated in the primary feature map by methods such as sliding window or anchor box. The sliding window can be a window with a fixed size and ratio moving on the primary feature map, extracting features from various positions of the primary feature map and generating multiple candidate boxes. The anchor box can be multiple candidate boxes with predefined sizes and ratios generated at different positions on the primary feature map. To reduce the computational complexity, a unified pooling operation can be performed on candidate boxes of various different sizes, so that each candidate box has the same spatial size, enabling the model to process features of a unified size and effectively improving the detection accuracy. Each candidate box after size adjustment is respectively input into the recognition branch and the detection branch for accurately positioning the optical fiber. Among them, the recognition branch can be used to detect which category the candidate box belongs to to obtain the first positioning result, for example: to the left (the optical fiber is on the left side of the preset area), to the right (the optical fiber is on the right side of the preset area), within the preset area. The detection branch can be used to fine-tune the position of the candidate box so that the candidate box can more accurately frame the position of the optical fiber to obtain the second positioning result. Specifically, the position of the candidate box in the primary feature map can be fine-tuned by encoding the prior box (the candidate box without fine-tuning) and the ground truth box (the bounding box of the real optical fiber marked in the training data). Example encoding formulas for the prior box and the ground truth box are as follows:
[0094] L x =(b x -p x ) / c
[0095] L y =(b y -p y ) / c
[0096] L w =log(b y / p y )
[0097] L h =log(b h / p h )
[0098] L a -(b a -p a ) / n
[0099] Wherein, c represents the width of the grid cell, n represents the number of prior boxes in each grid cell, and (Lx, Ly, Lw, Lh, La) respectively represent the horizontal and vertical coordinates of the center point of the encoded candidate box, the width and height, and the rotation angle; (bx, by, bw, bh, ba) respectively represent the horizontal and vertical coordinates of the center point of the prior box, the width and height, and the rotation angle, and (px, py, pw, ph, pa) respectively represent the horizontal and vertical coordinates of the center point of the ground truth box, the width and height, and the rotation angle.
[0100] By matching the first positioning result and the second positioning result obtained by each candidate box through the recognition branch and the detection branch, the current position of the optical fiber can be determined. If both the first positioning result and the second positioning result are "left", it means that the optical fiber is on the left side of the preset area and the laser has not focused on the optical fiber yet. If the matching between the first positioning result and the second positioning result fails, it means that an error has occurred in object detection and the fault needs to be promptly checked and repaired. By synthesizing the positioning results of each candidate box, the accuracy of optical fiber positioning can be further improved.
[0101] In this embodiment, the region candidate network can quickly identify the current position of the optical fiber, facilitating subsequent focusing and / or grating scribing.
[0102] In some embodiments, the image processing model can not only be used to determine the current position of the optical fiber, but also be used to determine whether the transparent layer of the optical fiber has been found. The transparent layer refers to the diameter cross-section after the optical fiber is laid flat, which can be used as the object for scribing gratings and can improve the stability, reliability, and optical performance of the gratings. When it is determined that the optical fiber is in the preset area, the recognition branch and the detection branch can also be used to detect the transparent layer, obtaining the first transparent layer detection result and the second transparent layer detection result. By matching the first transparent layer detection result and the second transparent layer detection result of each candidate box, it can be finally determined whether the input image information includes the transparent layer.
[0103] To implement transparent layer detection, the image processing model can be trained using the transparent layer image information, and the parameters of the model can be optimized using the RS loss function to improve the prediction ability of the model. The RS loss function for finding the transparent layer can be expressed as follows:
[0104]
[0105] Wherein, L gd represents the sum of the classification loss and the regression loss of the transparent layer image information, i represents the positive sample variable, j represents the negative sample variable, p g represents the probability of finding the prior box of the transparent layer image information in the positive samples, p u represents the probability of finding the prior box of the transparent layer image information in the negative samples, L represents the vector for predicting further finding the transparent layer, and L gtis the ground truth box information related to the prior box of the transparent layer image information, and θ is to find the transparent layer of the transparent layer image information, θ gt is the ground truth box that matches the prior box; N is the number of prior boxes of the transparent layer image information that are matched, α represents the proportion of the regression loss in the loss function, and β represents the proportion of the difference in the number of rotated transparent layers in the regression loss.
[0106] In this embodiment, the region proposal network can be used to further determine whether the transparent layer of the optical fiber has been found. The transparent layer can be used to characterize the focusing quality. By analyzing whether the image information includes the transparent layer, the current focusing quality can be determined, which is convenient for subsequent grating scribing operations.
[0107] The above-mentioned multiple embodiments introduce that the trained image processing model uses a preset image processing algorithm to process and analyze the input image information, and the current position of the optical fiber and the current focusing quality can be determined. In the case of inaccurate focusing or poor focusing quality, automatic focusing is required. The following will exemplarily introduce the focusing method through multiple embodiments.
[0108] Step S104 , when the optical fiber is located outside the preset area, according to the current position of the optical fiber, a target focusing strategy is determined, and the target focusing strategy is used to control the pose of the target scribing platform so that the laser focuses on the optical fiber.
[0109] Exemplarily, through the analysis of the image processing model, it is determined that the optical fiber is located on the left side of the preset area, indicating that the laser fails to focus on the optical fiber. In the case of non-focusing, a corresponding target focusing strategy can be formulated according to the current position of the optical fiber. By controlling the position and pose of the target scribing platform (including the coordinate information in the three directions of the X-axis, Y-axis, and Z-axis), the optical fiber can be moved into the preset area, so that the laser can focus on the optical fiber. In an alternative embodiment, the target focusing strategy can be to adjust the position of the target scribing platform along the horizontal axis (X-axis), for example: move the target scribing platform to the right to adjust the optical fiber on the left to within the preset area.
[0110] In this embodiment, when the laser does not focus on the optical fiber, the position of the target scribing platform can be controlled and adjusted according to the current position of the optical fiber, and the optical fiber is moved into the preset area for automatic focusing of the laser and the optical fiber core, without manual participation, improving the focusing accuracy and efficiency.
[0111] The above embodiments introduce how to perform automatic focusing when the optical fiber is located outside the preset area. The following will further introduce how to improve the focusing quality.
[0112] In an alternative embodiment, the method for automatically focusing a laser to write a grating may further include: when the optical fiber is located within a preset region or adjusted to the preset region based on the target focusing strategy, adjusting the pose of the target writing platform along the height axis direction to find the transparent layer of the optical fiber; wherein the transparent layer is used as the object for writing the grating.
[0113] As described above, the transparent layer is the diameter cross-section of the optical fiber and can be used as the object for writing the grating, further improving the stability, reliability, and optical performance of the grating. Therefore, if the image processing model analyzes and determines that the optical fiber is already in the preset region or the optical fiber has been adjusted to the preset region based on the target focusing strategy, the transparent layer of the optical fiber can be further searched to further improve the focusing quality. Exemplarily, the position of the target writing platform can be adjusted along the height axis (Z-axis) direction until the transparent layer of the optical fiber is found.
[0114] In this embodiment, when the optical fiber is within the preset region, controlling the target writing platform to move to find the transparent layer of the optical fiber and using it as the object for writing the grating can further improve the focusing quality and grating writing quality.
[0115] The above-mentioned multiple embodiments introduce how to achieve automatic focusing of the laser and the optical fiber.
[0116] To ensure the focusing accuracy, the focusing effect needs to be verified in multiple aspects. An exemplary solution will be provided below.
[0117] In an alternative embodiment, the method for automatically focusing a laser to write a grating may further include: when the optical fiber is located within a preset region or adjusted to the preset region based on the target focusing strategy, adjusting the pose of the target writing platform along the longitudinal axis direction and recording the offsets of the target writing platform in the horizontal axis direction and the height axis direction during the adjustment process to determine whether the adjustment start point and the adjustment end point are in the same plane; when the adjustment start point and the adjustment end point are in the same plane, controlling the laser to write a grating on the optical fiber.
[0118] In practical applications, when the optical fiber is already located within the preset area or has been adjusted to the preset area based on the target focusing strategy, the current focusing point of the laser on the optical fiber can be determined as the grating writing starting point (also known as the zero point). The pose of the target writing platform can be adjusted along the longitudinal axis (Y-axis) direction (i.e., the grating writing direction). For example, moving 5000 μm along the Y-axis can be used to simulate the scenario of writing a 5 mm grating. It should be noted that the moving distance can be determined according to actual requirements to simulate and meet different application scenarios. Record the offsets of the target writing platform in the horizontal axis (X-axis) direction and the height axis (Z-axis) direction before and after the movement, and it can be determined whether the adjustment starting point (grating writing starting point) and the adjustment ending point (simulated grating writing ending point) are in the same plane. Determine the error through the offsets of the X and Z axes. When the error is less than the preset error range (such as 0.3 μm), it can be considered that the grating writing starting point and the grating writing ending point are in the same plane. At this time, the autofocus is completed, and the grating writing operation can be performed.
[0119] In this embodiment, by adjusting the pose of the target writing platform, it is possible to further verify whether the focusing is successful, and no manual intervention is required, further improving the focusing accuracy.
[0120] In an alternative embodiment, as Figure 4 shown, the method for the laser to autofocus and write a grating may further include:
[0121] Step S400: When the adjustment starting point and the adjustment ending point are not in the same plane, determine a displacement adjustment strategy according to the preset displacement adjustment formula and the recorded offsets, where the displacement adjustment strategy is used to correct the target writing platform.
[0122] Step S402, obtain the latest image information of the corrected target writing platform.
[0123] Step S404, input the latest image information into a pre-trained image processing model, and determine the latest position of the optical fiber through the image processing model.
[0124] Step S406, according to the latest position of the optical fiber, re-determine the focusing strategy or control the laser to write a grating on the optical fiber.
[0125] As described above, when the error is greater than the preset error range, it is determined that the adjustment starting point and the adjustment ending point are not in the same plane, that is, the focusing fails and re - focusing is required. Before re - focusing, the pose of the target scribing platform can be corrected according to the current focusing result to align the focus of the optical fiber and the laser beam. Exemplarily, the displacements that the target scribing platform needs to be corrected in the X - axis and Z - axis can be determined according to a preset displacement adjustment formula. The displacement adjustment formula can be expressed as follows: x×left - right tilt coefficient, z×up - down tilt coefficient. Among them, the left - right tilt coefficient and the up - down tilt coefficient can be pre - configured. According to the calculated displacement amount, the X - axis and Z - axis are respectively finely adjusted to achieve automatic correction of the target scribing platform.
[0126] After correcting the target scribing platform, re - focusing can be performed. Specifically: again, obtain the latest image information of the corrected target scribing platform by calling the interface of the femtosecond grating software. Analyze the latest image information through an image - processing model to determine the latest position of the optical fiber. When the latest position of the optical fiber is outside the preset area, adjust the pose of the target scribing platform along the X - axis direction to move the optical fiber into the preset area. If the optical fiber is within the preset area, adjust the pose of the target scribing platform along the Z - axis direction to search for the transparent layer. The pose of the target scribing platform can also be adjusted along the Y - axis direction to verify the effect of this focusing. If the focusing is successful, subsequent grating scribing can be executed. If the focusing fails, re - focus after correcting the target scribing platform.
[0127] In this embodiment, when the focusing fails, after automatically correcting the target scribing platform based on the current focusing result and the preset displacement adjustment formula and then re - focusing, the difficulty of re - focusing can be reduced, and thus the focusing efficiency can be improved.
[0128] The above - mentioned multiple embodiments exemplarily introduce realizing automatic focusing, automatic verification of the focusing effect, automatic correction, etc. by controlling the positions of the target scribing platform in the X - axis, Y - axis, and Z - axis. In practical applications, the accuracy of the pose control of the target scribing platform can also be optimized, and thus the stability of focusing can be improved. The following will provide an exemplary embodiment.
[0129] In an alternative embodiment, the parameters of the target scribing platform (such as the coordinate information of the X - axis, Y - axis, and Z - axis) can be analyzed and adjusted through a PID control algorithm to achieve the control and adjustment of the X / Y / Z axes of the target scribing platform. Among them, the PID control algorithm consists of a proportional term (P term), an integral term (I term), and a derivative term (D term), and can be used for dynamically adjusting and controlling the error of the system. The proportional term P is used to proportionally amplify the error, the integral term I is used to accumulate the error and eliminate the static error, and the derivative term D is used to predict the change trend of the error. Through reasonable parameter settings, the PID control algorithm can achieve fast and stable focusing control. Its calculation formula can be expressed as follows:
[0130]
[0131] In practical applications, appropriate PID parameters can be set according to actual needs, including the proportional coefficient K p , the integral coefficient K I and the derivative coefficient K D . The setting of these parameters can be adjusted according to experience to achieve a fast and stable system response.
[0132] Specifically: the coordinate information of the target scribing platform can be continuously monitored and obtained; the error can be calculated based on the obtained coordinate information and the preset coordinate information (target value); the proportional, integral, and derivative parts of the error are calculated, and weighted summation is performed in combination with the corresponding weight coefficients to obtain the final control amount. The X / Y / Z coordinate values of the target scribing platform are adjusted in real time according to the control amount, so that the X / Y / Z coordinate values of the target scribing platform tend to the error value, and thus automatic focusing, automatic focus verification, automatic correction, etc. can be achieved quickly and stably.
[0133] To make the present application easier to understand, the following provides an exemplary application in conjunction with Figure 5 -7.
[0134] Initialize the number of focusing times n, the focusing position error m, the number of displacement adjustment times t, the focusing point s, and the zero point p to 0.
[0135] S11: Establish a connection through the TCP communication algorithm and the femtosecond grating software to obtain the topography information (image information) of the plane to be scribed (target scribing platform).
[0136] S12: Analyze and process the topography information through a pre-trained image processing model to determine the position of the optical fiber and the focusing quality.
[0137] S13: Determine whether the optical fiber is located in the preset area. If so, keep s at its initial value and proceed to step S15. If not, assign 1 to s and enter S14.
[0138] S14: The position of the optical fiber is outside the preset area. Adjust the pose of the scribing platform along the X-axis to find the topography information of the optical fiber (move the optical fiber into the preset area).
[0139] S15: The position of the optical fiber is within the preset area. Move the scribing platform along the Z-axis to find the transparent layer of the optical fiber.
[0140] S16: After finding the transparent layer, if t is 1, move the scribing platform 5000 μm along the Y-axis. If n is 1, determine whether the starting point and the ending point of the grating are on the same plane. If n is not 1, jump to S13. If they are on the same plane, enter S17; if not, enter S18.
[0141] Among them, the starting point of the grating is the beam focus point of the femtosecond laser.
[0142] If t is not 1, determine whether p is 0. If p is 0, set the current focus point as the zero point, i.e., the starting point of the grating, and assign 1 to p. If p is not 0, obtain the current X and Z axis offsets of the scribing platform, and calculate the required displacement amounts of the X and Z axes through the preset displacement adjustment formula: x × left-right tilt coefficient, z × up-down tilt coefficient, for fine-tuning the X and Z axes, that is, automatically correcting the scribing platform. Then enter the zeroing process and loop the above steps.
[0143] S17: Auto-focusing is completed, and grating scribing starts.
[0144] S18: Auto-focusing fails, jump to the initial zeroing stage and refocus.
[0145] During the process of adjusting the position of the scribing platform (such as the X-axis, Y-axis, Z-axis), use the PID control algorithm to make the actual position of the scribing platform tend to the target position, improving the focusing accuracy.
[0146] In this exemplary application: (1) Use a sensor or camera to obtain the topography information (image information) of the scribing area (target scribing platform), and then analyze and process this information through algorithms to automatically control the focusing of the femtosecond laser and the optical fiber. Auto-focusing has a higher degree of automation and accuracy compared to manual focusing, which can reduce human operation errors and improve the scribing efficiency and quality; (2) Control the pose of the scribing platform through the PID control algorithm to accurately achieve the auto-focusing of the femtosecond laser and the optical fiber.
[0147] Embodiment 2
[0148] Figure 8 Schematically shows a block diagram of a laser auto-focusing grating scribing device according to Embodiment 2 of the present application. Among them, the laser is used to irradiate the optical fiber, and the optical fiber is placed on the target scribing platform; this device can be divided into one or more program modules, and one or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiments of the present application. The program modules referred to in the embodiments of the present application refer to a series of computer program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment. As Figure 8As shown, the device 1000 may include: an acquisition module 1100, a determination module 1200, a first control module 1300, and a second control module 1400, where:
[0149] The acquisition module 1100 is configured to acquire image information of the target scribing platform, where the image information is obtained by photographing the target scribing platform at a preset angle;
[0150] The determination module 1200 is configured to input the image information into a pre-trained image processing model, and determine the current position of the optical fiber through the image processing model;
[0151] The first control module 1300 is configured to, when the optical fiber is outside a preset area, determine a target focusing strategy according to the current position of the optical fiber, where the target focusing strategy is used to control the pose of the target scribing platform so that the laser focuses on the optical fiber;
[0152] The second control module 1400 is configured to control the laser to scribe a grating on the optical fiber when the laser focuses on the optical fiber.
[0153] As an optional embodiment, the target focusing strategy includes: adjusting the pose of the target scribing platform along the horizontal axis direction to move the optical fiber into the preset area.
[0154] As an optional embodiment, the device 1000 is further configured to:
[0155] When the optical fiber is within or adjusted to within the preset area based on the target focusing strategy, adjust the pose of the target scribing platform along the height axis direction to find the transparent layer of the optical fiber;
[0156] Wherein, the transparent layer is used as an object for scribing a grating.
[0157] As an optional embodiment, the device 1000 is further configured to:
[0158] When the optical fiber is within or adjusted to within the preset area based on the target focusing strategy, adjust the pose of the target scribing platform along the vertical axis direction, and record the offsets of the target scribing platform in the horizontal axis direction and the height axis direction during the adjustment process to determine whether the adjustment starting point and the adjustment ending point are on the same plane;
[0159] When the adjustment starting point and the adjustment ending point are on the same plane, control the laser to scribe a grating on the optical fiber.
[0160] As an optional embodiment, the device 1000 is further configured to:
[0161] In the case where the adjustment starting point and the adjustment ending point are not in the same plane, determine a displacement adjustment strategy according to a preset displacement adjustment formula and the recorded offset, where the displacement adjustment strategy is used to correct the target scribing platform;
[0162] Obtain the latest image information of the corrected target scribing platform;
[0163] Input the latest image information into a pre-trained image processing model, and determine the latest position of the optical fiber through the image processing model;
[0164] According to the latest position of the optical fiber, re-determine the focusing strategy or control the laser to scribe a grating on the optical fiber.
[0165] As an optional embodiment, the image processing model includes a convolutional network and a region candidate network; correspondingly, the determining module 1200 is further configured to:
[0166] Extract semantic features from the image information through the convolutional network to obtain a primary feature map;
[0167] Perform object detection on the primary feature map through the region candidate network to determine the current position of the optical fiber.
[0168] As an optional embodiment, the determining module 1200 is further configured to:
[0169] Generate a plurality of candidate boxes in the primary feature map according to a preset rule;
[0170] Perform a pooling operation on each candidate box to obtain a plurality of candidate boxes with the same size;
[0171] Input the plurality of candidate boxes with the same size into an identification branch and a detection branch respectively to determine a first positioning result and a second positioning result corresponding to each candidate box;
[0172] Match the first positioning result and the second positioning result of each candidate box to determine the current position of the optical fiber.
[0173] Embodiment III
[0174] Figure 9Schematically shown is a hardware architecture diagram of a computer device 10000 suitable for implementing the method for automatically focusing and engraving gratings of a laser according to Embodiment 3 of the present application. In some embodiments, the computer device 10000 may be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle-mounted terminal, a game console, a virtual device, a workbench, a digital assistant, a set-top box, a robot, etc. In some other embodiments, the computer device 10000 may be a rack server, a blade server, a tower server, or a cabinet server (including an independent server or a server cluster composed of multiple servers), etc. As Figure 9 shown, the computer device 10000 includes, but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can be communicatively linked to each other through a system bus. Among them:
[0175] The memory 10010 includes at least one type of computer-readable storage medium. The readable storage medium includes flash memory, a hard disk, a multimedia card, a card-type memory (such as an SD or DX memory), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disc, etc. In some embodiments, the memory 10010 may be an internal storage module of the computer device 10000, such as the hard disk or memory of the computer device 10000. In some other embodiments, the memory 10010 may also be an external storage device of the computer device 10000, such as a plug-in hard disk, a SmartMedia Card (SMC), a Secure Digital (SD) card, a FlashCard, etc., equipped on the computer device 10000. Of course, the memory 10010 may also include both the internal storage module and the external storage device of the computer device 10000. In this embodiment, the memory 10010 is generally used to store the operating system and various application software installed on the computer device 10000, such as the program code of the method for automatically focusing and engraving gratings of a laser. In addition, the memory 10010 may also be used to temporarily store various data that have been output or will be output.
[0176] The processor 10020 can be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other chips in some embodiments. The processor 10020 is generally used to control the overall operation of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is used to run the program code stored in the memory 10010 or process data.
[0177] The network interface 10030 may include a wireless network interface or a wired network interface. The network interface 10030 is generally used to establish a communication link between the computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 to an external terminal through a network, and establish a data transmission channel and a communication link between the computer device 10000 and the external terminal. The network can be an enterprise internal network (Intranet), the Internet, the Global System of Mobile communication (abbreviated as GSM), Wideband Code Division Multiple Access (abbreviated as WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi and other wireless or wired networks.
[0178] It should be noted that Figure 9 Only the computer device with components 10010 - 10030 is shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented.
[0179] In this embodiment, the laser autofocus engraving grating method stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as the processor 10020) to complete the embodiments of the present application.
[0180] Embodiment 4
[0181] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the laser autofocus engraving grating method in the embodiment are implemented.
[0182] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the computer-readable storage medium may be an internal storage unit of a computer device, such as the hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. equipped on the computer device. Of course, the computer-readable storage medium may also include both the internal storage unit and the external storage device of the computer device. In this embodiment, the computer-readable storage medium is generally used to store the operating system installed on the computer device and various application software, such as the program code of the method for automatically focusing and scribing gratings by a laser in the embodiment. In addition, the computer-readable storage medium may also be used to temporarily store various data that have been output or will be output.
[0183] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the embodiments of the present application can be implemented by a general computer device. They can be concentrated on a single computer device or distributed on a network composed of multiple computer devices. Optionally, they can be implemented by program codes executable by the computer device. Thus, they can be stored in a storage device and executed by the computer device. And in some cases, the steps shown or described can be executed in a different order from here, or they can be separately made into individual integrated circuit modules, or multiple modules or steps among them can be made into a single integrated circuit module to implement. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0184] It should be noted that the above are only the preferred embodiments of the present application, and do not limit the patent protection scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present application.
Claims
1. A laser auto-focus grating writing method for automatically writing gratings on optical fibers, characterized in that: The optical fiber is placed on a target scribing platform; the method includes: Obtaining image information of the target scribing platform, where the image information is obtained by photographing the target scribing platform based on a preset angle; Inputting the image information into a pre-trained image processing model, and determining the current position of the optical fiber through the image processing model; When the optical fiber is outside a preset area, determining a target focusing strategy according to the current position of the optical fiber, where the target focusing strategy is used to control the pose of the target scribing platform so that the laser focuses on the optical fiber; When the laser focuses on the optical fiber, controlling the laser to scribe a grating on the optical fiber.
2. The method according to claim 1, wherein The target focusing strategy includes: adjusting the pose of the target scribing platform along the horizontal axis direction to move the optical fiber into the preset area.
3. The method according to claim 1, wherein The method further includes: When the optical fiber is within or adjusted to within the preset area based on the target focusing strategy, adjusting the pose of the target scribing platform along the height axis direction to find the transparent layer of the optical fiber; Wherein, the transparent layer is used as the object for scribing the grating.
4. The method according to claim 1, characterized in that: The method further includes: When the optical fiber is within or adjusted to within the preset area based on the target focusing strategy, adjusting the pose of the target scribing platform along the vertical axis direction, and recording the offsets of the target scribing platform in the horizontal axis direction and the height axis direction during the adjustment process to determine whether the adjustment starting point and the adjustment ending point are on the same plane; When the adjustment starting point and the adjustment ending point are on the same plane, controlling the laser to scribe a grating on the optical fiber.
5. The method according to claim 4, characterized in that The method further includes: When the adjustment starting point and the adjustment ending point are not on the same plane, determining a displacement adjustment strategy according to a preset displacement adjustment formula and the recorded offsets, where the displacement adjustment strategy is used to correct the target scribing platform; Obtaining the latest image information of the corrected target scribing platform; Inputting the latest image information into a pre-trained image processing model, and determining the latest position of the optical fiber through the image processing model; According to the latest position of the optical fiber, re-determining the focusing strategy or controlling the laser to scribe a grating on the optical fiber.
6. The method according to any one of claims 1 to 5, characterized in that, The image processing model includes a convolutional network and a region candidate network; correspondingly, inputting the image information into a pre-trained image processing model, and determining the current position of the optical fiber through the image processing model includes: Performing semantic feature extraction on the image information through the convolutional network to obtain a primary feature map; Performing target detection on the primary feature map through the region candidate network to determine the current position of the optical fiber.
7. The method according to claim 6, characterized in that, Performing target detection on the primary feature map through the region candidate network to determine the current position of the optical fiber, including: Generating a plurality of candidate boxes in the primary feature map according to a preset rule; Performing a pooling operation on each candidate box to obtain a plurality of candidate boxes with the same size; Inputting the plurality of candidate boxes with the same size into an identification branch and a detection branch respectively to determine a first positioning result and a second positioning result corresponding to each candidate box; The first positioning result and the second positioning result of each candidate frame are matched to determine the current position of the optical fiber.
8. A method for automatically focusing and scribing gratings of a laser, which is used for automatically scribing gratings on an optical fiber, is characterized in that, The optical fiber is placed on a target writing platform; the device comprises: An acquisition module, configured to acquire image information of the target writing platform, wherein the image information is obtained by photographing the target writing platform at a preset angle; a determination module, configured to input the image information into a pre-trained image processing model and determine the current position of the optical fiber through the image processing model; A first control module is configured to determine a target focusing strategy based on the current position of the optical fiber when the optical fiber is outside a preset area, wherein the target focusing strategy is configured to control the posture of the target writing platform so that the laser focuses on the optical fiber; The second control module is used to control the laser to perform grating on the optical fiber when the laser focuses on the optical fiber.
9. A computer device, characterized in that, include: at least one processor; and a memory communicatively coupled to the at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions, which, when executed by a processor, implement the method according to any one of claims 1 to 7.