Disclosure of Invention
Aiming at the defects or improvement requirements of the prior art, in order to ensure that the tail end of the robot moves in a preset direction strictly, improve the extraction speed of a three-dimensional point cloud model and reduce the memory space of a memory, the invention adopts a 'segmented identification' strategy to segment the whole welding line into a plurality of segments, the robot autonomously moves to scan each segment of the welding line to finish the identification of local welding line information and update the global welding line information, and simultaneously utilizes the information extracted from the current segment to adjust the tail end pose of the robot and guide the robot to autonomously move, so that after the extraction of each segment of the welding line is finished, the global position and height information of the welding line is obtained, and the robot is controlled to finish the welding line polishing task.
The invention is realized by the following technical scheme:
a robot welding seam grinding algorithm based on feature point identification comprises the following steps:
s1, dividing the whole welding seam into a plurality of small segments, and scanning the small segments by a robot in a segmented manner to obtain a point cloud model of the whole welding seam polishing scene;
s2, performing a local weld joint recognition algorithm on the point cloud model to complete recognition of local weld joint information;
s3, adjusting the motion of the robot by using the information extracted by the local welding seam algorithm, automatically completing welding seam scanning, and continuously updating the global welding seam information so as to obtain the global position and height information of the welding seam;
and S4, controlling the robot to finish automatic grinding of the welding line by using the welding line information.
Preferably, in the step S2, the local identification algorithm is:
(1) controlling the robot to move to an initial position through an interactive interface, and setting an initial movement direction and an initial movement distance of the robot to complete scanning and identification of a first section of welding line;
(2) determining the motion direction of the robot in the next scanning process by using the direction vector of the welding line of the current section; and determining the movement distance of the robot in the next scanning process by using the length of the scanning welding line in the current section, and repeating the scanning in the subsequent section until the whole welding line is scanned.
According to the optimization of the technical scheme, the local welding seam identification algorithm is to extract the normal vector of the welding seam, the direction information and the height information of the welding seam from the three-dimensional point cloud model.
Preferably, in step S3, the core of the global weld information updating algorithm is to splice the end points of the local weld into the global weld information, calculate more accurate global weld direction information by straight line fitting, and finally plan the polished path by using the intermediate path points inserted in the fitted straight line.
In general, compared with the prior art, the above technical solution contemplated by the present invention can achieve the following beneficial effects:
(1) the robot welding seam polishing algorithm ensures that the tail end of the robot moves strictly according to the preset direction through sectional identification.
(2) The robot welding seam polishing algorithm solves the problem of low welding seam feature extraction speed, improves the extraction speed and reduces the data storage of the three-dimensional point cloud model.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to fig. 1 to 8 and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
Example 1
As shown in fig. 1, a robot weld grinding algorithm based on feature point identification includes the following steps:
s1, dividing the whole welding seam into a plurality of small sections, and scanning the small sections by the robot in a segmented manner to obtain a point cloud model of the welding seam polishing scene;
s2, performing a local weld joint recognition algorithm on the point cloud model to complete recognition of local weld joint information;
s3, adjusting the motion of the robot by using the information extracted by the local welding seam algorithm, automatically completing welding seam scanning, and continuously updating the global welding seam information so as to obtain the global position and height information of the welding seam;
and S4, controlling the robot to finish automatic grinding of the welding line by using the welding line information.
As shown in fig. 2, in the welding seam grinding algorithm of the robot in the embodiment, in step S1, the plane where the welding seam is located is the target plane, and two end points of the whole welding seam are P respectivelyAAnd PBFrom the starting point, the weld is broken up into a number of segments, each segment being considered a local weld. Define each fragment as Pa0、Pb0、Pb1........。
The weld grinding robot mentioned in the present embodiment is common knowledge in the art.
In the weld grinding algorithm of the robot in this embodiment, the local identification algorithm in step S2 is:
(1) controlling the robot to move to an initial position through an interactive interface, and setting an initial movement direction and an initial movement distance of the robot to complete scanning and identification of a first section of welding line;
(2) determining the motion direction of the robot in the next scanning process by using the direction vector of the welding line of the current section; and determining the movement distance of the robot in the next scanning process by using the length of the scanning welding line in the current section, and repeating the scanning in the subsequent section until the whole welding line is scanned.
As shown in fig. 2 and 3, the specific steps of the "segment identification" policy in step S2 are as follows: firstly, the robot is controlled to move through an interactive interface when the laser sensor is positioned at Pa0Nearby, stopping interaction to obtain a scanning point set of a current local area, wherein the local area comprises a base material and a welding line; then, setting an initial movement direction Dir and an initial movement Step length Step of the robot, and finishing the scanning and identification of the first section of welding line; secondly, determining the motion direction of the robot in the next scanning process by using the direction vector of the welding line of the current section, namely updating the value of Dir; determining the motion Step length of the robot in the next scanning process by using the length of the scanning weld of the current segment, namely updating the value of Step, and repeating the following partial scanning of the weld segment until P is scannedBAnd finishing the whole welding seam scanning.
Wherein, the updating of the Dir value and the Step value is the core of the automatic guide control algorithm; and for each section of local welding seam, extracting effective information by adopting a local welding seam identification algorithm and a global welding seam information updating algorithm.
In step S2 of this embodiment, the local identification algorithm mainly includes the steps of obtaining a point cloud model, preprocessing the point cloud model, extracting a feature line at the intersection of a weld and a parent metal, extracting a normal vector of a weld plane and a parent metal plane, calculating a motion direction of the weld, and calculating a height of the weld, and a specific flowchart is shown in fig. 3.
Wherein, a point cloud model is obtained, which is completed by step S1.
Point cloud model preprocessing, namely controlling the robot to move through an interactive interface, and when the laser sensor is positioned at Pa0And nearby, stopping interaction to obtain a scanning point set of the current local area, wherein the local area comprises a base material and a welding line.
Extracting characteristic lines at the intersection of the welding line and the parent metal as follows:
the characteristic line, the intersection line of the welding seam and the base metal can be a straight line or a curve, and the direction of the straight line or the tangential direction of the curve at the point is expressed in a mathematical form as a direction vector.
The characteristic points of the joint of the welding line and the parent metal can be known as second-order characteristic points through analysis. Calculating the discrete curvature of the data points using the quadratic difference is shown in fig. 4. In order to identify second-order feature points in point cloud data, the scheme designs a function F(s)i) To measure the data point PiSecond order discontinuity of (a).
Wherein k isiIs a data point PiThe second difference is calculated as:
(1) known data point Pi(i ═ 0,1, … m), chord length was calculated:
(2) calculating a first order difference quotient:
(3) calculating a second order difference quotient:
(4) discrete curvature (derivative definition derivation):
ki=2|T[si+1,si,si-1]|
as shown in fig. 5, the second-order curvature of the point cloud data is calculated, and then points where the second-order curvature changes suddenly are searched, and these points are feature points between the weld and the base material, and all the feature points are connected in sequence to form a line, which is a feature line.
Extracting normal vectors of a welding line plane and a base material plane, and firstly triangularizing point cloud data, namely applying a Delaunay triangular mesh reconstruction algorithm to triangulate the point cloud data. The triangulated point cloud model is shown in fig. 6. Then, the normal vectors of all triangular patches relevant to the target point are obtained, and finally, the average value of the normal vectors is obtained to be used as the normal vector of the feature point.
The normal vector calculation method of the triangular patch is to calculate the equation of the plane where the triangular patch is located according to the vertex coordinates of the triangle measured by the laser sensor, and then calculate the normal vector of the plane.
The Delaunay triangulation reconstruction algorithm mentioned here is a known algorithm, and the specific algorithm is not described in detail in this embodiment.
Calculating the moving direction of the welding seam and the height of the welding seam, wherein the moving direction and the direction of the welding seam are the trend of the welding seam and are mathematically and accurately the direction vector described above; height of the weld (height information), height of the weld projection. As follows: and fitting the data points by using a cubic B-spline curve aiming at the characteristic line, and then calculating a tangent vector of an endpoint, namely the movement direction of the welding seam. And (3) projecting the discrete data points on the plane of the base material to the triangular surface patch along the normal vector of the discrete data points, recording projection points, and calculating to obtain the height of the welding line as the distance between the discrete points on the base material and the projection points.
In step S3 of this embodiment, the core of the global weld information updating algorithm is to splice the end points of the local welds into the global weld information, use the end point of the current local weld as the starting point of the next local weld, calculate more accurate global weld direction information through a straight line fitting algorithm, and finally insert the midpoint in the fitted straight line sequence as the polishing path.
The weld grinding requires obtaining global information of the weld, i.e., direction information (direction is the direction of the weld, mathematically and precisely the direction vector described above) and height information (height of weld projection) of the entire weld.
The direction of the global weld is described herein by the local weld end point and the height by the local maximum height. In the strategy of 'sectional identification', the whole welding seam is divided into a plurality of sections, a section of characteristic line is extracted from the first section, a section of characteristic line is extracted from the second section, and the like. In the global direction, all the characteristic lines are updated and combined, and then the parameter curve is used for fitting, so that a complete polishing track can be obtained.
And the global weld height determines the grinding feed amount and grinding times during grinding, and after the weld height of each section is obtained in local weld identification, the maximum height of all local section welds is used as the global weld height.
The specific implementation example is as follows:
one specific embodiment of the sanding algorithm is as follows:
the motorcycle oil tank is formed by punching and forming two 1.2mm thin plates and then symmetrically welding, and the welding line is the intersection line of the symmetrical middle plane of the oil tank and the surface of the oil tank, which is shown in figure 7.
As shown in fig. 7 and 8, which show the front and top views of the tank, the weld is shown as a bold line, the length of the weld measured before the start of the grinding is 60mm, the weld is divided empirically into 6 segments, each segment length Si 10mm, and i 1,2, …, 6. The more segments, the higher the calculation accuracy, but the longer the calculation time.
By laser scanning, first from PAAnd (3) point cloud information of a first section of welding line is obtained at the beginning of the point, and the point cloud of the section is reconstructed to obtain 21 triangular surface units, as shown in figure 9. Calculating all triangular patches related to each point in the point cloud to obtain normal vectors thereof, and finding a point Pf1Treating normal vector with mutation, recording Pf1Are characteristic points. Sequentially calculating and detecting all point clouds of the welding line to obtain all characteristic points P of the welding linef2,Pf3…. Will Pf1,Pf2,Pf3… are connected in turn according to B-spline curves to obtain weld characteristic lines.
Scanning the second section of welding line to obtain point cloud data by taking the tangential direction of the end point of the characteristic line of the first section of welding line as the scanning direction of the second section of welding lineAnd calculating to obtain a characteristic line of the second section of welding seam. And so on until P is scannedBAnd (4) point-counting to obtain the information of the whole welding seam.
It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.