A welding head path planning control system for gantry friction welding
Through welding image analysis and genetic algorithm optimization of the welding head path, automated and intelligent gantry friction welding is realized, which solves the problem of traditional welding relying on manual labor and being unable to automatically set parameters, and improves welding quality and efficiency.
Patent Information
- Application Number
- CN202410385507.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-01
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-04-01
AI Technical Summary
The welding head path planning of traditional gantry friction welding relies on manual control, which makes it difficult to achieve high-quality and stable welds. Moreover, path planning cannot be directly based on the shape of the object to be welded and the weld data. The application scenarios are highly restrictive, and during the welding process Parameters cannot be set automatically and must be preset manually, which may cause errors.
A welding head path planning and control system for gantry friction welding is designed, including a welding object image acquisition module, a weld image analysis module, a path acquisition module, a path selection module and a parameter setting module. Through the genetic algorithm and deep neural network model , dynamically obtain welding seam parameters and optimize the welding head path to achieve adaptive movement and parameter setting of the welding head.
It realizes the automation and intelligent welding process of the welding head, improves the welding quality and efficiency, solves the problem of traditional manual welding relying on the experience of the operator, and ensures that the welding head can complete the welding seam formation smoothly and without hindrance.
Smart Images

Figure CN118123223B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of welding head control, and more specifically, to a welding head path planning control system for gantry type friction welding. Background Art
[0002] Gantry friction welding is a commonly used surface welding technology. It uses a rotating rubber or silicone welding head and the principle of friction cooling to weld metal sheets. Compared with traditional spot welding or line welding, gantry friction welding has the advantage of continuous welding of the workpiece surface and can achieve a wide range of surface welding. It is especially suitable for products that require high-quality precision welds.
[0003] However, due to the complex shape and working conditions of the welding head, it is difficult to achieve high-quality and stable welds by relying on the traditional manual control of the welding head path; therefore, a high-precision welding head path planning system is required to ensure the accuracy of the path. For example, the Chinese patent with the authorization announcement number CN1 07350667B discloses a simulation method for a flexible production line for automobile door panel welding based on a digital factory; including: through machine vision technology, the production line can detect the integrity of the workpiece, the total number and location of the welds, and correctly call the welding head and the jig; through the path planning method, the welds are reasonably grouped and managed, the welding seams of each robot arm are set, and the welding order of the robot arm in each weld is planned; this simulation method is based on a digital factory, and can design the automobile door panel welding production line, workshop layout, production process optimization, and verify feasibility and find errors before the production line is actually put into operation, which can effectively reduce the R&D cycle and enterprise costs;
[0004] However, the above technology needs to obtain the number and position of welding points before the path planning of the welding head can be carried out. It cannot directly plan the path according to the shape of the object to be welded and the weld data, and the application scenario is relatively limited. In addition, it is impossible to obtain the relevant parameters of the welding head during the welding process, that is, it is impossible to automatically set the parameters during the welding process according to the planned path, and it needs to be manually set in advance, which is time-consuming and labor-intensive, and there are also errors.
[0005] In view of this, the present invention proposes a welding head path planning control system for gantry friction welding to solve the above problems. Summary of the invention
[0006] In order to overcome the above-mentioned defects of the prior art and to achieve the above-mentioned purpose, the present invention provides the following technical solution: a welding head path planning and control system for gantry friction welding, comprising:
[0007] A welding object image acquisition module, used for acquiring welding object images;
[0008] Welding seam image analysis module, used to analyze welding material images and obtain welding seam data;
[0009] A path acquisition module is used to acquire m paths of the welding seam of the friction welding head, where m is an integer greater than 1;
[0010] The path selection module is used to calculate the priority coefficients corresponding to the m paths, compare the priority coefficients of each path, and select the path corresponding to the largest priority coefficient as the moving path of the friction welding head;
[0011] The parameter setting module is used to obtain the welding material, and take the welding material, weld length, weld width and bending degree as influencing parameters; adopt a genetic algorithm to obtain the corresponding target welding parameters according to the influencing parameters; and set the parameters of the gantry friction welding equipment according to the obtained target welding parameters and moving path.
[0012] Furthermore, the welding object image is an image of the object to be welded; the weld data includes weld shape, weld length and weld width.
[0013] Furthermore, the method for obtaining the weld length and weld width includes:
[0014] S101: Read the welding material image;
[0015] S102: grayscale processing is performed on the welded material image to convert the color image into a grayscale image;
[0016] S103: applying Gaussian filtering to the grayscale image to reduce noise and details;
[0017] S104: performing edge detection on the grayscale image after applying the Gaussian filter, detecting the edge of the object to be welded in the grayscale image;
[0018] S105: performing a binarization operation on the grayscale image after edge detection, and converting the grayscale image into a binary image containing only the edge and the background;
[0019] S106: using findContours function to find contours in the binary image;
[0020] S107: Use the drawContours function to draw the found contour on the welding object image;
[0021] S108: Calculating the weld length and weld width of n welds according to the contours in the weld image;
[0022] S109: Display the weld image with the drawn outline.
[0023] Furthermore, the method for obtaining the weld shape includes:
[0024] The weld image with the drawn outline is divided into a weld images according to the outline of each weld, each weld image includes a weld, a=n;
[0025] Use the trained weld analysis model to identify a weld images in turn and output the recognition results, which include straight welds and curved welds;
[0026] The weld analysis model training process includes:
[0027] Collect multiple weld images in advance, mark each weld image as a training image, annotate the welds in each training image, and the annotations include straight welds and curved welds; convert the straight welds and curved welds into digital annotations respectively; divide the annotated training images into a training set and a test set: use the training set to train the weld analysis model, and use the test set to test the weld analysis model; preset an error threshold, and when the mean of the prediction errors of all training images in the test set is less than the error threshold, output the weld analysis model; the weld analysis model is a convolutional neural network model.
[0028] Furthermore, the method for obtaining m paths of the friction welding head welding weld includes:
[0029] Step a: number the n welds in the weld image in ascending order, and the numbering range is [1, n];
[0030] Step b: randomly select one weld from n welds, define the randomly selected weld as the initial weld, and start depth-first search from the initial weld;
[0031] Step c: starting from the initial weld, marking the initial weld as a visited weld, exploring the adjacent welds of the initial weld, and selecting one of the adjacent welds of the initial weld as the next weld, and marking the next weld as a visited weld; exploring the adjacent welds of the next weld, and selecting one of the adjacent welds of the next weld that is not marked as a visited weld as a new next weld, and marking the new next weld as a visited weld;
[0032] Step d: Repeat the method in step c until the adjacent welds of the next weld are all marked as visited welds, and then check whether all n welds are marked as visited welds;
[0033] If all n welds have been marked as visited welds, the depth-first search ends;
[0034] If there is a weld among the n welds that is not marked as a visited weld, the depth-first search continues; at this time, backtrack from the current weld to the previous weld, and select one of the adjacent welds of the previous weld that is not marked as a visited weld as the new next weld, until all n welds are marked as visited welds, then the depth-first search ends; the previous weld is the weld that selects the current weld as the new next weld;
[0035] Step e: repeat steps c to d to obtain m paths of the weld seam welded by the friction welding head.
[0036] Furthermore, the calculation method of the priority coefficients corresponding to the m paths includes:
[0037] According to the weld shapes of n welds, the bending points of the n welds are obtained, and a curve circle fitting is performed at each bending point, and the radius of the fitted circle is used as the bending radius; the reciprocal of the bending radius is used as the bending degree to obtain the bending degree corresponding to the n welds;
[0038]
[0039] In the formula, YX i is the priority coefficient of the i-th path, WQ ij is the bending degree of the jth weld in the i-th path, HC ij is the weld length of the jth weld in the ith path, HK ij is the weld width of the jth weld in the ith path, QZ j is the welding weight of the jth weld, ω1, ω2, ω3 are preset weight coefficients and ω1, ω2, ω3 are all greater than 0, i∈[1, m], j∈[1, n].
[0040] Furthermore, the welding parameters include moving speed, rotation speed and downward pressure; the moving speed is the moving speed of the friction welding head, the rotation speed is the rotation speed of the friction welding head, and the downward pressure is the pressure applied by the friction welding head to the object to be welded.
[0041] Furthermore, the method for obtaining corresponding target welding parameters according to the influencing parameters includes:
[0042] Step 1: Encode the welding parameters, obtain chromosomes, and construct the initial population;
[0043] Step 2: Determine the fitness function;
[0044] Step 3: Natural selection of chromosomes in the population;
[0045] Step 4: Perform crossover recombination on chromosomes in the population;
[0046] Step 5: mutate the chromosomes in the population;
[0047] Step 6: Get a new population, preset the population generation to R, the fitness threshold to Q, R is an integer greater than 0, and Q is a real number greater than 0; loop step 3 to step 5 until the generation corresponding to the new population is R or the fitness corresponding to the chromosome in the new population is greater than or equal to the fitness threshold Q, the loop ends, and the welding parameters corresponding to the chromosome with the maximum fitness in the new population are used as the target welding parameters.
[0048] Furthermore, in the step 1, the welding parameter is encoded as X, where X is the chromosome; a welding parameter range value is obtained, where the welding parameter range value includes a moving speed range value, a rotation speed range value, and a downward force range value, where the range of X is the welding parameter range value; N chromosomes are randomly generated to form an initial population Z0={X1, X2, ..., X N}, where one chromosome corresponds to a set of welding parameters, and a set of welding parameters includes a moving speed, a rotating speed, and a downward pressure intensity;
[0049] In step 2, the fitness function is expressed as: r =PP r ;
[0050] In the formula, f r is the fitness corresponding to the rth chromosome, PP r is the matching rate corresponding to the rth chromosome, r∈[1,N];
[0051] The matching rate can be obtained by:
[0052] A set of welding parameters and a set of influencing parameters corresponding to a chromosome are taken as a set of analysis data; under the condition of the analysis data, the corresponding matching rate is calculated;
[0053] Input the analysis data into the trained matching rate analysis model to predict the corresponding matching rate;
[0054] The training process of the matching rate analysis model includes:
[0055] Pre-collecting the matching rates corresponding to M groups of analysis data, and converting the analysis data and the corresponding matching rates into a corresponding set of feature vectors;
[0056] Each group of feature vectors is used as the input of the matching rate analysis model. The matching rate analysis model takes a group of predicted matching rates corresponding to each group of analysis data as output, and takes the actual matching rate corresponding to each group of analysis data as the prediction target, and the actual matching rate is the pre-collected matching rate corresponding to the analysis data; minimizing the sum of prediction errors of all analysis data is used as the training target; the matching rate analysis model is trained until the sum of prediction errors reaches convergence and the training is stopped; the matching rate analysis model is a deep neural network model.
[0057] Furthermore, in step 3, natural selection is performed by combining the elite method and the rotation method; wherein the elite method generates k′ offspring chromosomes, and for a population with a capacity of N, the fitness corresponding to the N chromosomes is arranged from large to small, and the k′ chromosomes at the front each generate a offspring chromosome; the rotation method generates k″ offspring chromosomes, that is, N chromosomes generate k″ offspring chromosomes according to the corresponding rotation probability; k′+k″=N;
[0058] The expression of rotation probability is:
[0059] Where P r is the rotation probability corresponding to the rth chromosome;
[0060] In the step 4, U chromosomes are randomly selected from the population for crossover recombination to obtain U new chromosomes; the crossover recombination adopts the PMX method; after the chromosome crossover recombination, the fitness of the U new chromosomes is calculated, the fitness of the U new chromosomes and the fitness of the U chromosomes are sorted from large to small and a sorting table is generated, and the U chromosomes in the sorting table are replaced with the U chromosomes in the population for crossover recombination in positive order;
[0061] In step 5, the mutation probability is preset to G, and the N chromosomes in the population are mutated according to the mutation probability. The mutation method is to randomly select the positions of two genes in the chromosome and exchange the values of the two genes.
[0062] The technical effects and advantages of the welding head path planning control system of the gantry friction welding of the present invention are as follows:
[0063] By collecting and analyzing images of the weld, it is possible to accurately obtain weld-related parameters, dynamically learn and optimize the welding head path, and achieve adaptive movement of the welding head along the contour by accurately planning and controlling the path movement of the welding head, effectively solving the problem of traditional manual welding relying on the operator's experience, thereby realizing an automated and intelligent welding process; and through genetic algorithms, it is possible to accurately set parameters for the gantry friction welding equipment, thereby improving the overall welding level and efficiency, and ensuring that the welding head automatically and smoothly completes the formation of the entire weld. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 This is a schematic diagram of a gantry type friction welding welding head path planning control system according to embodiment 1 of the present invention;
[0065] Figure 2 This is a schematic diagram of weld numbering in Example 1 of the present invention;
[0066] Figure 3 This is a flow chart of a welding head path planning and control method for gantry friction welding according to embodiment 2 of the present invention;
[0067] Figure 4 This is a schematic diagram of an electronic device according to Embodiment 3 of the present invention;
[0068] Figure 5 This is a schematic diagram of a storage medium according to Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0069] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0070] Embodiment 1:
[0071] See also Figure 1 As shown, a gantry-type friction welding welding head path planning and control system described in this embodiment includes a welding material image acquisition module, a weld image analysis module, a path acquisition module, a path selection module and a parameter setting module; each module is connected by wire and / or wireless means to realize data transmission between modules;
[0072] A welding object image acquisition module, used for acquiring welding object images;
[0073] The weld image is an image of the object to be welded; the weld image is acquired by a wide-angle camera installed on the gantry friction welding equipment;
[0074] The purpose of using a wide-angle camera is that when the area of the object to be welded is large, a general camera cannot capture the image of the entire object to be welded; compared with a general camera, a wide-angle camera has a wider field of view, so it can capture a larger area and capture more details around the camera, such as a narrower weld on the object to be welded.
[0075] Welding seam image analysis module, used to analyze welding material images and obtain welding seam data;
[0076] Weld data includes weld shape, weld length and weld width;
[0077] Weld seam shapes include straight seam, curved seam, etc.; different weld seam shapes require different welding head moving speeds, rotation speeds and downward pressures, so it is necessary to formulate corresponding welding head moving paths according to different weld seam shapes; the longer the weld seam length, the greater the impact on the overall welding quality, and the longer the production line resources occupied. Prioritizing welding of welds with longer weld seams can ensure welding quality and improve production line utilization; the smaller the weld seam width, the smaller the welding difficulty, and the easier it is to set welding parameters. Prioritizing welding of welds with smaller weld seam widths can make it easier to obtain smooth control, and the welding parameters set for welds with smaller weld seam widths during welding are of reference significance for the welding parameters set for subsequent welds with larger weld seam widths;
[0078] Methods for obtaining weld length and weld width include:
[0079] S101: Read the welding material image;
[0080] image=cv2.imread('your_imagejpg', cv2.IMREAD_COLOR)
[0081] S102: grayscale processing is performed on the welded material image to convert the color image into a grayscale image;
[0082] gray=cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
[0083] S103: applying Gaussian filtering to the grayscale image to reduce noise and details;
[0084] blurred=cv2.GaussianBlur(gray,(5,5),0)
[0085] S104: performing edge detection on the grayscale image after applying the Gaussian filter, detecting the edge of the object to be welded in the grayscale image;
[0086] edges=cv2.Canny(blurred, 50, 150)
[0087] S105: performing a binarization operation on the grayscale image after edge detection, and converting the grayscale image into a binary image containing only the edge and the background;
[0088] _, threshold=cv2.threshold(edges, 0, 255, cv2.THRESH_BINARY)
[0089] S106: using findContours function to find contours in the binary image;
[0090] contours, _ = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
[0091] S107: Use the drawContours function to draw the found contour on the weld image to visualize the identified contour;
[0092] contour_image = image.copy()
[0093] cv2.drawContours(contour_image, contours, -1, (0, 255, 0), 2)
[0094] S108: Calculating the weld length and weld width of n welds according to the contours in the weld image;
[0095] contours, hierarchy = cv2.findContours(binarized image, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
[0096]
[0097] S109: Displaying the weld image with the drawn outline;
[0098] cv2.imshow(′Image with Contours′,contour_image)
[0099] Methods for obtaining weld shape include:
[0100] The weld image with the drawn outline is divided into a weld images according to the outline of each weld, each weld image includes a weld, a=n;
[0101] Use the trained weld analysis model to identify a weld images in turn and output the recognition results, which include straight welds and curved welds;
[0102] The specific training process of the weld analysis model includes:
[0103] Collect multiple weld images in advance, mark each weld image as a training image, annotate the welds in each training image, and the annotations include straight welds and curved welds; convert straight welds and curved welds into digital annotations respectively, for example, convert straight welds into 1, and convert curved welds into 2; divide the annotated training images into a training set and a test set, use 70% of the training images as the training set, and use 30% of the training images as the test set; use the training set to train the weld analysis model, and use the test set to test the weld analysis model; preset an error threshold, and when the mean of the prediction errors of all training images in the test set is less than the error threshold, output the weld analysis model; wherein the calculation formula for the mean prediction error is: Where Z P is the prediction error, P is the number of the training image, α P is the predicted annotation corresponding to the Pth group of training images, μ P is the actual annotation corresponding to the Pth group of training images, H is the number of training images in the test set; the error threshold is preset according to the accuracy required by the weld analysis model;
[0104] The above-mentioned weld analysis model is specifically a convolutional neural network model;
[0105] A path acquisition module is used to acquire m paths of the welding seam of the friction welding head, where m is an integer greater than 1;
[0106] The method for obtaining m paths of a friction welding head welding weld includes:
[0107] Step a: number the n welds in the weld image in ascending order, and the numbering range is [1, n];
[0108] Step b: randomly select one weld from the n welds, define the randomly selected weld as the initial weld, start the depth-first search from the initial weld, and ensure that the friction welding head passes through each weld among the n welds;
[0109] Step c: starting from the initial weld, marking the initial weld as a visited weld, exploring the adjacent welds of the initial weld, and selecting one of the adjacent welds of the initial weld as the next weld, and marking the next weld as a visited weld; exploring the adjacent welds of the next weld, and selecting one of the adjacent welds of the next weld that is not marked as a visited weld as a new next weld, and marking the new next weld as a visited weld;
[0110] Step d: Repeat the method in step c until the adjacent welds of the next weld are all marked as visited welds, and then check whether all n welds are marked as visited welds;
[0111] If all n welds have been marked as visited welds, the depth-first search ends;
[0112] If there is a weld among the n welds that is not marked as a visited weld, the depth-first search continues; at this time, backtrack from the current weld to the previous weld, and select one of the adjacent welds of the previous weld that is not marked as a visited weld as the new next weld, until all n welds are marked as visited welds, then the depth-first search ends; the previous weld is the weld that selects the current weld as the new next weld;
[0113] Step e: repeating steps c to d to obtain m paths of the weld seams welded by the friction welding head, and the m paths are all different because the next weld seam selected is different each time the depth-first search is performed;
[0114] The reason for tracing back from the current weld to the previous weld is that, since the selection of the next weld in step c is random, the welds not marked as visited welds will be adjacent to the welds marked as visited welds, and the welds not marked as visited welds can be found only by tracing back to the previous welds in sequence;
[0115] For example, see Figure 2 As shown, the dotted line is the weld. If there are 9 welds in the weld image, mark the weld at the bottom left corner of the weld image as 1, the weld to the right of 1 as 2, the weld to the right of 2 as 3, the weld above 3 as 4, the weld to the left of 4 as 5, and so on to mark the 9 welds; mark 1 as the initial weld, mark 1 as the visited weld, the adjacent weld of 1 is 2 or 6, select 2 as the next weld, mark 2 as the visited weld, the adjacent weld of 2 is 3 or 5, select 3 as the new next weld, mark 3 as the visited weld, and then select 4, 5, 8 and 9 as the new next welds. A weld, and mark 4, 5, 8 and 9 as visited welds in turn. At this time, the adjacent welds of 9 are 8 and 4, but 8 and 4 have been marked as visited welds, so backtrack from 9 to 8, where 9 is the current weld, 8 is the previous weld, and the adjacent welds of 8 are 7 and 9. 7 is not marked as a visited weld, so 7 is selected as the new next weld, and 7 is marked as a visited weld. Finally, 6 is selected as the new next weld, and 6 is marked as a visited weld. At this time, all 9 welds have been marked as visited welds, and this depth-first search ends; in the order of 1, 2, 3, 4, 5, 8, 9, 7, 6 is a path;
[0116] The path selection module is used to calculate the priority coefficients corresponding to the m paths, compare the priority coefficients of each path, and select the path corresponding to the largest priority coefficient as the moving path of the friction welding head;
[0117] The calculation method of the priority coefficients corresponding to the m paths includes:
[0118] According to the weld shapes of n welds, the bending points of the n welds are obtained, and a curve circle is fitted at each bending point, and the radius of the fitted circle is used as the bending radius; the smaller the bending radius, the higher the bending degree, so the reciprocal of the bending radius is used as the bending degree to obtain the bending degree corresponding to the n welds; there is no bending degree for a straight weld;
[0119]
[0120] In the formula, YX i is the priority coefficient of the i-th path, WQ ij is the bending degree of the jth weld in the i-th path, HC ij is the weld length of the jth weld in the ith path, HK ij is the weld width of the jth weld in the ith path, QZ j is the welding weight of the jth weld, ω1, ω2, ω3 are preset weight coefficients and ω1, ω2, ω3 are all greater than 0, i∈[1, m], j∈[1, n];
[0121] The specific value of the weight coefficient in the formula can be set according to the actual situation. The weight coefficient reflects the influence of the bending degree, weld length and weld width on the path priority selection degree. Those skilled in the art can preset the corresponding weight coefficient according to the influence of the bending degree, weld length and weld width on the actual path priority selection degree, so as to accurately evaluate the priority of different paths;
[0122] It should be understood that the bending degree, weld length and weld width are the influencing factors of the priority coefficient. The greater the bending degree, the greater the priority coefficient, and vice versa; the greater the weld length, the greater the priority coefficient, and vice versa; the greater the weld width, the greater the priority coefficient, and vice versa; the priority coefficient is only used to determine the priority degree of the path, and the calculation of the priority coefficient is dimensionless calculation;
[0123] It should be noted that the welding weight is pre-set by those skilled in the art according to the welding sequence in the path. The welding weight corresponding to the weld that is welded first is smaller. The welding weight is set one by one according to the weld sequence in the path. For example, the welding weight corresponding to the first weld welded by the friction welding head is 0.1, and the welding weight corresponding to the second weld welded by the friction welding head is 0.2. The purpose of setting the welding weight is that when calculating the priority coefficient of each path, if the welding weight is not set, the priority coefficients calculated for different paths are the same because only the welding sequence of the welds is different. Therefore, it is necessary to set the welding weight, and the welding weight corresponding to the weld that is welded first is smaller. At this time, the priority coefficients calculated for different paths are inconsistent, so as to facilitate the acquisition of the optimal friction welding head moving path.
[0124] The parameter setting module obtains the welding material, and uses the welding material, weld length, weld width and bending degree as influencing parameters; adopts a genetic algorithm to obtain the corresponding target welding parameters according to the influencing parameters; and sets the parameters of the gantry friction welding equipment according to the obtained target welding parameters and moving path;
[0125] The welding material is obtained by a Raman spectrometer installed on a gantry friction welding device; the welding parameters include moving speed, rotation speed and downward pressure; the moving speed is the moving speed of the friction welding head, the rotation speed is the rotation speed of the friction welding head, and the downward pressure is the pressure applied by the friction welding head to the object to be welded;
[0126] Different influencing parameters require different welding parameters. Lightweight materials such as aluminum alloy can increase the moving speed and reduce the pressure, while heavy materials such as steel need to reduce the moving speed. Due to different materials, the heat transfer speed is also different, so different welding materials correspond to different rotation speeds. The longer the weld, the smaller the corresponding moving speed, and vice versa. The larger the weld width, the smaller the corresponding moving speed and the greater the pressure to increase the coverage area, and vice versa. The greater the degree of curvature, the smaller the corresponding moving speed and the greater the pressure, and vice versa.
[0127] The method for obtaining the corresponding target welding parameters according to the influencing parameters includes:
[0128] Step 1: Encode the welding parameters, obtain chromosomes, and construct the initial population;
[0129] Step 2: Determine the fitness function;
[0130] Step 3: Natural selection of chromosomes in the population;
[0131] Step 4: Perform crossover recombination on chromosomes in the population;
[0132] Step 5: mutate the chromosomes in the population;
[0133] Step 6: Obtain a new population, preset the population generation number to be R, the fitness threshold to be Q, R is an integer greater than 0, and Q is a real number greater than 0; loop step 3-step 5 until the generation number corresponding to the new population is R or the fitness corresponding to the chromosome in the new population is greater than or equal to the fitness threshold Q, the loop ends, and the welding parameters corresponding to the chromosome with the maximum fitness in the new population are used as the target welding parameters; illustratively, if the preset population generation number is 1, the chromosomes in the initial population are subjected to natural selection, crossover recombination and mutation to obtain a new population, and the generation number corresponding to the new population is 1 at this time, so the loop ends;
[0134] It should be noted that the fitness threshold Q is preset by those skilled in the art according to the algorithm accuracy, and the population algebra R is obtained by those skilled in the art using the genetic algorithm multiple times under multiple groups of different influencing parameter conditions to obtain the corresponding target welding parameters. In each process of using the genetic algorithm, when the fitness corresponding to the chromosome in the new population is greater than or equal to the fitness threshold Q, the cycle ends and the algebra corresponding to the new population is obtained; the largest algebra among the multiple algebras is taken as the population algebra R;
[0135] In the above step 1, the welding parameters are encoded as X, where X is the chromosome; the welding parameter range value is obtained, and the welding parameter range value includes the moving speed range value, the rotation speed range value and the downforce range value. The range of X is the welding parameter range value, and the welding parameter range is obtained from the technical specifications of the gantry friction welding equipment; N chromosomes are randomly generated to form an initial population Z0 = {X1, X2, ..., X N}, where one chromosome corresponds to a set of welding parameters, and a set of welding parameters includes a moving speed, a rotating speed, and a downward pressure intensity;
[0136] In step 2 above, the fitness function is expressed as: f r =PP r ;
[0137] In the formula, f r is the fitness corresponding to the rth chromosome, PP r is the matching rate corresponding to the rth chromosome, r∈[1,N];
[0138] The matching rate can be obtained by:
[0139] A set of welding parameters and a set of influencing parameters corresponding to a chromosome are taken as a set of analysis data; under the condition of the analysis data, the corresponding matching rate is calculated;
[0140] Input the analysis data into the trained matching rate analysis model to predict the corresponding matching rate;
[0141] The specific training process of the matching rate analysis model includes:
[0142] Pre-collecting the matching rates corresponding to M groups of analysis data, and converting the analysis data and the corresponding matching rates into a corresponding set of feature vectors;
[0143] Each set of feature vectors is used as the input of the matching rate analysis model. The matching rate analysis model uses a set of predicted matching rates corresponding to each set of analysis data as output, and uses the actual matching rate corresponding to each set of analysis data as the prediction target. The actual matching rate is the matching rate corresponding to the analysis data collected in advance. The training target is to minimize the sum of the prediction errors of all analysis data. The calculation formula of the prediction error is Z K=(α K -μ K ) 2 , where Z K is the prediction error, K is the group number of the eigenvector corresponding to the analysis data, α K is the predicted matching rate corresponding to the Kth group of analysis data, μ K is the actual matching rate corresponding to the Kth group of analysis data; the matching rate analysis model is trained until the sum of the prediction errors reaches convergence and the training is stopped;
[0144] The above matching rate analysis model is specifically a deep neural network model;
[0145] It should be noted that the matching rate corresponding to the analysis data is obtained by a technician in this field who collects multiple sets of different analysis data during the welding process of the object to be welded in the past, performs multiple welding on the object to be welded under the condition of each set of analysis data, records the welding quality corresponding to the multiple weldings, and uses the average of the multiple welding qualities as the matching rate corresponding to the set of analysis data, and obtains the matching rates corresponding to multiple sets of different analysis data in this way;
[0146] In the above step 3, natural selection is carried out by combining the elite method and the rotation method; the elite method produces k′ offspring chromosomes, and for a population with a capacity of N, the fitness corresponding to the N chromosomes is arranged from large to small, and the k′ chromosomes at the front each produce a offspring chromosome; the rotation method produces k″ offspring chromosomes, that is, N chromosomes produce k″ offspring chromosomes according to the corresponding rotation probability; k′+k″=N, so as to keep the offspring population capacity N unchanged and the population generation increases;
[0147] The expression of rotation probability is:
[0148] Where P r is the rotation probability corresponding to the rth chromosome;
[0149] In the above step 4, U chromosomes are randomly selected from the population for crossover recombination to obtain U new chromosomes; the crossover recombination adopts the PMX method, which is a prior art method and will not be described in detail here; after the chromosome crossover recombination, the fitness of the U new chromosomes is calculated, and the fitness of the U new chromosomes and the fitness of the U chromosomes are sorted from large to small to generate a sorting table, and the U chromosomes in the sorting table are replaced in positive order with the U chromosomes in the population for crossover recombination; in this embodiment, U=0.7N is preferred;
[0150] In the above step 5, the mutation probability is preset to G, and the N chromosomes in the population are mutated according to the mutation probability. The mutation method is to randomly select the positions of two genes in the chromosome and exchange the values of the two genes. In this embodiment, G is preferably 0.02; the mutation probability is preset by those skilled in the art according to the algorithm efficiency and algorithm accuracy;
[0151] By collecting and analyzing the image of the weld, this embodiment can accurately obtain the relevant parameters of the weld, dynamically learn and optimize the welding head path, and achieve adaptive movement of the welding head following the contour surface by accurately planning and controlling the path movement of the welding head, effectively solving the problem of traditional manual welding relying on the experience of the operator, thereby realizing an automated and intelligent welding process; and through the genetic algorithm, the parameters of the gantry friction welding equipment can be accurately set, thereby improving the overall welding level and efficiency, and ensuring that the welding head automatically completes the formation of the entire weld smoothly and without hindrance.
[0152] Embodiment 2:
[0153] See also Figure 3 As shown, the part not described in detail in this embodiment is described in Example 1, and a welding head path planning and control method for gantry friction welding is provided, which includes:
[0154] Collect welding images;
[0155] Analyze the weld image to obtain weld data;
[0156] Obtain m paths of the welding seam of the friction welding head, where m is an integer greater than 1;
[0157] Calculate the priority coefficients corresponding to the m paths, compare the priority coefficients of each path, and select the path corresponding to the largest priority coefficient as the moving path of the friction welding head;
[0158] The welding material is obtained, and the welding material, weld length, weld width and bending degree are used as influencing parameters; a genetic algorithm is used to obtain corresponding target welding parameters according to the influencing parameters; and parameters of the gantry friction welding equipment are set according to the obtained target welding parameters and moving path.
[0159] Furthermore, the welding object image is an image of the object to be welded; the weld data includes weld shape, weld length and weld width.
[0160] Furthermore, the method for obtaining the weld length and weld width includes:
[0161] S101: Read the welding material image;
[0162] S102: grayscale processing is performed on the welded material image to convert the color image into a grayscale image;
[0163] S103: applying Gaussian filtering to the grayscale image to reduce noise and details;
[0164] S104: performing edge detection on the grayscale image after applying the Gaussian filter, detecting the edge of the object to be welded in the grayscale image;
[0165] S105: performing a binarization operation on the grayscale image after edge detection, and converting the grayscale image into a binary image containing only the edge and the background;
[0166] S106: using findContours function to find contours in the binary image;
[0167] S107: Use the drawContours function to draw the found contour on the welding object image;
[0168] S108: Calculating the weld length and weld width of n welds according to the contours in the weld image;
[0169] S109: Display the weld image with the drawn outline.
[0170] Furthermore, the method for obtaining the weld shape includes:
[0171] The weld image with the drawn outline is divided into a weld images according to the outline of each weld, each weld image includes a weld, a=n;
[0172] Use the trained weld analysis model to identify a weld images in turn and output the recognition results, which include straight welds and curved welds;
[0173] The weld analysis model training process includes:
[0174] Collect multiple weld images in advance, mark each weld image as a training image, annotate the welds in each training image, and the annotations include straight welds and curved welds; convert the straight welds and curved welds into digital annotations respectively; divide the annotated training images into a training set and a test set; use the training set to train the weld analysis model, and use the test set to test the weld analysis model; preset an error threshold, and when the mean of the prediction errors of all training images in the test set is less than the error threshold, output the weld analysis model; the weld analysis model is a convolutional neural network model.
[0175] Furthermore, the method for obtaining m paths of the friction welding head welding weld includes:
[0176] Step a: number the n welds in the weld image in ascending order, and the numbering range is [1, n];
[0177] Step b: randomly select one weld from n welds, define the randomly selected weld as the initial weld, and start depth-first search from the initial weld;
[0178] Step c: starting from the initial weld, marking the initial weld as a visited weld, exploring the adjacent welds of the initial weld, and selecting one of the adjacent welds of the initial weld as the next weld, and marking the next weld as a visited weld; exploring the adjacent welds of the next weld, and selecting one of the adjacent welds of the next weld that is not marked as a visited weld as a new next weld, and marking the new next weld as a visited weld;
[0179] Step d: Repeat the method in step c until the adjacent welds of the next weld are all marked as visited welds, and then check whether all n welds are marked as visited welds;
[0180] If all n welds have been marked as visited welds, the depth-first search ends;
[0181] If there is a weld among the n welds that is not marked as a visited weld, the depth-first search continues; at this time, backtrack from the current weld to the previous weld, and select one of the adjacent welds of the previous weld that is not marked as a visited weld as the new next weld, until all n welds are marked as visited welds, then the depth-first search ends; the previous weld is the weld that selects the current weld as the new next weld;
[0182] Step e: repeat steps c to d to obtain m paths of the weld seam welded by the friction welding head.
[0183] Furthermore, the calculation method of the priority coefficients corresponding to the m paths includes:
[0184] According to the weld shapes of n welds, the bending points of the n welds are obtained, and a curve circle fitting is performed at each bending point, and the radius of the fitted circle is used as the bending radius; the reciprocal of the bending radius is used as the bending degree to obtain the bending degree corresponding to the n welds;
[0185]
[0186] In the formula, YX i is the priority coefficient of the i-th path, WQ ij is the bending degree of the jth weld in the i-th path, HC ij is the weld length of the jth weld in the ith path, HK ij is the weld width of the jth weld in the ith path, QZ j is the welding weight of the jth weld, ω1, ω2, ω3 are preset weight coefficients and ω1, ω2, ω3 are all greater than 0, i∈[1, m], j∈[1, n].
[0187] Furthermore, the welding parameters include moving speed, rotation speed and downward pressure; the moving speed is the moving speed of the friction welding head, the rotation speed is the rotation speed of the friction welding head, and the downward pressure is the pressure applied by the friction welding head to the object to be welded.
[0188] Furthermore, the method for obtaining corresponding target welding parameters according to the influencing parameters includes:
[0189] Step 1: Encode the welding parameters, obtain chromosomes, and construct the initial population;
[0190] Step 2: Determine the fitness function;
[0191] Step 3: Natural selection of chromosomes in the population;
[0192] Step 4: Perform crossover recombination on chromosomes in the population;
[0193] Step 5: mutate the chromosomes in the population;
[0194] Step 6: Get a new population, preset the population generation to R, the fitness threshold to Q, R is an integer greater than 0, and Q is a real number greater than 0; loop step 3 to step 5 until the generation corresponding to the new population is R or the fitness corresponding to the chromosome in the new population is greater than or equal to the fitness threshold Q, the loop ends, and the welding parameters corresponding to the chromosome with the maximum fitness in the new population are used as the target welding parameters.
[0195] Furthermore, in the step 1, the welding parameter is encoded as X, where X is the chromosome; a welding parameter range value is obtained, where the welding parameter range value includes a moving speed range value, a rotation speed range value, and a downward force range value, where the range of X is the welding parameter range value; N chromosomes are randomly generated to form an initial population Z0={X1, X2, ..., X N}, where one chromosome corresponds to a set of welding parameters, and a set of welding parameters includes a moving speed, a rotating speed, and a downward pressure intensity;
[0196] In step 2, the fitness function is expressed as: r =PP r ;
[0197] In the formula, f r is the fitness corresponding to the rth chromosome, PP r is the matching rate corresponding to the rth chromosome, r∈[1,N];
[0198] The matching rate can be obtained by:
[0199] A set of welding parameters and a set of influencing parameters corresponding to a chromosome are taken as a set of analysis data; under the condition of the analysis data, the corresponding matching rate is calculated;
[0200] Input the analysis data into the trained matching rate analysis model to predict the corresponding matching rate;
[0201] The training process of the matching rate analysis model includes:
[0202] Pre-collecting the matching rates corresponding to M groups of analysis data, and converting the analysis data and the corresponding matching rates into a corresponding set of feature vectors;
[0203] Each group of feature vectors is used as the input of the matching rate analysis model. The matching rate analysis model takes a group of predicted matching rates corresponding to each group of analysis data as output, and takes the actual matching rate corresponding to each group of analysis data as the prediction target, and the actual matching rate is the pre-collected matching rate corresponding to the analysis data; minimizing the sum of prediction errors of all analysis data is used as the training target; the matching rate analysis model is trained until the sum of prediction errors reaches convergence and the training is stopped; the matching rate analysis model is a deep neural network model.
[0204] Furthermore, in step 3, natural selection is performed by combining the elite method and the rotation method; wherein the elite method generates k′ offspring chromosomes, and for a population with a capacity of N, the fitness corresponding to the N chromosomes is arranged from large to small, and the k′ chromosomes at the front each generate a offspring chromosome; the rotation method generates k″ offspring chromosomes, that is, N chromosomes generate k″ offspring chromosomes according to the corresponding rotation probability; k′+k″=N;
[0205] The expression of rotation probability is:
[0206] Where P r is the rotation probability corresponding to the rth chromosome;
[0207] In the step 4, U chromosomes are randomly selected from the population for crossover recombination to obtain U new chromosomes; the crossover recombination adopts the PMX method; after the chromosome crossover recombination, the fitness of the U new chromosomes is calculated, the fitness of the U new chromosomes and the fitness of the U chromosomes are sorted from large to small and a sorting table is generated, and the U chromosomes in the sorting table are replaced with the U chromosomes in the population for crossover recombination in positive order;
[0208] In step 5, the mutation probability is preset to G, and the N chromosomes in the population are mutated according to the mutation probability. The mutation method is to randomly select the positions of two genes in the chromosome and exchange the values of the two genes.
[0209] Embodiment 3:
[0210] See also Figure 4 As shown, according to another aspect of the present application, an electronic device 500 is also provided. The electronic device 500 may include one or more processors and one or more memories. The memories store computer readable codes, and when the computer readable codes are executed by one or more processors, the above-mentioned online monitoring method of capacitor equipment based on artificial intelligence can be executed.
[0211] The method or system according to the embodiment of the present application can also be used by Figure 4 The electronic device architecture shown in FIG. Figure 4 As shown, the electronic device 500 may include a bus 501, one or more CPUs 502, ROM 503, RAM 504, a communication port 505 connected to a network, an input / output 506, a hard disk 507, etc. The storage device in the electronic device 500, such as ROM 503 or hard disk 507, may store the online monitoring method of capacitor equipment based on artificial intelligence provided by the present application. Further, the electronic device 500 may also include a user interface 508. Of course, Figure 4 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Figure 4 One or more components of an electronic device are shown.
[0212] Embodiment 4:
[0213] See also Figure 5 As shown, it is a computer-readable storage medium 600 according to an embodiment of the present application. Computer-readable instructions are stored on the computer-readable storage medium 600. When the computer-readable instructions are executed by the processor, the online monitoring method of capacitor equipment based on artificial intelligence according to the embodiment of the present application described with reference to the above figures can be executed. The storage medium 600 includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0214] In addition, according to the embodiments of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the present application provides a non-transitory machine-readable storage medium, which stores machine-readable instructions, and the machine-readable instructions can be executed by a processor to execute instructions corresponding to the method steps provided in the present application, such as: an online monitoring method for capacitor equipment based on artificial intelligence. When the computer program is executed by a central processing unit (CPU), the above functions defined in the method of the present application are executed.
[0215] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through a wired network or a wireless network. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0216] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0217] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0218] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only one, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0219] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0220] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0221] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0222] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A gantry type friction welding welding head path planning control system, characterized in that: include: A welding object image acquisition module, used for acquiring welding object images; A weld image analysis module is used to analyze the weld image and obtain weld data; the weld data includes weld shape, weld length and weld width; A path acquisition module is used to acquire m paths of the welding seam of the friction welding head, where m is an integer greater than 1; The method for obtaining m paths of the friction welding head welding weld comprises: Step a: number the n welds in the weld image in ascending order, and the numbering range is [1, n]; The path selection module is used to calculate the priority coefficients corresponding to the m paths, compare the priority coefficients of each path, and select the path corresponding to the largest priority coefficient as the moving path of the friction welding head. The calculation method of the priority coefficients corresponding to the m paths includes: According to the weld shapes of n welds, the bending points of the n welds are obtained, and a curve circle fitting is performed at each bending point, and the radius of the fitted circle is used as the bending radius; the reciprocal of the bending radius is used as the bending degree to obtain the bending degree corresponding to the n welds; In the formula, YX i is the priority coefficient of the i-th path, WQ ij is the bending degree of the jth weld in the i-th path, HC ij is the weld length of the jth weld in the ith path, HK ij is the weld width of the jth weld in the ith path, QZ j is the welding weight of the jth weld, ω1, ω2, ω3 are preset weight coefficients and ω1, ω2, ω3 are all greater than 0, i∈[1,m], j∈[1,n]; The parameter setting module is used to obtain the welding material, and use the welding material, weld length, weld width and bending degree as influencing parameters; adopt a genetic algorithm to obtain the corresponding target welding parameters according to the influencing parameters; and set the parameters of the gantry friction welding equipment according to the obtained target welding parameters and moving path; The welding parameters include moving speed, rotation speed and downward pressure; the moving speed is the moving speed of the friction welding head, the rotation speed is the rotation speed of the friction welding head, and the downward pressure is the pressure applied by the friction welding head to the object to be welded; The method for obtaining the corresponding target welding parameters according to the influencing parameters includes: Step 1: Encode the welding parameters, obtain chromosomes, and construct the initial population; Step 2: Determine the fitness function; Step 3: Natural selection of chromosomes in the population; Step 4: Perform crossover recombination on chromosomes in the population; Step 5: mutate the chromosomes in the population; Step 6: Get a new population, preset the population generation number as R, the fitness threshold as Q, R is an integer greater than 0, and Q is a real number greater than 0; loop through steps 3 to 5 until the generation number corresponding to the new population is R or the fitness corresponding to the chromosome in the new population is greater than or equal to the fitness threshold Q, the loop ends, and the welding parameters corresponding to the chromosome with the maximum fitness in the new population are taken as the target welding parameters; In the step 1, the welding parameters are encoded as X, where X is the chromosome; the welding parameter range value is obtained, and the welding parameter range value includes the moving speed range value, the rotation speed range value and the pressure range value, and the range of X is the welding parameter range value; N chromosomes are randomly generated to form an initial population Z0={X1,X2,...,X N }, where one chromosome corresponds to a set of welding parameters, and a set of welding parameters includes a moving speed, a rotating speed, and a downward pressure intensity; In step 2, the fitness function is expressed as: r =PP r ; In the formula, f r is the fitness corresponding to the rth chromosome, PP r is the matching rate corresponding to the rth chromosome, r∈[1,N]; The method for obtaining the matching rate includes: A set of welding parameters and a set of influencing parameters corresponding to a chromosome are taken as a set of analysis data; under the condition of the analysis data, the corresponding matching rate is calculated; Input the analysis data into the trained matching rate analysis model to predict the corresponding matching rate; The training process of the matching rate analysis model includes: Pre-collecting the matching rates corresponding to M groups of analysis data, and converting the analysis data and the corresponding matching rates into a corresponding set of feature vectors; Each group of feature vectors is used as the input of the matching rate analysis model. The matching rate analysis model takes a group of predicted matching rates corresponding to each group of analysis data as output, and takes the actual matching rate corresponding to each group of analysis data as the prediction target, and the actual matching rate is the pre-collected matching rate corresponding to the analysis data; minimizing the sum of prediction errors of all analysis data is used as the training target; the matching rate analysis model is trained until the sum of prediction errors reaches convergence and the training is stopped; the matching rate analysis model is a deep neural network model.
2. The welding head path planning and control system of gantry friction welding according to claim 1 is characterized in that: The welding object image is an image of an object to be welded.
3. The welding head path planning and control system of gantry type friction welding according to claim 2 is characterized in that: The method for obtaining the weld length and weld width includes: S101: Read the welding material image; S102: grayscale processing is performed on the welded material image to convert the color image into a grayscale image; S103: applying Gaussian filtering to the grayscale image to reduce noise and details; S104: performing edge detection on the grayscale image after applying the Gaussian filter, detecting the edge of the object to be welded in the grayscale image; S105: performing a binarization operation on the grayscale image after edge detection, and converting the grayscale image into a binary image containing only the edge and the background; S106: using findContours function to find contours in the binary image; S107: Use the drawContours function to draw the found contour on the welding object image; S108: Calculating the weld length and weld width of n welds according to the contours in the weld image; S109: Display the weld image with the drawn outline.
4. The welding head path planning and control system of gantry type friction welding according to claim 3 is characterized in that: The method for obtaining the weld shape comprises: The weld image with the drawn outline is divided into a weld images according to the outline of each weld, each weld image includes a weld, a=n; Use the trained weld analysis model to identify a weld images in turn and output the recognition results, which include straight welds and curved welds; The weld analysis model training process includes: Collect multiple weld images in advance, mark each weld image as a training image, annotate the welds in each training image, and the annotations include straight welds and curved welds; convert the straight welds and curved welds into digital annotations respectively; divide the annotated training images into a training set and a test set; use the training set to train the weld analysis model, and use the test set to test the weld analysis model; preset an error threshold, and when the mean of the prediction errors of all training images in the test set is less than the error threshold, output the weld analysis model; the weld analysis model is a convolutional neural network model.
5. The welding head path planning and control system of gantry type friction welding according to claim 4, characterized in that: The method for obtaining m paths of the friction welding head welding weld also includes: Step b: randomly select one weld from n welds, define the randomly selected weld as the initial weld, and start depth-first search from the initial weld; Step c: starting from the initial weld, marking the initial weld as a visited weld, exploring the adjacent welds of the initial weld, and selecting one of the adjacent welds of the initial weld as the next weld, and marking the next weld as a visited weld; exploring the adjacent welds of the next weld, and selecting one of the adjacent welds of the next weld that is not marked as a visited weld as a new next weld, and marking the new next weld as a visited weld; Step d: Repeat the method in step c until the adjacent welds of the next weld are all marked as visited welds, and then check whether all n welds are marked as visited welds; If all n welds have been marked as visited welds, the depth-first search ends; If there is a weld among the n welds that is not marked as a visited weld, the depth-first search continues; at this time, backtrack from the current weld to the previous weld, and select one of the adjacent welds of the previous weld that is not marked as a visited weld as the new next weld, until all n welds are marked as visited welds, then the depth-first search ends; the previous weld is the weld that selects the current weld as the new next weld; Step e: repeat steps c to d to obtain m paths of the weld seam welded by the friction welding head.
6. The welding head path planning and control system of gantry type friction welding according to claim 5, characterized in that: In step 3, natural selection is performed by combining the elite method and the rotation method; the elite method generates k′ offspring chromosomes, and for a population with a capacity of N, the fitness corresponding to the N chromosomes is arranged from large to small, and the k′ chromosomes at the front each generate a offspring chromosome; the rotation method generates k″ offspring chromosomes, that is, N chromosomes generate k″ offspring chromosomes according to the corresponding rotation probability; k′+k″=N; The expression of rotation probability is: Where P r is the rotation probability corresponding to the rth chromosome; In the step 4, U chromosomes are randomly selected from the population for crossover recombination to obtain U new chromosomes; the crossover recombination adopts the PMX method; after the chromosome crossover recombination, the fitness of the U new chromosomes is calculated, the fitness of the U new chromosomes and the fitness of the U chromosomes are sorted from large to small and a sorting table is generated, and the U chromosomes in the sorting table are replaced with the U chromosomes in the population for crossover recombination in positive order; In step 5, the mutation probability is preset to G, and the N chromosomes in the population are mutated according to the mutation probability. The mutation method is to randomly select the positions of two genes in the chromosome and exchange the values of the two genes.
