3D visual guidance welding method and equipment for flat wire stator
Through the 3D visual guide welding method, the welding execution coordinates of the flat line stator are determined by combining brightness images and depth images, which solves the problem of poor positioning accuracy and joint consistency in the welding of flat line motor stator and improves the welding quality.
Patent Information
- Application Number
- CN202411940301.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-03-07
AI Technical Summary
In the stator welding processing of flat wire motors, due to the limitations of the exposed copper wire of the stator flat wire, the cutting process and welding tooling, the repeated positioning accuracy of the center of the welding joint and the consistency of the joint state, affecting the welding quality.
Using the 3D visually guided welding method, the brightness image is obtained in the laser marking scene, visual calibration is performed to obtain the affine transformation matrix, collect the depth image, determine the welding execution coordinates, and perform welding operations based on these coordinates.
Accurate welding positioning and efficient welding operations of flat line stator are realized, welding quality is improved, and the problems of poor repeat positioning accuracy in the center of the welding joint and poor joint status consistency are solved.
Smart Images

Figure CN119566633A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of welding technology, and in particular to a 3D vision-guided welding method and equipment for a flat wire stator in the field of welding technology. Background Art
[0002] In the flat wire motor stator welding process, due to the limitations of the exposed copper wire length of the stator flat wire, the flattening process and the welding tooling, the repeated positioning accuracy of the welding point center and the poor consistency of the joint state (such as height difference, misalignment and gap, etc.) have seriously affected the welding quality. Therefore, the position and state of the copper wire before welding must be identified and analyzed by the visual system to screen out unqualified welding points and accurately guide to qualified welding points to ensure the success of welding.
[0003] There are two main types of commonly used visual guidance solutions in related technologies: pure two-dimensional (2D) vision solution and 2D vision + three-dimensional (3D) vision combination solution. Although the 2D solution can achieve basic positioning functions, it has low accuracy and cannot solve the problem of height difference recognition. Although the solution of combining 2D vision + 3D vision makes up for the shortcomings of 2D vision, it has problems such as complex equipment redundancy, high cost, complex operation, and inability to recognize all welds at one time. The solution using pure 3D vision can well solve the defects of the above solutions, accurately and efficiently guide to the welding point and ensure welding quality. Summary of the invention
[0004] The purpose of the present invention is to provide a 3D vision-guided welding method and equipment for a flat wire stator. The technical solutions adopted are as follows:
[0005] In a first aspect, an embodiment of the present invention provides a flat wire stator 3D vision-guided welding method, the method comprising:
[0006] In the laser marking scenario, a brightness image of the flat wire stator to be processed is obtained;
[0007] Performing visual calibration on the brightness image to obtain an affine transformation matrix;
[0008] Based on the affine transformation matrix, acquiring a depth image of the flat wire stator to be processed;
[0009] Determining welding execution coordinates of the flat wire stator to be processed based on the affine transformation matrix and the depth image;
[0010] Based on the welding execution coordinates, a welding operation is performed on the flat wire stator to be processed.
[0011] In a second aspect, an embodiment of the present invention provides a flat wire stator 3D vision-guided welding device, the device comprising:
[0012] A stator rotating device, used to fix the flat wire stator to be processed in the laser marking scene, and drive the flat wire stator to be processed to rotate;
[0013] A 3D vision module, used to collect a brightness image and a depth image of the flat wire stator to be processed in the laser marking scene;
[0014] A motion control module, at the end of which the 3D vision module is installed, is used to control the 3D vision module to move to the area just above the copper wire of the flat wire stator to be processed and move along the radial direction of the flat wire stator to be processed, so as to determine the image acquisition point based on the model information corresponding to the 3D vision module;
[0015] The host computer system is used to perform visual calibration on the brightness image to obtain an affine transformation matrix; based on the affine transformation matrix and the depth image, determine the welding execution coordinates of the flat wire stator to be processed;
[0016] The welding execution component is used to perform a welding operation on the flat wire stator to be processed based on the welding execution coordinates.
[0017] According to a third aspect, a computer program product is provided. The computer program product includes: a computer program code. When the computer program code is executed on a computer, the computer executes the method according to the first aspect.
[0018] According to a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program code. When the computer program code is executed on a computer, the computer executes the method according to the first aspect.
[0019] The present invention has the following beneficial effects:
[0020] 1. In the laser marking scenario, the image of the flat wire stator to be processed is scanned through the 3D vision module to obtain a brightness image. By visually calibrating the brightness image, an affine transformation matrix is obtained, so that the depth image can be more accurately collected through the affine transformation matrix; based on the affine transformation matrix and the depth image, the welding execution coordinates of the flat wire stator to be processed are determined; in this way, in the laser marking scenario, by visually calibrating the brightness image, the affine transformation matrix corresponding to the brightness image can be more accurately identified, so as to more effectively collect the depth image, thereby combining the depth image and the affine transformation matrix to accurately calculate the welding execution coordinates of the flat wire stator to be processed. Finally, the welding operation is performed on the flat wire stator to be processed through the welding execution coordinates. In this way, through more accurate welding execution coordinates, the welding operation can be performed more efficiently on the flat wire stator to be processed to improve the welding quality.
[0021] 2. Visually calibrate the brightness image through the marking points on the outer ring of the tooling disk of the flat wire stator to be processed to obtain N marking center points of the brightness image; determine the affine transformation matrix based on the N marking center points of the brightness image; in this way, by visually calibrating the brightness image, the marking center points in the brightness image can be accurately identified. Afterwards, the 3D vision module collects the depth image of the flat wire stator to be processed based on the affine transformation matrix. In this way, by calculating the affine transformation matrix, the depth image of the flat wire stator to be processed can be more accurately collected, so that by combining the depth image and the affine transformation matrix, the welding execution coordinates can be more effectively determined, so as to effectively guide the welding operation.
[0022] 3. Reconstruct the brightness image based on the preset global threshold G T The grayscale of the original brightness image is extracted, and the grayscale value is greater than or equal to the preset global threshold G T Pixel set P ij , and divide the pixel point set into regions according to the number of N marking points to obtain N pixel regions; so as to obtain more accurate and effective identification of N marking center points in the brightness image by performing linear fitting on the N pixel regions respectively; and then the affine transformation matrix can be accurately fitted through the N marking center points to meet the welding positioning accuracy of the stator under the guidance of 3D vision.
[0023] 4. Divide the pixel point set into regions according to the number of N marking points to obtain multiple initial regions; and shield the overlapping regions in the multiple initial regions to obtain N pixel regions; in this way, by shielding the overlapping regions in the initial regions obtained by region division, the obtained pixel regions can be made more accurate.
[0024] 5. By traversing the pixel points in each row and each column, the center point of each row can be quickly obtained and the center points of the columns After that, a linear fit is performed on the center points of each row, and the minimum sum of squared errors of each row is determined. To obtain multiple vertical lines; where i represents the row coordinate corresponding to the i-th pixel point; a and b represent the slope and intercept of the line respectively; and linear fitting is performed on the center point of each column, and the minimum sum of square errors of each column is determined In this way, a plurality of horizontal straight lines can be obtained by linear fitting through the center points of each row and each column, and then N marked center points (Row n , Col n ) so that the affine transformation matrix can be calculated more conveniently.
[0025] 6. After identifying multiple marking centers of the brightness image, the software control system uses the least squares method to perform linear fitting on the multiple marking centers and performs minimum error analysis on the fitting results, so that the affine transformation matrix can be obtained quickly and accurately to facilitate the calculation of the welding execution coordinates.
[0026] 7. After acquiring the depth image, multiple pixel coordinates of the flat wire stator to be processed are determined based on the depth image; and the multiple pixel coordinates are combined with the affine transformation matrix to accurately calculate the welding execution coordinates, thereby more effectively guiding the welding operation.
[0027] 8. The original depth image is obtained by performing an inverse polar coordinate transformation on the depth image, and then feature extraction is performed on the original depth image to obtain the depth features of each group of copper wire areas; the welds that do not meet the welding process in the depth image are correctly screened out by a preset depth threshold to obtain the coordinates of qualified welds that can be used for welding processing.
[0028] 9. Through the depth features, the height difference, misalignment and gap of each group of copper wire areas are obtained, and by judging whether the height difference is less than the preset height difference threshold, whether the misalignment is less than the preset misalignment threshold and whether the gap is less than the preset gap threshold, the welds whose joint height difference, misalignment and gap values do not meet the welding process in the depth image are correctly screened out, and the coordinates of qualified welds that can be used for welding processing are calculated, thereby ensuring the accurate identification of the welding status of each flat wire joint and the precise guidance and positioning of each flat wire joint weld. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0030] Figure 1 It is a schematic diagram of the composition structure of a flat wire stator provided by the related technology;
[0031] Figure 2 It is a schematic diagram of the composition structure and implementation process of a flat wire stator 3D vision-guided welding device provided by an embodiment of the present invention;
[0032] Figure 3 This is a schematic diagram of an application scenario of a flat wire stator 3D vision-guided welding device provided by an embodiment of the present invention;
[0033] Figure 4 is a schematic diagram of another application scenario of a flat wire stator 3D vision-guided welding device provided by an embodiment of the present invention;
[0034] Figure 5 It is a schematic diagram of the implementation process of a flat wire stator 3D vision-guided welding method provided by an embodiment of the present invention;
[0035] Figure 6 It is another implementation flow diagram of a flat wire stator 3D vision-guided welding method provided by an embodiment of the present invention;
[0036] Figure 7 It is a structural schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation, structure, features and effects of a flat wire stator 3D visual guided welding method proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0038] Among them, in the description of the embodiments of the present invention, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a way to describe the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present invention, "multiple" refers to two or more than two.
[0039] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0040] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0041] The traditional flat wire stator welding process is easily affected by the length of the exposed copper wire of the stator flat wire, the flattening process and the limitation of the welding tooling, resulting in poor welding conditions at the joints of the two copper wires, including two main problems: poor repeat positioning accuracy of the center of the solder joint and poor consistency of the joint state (there are height differences, misalignments and gaps, etc.). If these solder joints with poor welding conditions are not identified and eliminated in advance, the quality of the flat wire stator welding process cannot be guaranteed. Any factor of excessive height difference, misalignment or gap value between copper wires will directly lead to welding failure or even product scrapping, so a visual system must be equipped to identify and analyze the position and state of the copper wire before welding, screen out unqualified soldering points, and accurately guide to qualified soldering points to ensure the success of flat wire stator welding.
[0042] In the related technology, there are two main visual guidance solutions for flat wire stator welding: pure 2D vision solution and 2D vision + 3D vision combination solution. Although the 2D vision solution can realize the positioning function, it has low accuracy and cannot solve the problem of height difference recognition. Although the solution of 2D vision positioning + 3D vision height difference recognition makes up for the shortcomings of the 2D vision solution, it has the problems of complex equipment redundancy, high cost, complicated operation and inability to recognize all welding points at one time. Figure 1 As shown, in the related art, the visual guidance scheme for flat wire stator welding has defects such as the copper wire welding points at the ends of the flat wire stators and their height difference, misalignment and gap.
[0043] To this end, an embodiment of the present invention provides a flat wire stator 3D vision-guided welding method. The following specifically describes a specific scheme of a flat wire stator 3D vision-guided welding method provided by the present invention in conjunction with the accompanying drawings. Figure 2, which shows a schematic diagram of the implementation process of a flat wire stator 3D vision-guided welding method provided by an embodiment of the present invention, combined with Figure 2 The steps shown are explained below:
[0044] 201 , in a laser marking scenario, obtaining a brightness image of a flat wire stator to be processed.
[0045] Here, the brightness image of the flat wire stator to be processed is collected by the 3D vision module in the 3D vision-guided welding of the flat wire stator. The flat wire stator to be processed is fixed in the stator rotating device, and is driven by the stator rotating device to rotate 360°. Among them, the process of collecting the brightness image by the 3D vision module is as follows: the motion control module in the 3D vision-guided welding equipment of the flat wire stator drives the 3D vision module to move to the area directly above the copper wire of the flat wire stator to be processed, and adjusts the direction of the laser line of the 3D vision module along the radial direction of the copper wire of the flat wire stator to be processed, that is, controls the radial movement along the flat wire stator to be processed, and the height is determined according to the field of view corresponding to the model of the 3D vision module, and this is recorded as the image acquisition point. The acquisition mode of the 3D vision module is set to the brightness map mode, and then the stator rotating device drives the flat wire stator to be processed to rotate 360°, and the 3D vision module collects the brightness image of the surface copper wire area of the flat wire stator to be processed.
[0046] 202, visually calibrate the brightness image to obtain an affine transformation matrix.
[0047] Here, after the brightness image is acquired, the brightness image is visually calibrated to identify the center point of the brightness image, and then the affine transformation matrix H is obtained by linearly fitting the center point of the brightness image.
[0048] In some possible implementations, after the 3D vision module collects the brightness image of the flat wire stator to be processed, the center point of the brightness image is identified by visual calibration, so as to accurately collect the depth image of the flat wire stator to be processed. By combining the brightness image and the depth image, the welding execution coordinates of the flat wire stator to be processed can be analyzed more accurately. First, the outer ring of the tooling disk of the flat wire stator to be processed is marked to obtain N marking points; wherein N is an integer greater than or equal to 3; for example, N coordinate values are input in sequence along the circumferential direction on the outer ring, and the positions are roughly evenly divided, and the marking mode is turned on to mark the "×" shape on the tooling disk in turn. Secondly, based on the N marking points of the outer ring of the tooling disk of the flat wire stator to be processed, the brightness image is visually calibrated to obtain the N marking center points of the brightness image; finally, based on the N marking center points of the brightness image, the affine transformation matrix is determined; here, the affine transformation matrix is obtained by linearly fitting the conversion relationship between the N marking center points using the least squares method.
[0049] In some possible implementations, “performing visual calibration on the brightness image based on the N marking points on the outer ring of the tooling disk of the flat wire stator to be processed to obtain the N marking center points of the brightness image” can be implemented by the following process:
[0050] First, the brightness image is reconstructed to obtain the original brightness image; here, Figure 4 The polar coordinate transformation method shown in the figure performs polar coordinate inverse transformation on the brightness image to reconstruct the original brightness image of the end face of the flat wire stator to be processed. Among them, the brightness feature map marked after reconstruction is as follows Figure 5 shown.
[0051] Secondly, based on the preset global threshold G T The grayscale of the original brightness image is extracted to obtain a grayscale value greater than or equal to the preset global threshold G. T Pixel set P ij ; where i and j represent the i-th row and j-th column respectively. Here, a global fixed threshold G is set T , extract all gray values G≥G T The pixel set P ij , where i and j represent the i-th row and j-th column respectively.
[0052] Next, after obtaining the pixel point set, the pixel point set is divided into regions according to the number of the N marking points to obtain N pixel regions. Here, the software control system divides the pixel point set into regions according to the number of marking points to obtain multiple initial regions; the overlapping regions in the multiple initial regions are shielded to obtain the N pixel regions. For example, according to the actual number of marking points, the set is divided into N regions for separate analysis. To prevent confusion, the pixel points of each cross-overlapping region are shielded to obtain the pixel region P. ij =(P i ∪P j )-(P i ∩P j ), where (P i Pixels belonging to the vertical line area, P j In this way, by shielding the overlapping areas in the initial area obtained by area division, the obtained pixel area can be made more accurate.
[0053] Finally, linear fitting is performed on the N pixel areas to obtain N marked center points; and the affine transformation matrix can be calculated through the N marked center points. In this way, by reconstructing the brightness image and dividing the area according to the number of marked points, the visual calibration of the brightness image can be achieved, so as to more accurately and effectively identify the N marked center points in the brightness image; and then the affine transformation matrix can be accurately fitted through the N marked center points to meet the welding positioning accuracy of the flat wire stator to be processed under 3D vision guidance.
[0054] In some possible implementations, the software control system performs linear fitting on the N marking center points to obtain fitting results; and performs minimum error analysis on the fitting results to obtain the affine transformation matrix. For example, the least squares method is used to perform linear fitting on the conversion relationship of the coordinates corresponding to the N marking center points, and the minimum error value is calculated for the obtained fitting results, thereby obtaining the affine transformation matrix H. In this way, after identifying multiple marking centers of the brightness image, the least squares method is used to perform linear fitting on the multiple marking centers, so that the affine transformation matrix can be quickly and accurately obtained to facilitate the calculation of the welding execution coordinates.
[0055] In some possible implementations, the pixel points in the i-th row of each pixel area in the N pixel areas are traversed to obtain the center point of the i-th row. Among them, j is the column coordinate corresponding to the jth pixel, g _j is the grayscale value corresponding to the pixel in the i-th row and j-th column; n and m are the number of pixels; for example, traverse the pixel P in each row from left to right. i (pixel point in row i), get the column coordinates corresponding to the point where the grayscale minimum value is located After obtaining the center points of each row, a linear fit is performed on the center points of each row, and the minimum error sum of squares of each row is determined. To obtain multiple vertical lines; where i represents the row coordinate corresponding to the i-th pixel point; a and b represent the slope and intercept of the line respectively.
[0056] Afterwards, the pixel points in the i-th column of each pixel area are traversed to obtain the center point of the i-th column Among them, g i is the grayscale value corresponding to the pixel in the jth column and the ith row. For example, traverse the pixel points P in each column from top to bottom. j (pixel point in column j), get the row coordinates corresponding to the point where the grayscale minimum value is located After obtaining the center points of each column, a linear fit is performed on the center points of each column, and the minimum error sum of squares of each column is determined. To obtain multiple horizontal straight lines; where j represents the column coordinate corresponding to the j-th pixel point.
[0057] Finally, based on the intersections between the multiple vertical lines and the multiple horizontal lines, the N marking center points are obtained. For example, the intersection of every two lines is used as a marking center point, thereby obtaining N marking center points. Here, a linear fit is performed on the center points of all columns, and a theoretical horizontal straight line is obtained by calculating the minimum square error. The intersection of every two theoretical lines can be obtained to obtain the center coordinates of the marking point (Row n , Col n ), that is, N marking center points are obtained. And the pixel coordinates corresponding to the N marking center points are recorded, and the least squares method is used to perform linear fitting on the conversion relationship of these N points to calculate the minimum error Among them, Row [i] Indicates the row coordinates of the center point of the i-th marker, Col [i] represents the column coordinates of the center point of the i-th marker; X [i] and Y [i] Respectively represent the horizontal and vertical coordinates of the center of the i-th marker point in the world coordinate system. Finally, the affine transformation matrix is obtained In this way, by traversing the pixel points in each row and each column, the center point of each row and the center point of each column can be quickly obtained. After that, linear fitting is performed through the center points of each row and each column to obtain vertical and horizontal straight lines. Then, N marked center points can be obtained through the intersection of the two straight lines, so that the affine transformation matrix can be calculated more conveniently.
[0058] 203. Based on the affine transformation matrix, a depth image of the flat wire stator to be processed is acquired.
[0059] Here, after obtaining the affine transformation matrix H, the surface image of the flat wire stator to be welded and processed is formally collected. Since the characteristics of the copper wire of the flat wire stator to be processed in the depth direction are more obvious than the brightness, the welding point coordinates extracted by the image processing algorithm are more accurate, so the image acquisition mode of the 3D vision module is switched to the depth map mode, and the stator rotating device is controlled to rotate 360°, and the 3D vision module collects the depth image of the surface of the flat wire stator to be processed.
[0060] 204 . Determine welding execution coordinates of the flat wire stator to be processed based on the affine transformation matrix and the depth image.
[0061] Here, the depth image is collected through the affine transformation matrix H. In some possible implementations, due to the particularity of the marking design, it is on the same plane as the tooling, and it is difficult to distinguish the gray value difference through the algorithm in the depth image. However, the brightness difference between the marking point and the surrounding background can better extract its center, and then automatically identify the center coordinates of the brightness image.
[0062] In some possible implementations, first, based on the depth image, multiple pixel coordinates of the flat wire stator to be processed are determined; then, based on the multiple pixel coordinates and the affine transformation matrix, the welding execution coordinates are determined. Here, after the 3D vision module acquires the depth image, the host computer system performs an inverse polar coordinate transformation on the depth image, analyzes the depth features, and deletes the unqualified welding point coordinates to obtain multiple pixel coordinates. In this way, by performing depth feature analysis on the depth image, unreasonable welding point coordinates are eliminated to obtain more accurate multiple pixel coordinates, thereby being able to more effectively guide the welding operation.
[0063] In some possible implementations, the host computer system performs an inverse polar coordinate transformation on the depth image to obtain an original depth image; based on the original depth image, the depth features of each group of copper wire areas of the flat wire stator to be processed are determined; and when the depth features meet the preset depth threshold, the center point of each group of copper wire areas is identified to obtain the multiple pixel coordinates. In this way, the welds whose joint height difference, misalignment and gap values do not meet the welding process in the depth image are correctly screened out by the preset depth threshold, and the coordinates of qualified welds that can be used for welding processing are calculated, ensuring the accurate identification of the welding state of each flat wire joint and the precise guidance and positioning of each flat wire joint weld.
[0064] Here, the host computer receives the depth image and performs polar coordinate inverse transformation image reconstruction to obtain the original depth image. Then, the copper wires are arranged from the outside to the inside along the circumferential direction and numbered (taking the flat wire stator with a diameter of 204 mm and 48 slots to be processed as an example, there are 180 groups of copper wires in total). The image processing algorithm analyzes the depth characteristics of each group of copper wire areas in turn, including: height difference H, misalignment M and gap G. According to the welding process requirements, a preset depth threshold is set, including: preset height difference threshold Hmax, preset misalignment threshold Mmax, preset gap threshold Gmax; when and only when (H≤Hmax&M≤Mmax&G≤Gmax), the center point coordinates of the depth image are identified, and the remaining unqualified welds are screened out. Finally, X (0≤X≤180) pixel coordinates are obtained, and then the affine transformation matrix is used to calculate the welding execution coordinates corresponding to these X welds. The communication between the 3D vision system and the host computer of the welding actuator is established, and the coordinates of the X welding points are sent to the welding control software in sequence through the Transmission Control Protocol (TCP). The software monitors the welding process of the flat wire stator to be processed in real time, and realizes the welding process of the flat wire stator to be processed under the guidance of 3D vision.
[0065] Among them, the visual calibration process can be Figure 3 The steps shown achieve:
[0066] 301, the image processing software in the host computer first performs polar coordinate inverse transformation on the acquired brightness image to reconstruct the original brightness image of the stator end face.
[0067] 302, set a global fixed threshold, and extract a set of all pixels whose grayscale values are greater than the threshold.
[0068] 303, dividing the N marking areas according to the number of marking points and analyzing them separately, shielding the cross-overlapping areas.
[0069] 304, traverse the pixel points in each row from left to right, obtain the column coordinates corresponding to the point where the grayscale minimum value is located, and obtain the center point of the row.
[0070] 305, perform linear fitting on the center points of all rows, calculate the minimum sum of square errors, and obtain a theoretical vertical straight line.
[0071] 306, traverse the pixel points in each column from top to bottom, obtain the row coordinates corresponding to the point where the grayscale minimum value is located, and obtain the center point of the column.
[0072] 307, perform linear fitting on the center points of all columns, calculate the minimum sum of square errors, and obtain a theoretical horizontal straight line.
[0073] 308, calculating the intersection of the two straight lines to obtain the center coordinates of the marked point.
[0074] 309, use the least square method to perform linear fitting on the transformation relationship of the central coordinates of the N marking points, calculate the minimum error, and obtain the affine transformation matrix.
[0075] After obtaining the affine transformation matrix H, the depth image of the flat wire stator to be processed is formally collected. Since the characteristics of the stator copper wire in the depth direction are more obvious than the brightness, the weld coordinates extracted by the image processing algorithm are more accurate, so the image acquisition mode of the 3D line scan camera is switched to the depth map mode, and the rotating device is controlled to rotate 360°, and the 3D line scan camera collects the depth image of the surface of the flat wire stator to be processed.
[0076] 205 , performing a welding operation on the flat wire stator to be processed based on the welding execution coordinates.
[0077] In an embodiment of the present invention, in a laser marking scenario, by collecting the brightness image and depth image of the flat wire stator to be processed, the welding execution coordinates of the flat wire stator to be processed can be more accurately determined, so that the welding execution coordinates can be used to more effectively guide the welding execution component to perform welding operations on the flat wire stator to be processed.
[0078] The present invention provides a flat wire stator 3D vision guided welding device, please refer to Figure 6 , which shows a schematic diagram of the composition structure of a flat wire stator 3D vision-guided welding device provided by an embodiment of the present invention, the device includes: a welding execution component 1, a stator rotation device 3, a 3D vision module 5, a motion control module 4 and a host computer system 2; wherein:
[0079] The stator rotating device 3 is used to fix the flat wire stator to be processed in the laser marking scene and drive the flat wire stator to be processed to rotate.
[0080] Here, the flat wire stator to be processed is fixed in the stator rotating device 3, and is driven by the rotating device to rotate 360° for scanning, so that the 3D vision module can perform an all-round scanning on the flat wire stator to be processed.
[0081] The motion control module 4 has the 3D vision module installed at its end, which is used to control the motion of the 3D vision module and the motion of other mechanical parts.
[0082] The 3D vision module 5 is used to collect the brightness image and depth image of the flat wire stator to be processed.
[0083] Here, the 3D vision module can be realized by a 3D laser camera. 3D vision module: installed at the end of the motion control module, responsible for image acquisition and processing.
[0084] In some possible implementations, the motion control module 4 is used to control the 3D vision module to move to the area directly above the copper wire of the flat wire stator to be processed and move radially along the flat wire stator to be processed. Since the 3D vision module is installed at the end of the motion control module, the motion control module can drive the 3D vision module 5 to move to the area directly above the copper wire of the flat wire stator to be processed, and control the laser line of the 3D vision module to be emitted radially along the flat wire stator to be processed, so as to determine the image acquisition point based on the model information corresponding to the 3D vision module.
[0085] Here, the motion control module includes a servo module, and the servo module drives the 3D vision module to reach an image acquisition point or a processing avoidance point.
[0086] The stator rotating device is used to drive the stator of the flat wire to be processed to rotate 360°.
[0087] The 3D vision module is used to perform 360° image acquisition on the flat wire stator to be processed based on the image acquisition points to obtain the brightness image.
[0088] Here, the model information corresponding to the 3D vision module can be the model of the 3D line scan camera. The motion control module drives the 3D line scan camera to move to the area directly above the stator copper wire and moves along the radial direction of the flat wire stator to be processed. The height is determined according to the field of view corresponding to the camera model, and this is recorded as the image acquisition point. The image acquisition mode of the 3D3D vision module is set to the brightness image mode. Subsequently, the stator rotating device drives the flat wire stator to be processed to rotate 360°, and the 3D vision module acquires the brightness image of the copper wire area on the surface of the flat wire stator to be processed.
[0089] The 3D vision module is installed at the end of the motion control module, and is driven by the servo module in the motion control module to reach the image acquisition point and the processing avoidance point respectively. The flat wire stator to be processed is fixed in the stator rotating device, and is driven by the stator rotating device to rotate 360° for scanning; the welding execution component is installed on a movable bracket, and the appropriate processing range and height are adjusted by controlling its movement. The welding equipment is equipped with a corresponding host computer and software control system to ensure the smooth progress of the welding process. In this way, the movement of the 3D vision module is controlled by the motion control module, and the image acquisition point can be accurately located according to the model information corresponding to the 3D vision module; at the same time, the stator rotating device drives the flat wire stator to be processed to rotate 360°, so that the 3D vision module can perform 360° image acquisition on the flat wire stator to be processed based on the image acquisition point, so as to accurately acquire the brightness image of the flat wire stator to be processed.
[0090] The host computer system 2 is used to perform visual calibration on the brightness image to obtain an affine transformation matrix; based on the affine transformation matrix and the depth image, determine the welding execution coordinates of the flat wire stator to be processed.
[0091] In some possible implementations, the host computer system includes: a software control system and a host computer; wherein:
[0092] The software control system is used to visually calibrate the brightness image based on the marking points of the outer ring of the tooling disk of the flat wire stator to be processed to obtain N marking center points of the brightness image; and determine the affine transformation matrix based on the N marking center points of the brightness image.
[0093] Here, the movable bracket drives the welding actuator to move to the top of the flat wire stator to be processed, adjusts the center point of the welding actuator to align with the center of the circle of the flat wire stator to be processed, and adjusts the height to the optimal position according to the parameters of the equipment. The flat wire stator to be processed is installed in the stator rotating device, and the surface is equipped with a tooling for fixing the copper wire and visual calibration of the system. First, adjust the appropriate welding parameters in the software control system. Then, input N coordinate values (where N is an integer greater than or equal to 3) in sequence along the circumferential direction on the outer ring of the tooling disk of the flat wire stator to be processed, and the position is roughly evenly divided. Turn on the marking mode and mark the "×" shape on the tooling disk in turn. Among them, after the marking is completed, record the coordinates of these N points, and move the welding actuator to the avoidance point of the map.
[0094] The host computer is used to determine the welding execution coordinates based on the depth image and the affine transformation matrix. In this way, by combining the marking points of the outer ring of the tooling disk of the flat wire stator to be processed, the brightness image is visually calibrated, and the N marking center points of the brightness image can be more accurately determined, so as to facilitate the calculation of the affine transformation matrix. The depth image of the flat wire stator to be processed can be more accurately collected through the affine transformation matrix, and then the welding execution coordinates can be more effectively determined by combining the depth image and the affine transformation matrix.
[0095] The welding execution component 1 is used to perform a welding operation on the flat wire stator to be processed based on the welding execution coordinates.
[0096] During welding, the flat wire stator to be processed is fixed in the stator rotating device and visual calibration is performed; the welding execution component is moved to the top of the flat wire stator to be processed, and its center point is adjusted to align with the center of the circle of the flat wire stator to be processed; the 3D vision module is moved to the area just above the copper wire of the flat wire stator to be processed under the control of the motion control module, and the stator rotating device drives the flat wire stator to be processed to rotate 360°, and the 3D vision module collects the brightness image of the surface of the flat wire stator to be processed; the software control system uses the brightness difference between the marking point and the surrounding background based on the brightness image to identify the center coordinates of the brightness image; the stator rotating device drives the flat wire stator to rotate 360°, and the 3D vision module collects the depth image of the surface of the flat wire stator to be processed; the software control system selects qualified welding points based on the depth map, calculates the welding execution coordinates corresponding to the qualified welding points, and sends them to the welding execution component for welding.
[0097] In an embodiment of the present invention, in a flat wire stator 3D vision-guided welding device, a stator rotating device is used to fix the flat wire stator to be processed, and the flat wire stator to be processed is driven to rotate, so as to drive the flat wire stator to be processed to rotate 360°, so as to facilitate the 3D vision module to perform image scanning on the flat wire stator to be processed. The movement of the 3D vision module is controlled by a motion control module; the 3D vision module is installed at the end of the motion control module, and is used to collect the brightness image and depth image of the flat wire stator to be processed; in this way, the movement of the 3D vision module is controlled by the motion control module, so that the 3D vision module can collect the brightness image and the depth image more accurately. Afterwards, the upper computer system obtains an affine transformation matrix by visually calibrating the brightness image; based on the affine transformation matrix and the depth image, the welding execution coordinates of the flat wire stator to be processed are determined; in this way, by visually calibrating the brightness image, the affine transformation matrix corresponding to the brightness image can be more accurately identified, so as to more effectively collect the depth image, so as to combine the depth image and the affine transformation matrix, and the welding execution coordinates of the flat wire stator to be processed can be accurately calculated. Finally, the welding execution component performs welding operation on the flat wire stator to be processed based on the welding execution coordinates. In this way, the welding execution component can be guided to perform welding operation more efficiently through more accurate welding execution coordinates to improve welding quality.
[0098] Optionally, the transmission medium can be a wired link (for example, but not limited to, coaxial cable, optical fiber and digital subscriber line (DSL), etc.) or a wireless link (for example, but not limited to, wireless Fidelity (WIFI), Bluetooth and mobile device network, etc.). It should be noted that: the device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the method embodiments provided in the above embodiments belong to the same concept. The specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0099] Figure 7 is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention. Figure 7 As shown, the computer device 700 includes: a memory 701, a processor 702, and a computer program 703 stored in the memory 701 and running on the processor 702, wherein when the processor 702 executes the computer program 703, the computer device can execute any one of the flat wire stator 3D vision-guided welding methods described above.
[0100] In addition, an embodiment of the present invention also protects a system, which may include a memory and a processor, wherein the memory stores an executable program code, and the processor is used to call and execute the executable program code to execute a flat wire stator 3D vision-guided welding method provided by an embodiment of the present invention.
[0101] This embodiment can divide the system into functional modules according to the above method example. For example, each functional module can be corresponding, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware.
[0102] It should be noted that the division of modules in this embodiment is schematic, which is only a logical function division, and there may be other division methods in actual implementation. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here. It should be understood that the device provided in this embodiment is used to perform the above-mentioned flat wire stator 3D visual guided welding method, so the same effect as the above-mentioned implementation method can be achieved. In the case of an integrated unit, the device may include a processing module and a storage module. Among them, when the device is applied to a device, the processing module can be used to control and manage the action of the device. The storage module can be used to support the device to execute mutual program codes, etc. Among them, the processing module can be a processor or a controller, which can implement or execute various exemplary logical boxes, modules and circuits described in conjunction with the disclosure of the present invention. The processor can also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc., and the storage module can be a memory.
[0103] In addition, the device provided in the embodiment of the present invention may be a chip, a component or a module, and the chip may include a connected processor and a memory; wherein the memory is used to store instructions, and when the processor calls and executes the instructions, the chip may execute a flat wire stator 3D visual guided welding method provided in the above embodiment. This embodiment also provides a computer readable storage medium, in which a computer program code is stored, and when the computer program code is run on a computer, the computer executes the above related method steps to implement a flat wire stator 3D visual guided welding method provided in the above embodiment.
[0104] This embodiment also provides a computer program product, when the computer program product is run on a computer, the computer executes the above-mentioned related steps to implement a flat wire stator 3D vision-guided welding method provided in the above embodiment. Among them, the device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above, so the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0105] Through the description of the above implementation mode, the technicians in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual application, the above-mentioned function distribution can be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In the embodiments provided by the present invention, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point, 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.
[0106] It should be noted that the sequence of the above-mentioned embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The process depicted in the accompanying drawings does not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or may be advantageous. The various embodiments in this specification are described in a progressive manner, and the same and similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments. The above content is only a specific implementation method of the present invention, but the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered within the protection scope of the present invention.
Claims
1. A 3D vision-guided welding method for flat wire stators, characterized in that: The method comprises: In the laser marking scenario, a brightness image of the flat wire stator to be processed is obtained; Performing visual calibration on the brightness image to obtain an affine transformation matrix; Based on the affine transformation matrix, acquiring a depth image of the flat wire stator to be processed; Determining welding execution coordinates of the flat wire stator to be processed based on the affine transformation matrix and the depth image; Based on the welding execution coordinates, a welding operation is performed on the flat wire stator to be processed.
2. A flat wire stator 3D vision-guided welding method according to claim 1, characterized in that: The visual calibration of the brightness image to obtain an affine transformation matrix includes: Marking the outer ring of the tooling disk of the flat wire stator to be processed to obtain N marking points, wherein N is an integer greater than or equal to 3; Based on the N marking points on the outer ring of the tooling disk of the flat wire stator to be processed, visually calibrate the brightness image to obtain N marking center points of the brightness image; Based on the N labeled center points of the brightness image, an affine transformation matrix is determined.
3. A flat wire stator 3D vision-guided welding method according to claim 2, characterized in that: The visual calibration of the brightness image based on the N marking points of the outer ring of the tooling disk of the flat wire stator to be processed to obtain the N marking center points of the brightness image includes: Reconstructing the brightness image to obtain an original brightness image; Based on the preset global threshold G T The grayscale of the original brightness image is extracted to obtain a grayscale value greater than or equal to the preset global threshold G. T Pixel set P ij ; Where i and j represent the i-th row and j-th column respectively; Divide the pixel point set into regions according to the number of the N marking points to obtain N pixel regions; Linear fitting is performed on the N pixel regions respectively to obtain N marking center points.
4. A flat wire stator 3D vision-guided welding method according to claim 3, characterized in that: The step of dividing the pixel point set into regions according to the number of the marking points to obtain N pixel regions comprises: Dividing the pixel point set into regions according to the number of the marking points to obtain a plurality of initial regions; The overlapping areas in the multiple initial areas are shielded to obtain the N pixel areas.
5. A flat wire stator 3D vision-guided welding method according to claim 3, characterized in that: The performing linear fitting on the N pixel regions respectively to obtain N marking center points comprises: Traverse the pixel points in the i-th row of each pixel area in the N pixel areas to obtain the center point of the i-th row Among them, j is the column coordinate corresponding to the jth pixel, g _j is the grayscale value corresponding to the pixel in the i-th row and j-th column; n and m are the number of pixels; Perform a linear fit on the center points of each row and determine the minimum sum of squared errors for each row To obtain multiple vertical lines; where i represents the row coordinate corresponding to the i-th pixel point; a and b represent the slope and intercept of the line respectively; Traverse the pixel points in the i-th column of each pixel area to obtain the center point of the i-th column Among them, g i is the gray value corresponding to the pixel in the jth column and the ith row; Perform a linear fit on the center points of each column and determine the minimum sum of squared errors for each column To obtain multiple horizontal straight lines; where j represents the column coordinate corresponding to the jth pixel point; Based on the intersections between the plurality of vertical straight lines and the plurality of horizontal straight lines, the N marking center points (Row n , Col n ).
6. A flat wire stator 3D vision-guided welding method according to claim 2, characterized in that: The determining of the affine transformation matrix based on the N marked center points of the brightness image comprises: Performing linear fitting on the N marked center points to obtain a fitting result; Performing minimum error analysis on the fitting result to obtain the affine transformation matrix.
7. A flat wire stator 3D vision-guided welding method according to claim 1, characterized in that: The step of determining the welding execution coordinates of the flat wire stator to be processed based on the affine transformation matrix and the depth image comprises: Based on the depth image, determining a plurality of pixel coordinates of the flat wire stator to be processed; The welding execution coordinates are determined based on the plurality of pixel coordinates and the affine transformation matrix.
8. A flat wire stator 3D vision-guided welding method according to claim 7, characterized in that: The step of determining a plurality of pixel coordinates of the flat wire stator to be processed based on the depth image comprises: Performing an inverse polar coordinate transformation on the depth image to obtain an original depth image; Determining the depth characteristics of each group of copper wire regions of the flat wire stator to be processed based on the original depth image; When the depth feature meets a preset depth threshold, the center point of each group of copper wire areas is identified to obtain the multiple pixel coordinates.
9. A flat wire stator 3D vision-guided welding method according to claim 8, characterized in that: When the depth feature satisfies a preset depth threshold, identifying the center point of each group of copper wire areas to obtain the multiple pixel coordinates includes: Based on the depth characteristics, determining the height difference, misalignment and gap of each group of copper wire areas; When the height difference is less than a preset height difference threshold, the misalignment is less than a preset misalignment threshold, and the gap is less than a preset gap threshold, the center point of each group of copper wire areas is identified to obtain the multiple pixel coordinates.
10. A flat wire stator 3D vision-guided welding device, characterized in that: The device comprises: A stator rotating device, used to fix the flat wire stator to be processed in the laser marking scene, and drive the flat wire stator to be processed to rotate; A 3D vision module, used to collect a brightness image and a depth image of the flat wire stator to be processed in the laser marking scene; A motion control module, at the end of which the 3D vision module is installed, is used to control the 3D vision module to move to the area just above the copper wire of the flat wire stator to be processed and move along the radial direction of the flat wire stator to be processed, so as to determine the image acquisition point based on the model information corresponding to the 3D vision module; The host computer system is used to perform visual calibration on the brightness image to obtain an affine transformation matrix; based on the affine transformation matrix and the depth image, determine the welding execution coordinates of the flat wire stator to be processed; The welding execution component is used to perform a welding operation on the flat wire stator to be processed based on the welding execution coordinates.
Citation Information
Cited By
Robot vision detection method and system based on image enhancement
CN120563475A