Laser drilling processing path generation method, device, equipment and medium

Optimizing the laser drilling processing path through the ant colony algorithm solves the problems of invalid movement and deflection in the existing technology, achieves more efficient processing path planning, and improves the efficiency and quality of laser drilling processing.

CN118760059APending Publication Date: 2024-10-11SHENZHEN INTE LASER TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410737100.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Existing laser drilling processing path planning involves a large number of ineffective movements and deflections, resulting in low processing efficiency, especially in complex or large-scale processing tasks.

Method used

The path generation method based on the ant colony algorithm is used to initialize the population and model parameters, calculate the transition probability between processing objects, use the roulette mechanism to generate paths, update the tabu table, and iteratively optimize, and finally obtain the optimal path.

Benefits of technology

The length of the processing path is significantly shortened, the deflection angle of the galvanometer is reduced, the processing time is saved, and the efficiency and quality of laser drilling processing are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760059A_ABST
    Figure CN118760059A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of laser drilling machining, in particular to a laser drilling machining path generation method and device, equipment and a medium, and the method comprises the steps that algorithm parameters and populations are initialized in the S1 stage; s3, generating a processing path through a roulette and the transition probability, and updating a taboo table to avoid repetition and generate a processing path, S4, calculating to obtain an optimal path based on a preset number of processing paths, S5, iteratively updating pheromones, repeating the steps S2 to S4, and recording data of each iteration, and finally, in the stage S6, calculating the optimal path according to the preset number of processing paths. And adjusting parameters according to the iteration data, and updating the optimal path until a preset number of iterations is met. The length of a machining path is greatly shortened, the deflection angle of the galvanometer is reduced, and the machining time is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of laser drilling technology, and in particular to a laser drilling path generation method, device, equipment and medium. Background Art

[0002] In the current laser drilling industry, laser scanning systems generally use a direct processing method based on the CAD image sequence. This method processes objects one by one according to the preset order in the design drawings, resulting in a large number of unnecessary detours and repetitions in the movement path of the galvanometer between different processing points. This non-optimized path planning not only prolongs the movement distance of the galvanometer, but also increases its deflection angle, resulting in reduced processing efficiency. This problem is particularly prominent when facing complex or large-scale processing tasks.

[0003] Therefore, how to improve the existing laser drilling processing path planning, reduce the ineffective movement of the galvanometer during the processing, and reduce its deflection frequency and amplitude is a technical problem that needs to be solved urgently. Summary of the invention

[0004] The main purpose of this application is to provide a laser drilling processing path generation method, device, equipment and medium, aiming to solve the technical problem of how to improve the existing laser drilling processing path planning, reduce the ineffective movement of the galvanometer during the processing process, and reduce its deflection frequency and amplitude.

[0005] In order to achieve the above-mentioned invention object, the present application proposes a method for generating a laser drilling processing path, the method comprising:

[0006] S1. Based on the ant colony algorithm model, set and initialize the population, model parameters and influencing factors;

[0007] S2. Calculate the transition probability between each processing object based on the sequence number and coordinates of the processing object;

[0008] S3, based on the transfer probability, generate the next processing object in sequence through roulette, and update the taboo table according to the processing object, until all processing objects are traversed, a processing path is generated, and this step is repeated until a preset number of processing paths are obtained;

[0009] S4, calculating and obtaining an optimal path based on the preset number of processing paths;

[0010] S5, update pheromone, repeat S2-S4 for iteration, and record the iteration data in each iteration process;

[0011] S6. Adjusting the model parameters and influencing factors and updating the optimal path based on the iterative data of each time until a preset number of iterations is reached.

[0012] Furthermore, the step of setting and initializing the population, model parameters and influencing factors based on the ant colony algorithm model includes:

[0013] Taking the processing object derived from CAD images as the research object, an ant colony algorithm model was built;

[0014] Based on the ant colony algorithm model, setting model parameters and influencing factors of the ant colony algorithm;

[0015] Initializing the model parameters and the influencing factors, including initializing the starting position of the ants and initializing the pheromone concentration in each part of the path.

[0016] Furthermore, the step of calculating the transition probability between each processing object based on the sequence number and coordinates of the processing object includes:

[0017] Read the CAD image, divide the CAD image into several partitions according to the processing range of the galvanometer, and derive the serial number of each processing object and the X, Y coordinates of its center from each partition of the CAD image in turn;

[0018] Calculate the distance between each processing object based on the X and Y coordinates of the center of the circle;

[0019] According to the partition order, a two-dimensional array is established in each partition in turn to store the distance between each processing object and other processing objects, wherein each processing object is represented by the serial number of the processing object;

[0020] Based on the distance, a probability transfer function is used to calculate the probability of the current processed object being transferred to other unprocessed objects until all processed objects are processed; wherein the transfer probability is inversely proportional to the distance, and the closer the distance, the greater the transfer probability.

[0021] Further, the step of generating the next processing object in sequence through roulette based on the transition probability, and updating the taboo table according to the processing object until all processing objects are traversed, generating a processing path, and repeating this step until a preset number of processing paths are obtained includes:

[0022] Based on the transition probability, a roulette wheel selection algorithm is used to select a next processing object from the current processing object;

[0023] When it is determined that the next processing object is selected, updating the taboo table, wherein the taboo table is used to record the visited processing objects to avoid repeated selection;

[0024] When all processing objects are identified and selected, a complete processing path is generated;

[0025] Iteration is performed based on the processing path to generate a new processing path until a preset number of iterations is reached to obtain a preset number of processing paths.

[0026] Furthermore, the step of calculating the optimal path based on the preset number of processing paths includes:

[0027] Identifying the length of each processing path in the preset number of processing paths;

[0028] The sequence number combination of the length of the shortest processing path is obtained, which is the processing sequence of the optimal path.

[0029] The steps of updating pheromones, repeating S2-S4 for iteration, and recording iteration data in each iteration process include:

[0030] Calculate the increase in pheromone;

[0031] The initialized pheromone concentration is subjected to volatilization operation and combined with the pheromone increment to obtain the updated pheromone;

[0032] Based on the updated pheromone, S2-S4 are repeatedly executed to iterate, and the iteration data in each iteration process is recorded, wherein the iteration data includes the shortest distance sequence number combination after iteration and the shortest distance and average distance of each iteration.

[0033] The step of adjusting the model parameters and influencing factors based on each iteration data and updating the optimal path until a preset number of iterations is reached includes:

[0034] Based on the shortest distance and the average distance, generating a change curve of the shortest distance convergence trajectory and the average distance convergence trajectory relative to the number of iterations;

[0035] Calculate the calculation time and number of iterations of the ant colony algorithm, train the ant colony algorithm model, obtain the optimal solution for each processing object in the shortest time, update and save the optimal solution, that is, the optimal path, where the optimal path is the shortest distance sequence number combination.

[0036] The second aspect of the present application provides a laser drilling process path generation device, comprising:

[0037] The initialization module is used to set and initialize the population, model parameters and influencing factors based on the ant colony algorithm model;

[0038] A transition probability calculation module, used to calculate the transition probability between each processing object based on the sequence number and coordinates of the processing object;

[0039] A processing path generation module, used to generate the next processing object in sequence through roulette based on the transition probability, and update the taboo table according to the processing object until all processing objects are traversed, a processing path is generated, and this step is repeated until a preset number of processing paths are obtained;

[0040] An optimal path selection module, used for calculating an optimal path based on the preset number of processing paths;

[0041] Iterative optimization module, used to update pheromones, repeatedly execute S2-S4 for iteration, and record iteration data in each iteration process;

[0042] The parameter adjustment and convergence module is used to adjust the model parameters and influencing factors and update the optimal path based on each iteration data until a preset number of iterations is reached.

[0043] A third aspect of the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0044] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of any of the above methods when executed by a processor.

[0045] Beneficial Effects

[0046] This application first ensures the diversity and adaptability of the algorithm optimization process by initializing the population, model parameters and influencing factors. Subsequently, the sequence number and coordinate information of the processing object are used to accurately calculate the transfer probability between each processing object, providing a decision-making basis for subsequent path generation. The processing objects are generated in sequence through the roulette mechanism, the taboo table is updated to avoid duplication, and multiple processing paths are generated. This process effectively avoids the local optimal solution and enhances the global search capability. After obtaining a preset number of processing paths, the algorithm further calculates the optimal path to ensure the optimization of the processing sequence. By iteratively updating pheromones and adjusting model parameters and influencing factors according to iterative data, the algorithm can dynamically adapt to changes in the processing environment and continuously optimize the processing path. Not only does it greatly shorten the processing path length and reduce the galvanometer deflection angle, but it also saves processing time and reduces equipment loss, significantly improving the efficiency and quality of laser drilling processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A schematic diagram of a process flow of a laser drilling processing path generation method according to an embodiment of the present application;

[0048] Figure 2This is a schematic block diagram of the structure of a laser drilling processing path generation device according to an embodiment of the present application;

[0049] Figure 3 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.

[0050] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with 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.

[0052] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "a", "an", "above", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of features, integers, steps, operations, elements, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any module and all combinations of one or more associated listed items.

[0053] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.

[0054] Reference Figure 1 The embodiment of the present invention provides a method for generating a laser drilling processing path, comprising steps S1-S6, specifically:

[0055] S1. Based on the ant colony algorithm model, set and initialize the population, model parameters and influencing factors;

[0056] S2. Calculate the transition probability between each processing object based on the sequence number and coordinates of the processing object;

[0057] S3, based on the transfer probability, generate the next processing object in sequence through roulette, and update the taboo table according to the processing object, until all processing objects are traversed, a processing path is generated, and this step is repeated until a preset number of processing paths are obtained;

[0058] S4, calculating and obtaining an optimal path based on the preset number of processing paths;

[0059] S5, update pheromone, repeat S2-S4 for iteration, and record the iteration data in each iteration process;

[0060] S6. Adjusting the model parameters and influencing factors and updating the optimal path based on the iterative data of each time until a preset number of iterations is reached.

[0061] As described in step S1 above, the setting of the population is an important part of S1. The population represents the search agent in the algorithm, that is, the individual ant simulation. In the application scenario of laser drilling processing, each individual in the population represents a possible processing path. Initializing the population means defining the initial exploration space for the algorithm's search process. Each ant has a certain degree of randomness at the beginning, which helps the algorithm explore multiple possible paths in the early stage. Parameters include pheromone heuristic factor alpha, expected heuristic factor beta, number of ants m, and pheromone volatility factor vol. These parameters jointly determine the search strategy and behavior of the ant colony algorithm. For example, the size of the alpha value affects the degree of ant's dependence on historical information, while the beta value affects the preference for local optimality. The m value determines the breadth of the search, and the vol value affects the persistence of pheromones, which in turn affects the global search ability and convergence speed of the algorithm. The setting of influencing factors involves other factors that have an important impact on the performance of the algorithm, such as the spacing of the processing objects, the processing time, the moving speed of the galvanometer, etc. The reasonable setting of these factors can improve the adaptability of the algorithm to a specific processing environment and make the search process more efficient. By utilizing the swarm intelligence and positive feedback mechanism of the ant colony algorithm, the local optimal solution can be effectively avoided and the probability of finding the global optimal solution can be increased. In addition, through the dynamic adjustment of parameters and influencing factors, the algorithm can adapt to different processing environments and requirements, and has good flexibility and robustness.

[0062] As described in step S2 above, first, the serial number and coordinate information of each processing object need to be extracted from the CAD (Computer Aided Design) image. This information constitutes the basic data of the algorithm and provides the necessary input for subsequent path optimization. The coordinate information usually includes the X and Y coordinate values ​​of each processing object, which are used in the algorithm to calculate the distance between objects. Next, the algorithm calculates the distance between each processing object based on these coordinate values. This distance information is then used to estimate the probability of transferring from one processing object to another. The calculation formula for the transfer probability usually involves the inverse of the distance, that is, the closer the distance, the higher the transfer probability. This design reflects a core idea of ​​the ant colony algorithm: shorter paths are more likely to be selected by ants because the pheromones they leave on these paths are more easily detected by subsequent ants. When calculating the transfer probability, the influence of pheromones also needs to be considered. Pheromones are a virtual substance used to simulate the preferences of ants when choosing paths. In the early iterations of the algorithm, the distribution of pheromones is uniform and relatively random. As the iterations proceed, pheromones will gradually accumulate on those paths that have been selected multiple times, thereby guiding the entire ant colony to move towards the optimal solution.

[0063] As described in step S3 above, first, a selection probability is assigned to each processing object based on the transition probability calculated in step S2. The transition probability reflects the possibility of going from one processing object to another, which is usually inversely proportional to the distance between the two, and may also be related to the frequency of the ant's previous selection of the path (i.e., the concentration of pheromones). The roulette mechanism is a random selection process that determines the next selected processing object based on the transition probability of each processing object. The specific implementation process starts with randomly selecting a starting processing object, and then selecting the next processing object through roulette according to the transition probability. Whenever a processing object is selected, the algorithm adds it to the current processing path and marks it as visited in the taboo table. The taboo table is a data structure used to record the processing objects that the ant has visited in the current iteration to avoid repeated visits and promote the diversity of the path. As the iteration proceeds, the algorithm continuously generates new processing paths until all processing objects are traversed. In this way, a complete processing path is generated. Then, the algorithm will select other starting points and repeat this process to generate multiple processing paths, each of which represents a series of processing sequences from the starting point to the end point.

[0064] As described in step S4 above, all processing paths generated in step S3 need to be comprehensively evaluated first. Each path is composed of a series of processing objects connected in a specific order, and the length and characteristics of each path are different. The length of the path can be used as one of the main criteria for evaluation because it is directly related to the distance the galvanometer needs to move during the actual processing process. During the evaluation process, the algorithm considers factors such as the total length of each path, the number of turns, and the processing time. A shorter path means that the galvanometer needs to move a shorter distance, thereby reducing processing time and equipment wear and improving processing efficiency. At the same time, fewer turns also help reduce the deflection angle of the galvanometer and extend the service life of the equipment. In order to determine the optimal path, the algorithm will sort all paths and select the path with the shortest length or the highest comprehensive score as the optimal solution.

[0065] As described in step S5 above, first, the concentration of pheromones needs to be updated according to the frequency of ants choosing paths in the previous iteration. Pheromones are virtual marks left on the path, which simulate the smell left by real ants along the way when looking for food, and can attract other ants to follow the same path. In the algorithm, the concentration of pheromones is usually proportional to the quality of the path, that is, the better the path, the higher the pheromone concentration, and the more ants can choose. The process of updating pheromones includes two main parts: volatilization and deposition. Volatilization refers to the process of pheromone naturally decreasing over time, which ensures that the algorithm will not converge to a non-optimal solution too early; deposition is the process of increasing the pheromone concentration on a path according to the length of the path after the ant completes a path, which reflects the algorithm's preference for a better solution. After the pheromone update is completed, the algorithm will repeat steps S2 to S4. This means that the transition probability will be recalculated (step S2), the processing object will be generated again through the roulette selection mechanism and the taboo table will be updated (step S3), and the optimal path will be calculated from the path generated in the current iteration (step S4). Through such an iterative process, the algorithm can gradually explore more suitable and excellent processing paths. In this solution, the role of step S5 can dynamically adjust the search strategy so that the algorithm can adapt to changes in the search space and continuously optimize the quality of the solution. By iteratively updating pheromones, the algorithm can increase in-depth exploration of promising areas while ensuring the breadth of the search. Continuous optimization of the laser drilling processing path is achieved. As the iteration proceeds, the algorithm can gradually reduce the jump distance and processing time of the galvanometer, and improve processing efficiency and accuracy. At the same time, the adaptability of the algorithm enables it to perform well in different processing scenarios, with high practicality and flexibility.

[0066] As described in step S6 above, first, it is necessary to collect and analyze the data of each iteration. These data include but are not limited to the optimal path generated in each iteration, the average length of all paths, the distribution of pheromones, and the behavior pattern of ants in selecting paths. Through the careful analysis of these data, we can obtain an in-depth understanding of the current search status and formulate corresponding adjustment strategies accordingly. Next, adjust the model parameters and influencing factors according to the analysis results. Parameter adjustment may include changing the pheromone heuristic factor alpha, the expected heuristic factor beta, the number of ants m, and the pheromone volatility factor vol. The adjustment of these parameters will directly affect the behavior of ants in selecting paths, thereby affecting the efficiency and quality of the entire search process. At the same time, the optimal path is updated according to the iterative data, or the optimal solution is completely updated when a better path is found. In this way, the algorithm can be gradually improved in each round of iteration and finally converge to a stable and high-quality solution. The role of step S6 is to ensure that the algorithm can be flexibly adjusted according to the actual search situation, continuously optimize the search strategy, and improve the search efficiency. By dynamically adjusting parameters and updating the optimal path, the algorithm can better adapt to complex search spaces, avoid falling into local optimality, and finally find the global optimal solution. It is highly adaptable and flexible. The ant colony algorithm can dynamically adjust its behavior based on real-time search feedback, which enables it to maintain efficient search capabilities when facing ever-changing optimization problems.

[0067] Through steps S1-S6, the diversity and adaptability of the algorithm optimization process are ensured by first initializing the population, model parameters and influencing factors. Subsequently, the sequence number and coordinate information of the processing object are used to accurately calculate the transfer probability between each processing object, providing a decision-making basis for subsequent path generation. The processing objects are generated in sequence through the roulette mechanism, the taboo table is updated to avoid duplication, and multiple processing paths are generated. This process effectively avoids local optimal solutions and enhances global search capabilities. After obtaining a preset number of processing paths, the algorithm further calculates the optimal path to ensure the optimization of the processing sequence. By iteratively updating pheromones and adjusting model parameters and influencing factors according to iterative data, the algorithm can dynamically adapt to changes in the processing environment and continuously optimize the processing path. Not only does it greatly shorten the processing path length and reduce the galvanometer deflection angle, but it also saves processing time and reduces equipment loss, significantly improving the efficiency and quality of laser drilling processing.

[0068] In one embodiment, the step of setting and initializing the population, model parameters and influencing factors based on the ant colony algorithm model includes:

[0069] S10, taking the processing object derived from the CAD image as the research object, building an ant colony algorithm model;

[0070] S11, based on the ant colony algorithm model, setting the model parameters and influencing factors of the ant colony algorithm;

[0071] S12, initializing the model parameters and the influencing factors, including initializing the starting position of the ants and initializing the pheromone concentration in each part of the path.

[0072] In this embodiment, first, the processing objects derived from the CAD image are used as research objects, and these objects represent the specific tasks that need to be processed in the laser drilling process. The model is constructed by calculating the formula of the ant colony algorithm. This model can simulate the behavior of ants in finding paths and provide algorithm support for the path planning of laser drilling. When setting the model parameters and influencing factors of the ant colony algorithm (step S11), multiple aspects need to be considered, including the pheromone heuristic factor alpha, the expected heuristic factor beta, the number of ants m, and the pheromone volatility factor vol. These parameters jointly determine the search behavior and path selection preference of the ant colony algorithm. For example, the values ​​of alpha and beta affect the degree of ant's dependence on historical information and heuristic information when selecting a path; the m value determines the breadth of the search; and the vol value affects the persistence of pheromones, thereby affecting the global search capability and convergence speed of the algorithm. Next, when initializing the parameters and influencing factors (step S12), a starting position needs to be set for each ant, which is usually based on randomness to ensure the exploratory nature of the algorithm. At the same time, the pheromone concentration is initialized in each part of the path. The pheromone concentration represents the attractiveness of the path, and its initial value is usually low to promote extensive exploration of the algorithm in the early stage.

[0073] In one embodiment, the step of calculating the transition probability between each processing object based on the sequence number and coordinates of the processing object includes:

[0074] S21, reading a CAD image, dividing the CAD image into a plurality of partitions according to the processing range of the galvanometer, and deriving the serial number of each processing object and the X, Y coordinates of its center from each partition of the CAD image in turn;

[0075] S22, calculating the distance between each processing object based on the X and Y coordinates of the center of the circle;

[0076] S23, according to the partition order, sequentially establish a two-dimensional array in each partition to store the distance between each processing object and other processing objects, wherein each processing object is represented by a serial number of the processing object;

[0077] S24. Based on the distance, a probability transfer function is used to calculate the probability of the current processed object being transferred to other unprocessed objects until all processed objects are processed; wherein the transfer probability is inversely proportional to the distance, and the closer the distance, the greater the transfer probability.

[0078] In this embodiment, in order to effectively manage the search space and adapt to the actual processing capabilities of the galvanometer, the CAD image is divided into several partitions. These partitions are determined based on the effective processing range of the galvanometer to ensure that the processing objects in each partition can be reached by the galvanometer. Next, the serial number and center coordinates (X, Y) of the processing object are extracted from each partition. The serial number is used to uniquely identify each processing object, and the center coordinates provide the necessary location information for calculating the distance and transfer probability. Then, according to the partition order, a two-dimensional array is established in each partition. This array is used to store the distance from each processing object (center coordinates of the processing object) to other processing objects in the partition, where the distance can be calculated using the Euclidean distance formula. Finally, based on these distances, the probability transfer function is used to calculate the probability of the current processing object transferring to other unprocessed objects. The calculation of the transfer probability is usually inversely proportional to the distance, that is, the closer the distance, the greater the transfer probability. This design reflects an actual physical phenomenon, that is, paths with shorter distances are more likely to be selected by ants. P represents the transfer probability between two processing objects, k represents the next processing object, and P(k) represents the probability of transferring from the current processing object to the k processing objects. The calculation formula is (met lab language):

[0079] for k=1:length(al low)

[0080] P(k)=Tau(has_vis ited(end),al low(k))^alpha*

[0081] Heu_F(has_vis ited(end),al low(k))^beta;

[0082] end

[0083] P=P / sum(P)

[0084] (in,

[0085] has_visited() indicates the array of processing objects that have been visited;

[0086] al low() represents the next accessible processing object array;

[0087] Tau=ones(n,n); % pheromone matrix, indicating the initial amount of pheromone;

[0088] Heu_F() is the inverse matrix of the distance between each processing object, so the farther the distance, the lower the probability.) The search process of the ant colony algorithm of this application provides a distance-based transfer probability model, which enables ants to tend to choose processing objects with a closer distance when selecting paths, thereby helping to reduce the moving distance and processing time of the galvanometer.

[0089] In one embodiment, the step of sequentially generating the next processing object through roulette based on the transition probability, and updating the taboo table according to the processing object until all processing objects are traversed to generate a processing path, and repeating this step until a preset number of processing paths are obtained includes:

[0090] S31, based on the transition probability, using a roulette wheel selection algorithm to select the next processing object from the current processing object;

[0091] S32, when it is determined that the next processing object is selected, updating the taboo table, wherein the taboo table is used to record the visited processing objects to avoid repeated selection;

[0092] S33, when it is recognized that all processing objects have been selected, a complete processing path is generated;

[0093] S34, iterating based on the processing path to generate a new processing path, until a preset number of iterations is reached to obtain a preset number of processing paths.

[0094] In this embodiment, a roulette wheel is used to select the next processing object to be visited. The algorithm uses a roulette wheel selection algorithm to determine the next processing object based on the previously calculated transition probability. The roulette wheel selection algorithm is a random selection process that determines the next processing object to be selected based on the transition probability of each processing object. Processing objects with higher transition probabilities have a greater chance of being selected, which reflects the influence of pheromone concentration and heuristic factors on ant selection. The calculation formula is:

[0095] Pc = cumsum(P); (the accumulation function adds the first few to 1 and the sum of each column)

[0096] target_index = find(Pc>=rand); (return all cities that are greater than or equal to the random number. rand returns a random number uniformly distributed in the interval (0,1))

[0097] target=al low(target_index(1));

[0098] Table(i,j)=target;

[0099] Once the next processing object is selected, the taboo table is updated immediately. The taboo table is a data structure used to record the processing objects that the ants have visited in the current iteration. Through the taboo table, the algorithm can avoid repeatedly selecting the same processing object, ensure the diversity of the path, and encourage the ants to explore new paths. The taboo table uses a two-dimensional array has_visited to record the processing objects that have been visited, and a one-dimensional array all low to record the optional processing object set for accessing the next processing object. The calculation formula is:

[0100] (1)has_vis ited=Table(i,1:(j-1));

[0101] (2)

[0102] (3)al low=ci tys_index(al low_index)

[0103] Finally, in step S34, the algorithm will start an iterative process based on this initial processing path. In each iteration, a new object is selected as the starting point, and the algorithm will generate a new processing path and repeat steps S31 to S33. This process will continue until a preset number of iterations is reached, thereby obtaining a preset number of processing paths. These paths can then be used for subsequent optimal path selection and further optimization, which facilitates the provision of a globally optimized path search strategy, avoids the limitations of local optimal solutions, and improves search efficiency and solution quality.

[0104] In one embodiment, the step of calculating the optimal path based on the preset number of processing paths includes:

[0105] S41, identifying the length of each processing path among the preset number of processing paths;

[0106] S42, obtaining the sequence number combination of the length of the shortest processing path, which is the processing sequence of the optimal path.

[0107] In this embodiment, the length of each processing path is first identified and calculated. This involves evaluating all processing paths generated in step S34. The length of each path is the sum of the lengths of all line segments it contains, which connect the center coordinates of the processed object. By calculating the length of each path, the algorithm can assign a quantitative evaluation value to each path. The algorithm will obtain the serial number of the path with the shortest length among all processing paths. This path with the shortest length is considered to be the optimal solution in the current iteration because it represents the minimum distance that the galvanometer needs to move during the processing. After obtaining the serial number combination of the serial numbers represented by all the shortest processing paths in the path, the serial number combination contained in the path will be marked as the optimal path for subsequent iterations and comparisons. Through the implementation of steps S41 and S42, the algorithm can effectively screen out the optimal path from multiple candidate paths. This process is not only based on precise calculations, but also relies on the iterative process of the ant colony algorithm, in which each round of iteration will generate a new path and have the opportunity to improve the current optimal solution.

[0108] In one embodiment, the step of updating pheromones, repeating S2-S4 for iteration, and recording iteration data in each iteration process includes:

[0109] S51, calculating the increase in pheromone;

[0110] S52, performing a volatilization operation on the initialized pheromone concentration and combining it with the pheromone increment to obtain an updated pheromone;

[0111] S53, based on the updated pheromone, repeatedly execute S2-S4 to iterate, and record the iteration data in each iteration process, wherein the iteration data includes the shortest distance sequence number combination after iteration and the shortest distance and average distance of each iteration.

[0112] In this embodiment, the pheromone increase is first calculated. The calculation formula is:

[0113] Delta_Tau = zeros(n,n);

[0114] for i=1:m

[0115] for j=1:(n-1) (it can be understood that each ant carries an equal amount of pheromone and spreads the pheromone evenly along the path it walks)

[0116] Delta_Tau(Table(i,j),Table(i,j+1))=Delta_Tau(Table(i,j),Table(i,j+1))+Q / Length(i);

[0117] end

[0118] Then the original pheromone is evaporated and the increment is added to obtain the updated pheromone array.

[0119] Tau = ones(n,n); (pheromone matrix);

[0120] Tau = (1-vol)*Tau+Delta_Tau; (pheromone volatilization + increment);

[0121] After updating the pheromone table, it is saved as a reference for the next calculation, affecting the next iteration result and finding the optimal path. The algorithm obtains the updated pheromone concentration. The updated pheromone concentration reflects the attractiveness of the path, where the shorter path becomes more attractive due to the deposition of more pheromones. Based on the updated pheromones, the algorithm repeats the iterative process from S2 to S4, which includes recalculating the transition probability, selecting the processing object, updating the taboo table and identifying the optimal path. In this round of iteration, the set number of ants determines the number of iterations in each generation. Each ant can iterate a complete scanning path for each processing object in the CAD image partition, record the path sequence of each ant, calculate the length of each path, and the path with the shortest length is the optimal solution of this iteration. At the same time, the average value of the scanning paths of all ants in this iteration result is calculated. In each iteration, the algorithm records key iteration data, such as the shortest distance sequence number combination after the iteration, which represents the path sequence of the current optimal solution. At the same time, the shortest distance and average distance of each iteration are recorded. These data are not only used to monitor the convergence trend of the algorithm, but also provide a basis for adjusting the algorithm parameters. The algorithm can continuously learn and improve in each round of iteration, gradually optimizing the processing path of the galvanometer. Compared with the existing technology, the advantage of this solution is that it can dynamically adapt to changes in the processing environment and guide the search process by iteratively updating pheromones, thereby more effectively exploring the solution space and increasing the probability of finding the global optimal solution.

[0122] In one embodiment, the step of adjusting the model parameters and the influencing factors and updating the optimal path based on each iteration data until a preset number of iterations is reached includes:

[0123] S61, based on the shortest distance and the average distance, generating a change curve of the shortest distance convergence trajectory and the average distance convergence trajectory relative to the number of iterations;

[0124] S62, calculating the calculation time and the number of iterations of the ant colony algorithm, training the ant colony algorithm model, obtaining the optimal solution for each processing object in the shortest time, updating and saving the optimal solution, that is, the optimal path, wherein the optimal path is the shortest distance sequence number combination.

[0125] In this embodiment, after each generation of ant colony iteration is completed, two two-dimensional arrays are defined, one for storing the optimal solution generated by each iteration, and the other for storing the average value of all path lengths generated by each iteration. The change curves of the shortest distance convergence trajectory and the average distance convergence trajectory relative to the number of iterations are drawn respectively. Whether the parameter and influencing factor setting values ​​are appropriate can be verified according to the convergence trajectory curve. The calculation time of the ant colony algorithm is calculated, and the number of iterations is reduced as much as possible when the optimal solution is obtained by reducing the number of iterations, saving the calculation time of the ant colony algorithm model. After adjusting the parameter and influencing factor setting values, the optimal solution of each processing object is obtained in the shortest time through the ant colony algorithm model, and the optimal solution is updated and saved, representing the optimal path of the galvanometer processing. Not only can the current solution be continuously improved, but also the search strategy can be dynamically adjusted according to real-time feedback to ensure that the path found is the most optimized when the preset number of iterations is reached. The advantage of this method is that it can balance exploration and development while maintaining the flexibility and robustness of the algorithm. Its highly adaptive optimization capability. The ant colony algorithm can continuously adjust itself according to real-time iteration data and automatically optimize parameters, rather than relying on manual model parameter adjustment. This method not only improves the probability of finding high-quality solutions, but also reduces human intervention and improves the degree of automation.

[0126] In one embodiment, a specified number of CAD images are selected for actual testing, and the galvanometer jump length and actual processing time of the default processing path of the CAD image and the galvanometer jump length and actual processing time of the processing path of the optimal solution calculated by the ant colony algorithm model are recorded, and conclusions are drawn based on the test data. That is, based on the actual test data, by comparing the galvanometer jump length and actual processing time of the default processing path of the CAD image and the galvanometer jump length of the processing path of the optimal solution calculated by the ant colony algorithm model, it can be concluded that the galvanometer jump length of the processing path of the optimal solution calculated by the ant colony algorithm model is shorter and the processing time is shorter. Therefore, the ant colony algorithm model can save time and improve the processing efficiency of the equipment.

[0127] Reference Figure 2 , is a structural block diagram of a laser drilling processing path generation device in an embodiment of the present application, the device includes:

[0128] Initialization module 100, used to set and initialize the population, model parameters and influencing factors based on the ant colony algorithm model;

[0129] The transition probability calculation module 200 is used to calculate the transition probability between each processing object based on the sequence number and coordinates of the processing object;

[0130] A processing path generation module 300 is used to generate the next processing object in sequence through a roulette wheel based on the transition probability, and update the taboo table according to the processing object until all processing objects are traversed, a processing path is generated, and this step is repeated until a preset number of processing paths are obtained;

[0131] An optimal path selection module 400, configured to calculate an optimal path based on the preset number of processing paths;

[0132] Iterative optimization module 500, used to update pheromones, and repeatedly execute S2-S4 to iterate, and record iterative data in each iteration process;

[0133] The parameter adjustment and convergence module 600 is used to adjust the model parameters and influencing factors and update the optimal path based on each iteration data until a preset number of iterations is reached.

[0134] In one embodiment, the initialization module 100 includes:

[0135] A research object definition unit is used to build an ant colony algorithm model using the processing object exported from the CAD image as the research object;

[0136] An algorithm model building unit, used to set model parameters and influencing factors of the ant colony algorithm based on the ant colony algorithm model;

[0137] The parameter and influencing factor setting unit is used to initialize the model parameters and the influencing factors, including initializing the starting position of the ants and initializing the pheromone concentration in each part of the path.

[0138] In one embodiment, the optimal transition probability calculation module 200 includes:

[0139] An image partition processing unit is used to read a CAD image, divide the CAD image into several partitions according to the processing range of the galvanometer, and derive the serial number of each processing object and the X, Y coordinates of its center from each partition of the CAD image in turn;

[0140] A distance calculation unit, used for calculating the distance between each processing object based on the X and Y coordinates of the center of the circle;

[0141] A distance matrix construction unit is used to establish a two-dimensional array in each partition in turn according to the partition order to store the distance between each processing object and other processing objects, wherein each processing object is represented by a serial number of the processing object;

[0142] The transfer probability calculation unit is used to calculate the probability of the current processed object being transferred to other unprocessed objects based on the distance using a probability transfer function until all processed objects are processed; wherein the transfer probability is inversely proportional to the distance, and the closer the distance, the greater the transfer probability.

[0143] In one embodiment, the processing path generation module 300 includes:

[0144] A selection mechanism application unit, configured to select a next processing object from the current processing object using a roulette wheel selection algorithm based on the transition probability;

[0145] A taboo table management unit, used for updating a taboo table when it is determined that the next processing object is selected, wherein the taboo table is used to record the visited processing objects to avoid repeated selection;

[0146] A path generation completion unit is used to generate a complete processing path when it is identified that all processing objects have been selected;

[0147] The iterative path generation unit is used to iterate based on the processing path to generate a new processing path until a preset number of iterations is reached to obtain a preset number of processing paths.

[0148] In one embodiment, the optimal path selection module 400 includes:

[0149] a path length identification unit, used to identify the length of each processing path in the preset number of processing paths;

[0150] The optimal path determination unit is used to obtain the sequence number combination of the length of the shortest processing path, which is the processing sequence of the optimal path.

[0151] In one embodiment, the iterative optimization module 500 includes:

[0152] A pheromone increment calculation unit, used for calculating the pheromone increment;

[0153] The pheromone updating unit is used to volatilize the initialized pheromone concentration and combine it with the pheromone increment to obtain the updated pheromone;

[0154] The iterative data recording unit is used to repeatedly execute S2-S4 for iteration based on the updated pheromone and record the iterative data in each iteration process, wherein the iterative data includes the shortest distance sequence number combination after iteration and the shortest distance and average distance of each iteration.

[0155] In one embodiment, the parameter adjustment and convergence module 600 includes:

[0156] A convergence trajectory drawing unit, used for generating a change curve of the shortest distance convergence trajectory and the average distance convergence trajectory relative to the number of iterations based on the shortest distance and the average distance;

[0157] The model training and optimization unit is used to calculate the calculation time and number of iterations of the ant colony algorithm, train the ant colony algorithm model, obtain the optimal solution for each processing object in the shortest time, update and save the optimal solution, that is, the optimal path, wherein the optimal path is the shortest distance sequence number combination.

[0158] Reference Figure 3 In the embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store usage data in a laser drilling processing path generation method process, etc. The network interface of the computer device is used to communicate with an external terminal through a network connection. Furthermore, the above-mentioned computer device can also be provided with an input device and a display screen, etc. When the above computer program is executed by the processor, a method for generating a laser drilling processing path is implemented, including the following steps: S1. Based on the ant colony algorithm model, set and initialize the population, model parameters and influencing factors; S2. Based on the serial number and coordinates of the processing object, calculate the transition probability between each processing object; S3. Based on the transition probability, generate the next processing object in turn through roulette, and update the taboo table according to the processing object until all processing objects are traversed, generate a processing path, and repeat this step until a preset number of processing paths are obtained; S4. Based on the preset number of processing paths, calculate the optimal path; S5. Update pheromones, and repeat S2-S4 for iteration, and record the iteration data during each iteration; S6. Adjust the model parameters and influencing factors and update the optimal path based on each iteration data until the preset number of iterations is reached. Those skilled in the art can understand that Figure 3 The structure shown in is merely a block diagram of a portion of the structure related to the present application solution and does not constitute a limitation on the computer device to which the present application solution is applied.

[0159] An 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, a method for generating a laser drilling processing path is implemented, including the following steps: S1, based on the ant colony algorithm model, set and initialize the population, model parameters and influencing factors; S2, based on the sequence number and coordinates of the processing object, calculate the transition probability between each processing object; S3, based on the transition probability, generate the next processing object in turn through roulette, and update the taboo table according to the processing object until all processing objects are traversed, a processing path is generated, and this step is repeated until a preset number of processing paths is obtained; S4, based on the preset number of processing paths, the optimal path is calculated; S5, update pheromones, and repeat S2-S4 for iteration, and record the iteration data in each iteration process; S6, adjust the model parameters and influencing factors based on each iteration data and update the optimal path until the preset number of iterations is reached. It can be understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0160] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0161] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.

[0162] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A laser drilling process path generation method, characterized in that: The method comprises: S1. Based on the ant colony algorithm model, set and initialize the population, model parameters and influencing factors; S2. Calculate the transition probability between each processing object based on the sequence number and coordinates of the processing object; S3, based on the transfer probability, generate the next processing object in sequence through roulette, and update the taboo table according to the processing object, until all processing objects are traversed, a processing path is generated, and this step is repeated until a preset number of processing paths are obtained; S4, calculating and obtaining an optimal path based on the preset number of processing paths; S5, update pheromone, repeat S2-S4 for iteration, and record the iteration data in each iteration process; S6. Adjusting the model parameters and influencing factors and updating the optimal path based on the iterative data of each time until a preset number of iterations is reached.

2. The laser drilling process path generation method according to claim 1, characterized in that: The steps of setting and initializing the population, model parameters and influencing factors based on the ant colony algorithm model include: Taking the processing object derived from CAD images as the research object, an ant colony algorithm model was built; Based on the ant colony algorithm model, setting model parameters and influencing factors of the ant colony algorithm; Initializing the model parameters and the influencing factors, including initializing the starting position of the ants and initializing the pheromone concentration in each part of the path.

3. The laser drilling process path generation method according to claim 1, characterized in that: The step of calculating the transition probability between each processing object based on the sequence number and coordinates of the processing object includes: Read the CAD image, divide the CAD image into several partitions according to the processing range of the galvanometer, and derive the serial number of each processing object and the X, Y coordinates of its center from each partition of the CAD image in turn; Calculate the distance between each processing object based on the X and Y coordinates of the center of the circle; According to the partition order, a two-dimensional array is established in each partition in turn to store the distance between each processing object and other processing objects, wherein each processing object is represented by the serial number of the processing object; Based on the distance, a probability transfer function is used to calculate the probability of the current processed object being transferred to other unprocessed objects until all processed objects are processed; wherein the transfer probability is inversely proportional to the distance, and the closer the distance, the greater the transfer probability.

4. The laser drilling process path generation method according to claim 1, characterized in that: The step of sequentially generating the next processing object through roulette based on the transition probability, and updating the taboo table according to the processing object until all processing objects are traversed, generating a processing path, and repeating this step until a preset number of processing paths are obtained, includes: Based on the transition probability, a roulette wheel selection algorithm is used to select a next processing object from the current processing object; When it is determined that the next processing object is selected, updating the taboo table, wherein the taboo table is used to record the visited processing objects to avoid repeated selection; When all processing objects are identified and selected, a complete processing path is generated; Iteration is performed based on the processing path to generate a new processing path until a preset number of iterations is reached to obtain a preset number of processing paths.

5. The laser drilling process path generation method according to claim 1, characterized in that: The step of calculating the optimal path based on the preset number of processing paths includes: Identifying the length of each processing path in the preset number of processing paths; The sequence number combination of the length of the shortest processing path is obtained, which is the processing sequence of the optimal path.

6. The laser drilling process path generation method according to claim 1, characterized in that: The steps of updating pheromones, repeating S2-S4 for iteration, and recording iteration data in each iteration process include: Calculate the increase in pheromone; The initialized pheromone concentration is subjected to volatilization operation and combined with the pheromone increment to obtain the updated pheromone; Based on the updated pheromone, S2-S4 are repeatedly executed to perform iterations, and the iteration data in each iteration process is recorded, wherein the iteration data includes the shortest distance sequence number combination after the iteration and the shortest distance and average distance of each iteration.

7. The laser drilling process path generation method according to claim 6, characterized in that: The step of adjusting the model parameters and influencing factors based on each iteration data and updating the optimal path until a preset number of iterations is reached includes: Based on the shortest distance and the average distance, generating a change curve of the shortest distance convergence trajectory and the average distance convergence trajectory relative to the number of iterations; Calculate the calculation time and number of iterations of the ant colony algorithm, train the ant colony algorithm model, obtain the optimal solution for each processing object in the shortest time, update and save the optimal solution, that is, the optimal path, where the optimal path is the shortest distance sequence number combination.

8. A laser drilling process path generation device, characterized in that: include: The initialization module is used to set and initialize the population, model parameters and influencing factors based on the ant colony algorithm model; A transition probability calculation module, used to calculate the transition probability between each processing object based on the sequence number and coordinates of the processing object; A processing path generation module, used to generate the next processing object in sequence through roulette based on the transition probability, and update the taboo table according to the processing object until all processing objects are traversed, a processing path is generated, and this step is repeated until a preset number of processing paths are obtained; An optimal path selection module, used for calculating an optimal path based on the preset number of processing paths; Iterative optimization module, used to update pheromones, repeatedly execute S2-S4 for iteration, and record iteration data in each iteration process; The parameter adjustment and convergence module is used to adjust the model parameters and influencing factors and update the optimal path based on each iteration data until a preset number of iterations is reached.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

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

Citation Information

Cited By

  • Workpiece drilling path generation method and system based on artificial intelligence

    CN119511937A

  • High-precision AI glasses metal structural part machining intelligent control method and system

    CN121680291A