A welding method and device for outlet pipe of stainless steel centrifugal pump

By using binocular cameras and image processing technology, the machine welding problem of irregular elliptical welds between the centrifugal pump outlet pipe and the pump casing was solved, achieving efficient and stable automatic welding and improving welding quality and efficiency.

CN117359149BActive Publication Date: 2026-07-03NANFANG PUMP IND CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANFANG PUMP IND CO LTD
Filing Date
2023-11-24
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In the existing technology, the irregular elliptical weld between the outlet pipe and the pump casing of a centrifugal pump is difficult to machine weld, resulting in discontinuous welds, easy leakage and poor appearance, and low efficiency of manual welding.

Method used

A binocular camera is used to acquire weld seam images. Through image preprocessing, segmentation, morphological processing, and welding torch trajectory control, automated welding of the pump casing and outlet pipe is achieved. Specific steps include image enhancement, edge detection, Hough line detection, and welding torch trajectory correction. Bilateral filtering, the Otsu algorithm, and the Hessian matrix are used to extract the weld seam centerline. Offline and online correction techniques are combined to ensure welding quality.

Benefits of technology

It enables efficient and automated welding of pump casing and outlet pipe, reducing labor costs, improving welding quality and flatness, and ensuring the continuity and stability of weld seams.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117359149B_ABST
    Figure CN117359149B_ABST
Patent Text Reader

Abstract

This invention discloses a welding method and apparatus for welding the outlet pipe of a stainless steel centrifugal pump, comprising the following steps: acquiring weld images between the centrifugal pump and the outlet pipe using a binocular camera; preprocessing the weld images to obtain enhanced images; segmenting the enhanced images to separate the weld from the weld images, obtaining an initial weld image; performing morphological processing on the initial weld image to obtain a laser stripe image, and then extracting the weld centerline from the laser stripe image; controlling the trajectory of the welding torch according to the weld centerline to achieve welding of the weld between the centrifugal pump and the outlet pipe. This invention enables automated machine welding of the pump casing and the inlet pipe, reducing labor costs and improving welding efficiency, welding quality, and weld smoothness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of welding technology, and more specifically, to a welding method and welding apparatus for the outlet pipe of a stainless steel centrifugal pump. Background Technology

[0002] A centrifugal pump is a pump that uses the centrifugal force generated by the rotation of an impeller to transport liquids. The pump body, also called the pump casing, is the main body of the pump, providing support and stability, and is connected to the bracket for mounting bearings. The pump casing has an inlet and an outlet, both of which are fixed to the inlet and outlet pipes by welding. Because the weld between the pump casing and the outlet pipe is an irregular elliptical weld, the welding between the outlet pipe and the pump casing is currently mainly done manually. While manual welding can ensure weld quality, it requires careful operation and is inefficient. Machine welding, due to the irregular elliptical weld, makes it difficult to ensure the stability of continuous welding, easily leading to leaks and poor weld appearance. Summary of the Invention

[0003] The purpose of this invention is to provide a welding method and welding device for the outlet pipe of a stainless steel centrifugal pump. This invention enables automated machine welding of the pump casing and inlet pipe, reducing labor costs and improving welding efficiency, welding quality, and weld smoothness.

[0004] The technical solution of the present invention is as follows: A method for welding the outlet pipe of a stainless steel centrifugal pump, comprising the following steps:

[0005] Step 1: Use a binocular camera to acquire images of the weld between the centrifugal pump and the outlet pipe, and then preprocess the weld images to obtain enhanced images;

[0006] Step 2: Perform segmentation processing on the enhanced image to separate the weld from the weld image and obtain the initial weld image;

[0007] Step 3: Perform morphological processing on the initial weld image to obtain a laser stripe image, and then extract the weld centerline from the laser stripe image;

[0008] Step 4: Control the trajectory of the welding torch according to the center line of the weld to achieve welding of the weld between the centrifugal pump and the outlet pipe.

[0009] In the above-mentioned welding method for the outlet pipe of the stainless steel centrifugal pump, step 1, the pretreatment step is as follows:

[0010] Step 1.1: Use bilateral filtering for image denoising; the bilateral filtering combines spatial distance and gray-level similarity to fuse features from both the spatial and value domains; where spatial distance refers to the distance between the target point and the center point of the template, and the Gaussian function in the spatial domain is as follows:

[0011]

[0012] In the formula: (x i y j (x) represents the current image position. c y c ) represents the location of the template center point, and σ1 represents the standard deviation of the spatial domain;

[0013] The grayscale similarity is the absolute value of the difference between the grayscale value of the current point and the grayscale value of the center point of the template. Its Gaussian function in the range is as follows:

[0014]

[0015] In the formula: g(x) i y j ) represents the grayscale value of the current point, g(x) c y c ) represents the gray value at the center point of the template, and σ² represents the standard deviation of the value range;

[0016] The kernel function of the bilateral filter is shown in the following equation:

[0017]

[0018] In the formula: ω(i, j, k, l) is the weight of the pixel, and f(k, l) represents the pixel value of the neighborhood center;

[0019] Step 1.2: Perform grayscale processing on the denoised image; the grayscale processing uses a weighted average method, and the formula is as follows:

[0020] Gary(i,j)=0.299*R(i,j)+0.578*G(i,j)+0.114*B(i,j);

[0021] In the formula: Gary(i,j) represents the grayscale image, and R, G and B represent the three color components respectively;

[0022] Step 1.3: Image enhancement is performed using the linear grayscale transformation method; the formula for the linear grayscale transformation method is as follows:

[0023]

[0024] In the formula: a and b represent the critical values ​​of pixel grayscale before and after image enhancement, respectively; f(x, y) is the original pixel grayscale value; and g(x, y) is the pixel grayscale value after linear grayscale transformation.

[0025] In the aforementioned welding method for the outlet pipe of the stainless steel centrifugal pump, step 2, the segmentation process includes the following steps:

[0026] Step 2.1: Based on the overall grayscale distribution characteristics of the image, divide it into foreground and background parts. Segmentation is then performed by calculating the inter-class variance between the two parts. The solution for the inter-class variance is shown below:

[0027]

[0028] in:

[0029]

[0030]

[0031] In the formula: Let C1 represent the inter-class variance; P1 is the probability that a pixel is classified into C1; P2 is the probability that a pixel is classified into C2; m1 is the average gray value of pixels assigned to C1; m2 is the average gray value of pixels assigned to C2; m G p is the global mean of the image; k is the gray level; p i Let be the probability that a pixel has a gray level of i; L is the total number of gray levels.

[0032] The image is then processed using Gaussian filtering to enhance contrast and improve edge contours. The formula is as follows:

[0033]

[0034] In the formula: f s (x, y) is the result of convolving the Gaussian function with the image; G(x, y) is the one-dimensional zero-mean Gaussian kernel function; f(x, y) is the gray value of the original pixel; σ is the standard deviation;

[0035] Then calculate the image grayscale gradient:

[0036] dy = f(x, y)·Sobel x (x, y)

[0037] dy = f(x, y)·Sobel y (x, y);

[0038] In the formula: Sobel is the Sobel operator;

[0039] The resulting image gradient magnitude and angle are as follows:

[0040]

[0041] In the formula: M[x, y] is the gradient value, θ M Let dx and dy represent the gradient directions, respectively, and dx and dy represent the gradients of the image in the horizontal and vertical directions.

[0042] Step 2.2: Based on the calculated gradients of the image in the horizontal and vertical directions, perform non-maximum suppression on the magnitude along the gradient direction; for each pixel, compare the center value of its neighborhood with the two adjacent pixels in the corresponding gradient direction. If the value is the maximum, it indicates that the point is an edge value and retains a point with a width of 1 pixel. Otherwise, it is set to 0. In this way, the point with the maximum local gradient is retained through Canny edge detection to obtain edge features.

[0043] Step 2.3: Use dual thresholds to filter the extracted edge features. Set two different thresholds, high and low, to determine the final edge pixels. If the pixel neighborhood edge gradient obtained in Step 2.2 is greater than the set high threshold, it is determined to be an edge. If it is less than the set low threshold, it is determined to be a non-edge. Pixels between the thresholds are judged based on whether they are connected to edge pixels. If they are connected, they are determined to be edge feature pixels.

[0044] Step 2.4: Use Hough line detection to randomly select individual points through a probability selection mechanism to calculate the line. Each line is a vector (x1, y1, x2, y2) with four elements, where (x1, y1) represents the starting point of the line segment and (x2, y2) represents the ending point of the line segment.

[0045] In the aforementioned welding method for the outlet pipe of the stainless steel centrifugal pump, step 3, the morphological treatment steps are as follows:

[0046] First, image dilation is performed on the initial weld image to fill the holes in the image. The formula is as follows:

[0047]

[0048] Where: A represents the initial image of the weld; B represents the structuring element; S represents the expanded image; α and β represent the coordinates of a pixel point of the anchor point of the structuring element B moved to the initial image of the weld A. This represents the set of pixels after binarization;

[0049] Then, image erosion is performed to remove small objects around the object. The formula is as follows:

[0050]

[0051] Finally, image opening and closing operations are performed, with the opening operation formula as follows:

[0052]

[0053] The formula for closing is as follows:

[0054]

[0055] In the aforementioned welding method for the outlet pipe of a stainless steel centrifugal pump, step 3 involves extracting the weld centerline by determining the normal direction of the laser stripe image based on the eigenvalues ​​of the Hessian matrix and the corresponding eigenvectors. Then, the extreme points along the normal direction are calculated to obtain the sub-pixel coordinates of the light stripe center. Specifically, (x0, y0) represents the center point of the light stripe, (p x p y ) represents sub-pixel coordinates, (n) x n y ) is the eigenvector of the Hessian matrix whose largest eigenvalue corresponds to the normal direction of the light stripe, (tn) x ,tn y () represents the offset between the center point and the sub-pixel, and their relationship is as follows:

[0056]

[0057] (p x p y )=(x0+tn x y0+tn y );

[0058] (tn x ,tn y )∈[-0.5, 0.5]×[-0.5, 0.5];

[0059] The expression for the Hessian matrix is ​​as follows:

[0060]

[0061] In the formula: g′(x, y) is a two-dimensional Gaussian function; Z(x, y) represents the laser stripe image; r xx and r yy Let r represent the second derivatives in the x and y directions, respectively. xy This represents the second-order mixed derivative.

[0062] The aforementioned welding method for the outlet pipe of a stainless steel centrifugal pump includes offline and online correction of the welding torch's trajectory. Offline correction involves matching the weld centerline to obtain a teaching point suitable for the current welding stage, combining this point with the initial teaching posture information, updating the initial teaching program, and completing the offline correction of the weld. Online correction involves estimating the real-time trajectory of the welding torch tip during welding, ensuring it remains within a good deviation range and moves along the weld centerline.

[0063] The aforementioned welding method for the outlet pipe of the stainless steel centrifugal pump, and the specific process of offline correction are as follows:

[0064] The least squares fitting plane is used to calculate the weld centerline trajectory and the normal vector of each data point on the teaching trajectory. The curvature is calculated using the least squares fitting method to the surface S(x, y), and then the mean curvature (H) and Gaussian curvature (K) of the principal curvatures (k1, k2) are calculated using the formulas respectively:

[0065]

[0066]

[0067] In the formula: E s =S x S x ;F s =S x S y G s =S y S y S x It is the first partial derivative of the fitted surface S(x, y) in the x-direction; S y The first partial derivative of the fitted surface S(x, y) in the x-direction; S yy The second partial derivative of the fitted surface S(x, y) in the y-direction; S xx It is the second partial derivative of the fitted surface S(x, y) in the x-direction; S xy For S x The second-order partial derivative in the y-direction; L is the normal vector of each data point in the teaching trajectory; s N s and M s E represents the first fundamental invariant of the fitted surface S(x, y). s F s and G s These are the second fundamental invariants of the fitted surface S(x, y);

[0068] Then, points with similar curvature between two trajectories are found, and the similarity of the matched point pairs is measured based on a distance function of curvature: a curvature-based quaternion vector is constructed, as shown in the following formula:

[0069] X = (KH k1 k2);

[0070] Use X i and X z Represent the teaching trajectory point p respectively i and weld inspection trajectory q z The characteristics of p i and q z The similarity is defined as follows:

[0071]

[0072] In the formula: S iz D(p) represents similarity; i q z )=||X i -X z ||;

[0073] Next, the similarity points are decentered to find the center of the two trajectory data. and and the corresponding covariance and M Q The formula is as follows:

[0074]

[0075]

[0076] In the formula: n represents the number of sampling points for the two trajectory data;

[0077] Find the eigenvalues ​​M of the covariance P1 T M P1 x = λx, where λ is the eigenvalue and x is an n-dimensional non-zero column vector;

[0078] Extract the two largest feature values ​​and their corresponding feature vectors (η1, η2) and (ξ1, ξ2) from the two trajectory data; and obtain the third feature vector (η3, ξ3) by the cross product of the first two feature vectors.

[0079] The characteristic matrices for the weld centerline trajectory Q and the teaching trajectory P1 are established using the following formulas:

[0080]

[0081] Among them, the principal directions of the weld centerline trajectory Q and the teaching trajectory P1 are W and W, respectively. Q and ;

[0082] Obtain the initial matching transformation matrix (R0, T0):

[0083]

[0084] In the formula: R0 is the rotation matrix, and T0 is the translation vector;

[0085] Finally, the position of the teaching point is updated according to the initial matching transformation matrix (R0, T0), thereby outputting the corrected teaching program and completing the offline correction of the weld.

[0086] In the aforementioned welding method for the outlet pipe of a stainless steel centrifugal pump, the online correction process involves estimating the real-time trajectory of the welding torch tip using a tracking differentiator and an expanded state observer. The formula for the tracking differentiator is as follows:

[0087]

[0088] In the formula: fhan is the fastest synthesis function; v is the target point collected by the line structured light sensor as the input signal; v1 is the tracking signal of the input signal; v2 is the derivative of v1; k1 is the scaling factor; r is the velocity factor; h is the filtering factor;

[0089] The formula for the extended state observer is as follows:

[0090]

[0091] In the formula: e is the deviation between the current position of the welding torch and the target point; z1 is the observed estimate of the target position; z2 is the observed estimate of the welding speed; z3 is the observed estimate of the total system disturbance; y(k) is the real-time position of the welding torch output by the system; β 01 ,β 02 and β 03 Here, α1 and α2 are the gain parameters of the system, respectively; α1 and α2 are gain constants between 0 and 1; τ is a constant that affects the filtering effect; fal is the nonlinear saturation function, and its expression is as follows:

[0092]

[0093] In the formula: α is a constant between 0 and 1; e is the error of the fal function;

[0094] The nonlinear feedback rate of the state error between the welding torch tip and the weld centerline is obtained based on the tracking differentiator and the expanded state observer:

[0095]

[0096] In the formula: e1 is the position error signal; e2 is the differential position error signal; u0 is the nonlinear state error nonlinear feedback rate; β1 and β2 are adjustable weight parameters;

[0097] Disturbance compensation is obtained based on the nonlinear feedback rate:

[0098]

[0099] In the formula: u(k) is the final correction amount obtained by compensating u0 with the disturbance estimate z3;

[0100] Therefore, the welding torch position is corrected online based on the final correction amount, so that it can always move along the weld centerline within a good deviation range.

[0101] The welding device for the aforementioned welding method of the outlet pipe of a stainless steel centrifugal pump includes a welding base with a lifting cylinder mounted on it. A welding platform is vertically connected to the welding base, and the bottom surface of the welding platform is connected to the telescopic end of the lifting cylinder. A rotary motor is also provided on the back of the welding platform, and the output end of the rotary motor is connected to a rotating disk on the surface of the welding platform. A positioning disk for fixing the pump casing is provided on the rotating disk. A welding cabinet is also provided on the welding platform, and a control cabinet is installed inside the welding cabinet. A three-axis moving mechanism is provided at the upper end of the welding cabinet, and a welding torch and a first camera are provided at the lower end of the three-axis moving mechanism. A second camera is also provided on the side of the welding cabinet. The first camera, the second camera, and the three-axis moving mechanism are all electrically connected to the control cabinet.

[0102] The welding device for the aforementioned welding method of the outlet pipe of the stainless steel centrifugal pump, wherein the lower end of the three-axis moving mechanism is also provided with an exhaust fan located on one side of the welding torch.

[0103] Compared with the prior art, the present invention has the following beneficial effects:

[0104] 1. This invention enables machine welding of pump casings and outlet pipes. Addressing the issue of irregular elliptical weld seams between centrifugal pumps and outlet pipes, this invention utilizes a binocular camera to meticulously acquire weld seam images. Preprocessing of the weld seam images further disperses the grayscale values, facilitating image segmentation and other operations. The increased overall grayscale value also compensates for insufficient image brightness due to lighting conditions during image capture. The weld seam image is then segmented to separate the weld seam from the image, yielding an initial weld seam image. Morphological processing eliminates the impact of burrs, voids, and other defects on the accuracy of centerline and feature point extraction, resulting in the weld seam centerline of the laser stripe image. This allows for control of the welding torch's trajectory based on the weld seam centerline, enabling the welding of the weld seam between the centrifugal pump and outlet pipe. This achieves machine welding, reducing labor costs and improving welding efficiency, quality, and smoothness.

[0105] 2. This invention addresses the control of the welding torch's trajectory by implementing both offline and online correction. Offline correction involves matching the weld centerline to obtain a teaching point suitable for the current welding stage. This point is then combined with the initial teaching posture information to update the initial teaching program, ensuring the welding torch's trajectory follows the corresponding weld centerline. Simultaneously, the online correction of this invention estimates the real-time movement trajectory of the welding torch tip during welding, ensuring it remains within a favorable deviation range along the weld centerline, thereby guaranteeing welding quality and smoothness. Attached Figure Description

[0106] Figure 1 This is a schematic diagram of the welding method of the present invention;

[0107] Figure 2 This is a flowchart illustrating the image preprocessing process;

[0108] Figure 3 This is a schematic diagram of the image after grayscale linear transformation enhancement;

[0109] Figure 4 This is a flowchart illustrating the segmentation process;

[0110] Figure 5 A flowchart illustrating morphological processing;

[0111] Figure 6 A flowchart for offline correction;

[0112] Figure 7 This is a schematic diagram of the structure of the device of the present invention;

[0113] Figure 8 This is a schematic diagram of the internal structure of the welding cabinet 7;

[0114] Figure 9 This is a schematic diagram of the assembly of the pump casing and the outlet pipe.

[0115] Figure Labels

[0116] 1. Welding base; 2. Lifting cylinder; 3. Welding platform; 4. Rotating motor; 5. Rotating disc; 6. Positioning disc; 7. Welding cabinet; 8. Three-axis moving mechanism; 9. Welding torch; 10. Exhaust fan; 11. First camera; 12. Second camera; 13. Pump casing; 14. Water outlet pipe; 15. Weld seam. Detailed Implementation

[0117] The present invention will be further described below with reference to the accompanying drawings and embodiments, but this should not be construed as limiting the present invention.

[0118] Example 1: A method for welding the outlet pipe of a stainless steel centrifugal pump, such as... Figure 1 As shown, it includes the following steps:

[0119] Step 1: Use a binocular camera to acquire images of the weld between the centrifugal pump and the outlet pipe, and then preprocess the weld images to obtain enhanced images; in this step, the preprocessing steps are as follows: Figure 2 As shown:

[0120] Step 1.1: Use bilateral filtering for image denoising; the bilateral filtering combines spatial distance and gray-level similarity to fuse features from both the spatial and value domains; where spatial distance refers to the distance between the target point and the center point of the template, and the Gaussian function in the spatial domain is as follows:

[0121]

[0122] In the formula: (x i y i (x) represents the current image position. c y c ) represents the location of the template center point, and σ1 represents the standard deviation of the spatial domain;

[0123] The grayscale similarity is the absolute value of the difference between the grayscale value of the current point and the grayscale value of the center point of the template. Its Gaussian function in the range is as follows:

[0124]

[0125] In the formula: g(x) i y j ) represents the grayscale value of the current point, g(x) c y c ) represents the gray value at the center point of the template, and σ² represents the standard deviation of the value range;

[0126] The kernel function of the bilateral filter is shown in the following equation:

[0127]

[0128] In the formula: ω(i, j, k, l) is the weight of the pixel, and f(k, l) represents the pixel value of the neighborhood center;

[0129] Step 1.2: Perform grayscale processing on the denoised image. The grayscale processing uses a weighted average method, where the three components are weighted according to their importance and other indicators. Since the human eye is most sensitive to green and least sensitive to blue, a more reasonable grayscale image can be obtained by weighting the RGB components using the following formula:

[0130] Gary(i,j)=0.299*R(i,j)+0.578*G(i,j)+0.114*B(i,j);

[0131] In the formula: Gary(i,j) represents the grayscale image, and R, G and B represent the three color components respectively;

[0132] The image after grayscale processing is a grayscale image represented by a one-dimensional array. The grayscale image retains the feature information of the color image while reducing the dimensionality of the algorithm computation to a certain extent.

[0133] Step 1.3: Image enhancement is performed using the linear grayscale transformation method; the formula for the linear grayscale transformation method is as follows:

[0134]

[0135] In the formula: a and b represent the critical values ​​of pixel grayscale before and after image enhancement, respectively; f(x, y) is the original pixel grayscale value; and g(x, y) is the pixel grayscale value after linear grayscale transformation.

[0136] Linear grayscale transformation primarily improves image quality by enhancing the contrast of pixel grayscale values. Essentially, it modifies the grayscale value of each pixel according to certain rules, widening the dynamic range of pixel values ​​and thus expanding the overall image contrast, making the image clearer and its features more prominent. For example... Figure 3 As shown, the image enhanced by grayscale linear transformation has a more dispersed overall grayscale value distribution compared to the original image, which is beneficial for operations such as image segmentation. Furthermore, the increase in overall grayscale value also compensates for the insufficient brightness of the image due to lighting conditions during the capture.

[0137] Step 2: Perform segmentation processing on the enhanced image to separate the weld from the weld image, obtaining the initial weld image; for example... Figure 4As shown, the segmentation process includes the following steps:

[0138] Step 2.1: This step uses the Otsu algorithm for threshold segmentation. The main principle of the Otsu algorithm is to divide the image into foreground and background based on the overall gray-level distribution characteristics. Segmentation is determined by calculating the inter-class variance between the two parts. A larger variance value indicates a greater difference in gray levels between the two parts, and the contrast is then further enhanced for better segmentation. Therefore, the Otsu algorithm is also known as the maximum inter-class variance method. The calculation of the inter-class variance in this step is shown below:

[0139]

[0140] in:

[0141]

[0142]

[0143] In the formula: Let C1 represent the inter-class variance; P1 is the probability that a pixel is classified into C1; P2 is the probability that a pixel is classified into C2; m1 is the average gray value of pixels assigned to C1; m2 is the average gray value of pixels assigned to C2; m G p is the global mean of the image; k is the gray level; p i Let be the probability that a pixel has a gray level of i; L is the total number of gray levels.

[0144] In solving for the inter-class variance, let {0, 1, 2, ..., L-1} represent L distinct gray levels in a digital image of size M×N pixels, and n i This represents the number of pixels with gray level i, and the probability that pixel i has a gray level of i is p. i ,and Suppose we choose a threshold T(k) = k, 0 < k < L-1, and use it to threshold the input image into two classes, C1 and C2. C1 consists of all pixels in the image with gray values ​​in the range [0, k], and C2 consists of all pixels with gray values ​​in the range [k+1, L-1]. Then the probability of a pixel being classified into C1 is... The probability of classifying it into C2 is The average gray value of the pixel assigned to C1 is Those assigned to C2 are The average gray level of pixels with gray levels from 0 to k is: The average grayscale value of the entire image is: Between-class variance is (omitting k), the global variance is:

[0145] The image is then processed using Gaussian filtering to enhance contrast and improve edge contours. The formula is as follows:

[0146]

[0147] In the formula: f s (x, y) is the result of convolving the Gaussian function with the image; G(x, y) is the one-dimensional zero-mean Gaussian kernel function; f(x, y) is the gray value of the original pixel; σ is the standard deviation;

[0148] Then calculate the image grayscale gradient:

[0149] dx = f(x, y)·Sobel x (x, y)

[0150] dy = f(x, y)·Sobel y (x, y);

[0151] In the formula: Sobel is the Sobel operator;

[0152] The resulting image gradient magnitude and angle are as follows:

[0153]

[0154] In the formula: M[x, y] is the gradient value, θ M Let dx and dy represent the gradient directions, respectively, and dx and dy represent the gradients of the image in the horizontal and vertical directions.

[0155] Step 2.2: Based on the calculated gradients of the image in the horizontal and vertical directions, perform non-maximum suppression on the magnitude along the gradient direction; for each pixel, compare the center value of its neighborhood with the two adjacent pixels in the corresponding gradient direction. If the value is the maximum, it indicates that the point is an edge value and retains a point with a width of 1 pixel. Otherwise, it is set to 0. In this way, the point with the maximum local gradient is retained through Canny edge detection to obtain edge features.

[0156] Step 2.3: Use dual thresholds to filter the extracted edge features. Set two different thresholds, high and low, to determine the final edge pixels. If the pixel neighborhood edge gradient obtained in Step 2.2 is greater than the set high threshold, it is determined to be an edge. If it is less than the set low threshold, it is determined to be a non-edge. Pixels between the thresholds are judged based on whether they are connected to edge pixels. If they are connected, they are determined to be edge feature pixels.

[0157] Step 2.4: Using Hough line detection, individual points are randomly selected through a probability selection mechanism to calculate lines. Each line consists of a vector with four elements (x1, y1, x2, y2), where (x1, y1) represents the starting point of the line segment and (x2, y2) represents the ending point. Hough line detection is used to obtain the position coordinates of the two endpoints of a line segment to assist in subsequent image segmentation and morphological processing operations.

[0158] Step 3: Perform morphological processing on the initial weld image to obtain a laser stripe image, and then extract the weld centerline from the laser stripe image; in this step, such as Figure 5 As shown, the steps of the morphological processing are as follows:

[0159] First, image dilation is performed on the initial weld image (i.e., the segmented image). The principle of image dilation is to merge the target image with its surrounding neighboring points, thereby expanding the boundary of the target image outward to fill the holes in the image. The formula is as follows:

[0160]

[0161] Where: A represents the initial image of the weld; B represents the structuring element; S represents the expanded image; α and β represent the coordinates of a pixel point of the anchor point of the structuring element B moved to the initial image of the weld A. This represents the set of pixels after binarization;

[0162] The process of image dilation involves moving the structuring element B line by line on the original image A. When the anchor point of B moves to a certain pixel (i, j), if at least one pixel in the target image intersects with an element in B, that pixel is expanded outward to obtain the expanded result.

[0163] Then, image erosion is performed to remove small objects around the object. The formula is as follows:

[0164]

[0165] Image erosion processing involves moving the anchor point of structuring element B to a certain pixel (i, j) in A at each pixel location. If the element in B is the same as the corresponding element in the neighboring domain centered at pixel (i, j), the pixel is retained; otherwise, the pixel is deleted, ultimately resulting in the target being shrunk inward.

[0166] Finally, image opening and closing operations are performed. The process of erosion followed by dilation is called the opening operation, and the formula for the opening operation is as follows:

[0167]

[0168] The purpose of opening operations is to eliminate burrs, discrete bright spots, and smooth target boundaries in an image, while keeping the object size almost unchanged.

[0169] The process of expanding followed by eroding is called the closing operation, and its purpose is to fill the internal voids of a target object. The formula for the closing operation is as follows:

[0170]

[0171] After processing using the above method, a laser stripe image with a certain width is obtained. Based on this, the centerline of the weld laser stripe is extracted to ensure the accuracy of weld feature point extraction. Specifically, the normal direction of the laser stripe image is determined by solving the eigenvalues ​​of the Hessian matrix and the corresponding eigenvectors. Then, the extreme points are calculated along the normal direction to obtain the sub-pixel coordinates of the center of the light stripe. Specifically, a point with a first derivative of zero is located within the current pixel, and the second derivative of the direction is greater than a specified threshold. Then, (x0, y0) represents the center point of the light stripe. x p y ) represents sub-pixel coordinates, (n) x n y ) is the eigenvector of the Hessian matrix whose largest eigenvalue corresponds to the normal direction of the light stripe, (tn) x ,tn y ) is the offset between the center point and the sub-pixel (its absolute value cannot exceed 0.5; if it exceeds 0.5, it goes out of the range of that pixel), and its relationship is as follows:

[0172]

[0173] (tn x ,tn y )∈[-0.5, 0.5]×[-0.5, 0.5];

[0174] The expression for the Hessian matrix above is as follows:

[0175]

[0176] In the formula: g′(x, y) is a two-dimensional Gaussian function; Z(x, y) represents the laser stripe image; r xx and r yy Let r represent the second derivatives in the x and y directions, respectively. xy This represents the second-order mixed derivative.

[0177] Step 4: Control the welding torch's trajectory based on the weld centerline to weld the centrifugal pump and the outlet pipe. The welding torch trajectory control includes offline and online correction. Offline correction involves matching the weld centerline to obtain a teaching point suitable for the current welding stage, combining this point with the initial teaching posture information to update the initial teaching program, thus completing the offline correction. Offline correction is used to test and adjust the welding torch's trajectory before welding, allowing the torch to rehearse its movement before welding. Online correction, during welding, estimates the real-time movement trajectory of the welding torch tip, ensuring it remains within a good deviation range along the weld centerline.

[0178] like Figure 6 As shown, the specific process of offline correction is as follows:

[0179] The least squares fitting plane is used to calculate the weld centerline trajectory and the normal vector of each data point on the teaching trajectory. The curvature is calculated using the least squares fitting method to the surface S(x, y), and then the mean curvature (H) and Gaussian curvature (K) of the principal curvatures (k1, k2) are calculated using the formulas respectively:

[0180]

[0181]

[0182] In the formula: E s =S x S x ;F s =S x S y G s =S y S y S x It is the first partial derivative of the fitted surface S(x, y) in the x-direction; S y The first partial derivative of the fitted surface S(x, y) in the x-direction; S yy The second partial derivative of the fitted surface S(x, y) in the y-direction; S xx It is the second partial derivative of the fitted surface S(x, y) in the x-direction; S xy For S x The second-order partial derivative in the y-direction; L is the normal vector of each data point in the teaching trajectory; s N s and M s E represents the first fundamental invariant of the fitted surface S(x, y). s F sand G s These are the second fundamental invariants of the fitted surface S(x, y);

[0183] The first-order and second-fundamental forms of a surface are represented as follows:

[0184]

[0185] Then, points with similar curvature between two trajectories are found, and the similarity of the matched point pairs is measured based on a distance function of curvature: a curvature-based quaternion vector is constructed, as shown in the following formula:

[0186] X = (KH k1 k2);

[0187] Use X i and X z Represent the teaching trajectory point p respectively i and weld inspection trajectory q z The characteristics of p i and q z The similarity is defined as follows:

[0188]

[0189] In the formula: S iz D(p) represents similarity; i q z )=||X i -X z ||;

[0190] Next, the similarity points are decentered to find the center of the two trajectory data. and and the corresponding covariance and M Q The formula is as follows:

[0191]

[0192] In the formula: n represents the number of sampling points for the two trajectory data;

[0193] In this embodiment, the centralized processing uses the teaching trajectory data P = {x1, x2, ..., x...} n For example, the formula is as follows:

[0194]

[0195] Where n represents the number of trajectory sampling points, x i and x j These represent the coordinates of the sampling points at positions i and j, respectively.

[0196] Find the eigenvalues ​​of the covariance: M P1T M P1 x = λx, where λ is the eigenvalue and x is an n-dimensional non-zero column vector;

[0197] Extract the two largest eigenvalues ​​and their corresponding eigenvectors (η1, η2) and (ξ1, ξ2) from the two trajectory data; and obtain the third eigenvector (η3, ξ3) by the cross product of the first two eigenvectors. The eigenvectors of the first two eigenvalues ​​are used as the principal directions, and the third principal direction is obtained by the cross product of the first two eigenvectors. Construct an eigenma matrix using the eigenvectors of the three principal directions. Finally, calculate the transformation matrix between the two trajectories using the eigenma matrix.

[0198] The characteristic matrices for the weld centerline trajectory Q and the teaching trajectory P1 are established using the following formulas:

[0199]

[0200] Among them, the principal directions of the weld centerline trajectory Q and the teaching trajectory P1 are W and W, respectively. Q and ;

[0201] Obtain the initial matching transformation matrix (R0, T0):

[0202]

[0203] In the formula: R0 is the rotation matrix, and T0 is the translation vector;

[0204] Finally, the position of the teaching point is updated according to the initial matching transformation matrix (R0, T0), thereby outputting the corrected teaching program and completing the offline correction of the weld.

[0205] In this step, during the online correction, the real-time trajectory estimation of the welding torch tip is performed using a tracking differentiator and an expansion state observer. The formula for the tracking differentiator is as follows:

[0206]

[0207] In the formula: fhan is the fastest synthesis function; v is the target point collected by the line structured light sensor as the input signal; v1 is the tracking signal of the input signal; v2 is the derivative of v1; k is the proportional coefficient. The larger the proportional coefficient, the faster the tracking, but the worse the filtering effect will be; r is the velocity factor; h is the filtering factor. When r is too large, it will amplify the noise. Therefore, the filtering factor h is introduced to suppress the noise. The larger h is, the better the filtering effect, and it can also reduce overshoot and improve the robustness of the system.

[0208] The formula for the extended state observer is as follows:

[0209]

[0210] In the formula: e is the deviation between the current position of the welding torch and the target point; z1 is the observed estimate of the target position; z2 is the observed estimate of the welding speed; z3 is the observed estimate of the total system disturbance; y(k) is the real-time position of the welding torch output by the system; β 01 ,β 02 and β 03 Here, α1 and α2 are the gain parameters of the system, respectively; α1 and α2 are gain constants between 0 and 1; τ is a constant that affects the filtering effect; fal is the nonlinear saturation function, and its expression is as follows:

[0211]

[0212] In the formula: α is a constant between 0 and 1; e is the error of the fal function;

[0213] The nonlinear feedback rate of the state error between the welding torch tip and the weld centerline is obtained based on the tracking differentiator and the expanded state observer:

[0214]

[0215] In the formula: e1 is the position error signal; e2 is the differential position error signal; u0 is the nonlinear state error nonlinear feedback rate; β1 and β2 are adjustable weight parameters;

[0216] Disturbance compensation is obtained based on the nonlinear feedback rate:

[0217]

[0218] In the formula: u(k) is the final correction amount obtained by compensating u0 with the disturbance estimate z3;

[0219] Therefore, the welding torch position is corrected online based on the final correction amount, so that it can always move along the weld centerline within a good deviation range.

[0220] Example 2: This example provides a welding apparatus for operating the welding method of Example 1, such as... Figure 7 and Figure 8As shown, the system includes a welding base 1, on which a lifting cylinder 2 is mounted; a welding platform 3 is vertically connected to the welding base 1, and the bottom surface of the welding platform 3 is connected to the telescopic end of the lifting cylinder 2; a rotary motor 4 is also provided on the back of the welding platform 3, and the output end of the rotary motor 4 is connected to a rotating disk 5 on which the surface of the welding platform 3 is mounted, and a positioning disk 6 for fixing the pump housing 13 is provided on the rotating disk 5; a welding cabinet 7 is also provided on the welding platform 3, and a control cabinet is provided inside the welding cabinet 7; a three-axis moving mechanism 8 is provided at the upper end of the welding cabinet 7, and a welding torch 9 and a first camera 11 are provided at the lower end of the three-axis moving mechanism 8; a second camera 12 is also provided on the side of the welding cabinet 7; the first camera 11, the second camera 12, and the three-axis moving mechanism 8 are all electrically connected to the control cabinet. The first camera 11 and the second camera 12 form a binocular camera; in this embodiment, the welding base 1 uses a lifting cylinder 1 to move the welding platform 3 up and down, for initial adjustment of the welding platform height; the positioning plate 6 is used to fix the pump casing, and a rotating motor 4 is provided to drive the rotating plate 5 to rotate, so as to adjust the relative position of the pump casing 13 and facilitate the binocular camera to acquire weld images; Figure 9 As shown, after the pump casing 13 and the outlet pipe 14 are press-fitted, the resulting weld 13 is an irregular ellipse. The three-axis moving mechanism 8 in this embodiment achieves movement along the x, y, and z axes. It uses a conventional motor to drive a lead screw to rotate, thus moving the moving block on the lead screw. Slide rails are provided on both sides to ensure stability during movement. The three-axis moving mechanism in this embodiment is driven by a conventional servo motor. The servo motor is electrically connected to the control cabinet, which contains a chip and a control circuit board with corresponding processing capabilities to control the entire device. Furthermore, the invention also includes an exhaust fan 10 located on one side of the welding torch 9 at the lower end of the three-axis moving mechanism 8. The exhaust fan can assist in defogging to facilitate binocular camera shooting.

[0221] In summary, this invention enables automated welding of pump casing and inlet pipe, reducing labor costs and improving welding efficiency, welding quality, and weld smoothness.

Claims

1. A method for welding the outlet pipe of a stainless steel centrifugal pump, characterized in that: Includes the following steps: Step 1: Use a binocular camera to acquire images of the weld between the centrifugal pump and the outlet pipe, and then preprocess the weld images to obtain enhanced images; Step 2: Perform segmentation processing on the enhanced image to separate the weld from the weld image and obtain the initial weld image; Step 3: Perform morphological processing on the initial weld image to obtain a laser stripe image, and then extract the weld centerline from the laser stripe image; Step 4: Control the trajectory of the welding torch according to the center line of the weld to achieve welding of the weld between the centrifugal pump and the outlet pipe. In step 3, the extraction of the weld centerline involves determining the normal direction of the laser stripe image based on the eigenvalues ​​and corresponding eigenvectors of the Hessian matrix, and then calculating the extrema along the normal direction to obtain the sub-pixel coordinates of the light stripe center; specifically, using... Indicates the center point of the light stripe. Subpixel coordinates The eigenvector corresponding to the normal direction of the light stripe is the largest eigenvalue of the Hessian matrix. It is the offset between the center point and the sub-pixel, and its relationship is as follows: ; ; ; The expression for a Hessian matrix is ​​as follows: ; In the formula: ; It is a two-dimensional Gaussian function; Represents a laser stripe image; and They represent and Second derivative in the direction, This represents the second-order mixed derivative.

2. The welding method for the outlet pipe of the stainless steel centrifugal pump according to claim 1, characterized in that: In step 1, the preprocessing steps are as follows: Step 1.1: Use bilateral filtering for image denoising; the bilateral filtering combines spatial distance and gray-level similarity to fuse features from both the spatial and value domains; where spatial distance refers to the distance between the target point and the center point of the template, and the Gaussian function in the spatial domain is as follows: ; In the formula: The current point's image position. The center point of the template. The standard deviation is the spatial domain. The grayscale similarity is the absolute value of the difference between the grayscale value of the current point and the grayscale value of the center point of the template. Its Gaussian function in the range is as follows: ; In the formula: This represents the grayscale value of the current point. The grayscale value at the center point of the template. The standard deviation of the range; The kernel function of the bilateral filter is shown in the following formula: ; In the formula: The weight of each pixel. Represents the pixel value at the center of the neighborhood; Step 1.2: Perform grayscale processing on the denoised image; the grayscale processing uses a weighted average method, and the formula is as follows: ; In the formula: Represents a grayscale image. , and These represent the three color components respectively; Step 1.3: Image enhancement is performed using the linear grayscale transformation method; the formula for the linear grayscale transformation method is as follows: ; In the formula: These represent the critical values ​​of pixel grayscale before and after image enhancement, respectively. This represents the grayscale value of the original pixel. This represents the pixel grayscale value after linear grayscale transformation.

3. The welding method for the outlet pipe of the stainless steel centrifugal pump according to claim 1, characterized in that: Step 2, the segmentation process includes the following steps: Step 2.1: Based on the overall grayscale distribution characteristics of the image, divide it into foreground and background parts. Segmentation is then performed by calculating the inter-class variance between the two parts. The solution for the inter-class variance is shown below: ; in: ; ; ; In the formula: Represents the variance between classes; Pixels are classified into The probability of; Pixels are classified into The probability, To be allocated The average grayscale value of the pixels; To be allocated The average grayscale value of the pixels; The global mean of the image; Grayscale; The gray level of a pixel is The probability of; This represents the total number of gray levels. The image is then processed using Gaussian filtering to enhance contrast and improve edge contours. The formula is as follows: ; In the formula: This is the result of convolving a Gaussian function with an image. It is a one-dimensional Gaussian kernel function with zero mean; This represents the grayscale value of the original pixel. Standard deviation; Then calculate the image grayscale gradient: ; In the formula: For Sobel operators; The resulting image gradient magnitude and angle are as follows: ; In the formula: The gradient value, For the gradient direction, and These represent the gradients of the image in the horizontal and vertical directions, respectively; Step 2.2: Based on the calculated gradients of the image in the horizontal and vertical directions, perform non-maximum suppression on the magnitude along the gradient direction; for each pixel, compare the center value of its neighborhood with the two adjacent pixels in the corresponding gradient direction. If the value is the maximum, it indicates that the point is an edge value and retains a point with a width of 1 pixel. Otherwise, it is set to 0. In this way, the point with the maximum local gradient is retained through Canny edge detection to obtain edge features. Step 2.3: Use dual thresholds to filter the extracted edge features. The final edge pixels are determined by setting two different thresholds, high and low. If the pixel neighborhood edge gradient obtained in Step 2.2 is greater than the set high threshold, it is determined to be an edge. If it is less than the set low threshold, it is determined to be a non-edge. Pixels between the thresholds are judged based on whether they are connected to edge pixels. If they are connected, they are determined to be edge feature pixels. Step 2.4: Using Hough line detection, individual points are randomly selected through a probability selection mechanism to calculate lines. Each line is a vector with four elements. ,in Indicates the starting point of the line segment. Indicates the endpoint of the line segment.

4. The welding method for the outlet pipe of the stainless steel centrifugal pump according to claim 1, characterized in that: In step 3, the morphological processing steps are as follows: First, image dilation is performed on the initial weld image to fill the holes in the image. The formula is as follows: ; in: This represents the initial image of the weld. Represents a structural element. This represents the image after dilation. express The anchor point of the structural element is moved to the initial image of the weld. The coordinates of a certain pixel; This represents the set of pixels after binarization; Then, image erosion is performed to remove small objects around the object. The formula is as follows: ; Finally, image opening and closing operations are performed, with the opening operation formula as follows: ; The formula for closing is as follows: 。 5. The welding method for the outlet pipe of the stainless steel centrifugal pump according to claim 1, characterized in that: The trajectory control of the welding torch includes offline and online correction. Offline correction involves matching the weld centerline to obtain a teaching point that meets the current welding requirements, combining it with the initial teaching posture information, updating the initial teaching program, and completing the offline correction of the weld. Online correction involves estimating the real-time trajectory of the welding torch tip during the welding process, ensuring that it always moves along the weld centerline within a good deviation range.

6. The welding method for the outlet pipe of the stainless steel centrifugal pump according to claim 5, characterized in that: The specific process of offline correction is as follows: The least squares fitting plane is used to calculate the weld centerline trajectory and the normal vector of each data point on the teaching trajectory. Using least squares to fit the surface The curvature is calculated using the method described above, and then the principal curvatures are calculated using formulas. average curvature and Gaussian curvature : ; ; ; ; In the formula: ; ; ; ; ; ; It is a fitted surface The first partial derivative in the x-direction; Fitted surface The first partial derivative in the x-direction; Fitted surface The second-order partial derivative in the y-direction; It is a fitted surface Second-order partial derivative in the x-direction; for The second-order partial derivative in the y-direction; The normal vector for each data point of the teaching trajectory; , and respectively fitted surfaces The first fundamental invariant , and respectively fitted surfaces The second fundamental invariant; Then, points with similar curvature between two trajectories are found, and the similarity of the matched point pairs is measured based on a distance function of curvature: a curvature-based quaternion vector is constructed, as shown in the following formula: ; use and Representing the teaching trajectory points respectively and weld inspection trajectory Features and The similarity is defined as follows: ; In the formula: Indicates similarity; ; Next, the similarity points are decentered to find the center of the two trajectory data. and and the corresponding covariance and The formula is as follows: ; ; In the formula: This indicates the number of sampling points for the two trajectory data; Find the eigenvalues ​​of the covariance , For eigenvalues, It is an n-dimensional non-zero column vector; Extract the two largest eigenvalues ​​and their corresponding eigenvectors from the two trajectory data. and ; and the third eigenvector is obtained by the cross product of the first two eigenvectors. ; Establish weld centerline trajectory and teaching trajectory The characteristic matrix of is given by the following formula: ; Among them, the trajectory of the weld centerline and teaching trajectory The main directions are respectively and ; Obtain the initial matching transformation matrix : ; In the formula: For rotation matrix, It is a translation vector; Finally, based on the initial matching transformation matrix Update the position of the teaching point to output the corrected teaching program and complete the offline correction of the weld.

7. The welding method for the outlet pipe of the stainless steel centrifugal pump according to claim 5, characterized in that: In the online correction process, the real-time trajectory of the welding torch tip is estimated using a tracking differentiator and an extended state observer. The formula for the tracking differentiator is as follows: ; In the formula: It is the fastest synthesis function; The target point collected by the line structured light sensor is used as the input signal; It is a tracking signal for the input signal; yes The differential; This is the proportionality coefficient; For velocity factor; The filter factor; The formula for the extended state observer is as follows: ; In the formula: This represents the deviation between the current position of the welding torch and the target point. For the observational estimation of the target location, For observational estimation of welding speed; is the observed estimate of the total system disturbance; is the real-time position of the welding torch output by the system. , and These are the system gain parameters; and The gain constant is between 0 and 1; These are constants that affect the filtering effect; It is a nonlinear saturation function, and its expression is as follows: ; In the formula: A constant between 0 and 1; This represents the error of the fal function; The nonlinear feedback rate of the state error between the welding torch tip and the weld centerline is obtained based on the tracking differentiator and the expanded state observer: ; In the formula: This is the position error signal; This is the differential signal of the position error; The nonlinear state error is the nonlinear feedback rate. and These are adjustable weight parameters; Disturbance compensation is obtained based on the nonlinear feedback rate: ; In the formula: To use the disturbance estimate right Compensation is performed to obtain the final correction amount; Therefore, the welding torch position is corrected online based on the final correction amount, so that it can always move along the weld centerline within a good deviation range.

8. The welding apparatus for the welding method of the outlet pipe of a stainless steel centrifugal pump according to any one of claims 1-7, characterized in that: The system includes a welding base (1), on which a lifting cylinder (2) is installed; a welding platform (3) is connected to the welding base (1) in a lifting manner, and the bottom surface of the welding platform (3) is connected to the telescopic end of the lifting cylinder (2); a rotating motor (4) is also provided on the back of the welding platform (3), and the output end of the rotating motor (4) is connected to a rotating disk (5) on the surface of the welding platform (3), and a positioning disk (6) for fixing the pump casing is provided on the rotating disk (5); a welding cabinet (7) is also provided on the welding platform (3), and a control cabinet is provided inside the welding cabinet (7); a three-axis moving mechanism (8) is provided at the upper end of the welding cabinet (7), and a welding torch (9) and a first camera (11) are provided at the lower end of the three-axis moving mechanism (8); a second camera (12) is also provided on the side of the welding cabinet (7); the first camera (11), the second camera (12) and the three-axis moving mechanism (8) are all electrically connected to the control cabinet.

9. The welding apparatus for the welding method of the outlet pipe of the stainless steel centrifugal pump according to claim 8, characterized in that: The lower end of the three-axis moving mechanism (8) is also provided with an exhaust fan (10) located on one side of the welding torch (9).