Automatic normal attitude adjusting method and system for ultrasonic probe of curved surface component based on laser ranging
The attitude angle of the ultrasonic probe is calculated through a multi-point laser ranging sensor array and a differential geometry algorithm, and real-time correction is carried out in combination with the three-axis servo motor component, which solves the problems of low efficiency and poor accuracy of ultrasonic probe attitude adjustment, and realizes efficient and accurate detection of complex curved surface components.
Patent Information
- Application Number
- CN202510730078.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, ultrasonic probes have low attitude adjustment efficiency and poor accuracy, making it difficult to adapt to the automated detection needs of complex curved surface components, and traditional methods are prone to introduce artificial errors or damage to the measured surface.
The curved surface components are rasterized by using a multi-point laser ranging sensor array, combined with differential geometric algorithms and pose transformation matrix, the attitude angle parameters of the ultrasonic probe are automatically calculated, and real-time attitude correction is performed through the three-axis servo motor component to ensure that the probe normal is perpendicular to the curved surface.
Automatic adjustment of the normal direction of the ultrasonic probe is realized, detection efficiency and accuracy are improved, and it is adapted to various complex curved surface components, reducing human error and surface damage.
Smart Images

Figure CN120404934A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to laser technology, and particularly to a method and system for automatically adjusting the normal posture of an ultrasonic probe for a curved surface component based on laser ranging. Background Art
[0002] Ultrasonic testing technology is widely used in the defect detection of curved surface components in industrial production. To ensure the detection accuracy and reliability, the axis of the ultrasonic probe beam needs to be perpendicular to the measured curved surface. In the traditional ultrasonic testing process, the probe posture is usually manually adjusted, which is inefficient and difficult to ensure accuracy. Especially for curved surface components with complex shapes, manual adjustment is more difficult, prone to introducing human errors, and affecting the reliability of the detection results.
[0003] The traditional method of relying on manual adjustment of the ultrasonic probe posture is inefficient and inaccurate, and it is difficult to meet the requirements of modern industrial production for automation and high-precision detection.
[0004] Existing automated probe adjustment methods are mostly based on contact measurement, which requires the probe to contact the measured curved surface, easily scratches the measured surface, and is not applicable to curved surface components with complex shapes or easily damaged surfaces.
[0005] Some non-contact measurement methods, such as vision-based posture adjustment methods, are easily affected by lighting conditions and surface features, have poor robustness, and are difficult to ensure stability and reliability in complex environments. Summary of the Invention
[0006] Embodiments of the present invention provide a method and system for automatically adjusting the normal posture of an ultrasonic probe for a curved surface component based on laser ranging, which can solve the problems in the prior art.
[0007] In the first aspect of the embodiments of the present invention, A method for automatically adjusting the normal posture of an ultrasonic probe for a curved surface component based on laser ranging is provided, including: Performing raster scanning measurement on the surface of the curved surface component through a multi-point laser ranging sensor array arranged on the end effector of the robot, where the laser ranging sensor array includes a central ranging sensor and peripheral ranging sensors distributed in a ring array; collecting the distance information and angle information output by the laser ranging sensor array, and combining the position coordinates of the end effector of the robot to calculate multiple sets of spatial coordinate point data on the surface of the curved surface component; inputting the multiple sets of spatial coordinate point data into a preset surface fitting model for calculation to obtain the spatial geometric equation of the curved surface component, and dividing the spatial geometric equation into multiple detection regions; Select a detection position point as the detection center point of the ultrasonic probe in each detection area of the spatial geometric equation; calculate the surface normal vector at each of the detection center points using the differential geometry algorithm; establish a local coordinate system of the probe based on the axis of the ultrasonic probe beam, convert the normal vector from the global coordinate system to the local coordinate system of the probe, and construct a pose transformation matrix; calculate the attitude angle parameters of the ultrasonic probe at each detection center point based on the pose transformation matrix, where the attitude angle parameters include pitch angle, yaw angle, and roll angle; Convert the attitude angle parameters into motion control instructions for the end effector of the robot; drive a three-axis servo motor assembly mounted on the end effector of the robot through the motion control instructions, where the three-axis servo motor assembly includes a pitch axis motor, a yaw axis motor, and a roll axis motor arranged orthogonally to each other; detect the actual attitude angle of the ultrasonic probe in real time through angle encoders arranged on the three-axis servo motor assembly, and compare it with the expected attitude angle parameters in real time. When the detected attitude deviation exceeds a preset deviation threshold, trigger a compensation controller to perform real-time attitude correction.
[0008] Collect the distance information and angle information output by the laser range sensor array, and combine with the position coordinates of the end effector of the robot to calculate multiple sets of spatial coordinate point data on the surface of the curved surface component; input the multiple sets of spatial coordinate point data into a preset surface fitting model for calculation to obtain the spatial geometric equation of the curved surface component, and divide the spatial geometric equation into multiple detection areas including: Obtain the distance information and angle information output by the laser range sensor array, where the laser range sensor array includes a central laser range sensor and a plurality of peripheral laser range sensors distributed in a circular array, and the installation positions of the central laser range sensor and the plurality of peripheral laser range sensors determine a local coordinate system of the sensor; Convert the distance information and the angle information into first spatial coordinate point data in the local coordinate system of the sensor; establish a coordinate transformation matrix based on the position coordinates of the end effector of the robot, and convert the first spatial coordinate point data into second spatial coordinate point data in the global coordinate system through the coordinate transformation matrix; Construct a local weighted objective function using the moving least squares method, where the local weighted objective function includes a spatial weight function, and the spatial weight function adopts an exponential weighting form, where the exponential term is the opposite of the ratio of the square of the distance between the point to be fitted and the second spatial coordinate point data to the square of the influence radius; perform spatial partitioning on the second spatial coordinate point data using an octree structure to obtain multiple local areas, and establish local coordinate systems in the multiple local areas; Solve for the minimum value of the local weighted objective function in each of the local coordinate systems to obtain the coefficients of the local quadratic surface equation; combine the local quadratic surface equations of the multiple local regions to obtain a spatial geometric equation describing the entire surface component; Calculate the Gaussian curvature and mean curvature of each point on the surface of the surface component based on the spatial geometric equation; substitute the weighted sum of the Gaussian curvature and the mean curvature into the adaptive grid size calculation formula, where the grid size in the adaptive grid size calculation formula is proportional to the reciprocal square root of the curvature weighted sum; divide the spatial geometric equation into multiple overlapping detection regions according to the calculated grid size.
[0009] Select a detection position point as the detection center point of the ultrasonic probe in each detection region of the spatial geometric equation; use the differential geometry algorithm to calculate the surface normal vector at each detection center point; establish a local coordinate system of the probe based on the axis of the ultrasonic probe beam, and transform the normal vector from the global coordinate system to the local coordinate system of the probe. The pose transformation matrix includes: In each detection region of the spatial geometric equation, calculate the geometric center coordinates of the detection region, and use the geometric center coordinates as the first detection position; establish an exponential weight function considering the Gaussian curvature and mean curvature of the surface, substitute the Gaussian curvature value and mean curvature value of the first detection position into the exponential weight function for calculation, and perform position compensation on the first detection position according to the calculation result to obtain the second detection position; calculate the minimum distance from the second detection position to the boundary of the detection region. When the minimum distance is greater than the product of the ultrasonic probe beam radius and the cosine value of the maximum incident angle, determine the second detection position as the detection center point of the ultrasonic probe. At each detection center point, use the second-order central difference method based on the curvature adaptive step size to calculate the partial derivative value of the surface, and obtain two tangent vectors along the parametric coordinate direction at the detection center point according to the partial derivative value; perform a cross product operation on the two tangent vectors to obtain the normal vector at the detection center point, and perform normalization processing on the normal vector to obtain the unit normal vector, which is used to determine the direction of the axis of the ultrasonic probe beam. Establish a local coordinate system of the probe based on the axis of the ultrasonic probe beam, and determine the direction of the unit normal vector as the positive direction of the Z axis of the local coordinate system of the probe; perform a cross product operation on the unit vector of the X axis of the global coordinate system and the unit vector of the Z axis of the local coordinate system of the probe and normalize it to obtain the unit vector of the X axis of the local coordinate system of the probe; perform a cross product operation on the unit vector of the Z axis of the local coordinate system of the probe and the unit vector of the X axis of the local coordinate system of the probe to obtain the unit vector of the Y axis of the local coordinate system of the probe; combine the three orthogonal unit vectors of the local coordinate system of the probe by columns to construct a rotation matrix, and combine the rotation matrix with the spatial coordinates of the detection center point to form a pose transformation matrix.
[0010] Calculate the attitude angle parameters of the ultrasonic probe at each detection center point based on the pose transformation matrix. The attitude angle parameters include pitch angle, yaw angle, and roll angle, including: Extract nine elements of the rotation matrix based on the pose transformation matrix, and calculate the yaw angle parameter, pitch angle parameter, and roll angle parameter of the ultrasonic probe using the ZYX Euler angle decomposition order based on the rotation matrix. The yaw angle parameter represents the rotation angle of the ultrasonic probe around the Z axis, the pitch angle parameter represents the rotation angle of the ultrasonic probe around the Y axis, and the roll angle parameter represents the rotation angle of the ultrasonic probe around the X axis; Judge the calculation method of the pitch angle parameter based on the element in the first column of the third row of the rotation matrix. When the absolute value of the element in the first column of the third row is equal to one, assign a fixed angle. When the element in the first column of the third row is -1, assign the pitch angle parameter as +90 degrees. When the element in the first column of the third row is 1, assign the pitch angle parameter as -90 degrees. When the absolute value of the element in the first column of the third row is less than one, substitute the negative value of the element in the first column of the third row into the arcsine function to calculate the pitch angle parameter; Calculate the cosine value of the pitch angle parameter and use it as the singularity judgment basis. When the cosine value is not zero, divide the element in the first column of the second row of the rotation matrix by the cosine value to obtain the first quotient value, divide the element in the first column of the first row of the rotation matrix by the cosine value to obtain the second quotient value, substitute the first quotient value and the second quotient value into the arctangent function to calculate the yaw angle parameter, divide the element in the second column of the third row of the rotation matrix by the cosine value to obtain the third quotient value, divide the element in the third column of the third row of the rotation matrix by the cosine value to obtain the fourth quotient value, and substitute the third quotient value and the fourth quotient value into the arctangent function to calculate the roll angle parameter; When the cosine value is zero, assign the yaw angle parameter as zero, and select the calculation method of the roll angle parameter according to the positive or negative of the pitch angle parameter. When the pitch angle parameter is +90 degrees, substitute the element in the second column of the first row and the element in the third column of the first row of the rotation matrix into the arctangent function to calculate the roll angle parameter. When the pitch angle parameter is -90 degrees, substitute the negative value of the element in the second column of the first row and the negative value of the element in the third column of the first row of the rotation matrix into the arctangent function to calculate the roll angle parameter; Compare the calculated yaw angle parameter, pitch angle parameter, and roll angle parameter with their corresponding angle ranges respectively, and correct the parameters that exceed the angle range to ensure that the value range of the yaw angle parameter is from -180 degrees to +180 degrees, ensure that the value range of the pitch angle parameter is from -90 degrees to +90 degrees, ensure that the value range of the roll angle parameter is from -180 degrees to +180 degrees, calculate the change amount of the attitude angle parameter between adjacent detection center points and control it within the preset maximum change amount range; Substitute the Gaussian curvature value and the mean curvature value at the detection center point into a preset compensation function to calculate the attitude angle compensation amount, superimpose the attitude angle compensation amount with the yaw angle parameter, the pitch angle parameter, and the roll angle parameter respectively to obtain the compensated attitude angle parameter. When the cosine value corresponding to the compensated attitude angle parameter is less than the preset cosine threshold, perform a smooth transition process on the compensated attitude angle parameter using the spherical linear interpolation algorithm based on multiple reference points within the neighborhood of this detection center point to obtain the attitude angle parameter of the ultrasonic probe at each detection center point.
[0011] Substituting the Gaussian curvature value and the mean curvature value at the detection center point into a preset compensation function to calculate the attitude angle compensation amount includes: Based on the principle that the Gaussian curvature value characterizes the local geometric features of the surface, preset a yaw angle compensation function using the arctangent function. The yaw angle compensation function maps the Gaussian curvature value of the detection center point to the yaw angle compensation amount. When the Gaussian curvature value is positive, it indicates that the surface is elliptical and requires minimum compensation. When the Gaussian curvature value is negative, it indicates that the surface is hyperbolic and requires maximum compensation. Substitute the Gaussian curvature value of the detection center point into the yaw angle compensation function to obtain the corresponding yaw angle compensation amount; Based on the principle that the mean curvature value characterizes the concavity and convexity of the surface, preset a pitch angle compensation function using a linear function. The pitch angle compensation function maps the mean curvature value of the detection center point to the pitch angle compensation amount. The sign of the mean curvature value determines the compensation direction. A positive value corresponds to a convex surface and requires an increase in the pitch angle, while a negative value corresponds to a concave surface and requires a decrease in the pitch angle. Substitute the mean curvature value of the detection center point into the pitch angle compensation function to obtain the corresponding pitch angle compensation amount; Based on the principle that the Gaussian curvature and the mean curvature jointly describe the surface characteristics, preset a roll angle compensation function using a weighted summation function. The roll angle compensation function maps the Gaussian curvature value and the mean curvature value of the detection center point to the roll angle compensation amount. The weight of the Gaussian curvature value determines the compensation for the degree of distortion, and the weight of the mean curvature value determines the compensation for the degree of tilt. Substitute the Gaussian curvature value and the mean curvature value of the detection center point into the roll angle compensation function to obtain the corresponding roll angle compensation amount; According to the mechanical structure constraints of the ultrasonic probe, maximum compensation thresholds are respectively set for the yaw angle compensation amount, the pitch angle compensation amount, and the roll angle compensation amount, and the compensation amounts exceeding their respective maximum compensation thresholds are limited within corresponding preset ranges to obtain amplitude-limited compensation amounts that meet the mechanical constraints; the amplitude-limited yaw angle compensation amount, pitch angle compensation amount, and roll angle compensation amount are respectively added to the original angle parameters of the current probe attitude to obtain the compensated probe attitude angle parameters.
[0012] The actual attitude angle of the ultrasonic probe is detected in real time by angle encoders arranged on the three-axis servo motor assembly and compared with the expected attitude angle parameters in real time. When the detected attitude deviation exceeds the preset deviation threshold, the compensation controller is triggered to perform real-time attitude correction, including: A first angle encoder, a second angle encoder, and a third angle encoder are respectively arranged on the yaw axis, pitch axis, and roll axis of the three-axis servo motor assembly, and the signal output ends of the first angle encoder, the second angle encoder, and the third angle encoder are respectively connected to the signal processing unit; The signal processing unit samples and filters the angle signals output by the first angle encoder, the second angle encoder, and the third angle encoder, and converts the filtered angle signals into actual attitude angle data in a standard communication protocol format. The actual attitude angle data includes actual yaw angle data, actual pitch angle data, and actual roll angle data; Receive the expected attitude angle parameters sent by the probe control system. The expected attitude angle parameters include expected yaw angle parameters, expected pitch angle parameters, and expected roll angle parameters, and input the expected attitude angle parameters into the compensation controller; The compensation controller receives the actual attitude angle data sent by the signal processing unit in real time, performs a difference operation between the actual yaw angle data and the expected yaw angle parameters to obtain a yaw angle deviation, performs a difference operation between the actual pitch angle data and the expected pitch angle parameters to obtain a pitch angle deviation, and performs a difference operation between the actual roll angle data and the expected roll angle parameters to obtain a roll angle deviation; The compensation controller determines whether the yaw angle deviation, the pitch angle deviation, and the roll angle deviation exceed the corresponding preset deviation thresholds according to the preset yaw angle threshold, pitch angle threshold, and roll angle threshold. When any angle deviation exceeds the corresponding preset deviation threshold, attitude correction is triggered.
[0013] In the second aspect of the embodiments of the present invention, A normal automatic attitude adjustment system for an ultrasonic probe based on a laser ranging curved surface member is provided, including: The first unit is used to perform raster scanning measurement on the surface of a curved component through a multi-point laser ranging sensor array arranged on the end effector of the robot. The laser ranging sensor array includes a central ranging sensor and peripheral ranging sensors distributed in an annular array; collect the distance information and angle information output by the laser ranging sensor array, and combine the position coordinates of the end effector of the robot to calculate multiple sets of spatial coordinate point data on the surface of the curved component; input the multiple sets of spatial coordinate point data into a preset surface fitting model for calculation to obtain the spatial geometric equation of the curved component, and divide the spatial geometric equation into multiple detection regions; The second unit is used to select a detection position point as the detection center point of the ultrasonic probe in each detection region of the spatial geometric equation; calculate the surface normal vector at each detection center point by using the differential geometry algorithm; establish a local coordinate system of the probe with the axis of the ultrasonic probe beam as the reference, convert the normal vector from the global coordinate system to the local coordinate system of the probe, and construct a pose transformation matrix; calculate the attitude angle parameters of the ultrasonic probe at each detection center point based on the pose transformation matrix, and the attitude angle parameters include pitch angle, yaw angle, and roll angle; The third unit is used to convert the attitude angle parameters into motion control instructions for the end effector of the robot; drive a three-axis servo motor assembly installed on the end effector of the robot through the motion control instructions. The three-axis servo motor assembly includes a pitch axis motor, a yaw axis motor, and a roll axis motor arranged orthogonally to each other; detect the actual attitude angle of the ultrasonic probe in real time through an angle encoder arranged on the three-axis servo motor assembly, and compare it with the expected attitude angle parameters in real time. When the detected attitude deviation exceeds a preset deviation threshold, trigger a compensation controller to perform real-time attitude correction.
[0014] In the third aspect of the embodiments of the present invention, provide an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein, the processor is configured to call the instructions stored in the memory to execute the method described above.
[0015] In the fourth aspect of the embodiments of the present invention, provide a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described above is implemented.
[0016] The beneficial effects of this application are as follows: High degree of automation: The end effector of the robot is equipped with a laser ranging sensor array and an ultrasonic probe, and combined with the pose transformation matrix and motion control instructions, the automatic adjustment of the normal pose of the ultrasonic probe is realized, without manual intervention, improving the detection efficiency.
[0017] High detection accuracy: Through multi-point laser ranging and surface fitting algorithms, the spatial geometric equation of the curved surface component can be accurately obtained, and the surface normal vector at each detection center point can be calculated, so as to ensure that the ultrasonic probe is always perpendicular to the measured curved surface, improving the detection accuracy.
[0018] Strong adaptability: This method is applicable to the ultrasonic detection of various complex curved surface components. By adjusting the division of the detection area and the selection of the detection center points, it can flexibly cope with curved surface components of different shapes and sizes, with strong adaptability. Brief Description of the Drawings
[0019] Figure 1 It is a schematic flow chart of the method for automatically adjusting the normal pose of the ultrasonic probe of the curved surface component based on laser ranging in the embodiment of the present invention; Figure 2 It is a schematic structural diagram of the system for automatically adjusting the normal pose of the ultrasonic probe of the curved surface component based on laser ranging in the embodiment of the present invention. Detailed Embodiment
[0020] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0021] The technical solutions of the present invention will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0022] Figure 1 It is a schematic flow chart of the method for automatically adjusting the normal pose of the ultrasonic probe of the curved surface component based on laser ranging in the embodiment of the present invention, as Figure 1 shown, the method includes: S11. Perform raster scanning measurement on the surface of the curved component using a multi-point laser ranging sensor array arranged on the end effector of the robot. The laser ranging sensor array includes a central ranging sensor and peripheral ranging sensors distributed in a circular array. Collect the distance information and angle information output by the laser ranging sensor array, and combine with the position coordinates of the end effector of the robot to calculate multiple sets of spatial coordinate point data on the surface of the curved component. Input the multiple sets of spatial coordinate point data into a preset surface fitting model for calculation to obtain the spatial geometric equation of the curved component, and divide the spatial geometric equation into multiple detection regions. S12. Select a detection position point as the detection center point of the ultrasonic probe in each detection region of the spatial geometric equation. Use the differential geometry algorithm to calculate the surface normal vector at each detection center point. Establish a local coordinate system of the probe based on the axis of the ultrasonic probe beam, convert the normal vector from the global coordinate system to the local coordinate system of the probe, and construct a pose transformation matrix. Calculate the attitude angle parameters of the ultrasonic probe at each detection center point based on the pose transformation matrix. The attitude angle parameters include pitch angle, yaw angle, and roll angle. S13. Convert the attitude angle parameters into motion control instructions for the end effector of the robot. Drive a three-axis servo motor assembly installed on the end effector of the robot through the motion control instructions. The three-axis servo motor assembly includes a pitch axis motor, a yaw axis motor, and a roll axis motor arranged orthogonally to each other. Real-time detect the actual attitude angle of the ultrasonic probe through an angle encoder arranged on the three-axis servo motor assembly, and compare it with the expected attitude angle parameters in real time. When the detected attitude deviation exceeds a preset deviation threshold, trigger a compensation controller to perform real-time attitude correction.
[0023] In an optional implementation manner, collecting the distance information and angle information output by the laser ranging sensor array, and combining with the position coordinates of the end effector of the robot to calculate multiple sets of spatial coordinate point data on the surface of the curved component. Input the multiple sets of spatial coordinate point data into a preset surface fitting model for calculation to obtain the spatial geometric equation of the curved component, and dividing the spatial geometric equation into multiple detection regions includes: Obtain the distance information and angle information output by the laser ranging sensor array, where the laser ranging sensor array includes a central laser ranging sensor and multiple peripheral laser ranging sensors distributed in a circular array. The installation positions of the central laser ranging sensor and the multiple peripheral laser ranging sensors determine the local coordinate system of the sensor. Convert the distance information and the angle information into first spatial coordinate point data in the local coordinate system of the sensor; establish a coordinate transformation matrix based on the position coordinates of the end effector of the robot, and convert the first spatial coordinate point data into second spatial coordinate point data in the global coordinate system through the coordinate transformation matrix; Construct a local weighted objective function using the moving least squares method. The local weighted objective function includes a spatial weight function, and the spatial weight function adopts an exponential weighting form, where the exponential term is the negative of the ratio of the square of the distance between the point to be fitted and the second spatial coordinate point data to the square of the influence radius; perform spatial partitioning on the second spatial coordinate point data using an octree structure to obtain multiple local regions, and establish local coordinate systems in the multiple local regions; Solve the minimum value of the local weighted objective function in each local coordinate system to obtain the coefficients of the local quadratic surface equation; combine the local quadratic surface equations of the multiple local regions to obtain a spatial geometric equation describing the entire surface component; Calculate the Gaussian curvature and mean curvature of each point on the surface of the surface component based on the spatial geometric equation; substitute the weighted sum of the Gaussian curvature and the mean curvature into the adaptive mesh size calculation formula, and the mesh size in the adaptive mesh size calculation formula is proportional to the reciprocal square root of the curvature weighted sum; divide the spatial geometric equation into multiple overlapping detection regions according to the calculated mesh size.
[0024] The method for a laser ranging sensor array to collect surface information, fit a spatial geometric equation, and then divide detection regions is specifically implemented as follows: First, prepare a laser ranging sensor array, which includes a central laser ranging sensor and multiple peripheral laser ranging sensors annularly distributed around it. The fixed installation positions of these sensors together determine the local coordinate system of the sensor. For example, the central sensor is located at (0, 0, 0), and the peripheral sensors are evenly distributed on a circle with a radius of 10 cm, and their three-dimensional coordinates can determine the local coordinate system.
[0025] Next, control the laser ranging sensor array to scan the surface component to be measured to obtain the distance information and angle information output by each sensor. Assume that the central sensor measures a distance of 20 cm, and a certain peripheral sensor measures a distance of 22 cm and an angle of 30 degrees.
[0026] Then, convert the obtained distance information and angle information into first spatial coordinate point data in the local coordinate system of the sensor. For example, according to the distance of 20 cm measured by the central sensor, the coordinate point (0, 0, 20) in the local coordinate system can be obtained. For the peripheral sensor, it is necessary to combine the distance of 22 cm and the angle of 30 degrees and use trigonometric functions to calculate its three-dimensional coordinates in the local coordinate system.
[0027] Meanwhile, obtain the position coordinates of the end effector of the robot in the global coordinate system. Based on this position coordinate, establish a coordinate transformation matrix from the local coordinate system of the sensor to the global coordinate system. This matrix contains rotation and translation information and can transform points in the local coordinate system to the global coordinate system.
[0028] Transform the previously calculated first spatial coordinate point data to the global coordinate system through the coordinate transformation matrix to obtain the second spatial coordinate point data. For example, transform the point (0, 0, 20) in the local coordinate system to the point (110, 100, 70) in the global coordinate system through the transformation matrix.
[0029] Next, to fit the surface, use the moving least squares method to construct a local weighted objective function. This objective function contains a spatial weight function in an exponential weighted form, where the exponential term is the negative of the ratio of the square of the distance between the point to be fitted and the second spatial coordinate point data to the square of the influence radius. The influence radius can be set according to the actual situation, for example, set to 5 cm.
[0030] To improve the fitting efficiency, partition the second spatial coordinate point data using an octree structure to obtain multiple local regions. Establish a local coordinate system within each local region. For example, divide the point cloud data into 8 small cubic regions and establish an independent local coordinate system for each region.
[0031] In each local coordinate system, solve the minimum value of the local weighted objective function to obtain the coefficients of the local quadratic surface equation. This means that within each small region, fit an optimal quadratic surface to approximate the point cloud data.
[0032] Combine the local quadratic surface equations of all local regions to obtain a complete spatial geometric equation describing the entire surface component. This is equivalent to splicing the surfaces of each small piece into a complete surface.
[0033] Based on the obtained complete spatial geometric equation, calculate the Gaussian curvature and mean curvature of each point on the surface of the surface component. These two curvature values can reflect the degree of curvature of the surface.
[0034] Substitute the weighted sum of the calculated Gaussian curvature and mean curvature into the adaptive mesh size calculation formula. In this formula, the mesh size is proportional to the square root of the reciprocal of the curvature weighted sum. This means that in regions with greater curvature, the mesh size is smaller, and the surface details can be described more precisely.
[0035] Finally, according to the calculated mesh size, divide the spatial geometric equation into multiple overlapping detection regions. These regions can be used for subsequent defect detection or other applications.
[0036] The solution of this application can: Improve the detection accuracy: By adopting local weighted sum and adaptive grid division, complex surfaces can be more accurately described, thus improving the detection accuracy. Improve the calculation efficiency: By using the octree structure for spatial partitioning, the calculation complexity can be reduced and the calculation efficiency can be improved. Enhance the adaptability: This method can be applied to surface components of various shapes and has strong adaptability.
[0037] In an optional implementation manner, a detection position point is selected as the detection center point of the ultrasonic probe in each detection area of the spatial geometric equation; the differential geometry algorithm is used to calculate the surface normal vector at each detection center point; a local coordinate system of the probe is established based on the axis of the ultrasonic probe beam, and the normal vector is transformed from the global coordinate system to the local coordinate system of the probe. The construction of the pose transformation matrix includes: In each detection area of the spatial geometric equation, calculate the geometric center coordinates of the detection area, and use the geometric center coordinates as the first detection position; establish an exponential weight function considering the Gaussian curvature and mean curvature of the surface, substitute the Gaussian curvature value and mean curvature value of the first detection position into the exponential weight function for calculation, and perform position compensation on the first detection position according to the calculation result to obtain the second detection position; calculate the minimum distance from the second detection position to the boundary of the detection area. When the minimum distance is greater than the product of the ultrasonic probe beam radius and the cosine value of the maximum incident angle, the second detection position is determined as the detection center point of the ultrasonic probe. At each detection center point, use the second-order central difference method based on curvature adaptive step size to calculate the partial derivative value of the surface, and obtain two tangent vectors along the parameter coordinate direction at the detection center point according to the partial derivative value; perform a cross product operation on the two tangent vectors to obtain the normal vector at the detection center point, and perform normalization processing on the normal vector to obtain the unit normal vector, and the unit normal vector is used to determine the direction of the ultrasonic probe beam axis. Establish a local coordinate system of the probe based on the axis of the ultrasonic probe beam, and determine the direction of the unit normal vector as the positive direction of the Z axis of the local coordinate system of the probe; perform a cross product operation and normalization on the unit vector of the X axis of the global coordinate system and the unit vector of the Z axis of the local coordinate system of the probe to obtain the unit vector of the X axis of the local coordinate system of the probe; perform a cross product operation on the unit vector of the Z axis of the local coordinate system of the probe and the unit vector of the X axis of the local coordinate system of the probe to obtain the unit vector of the Y axis of the local coordinate system of the probe; combine the three orthogonal unit vectors of the local coordinate system of the probe by columns to construct a rotation matrix, and combine the rotation matrix with the spatial coordinates of the detection center point to form a pose transformation matrix.
[0038] The method for determining the detection pose of an ultrasonic probe based on a spatial geometric equation can accurately guide the ultrasonic probe to detect complex surfaces.
[0039] First, represent the surface to be detected as a spatial geometric equation. For example, the surface of a car fender can be represented by a NURBS surface equation. Then, according to the detection requirements, divide the surface into several detection regions. For instance, divide the fender into multiple detection regions with an area of 10 square centimeters each. Within each detection region, first calculate the geometric center coordinates of the region.
[0040] Next, calculate the Gaussian curvature and mean curvature of the surface at the first detection position. Here, use the second-order central difference method based on curvature adaptive step size to calculate the partial derivatives of the surface, and then calculate the curvature. Suppose the calculated Gaussian curvature is 0.1 and the mean curvature is 0.2.
[0041] Establish an exponential weight function considering Gaussian curvature and mean curvature. For example, the function can be defined as: compensation coefficient = exp(-(a * Gaussian curvature + b * mean curvature)), where a and b are adjustment coefficients. Here, assume a = 1 and b = 0.5. Substitute the calculated Gaussian curvature and mean curvature values into this exponential weight function, and calculate the compensation coefficient as exp(-(1 * 0.1 + 0.5 * 0.2)) = 0.8187.
[0042] Multiply the coordinates of the first detection position by the compensation coefficient respectively to obtain the second detection position. For example, (1.5, 1.5, 1.5) multiplied by 0.8187 gives the second detection position (1.228, 1.228, 1.228).
[0043] Calculate the minimum distance from the second detection position to the boundary of the detection region. Suppose the calculated minimum distance is 0.8 cm. At the same time, according to the beam radius and maximum incident angle of the ultrasonic probe, calculate the product of the beam radius and the cosine value of the maximum incident angle: 0.5 * cos(30 degrees) = 0.433 cm. Since the minimum distance of 0.8 cm is greater than 0.433 cm, the second detection position is determined as the detection center point of the ultrasonic probe.
[0044] At the determined detection center point, use the second-order central difference method based on curvature adaptive step size to calculate the partial derivative values of the surface. Obtain two tangent vectors at the detection center point along the parametric coordinate directions according to the partial derivative values.
[0045] Perform a cross product operation on these two tangent vectors to obtain the normal vector at the detection center point. For example, after the cross product operation, the normal vector obtained is (-0.01, -0.15, 0.7). Normalize this normal vector to obtain the unit normal vector. For example, after normalization, it is (-0.014, -0.213, 0.977). This unit normal vector is used to determine the pointing direction of the ultrasonic probe beam axis.
[0046] A local coordinate system of the probe is established based on the axis of the ultrasonic probe beam. The direction of the unit normal vector is determined as the positive direction of the Z-axis of the local coordinate system of the probe. The cross product operation of the unit vector (1, 0, 0) of the X-axis of the global coordinate system and the unit vector (-0.014, -0.213, 0.977) of the Z-axis of the local coordinate system of the probe is performed and normalized to obtain the unit vector of the X-axis of the local coordinate system of the probe. The cross product operation of the unit vector of the Z-axis and the unit vector of the X-axis of the local coordinate system of the probe is performed to obtain the unit vector of the Y-axis of the local coordinate system of the probe. The three orthogonal unit vectors of the local coordinate system of the probe are combined by columns to construct a rotation matrix. The rotation matrix and the spatial coordinates of the detection center point are combined to form a pose transformation matrix.
[0047] The solution of this application can: Improve detection accuracy: By accurately calculating the position and normal vector of the detection center point, the pose of the ultrasonic probe can be accurately positioned, thereby improving the detection accuracy and effectively avoiding missed detection and false detection. Adapt to complex curved surfaces: This method can adapt to the detection of various complex curved surfaces, such as automobile fenders, aircraft wings, etc., and has wide applicability. Improve detection efficiency: By pre-calculating the detection pose, the on-site adjustment time can be reduced, the detection efficiency can be improved, and the detection cost can be reduced.
[0048] In an alternative embodiment, based on the pose transformation matrix, the attitude angle parameters of the ultrasonic probe at each detection center point are calculated, and the attitude angle parameters include pitch angle, yaw angle, and roll angle, including: Nine elements of the rotation matrix are extracted based on the pose transformation matrix, and the yaw angle parameter, pitch angle parameter, and roll angle parameter of the ultrasonic probe are calculated based on the rotation matrix using the ZYX Euler angle decomposition order. The yaw angle parameter represents the rotation angle of the ultrasonic probe around the Z-axis, the pitch angle parameter represents the rotation angle of the ultrasonic probe around the Y-axis, and the roll angle parameter represents the rotation angle of the ultrasonic probe around the X-axis; Based on the element in the first column of the third row of the rotation matrix, the calculation method of the pitch angle parameter is judged. When the absolute value of the element in the first column of the third row is equal to one, a fixed angle is assigned. When the element in the first column of the third row is -1, the pitch angle parameter is assigned as positive ninety degrees. When the element in the first column of the third row is 1, the pitch angle parameter is assigned as negative ninety degrees. When the absolute value of the element in the first column of the third row is less than one, the negative value of the element in the first column of the third row is substituted into the arcsine function to calculate the pitch angle parameter; Calculate the cosine value of the pitch angle parameter and use it as the singularity judgment basis. When the cosine value is not zero, divide the element in the first column of the second row of the rotation matrix by the cosine value to obtain a first quotient value, divide the element in the first column of the first row of the rotation matrix by the cosine value to obtain a second quotient value, substitute the first quotient value and the second quotient value into the arctangent function to calculate the yaw angle parameter, divide the element in the second column of the third row of the rotation matrix by the cosine value to obtain a third quotient value, divide the element in the third column of the third row of the rotation matrix by the cosine value to obtain a fourth quotient value, and substitute the third quotient value and the fourth quotient value into the arctangent function to calculate the roll angle parameter; When the cosine value is zero, assign the yaw angle parameter to zero, and select the calculation method of the roll angle parameter according to the positive or negative of the pitch angle parameter. When the pitch angle parameter is 90 degrees, substitute the element in the second column of the first row and the element in the third column of the first row of the rotation matrix into the arctangent function to calculate the roll angle parameter. When the pitch angle parameter is -90 degrees, substitute the negative value of the element in the second column of the first row and the negative value of the element in the third column of the first row of the rotation matrix into the arctangent function to calculate the roll angle parameter; Compare the calculated yaw angle parameter, pitch angle parameter, and roll angle parameter with their corresponding angle ranges respectively, and correct the parameters that exceed the angle range to ensure that the value range of the yaw angle parameter is from -180 degrees to +180 degrees, ensure that the value range of the pitch angle parameter is from -90 degrees to +90 degrees, ensure that the value range of the roll angle parameter is from -180 degrees to +180 degrees, calculate the change amount of the attitude angle parameter between adjacent detection center points and control it within the preset maximum change amount range; Substitute the Gaussian curvature value and the mean curvature value at the detection center point into a preset compensation function to calculate the attitude angle compensation amount, superimpose the attitude angle compensation amount with the yaw angle parameter, the pitch angle parameter, and the roll angle parameter respectively to obtain the compensated attitude angle parameter. When the cosine value corresponding to the compensated attitude angle parameter is less than the preset cosine threshold, perform a smooth transition process on the compensated attitude angle parameter using the spherical linear interpolation algorithm based on multiple reference points within the neighborhood of the detection center point to obtain the attitude angle parameter of the ultrasonic probe at each detection center point.
[0049] A method for accurately obtaining the attitude angle parameters of an ultrasonic probe, which is used to obtain the attitude angle parameters of the ultrasonic probe at each detection center point, including the pitch angle, yaw angle, and roll angle.
[0050] First, obtain the pose transformation matrix of the ultrasonic probe at each detection center point. The pose transformation matrix is a 4x4 matrix that contains rotation and translation information.
[0051] Extract the rotation matrix from the pose transformation matrix. The rotation matrix is a part of the pose transformation matrix and is a 3x3 matrix that describes the rotation state of the ultrasound probe. This rotation matrix contains nine elements, which respectively represent the rotation of the probe in three-dimensional space. For example, the element in the first row and first column of the rotation matrix represents the projection of the X-axis on the rotated X-axis.
[0052] Using the extracted rotation matrix, calculate the pose angle parameters of the ultrasound probe, including yaw angle, pitch angle, and roll angle, in the ZYX Euler angle decomposition order. The yaw angle represents the rotation angle of the ultrasound probe around the Z-axis, the pitch angle represents the rotation angle of the ultrasound probe around the Y-axis, and the roll angle represents the rotation angle of the ultrasound probe around the X-axis. The ZYX Euler angle decomposition order means rotating around the Z-axis (yaw) first, then around the Y-axis (pitch), and finally around the X-axis (roll) to obtain the final pose.
[0053] Judge the calculation method of the pitch angle according to the element in the third row and first column of the rotation matrix. This element reflects the projection of the Z-axis on the X-axis after rotation. If the absolute value of this element is equal to 1, the pitch angle is plus or minus ninety degrees. For example, if this element is -1, the pitch angle is assigned as positive ninety degrees; if this element is 1, the pitch angle is assigned as negative ninety degrees. If the absolute value of this element is less than 1, substitute the negative value of this element into the arcsine function to calculate the pitch angle. For example, if this element is 0.5, the pitch angle is the calculation result of the arcsine function(-0.5).
[0054] Calculate the cosine value of the pitch angle and use it as the singularity judgment basis. If the cosine value is not zero, the yaw angle and roll angle can be calculated normally. Divide the element in the second row and first column of the rotation matrix by the cosine value to get the first quotient value, divide the element in the first row and first column of the rotation matrix by the cosine value to get the second quotient value, and substitute these two quotient values into the arctangent function to calculate the yaw angle. Similarly, divide the element in the third row and second column of the rotation matrix by the cosine value to get the third quotient value, divide the element in the third row and third column of the rotation matrix by the cosine value to get the fourth quotient value, and substitute these two quotient values into the arctangent function to calculate the roll angle. For example, if the cosine value is 0.8, the element in the second row and first column is 0.6, and the element in the first row and first column is 0.2, then the yaw angle is the calculation result of the arctangent function(0.6 / 0.8,0.2 / 0.8).
[0055] If the cosine value of the pitch angle is zero, assign the yaw angle as zero. Select the calculation method of the roll angle according to the positive or negative of the pitch angle. If the pitch angle is positive ninety degrees, substitute the element in the first row and second column and the element in the first row and third column of the rotation matrix into the arctangent function to calculate the roll angle. If the pitch angle is negative ninety degrees, substitute the negative value of the element in the first row and second column and the negative value of the element in the first row and third column of the rotation matrix into the arctangent function to calculate the roll angle.
[0056] Compare the calculated yaw angle, pitch angle, and roll angle with their corresponding angle ranges, and correct the parameters that exceed the angle range. The value ranges of the yaw angle and roll angle are from -180 degrees to +180 degrees, and the value range of the pitch angle is from -90 degrees to +90 degrees. For example, if the calculated yaw angle is 200 degrees, it is corrected to -160 degrees. Calculate the change amount of the attitude angle parameters between adjacent detection center points and control it within the preset maximum change amount range. For example, if the yaw angle of the current detection point is 30 degrees, the yaw angle of the previous detection point is 20 degrees, and the maximum change amount is set to 15 degrees, then the yaw angle of the current detection point is corrected to 25 degrees.
[0057] Substitute the Gaussian curvature value and the mean curvature value at the detection center point into a preset compensation function to calculate the attitude angle compensation amount. Superimpose the attitude angle compensation amount with the yaw angle, pitch angle, and roll angle respectively to obtain the compensated attitude angle parameters. For example, if the calculated yaw angle compensation amount is 2 degrees and the original yaw angle is 30 degrees, then the compensated yaw angle is 32 degrees. If the cosine value corresponding to the compensated attitude angle parameters is less than the preset cosine threshold, then perform a smooth transition process on the compensated attitude angle parameters using the spherical linear interpolation algorithm based on multiple reference points within the neighborhood of the detection center point.
[0058] The solution of this application can: Improve the accuracy of the attitude angle parameters: By compensating with Gaussian curvature and mean curvature and performing special processing on singular points, the calculation accuracy of the attitude angle parameters can be effectively improved. Enhance the stability of the attitude angle parameters: By controlling the change amount of the attitude angle parameters between adjacent detection center points and performing a smooth transition process on the compensated attitude angle parameters, the jump of the attitude angle parameters can be effectively avoided and its stability can be improved. Simplify the calculation process of the attitude angle parameters: Adopting the ZYX Euler angle decomposition order and making judgments and calculations according to specific elements of the rotation matrix simplifies the calculation process of the attitude angle parameters and improves the calculation efficiency.
[0059] In an alternative embodiment, substituting the Gaussian curvature value and the mean curvature value at the detection center point into a preset compensation function to calculate the attitude angle compensation amount includes: Based on the principle that the Gaussian curvature value characterizes the local geometric features of the surface, a yaw angle compensation function using the arctangent function is preset. The yaw angle compensation function maps the Gaussian curvature value of the detection center point to the yaw angle compensation amount. When the Gaussian curvature value is positive, it indicates that the surface is elliptical and requires minimum compensation. When the Gaussian curvature value is negative, it indicates that the surface is hyperbolic and requires maximum compensation. Substitute the Gaussian curvature value of the detection center point into the yaw angle compensation function to obtain the corresponding yaw angle compensation amount; Based on the principle that the concavity and convexity of the surface is characterized by the average curvature value, a pitch angle compensation function using a linear function is preset. The pitch angle compensation function maps the average curvature value of the detection center point to a pitch angle compensation amount. The sign of the average curvature value determines the compensation direction. A positive value corresponds to a convex surface where the pitch angle needs to be increased, and a negative value corresponds to a concave surface where the pitch angle needs to be decreased. Substitute the average curvature value of the detection center point into the pitch angle compensation function to obtain the corresponding pitch angle compensation amount; Based on the principle that the surface characteristics are jointly described by the Gaussian curvature and the average curvature, a roll angle compensation function using a weighted summation function is preset. The roll angle compensation function maps the combination of the Gaussian curvature value and the average curvature value of the detection center point to a roll angle compensation amount. The weight of the Gaussian curvature value determines the compensation for the degree of distortion, and the weight of the average curvature value determines the compensation for the degree of inclination. Substitute the Gaussian curvature value and the average curvature value of the detection center point into the roll angle compensation function to obtain the corresponding roll angle compensation amount; According to the mechanical structure constraints of the ultrasonic probe, set maximum compensation thresholds for the yaw angle compensation amount, the pitch angle compensation amount, and the roll angle compensation amount respectively. Limit the compensation amounts exceeding their respective maximum compensation thresholds within the corresponding preset ranges to obtain the limited compensation amounts that meet the mechanical constraints; Add the limited yaw angle compensation amount, pitch angle compensation amount, and roll angle compensation amount to the original angle parameters of the current probe attitude respectively to obtain the compensated probe attitude angle parameters.
[0060] Obtain the original angle parameters of the current attitude of the ultrasonic probe. The purpose of this step is to obtain the initial attitude of the ultrasonic probe in space and provide a benchmark for subsequent attitude compensation. For example, the initial values of the yaw angle, pitch angle, and roll angle of the probe can be obtained through the inertial measurement unit (IMU) built into the probe. Assume the initial yaw angle is 10 degrees, the pitch angle is 5 degrees, and the roll angle is 2 degrees.
[0061] Select a detection center point on the surface to be measured. The detection center point is the key position for curvature calculation. For example, select a representative point on the surface of the workpiece to be measured as the detection center point.
[0062] Calculate the Gaussian curvature value and the average curvature value at the detection center point. Use surface reconstruction technology or other methods to calculate the Gaussian curvature and the average curvature at the detection center point. For example, assume that after fitting the surface through three-dimensional point cloud data, the calculated Gaussian curvature value of the detection center point is 0.05 and the average curvature value is 0.02.
[0063] Calculate the yaw angle compensation amount based on the Gaussian curvature value. Use the arctangent function as the yaw angle compensation function to map the Gaussian curvature value to the yaw angle compensation amount. A positive Gaussian curvature value corresponds to a smaller compensation amount, and a negative Gaussian curvature value corresponds to a larger compensation amount. For example, assume the preset arctangent function is arctan(K)*10, where K is the Gaussian curvature value. Substitute the Gaussian curvature value of 0.05 into the function, and the obtained yaw angle compensation amount is arctan(0.05)*10 = 0.5 degrees.
[0064] Calculate the pitch angle compensation amount based on the mean curvature value. Use a linear function as the pitch angle compensation function to map the mean curvature value to the pitch angle compensation amount. The sign of the mean curvature value determines the compensation direction: a positive value indicates a convex surface and the pitch angle needs to be increased; a negative value indicates a concave surface and the pitch angle needs to be decreased. For example, assume the preset linear function is H*20, where H is the mean curvature value. Substitute the mean curvature value of 0.02 into the function, and the obtained pitch angle compensation amount is 0.02*20 = 0.4 degrees.
[0065] Calculate the roll angle compensation amount based on the Gaussian curvature value and the mean curvature value. Use a weighted sum function as the roll angle compensation function to map the combination of the Gaussian curvature value and the mean curvature value to the roll angle compensation amount. The weight of the Gaussian curvature value affects the compensation for the degree of distortion, and the weight of the mean curvature value affects the compensation for the degree of tilt.
[0066] Perform clipping processing on the yaw angle compensation amount, pitch angle compensation amount, and roll angle compensation amount. According to the mechanical structure constraints of the ultrasonic probe, set the maximum compensation threshold, and limit the compensation amount exceeding the threshold within the preset range. For example, assume the maximum compensation thresholds for the yaw angle, pitch angle, and roll angle are 1 degree, 0.8 degree, and 1.2 degrees respectively. Since the calculated compensation amounts do not exceed the thresholds, the compensation amounts remain unchanged.
[0067] Add the clipped compensation amount to the original angle parameter to obtain the compensated probe attitude angle parameter. Add the calculated yaw angle compensation amount, pitch angle compensation amount, and roll angle compensation amount to the original angle parameters of the probe attitude respectively to obtain the final probe attitude angle parameter. For example, add the compensation amount of 0.5 degrees to the original yaw angle of 10 degrees to obtain the compensated yaw angle of 10.5 degrees; add the compensation amount of 0.4 degrees to the original pitch angle of 5 degrees to obtain the compensated pitch angle of 5.4 degrees; add the compensation amount of 0.575 degrees to the original roll angle of 2 degrees to obtain the compensated roll angle of 2.575 degrees.
[0068] The solution of this application can: Improve ultrasonic detection accuracy: Through attitude compensation, the attitude deviation of the probe can be effectively corrected, thereby improving the coincidence degree between the ultrasonic beam and the normal of the measured curved surface, and further improving the detection accuracy. Enhance the adaptability to complex curved surfaces: This method can perform attitude compensation according to the local geometric features of the curved surface, so it can better adapt to various complex curved surfaces, such as elliptical, hyperbolic, etc. Simplify the operation process: This method adopts an automated attitude compensation strategy without manual intervention, thus simplifying the operation process and improving the detection efficiency.
[0069] In an alternative embodiment, the actual attitude angle of the ultrasonic probe is detected in real time by an angle encoder arranged on the three-axis servo motor assembly, and compared with the expected attitude angle parameter in real time. When the detected attitude deviation exceeds the preset deviation threshold, the compensation controller is triggered to perform real-time attitude correction, including: A first angle encoder, a second angle encoder, and a third angle encoder are respectively arranged on the yaw axis, pitch axis, and roll axis of the three-axis servo motor assembly. The signal output ends of the first angle encoder, the second angle encoder, and the third angle encoder are respectively connected to the signal processing unit; The signal processing unit samples and filters the angle signals output by the first angle encoder, the second angle encoder, and the third angle encoder, and converts the filtered angle signals into actual attitude angle data in the standard communication protocol format. The actual attitude angle data includes actual yaw angle data, actual pitch angle data, and actual roll angle data; Receive the expected attitude angle parameter sent by the probe control system. The expected attitude angle parameter includes an expected yaw angle parameter, an expected pitch angle parameter, and an expected roll angle parameter, and input the expected attitude angle parameter into the compensation controller; The compensation controller receives the actual attitude angle data sent by the signal processing unit in real time, performs a difference operation between the actual yaw angle data and the expected yaw angle parameter to obtain a yaw angle deviation, performs a difference operation between the actual pitch angle data and the expected pitch angle parameter to obtain a pitch angle deviation, and performs a difference operation between the actual roll angle data and the expected roll angle parameter to obtain a roll angle deviation; The compensation controller judges whether the yaw angle deviation, the pitch angle deviation, and the roll angle deviation exceed the corresponding preset deviation thresholds according to the preset yaw angle threshold, pitch angle threshold, and roll angle threshold. When any angle deviation exceeds the corresponding preset deviation threshold, attitude correction is triggered.
[0070] An ultrasonic probe attitude real-time correction system and method are used to accurately control the attitude of the ultrasonic probe to ensure that it maintains the expected direction during the working process.
[0071] First, in the preparation stage, three high-precision angle encoders are installed on the three-axis servo motor assembly. These three angle encoders respectively correspond to the yaw axis, pitch axis, and roll axis of the servo motor, and are used to measure the three rotation angles of the probe in real time. The signal output terminals of each angle encoder are connected to a signal processing unit. For example, an absolute angle encoder with a resolution of 16 bits is selected, which can be accurate to 0.0055 degrees.
[0072] Next, in the signal acquisition and processing stage, the signal processing unit samples and digitizes the analog signals output by the three angle encoders. To improve the measurement accuracy, oversampling technology is adopted, for example, sampling at a frequency of 10 kHz, and combined with a digital filter, such as a Kalman filter, to remove the noise and interference in the signals. Then, the filtered angle data is converted into a standard communication protocol format, such as Modbus RTU or CAN bus protocol, for subsequent processing and transmission. Assume that the output value of the first angle encoder is 20000, corresponding to a yaw angle of 120 degrees; the output value of the second angle encoder is 10000, corresponding to a pitch angle of 60 degrees; the output value of the third angle encoder is 5000, corresponding to a roll angle of 30 degrees. These data will be packed into a standard data frame for transmission.
[0073] Subsequently, in the expected attitude angle parameter receiving stage, the probe control system generates the expected attitude angle parameters according to the preset scanning trajectory or other control requirements, including the expected yaw angle, expected pitch angle, and expected roll angle. These parameters are sent to the compensation controller through a communication interface, such as RS-485 or Ethernet. Assume that the expected yaw angle is 125 degrees, the expected pitch angle is 62 degrees, and the expected roll angle is 28 degrees.
[0074] Enter the attitude deviation calculation stage. The compensation controller receives the actual attitude angle data sent by the signal processing unit and the expected attitude angle parameters sent by the probe control system. The compensation controller compares the actual yaw angle data with the expected yaw angle parameter to obtain the yaw angle deviation. For example, comparing 120 degrees with 125 degrees, the deviation is -5 degrees. Similarly, comparing the actual pitch angle data with the expected pitch angle parameter to obtain the pitch angle deviation. For example, comparing 60 degrees with 62 degrees, the deviation is -2 degrees. Finally, comparing the actual roll angle data with the expected roll angle parameter to obtain the roll angle deviation. For example, comparing 30 degrees with 28 degrees, the deviation is 2 degrees.
[0075] Finally, in the attitude correction stage, the compensation controller determines whether the three calculated angle deviations exceed the corresponding thresholds according to the preset yaw angle threshold, pitch angle threshold, and roll angle threshold. Assume that the yaw angle threshold is ±6 degrees, the pitch angle threshold is ±3 degrees, and the roll angle threshold is ±4 degrees. In this example, the yaw angle deviation of -5 degrees and the roll angle deviation of 2 degrees are both within the threshold range, and the pitch angle deviation of -2 degrees also does not exceed the threshold. If any of the angle deviations exceeds the corresponding threshold, the compensation controller will immediately trigger attitude correction. The compensation controller generates corresponding control signals, such as PID control signals, according to the magnitude and direction of the deviation values, and sends them to the three-axis servo motor driver to drive the motor to adjust the attitude of the probe until the deviation values return within the threshold range.
[0076] The solution of this application can: Improve the pointing accuracy of the ultrasonic probe: By real-time detecting and correcting the attitude deviation of the probe, the pointing error can be effectively reduced, improving the accuracy and reliability of ultrasonic detection. Enhance the stability and robustness of the system: The system can compensate for attitude disturbances caused by various factors in real time, such as mechanical vibration, temperature change, etc., thus enhancing the stability and robustness of the system. Simplify the design and operation of the system: The system adopts a closed-loop control method, which can automatically adjust the attitude of the probe without manual intervention, simplifying the design and operation of the system and improving work efficiency.
[0077] Figure 2 This is a schematic structural diagram of the normal automatic attitude adjustment system for the ultrasonic probe of the curved surface component based on laser ranging in the embodiment of the present invention. As Figure 2 shown, the system includes: The first unit is used to perform raster scanning measurement on the surface of the curved surface component through a multi-point laser ranging sensor array arranged on the end effector of the robot. The laser ranging sensor array includes a central ranging sensor and peripheral ranging sensors distributed in a ring array; collect the distance information and angle information output by the laser ranging sensor array, combine the position coordinates of the end effector of the robot, and calculate multiple sets of spatial coordinate point data on the surface of the curved surface component; input the multiple sets of spatial coordinate point data into a preset surface fitting model for calculation to obtain the spatial geometric equation of the curved surface component, and divide the spatial geometric equation into multiple detection regions; A second unit, configured to select a detection position point as the detection center point of the ultrasonic probe within each detection area of the spatial geometric equation; calculate the surface normal vector at each of the detection center points by using a differential geometry algorithm; establish a local probe coordinate system based on the beam axis of the ultrasonic probe, convert the normal vector from the global coordinate system to the local probe coordinate system, and construct a pose transformation matrix; calculate the attitude angle parameters of the ultrasonic probe at each detection center point based on the pose transformation matrix, where the attitude angle parameters include a pitch angle, a yaw angle, and a roll angle; A third unit, configured to convert the attitude angle parameters into motion control instructions for the robot end effector; drive a three-axis servo motor assembly mounted on the robot end effector through the motion control instructions, where the three-axis servo motor assembly includes a pitch axis motor, a yaw axis motor, and a roll axis motor that are orthogonally arranged; detect the actual attitude angle of the ultrasonic probe in real time through an angle encoder arranged on the three-axis servo motor assembly, and compare it with the expected attitude angle parameters in real time. When the detected attitude deviation exceeds a preset deviation threshold, trigger a compensation controller to perform real-time attitude correction.
[0078] In a third aspect of the embodiments of the present invention, a kind of electronic device is provided, including: a processor; a memory for storing instructions executable by the processor; wherein, the processor is configured to call the instructions stored in the memory to execute the method described above.
[0079] In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described above is implemented.
[0080] The present invention can be a method, a device, a system, and / or a computer program product. The computer program product may include a computer-readable storage medium, on which computer-readable program instructions for executing various aspects of the present invention are uploaded.
[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An ultrasonic probe normal automatic posture adjustment method for curved surface components based on laser ranging, characterized in that, Including: Performing raster scanning measurement on the surface of a curved member through a multi-point laser ranging sensor array arranged on the end effector of a robot. The laser ranging sensor array includes a central ranging sensor and peripheral ranging sensors distributed in an annular array; collecting the distance information and angle information output by the laser ranging sensor array, and combining with the position coordinates of the end effector of the robot to calculate multiple sets of spatial coordinate point data on the surface of the curved member; Inputting the multiple sets of spatial coordinate point data into a preset surface fitting model for calculation to obtain the spatial geometric equation of the curved member, and dividing the spatial geometric equation into multiple detection regions; Selecting a detection position point as the detection center point of the ultrasonic probe in each detection region of the spatial geometric equation; calculating the surface normal vector at each detection center point by using a differential geometry algorithm; establishing a local coordinate system of the probe based on the axis of the ultrasonic probe beam, converting the normal vector from the global coordinate system to the local coordinate system of the probe, and constructing a pose transformation matrix; calculating the attitude angle parameters of the ultrasonic probe at each detection center point based on the pose transformation matrix, where the attitude angle parameters include pitch angle, yaw angle, and roll angle; Converting the attitude angle parameters into motion control instructions for the end effector of the robot; driving a three-axis servo motor assembly installed on the end effector of the robot through the motion control instructions. The three-axis servo motor assembly includes a pitch axis motor, a yaw axis motor, and a roll axis motor that are orthogonally arranged; detecting the actual attitude angle of the ultrasonic probe in real time through an angle encoder arranged on the three-axis servo motor assembly, and comparing it with the expected attitude angle parameters in real time. When the detected attitude deviation exceeds a preset deviation threshold, triggering a compensation controller to perform real-time attitude correction.
2. The method according to claim 1, wherein Collecting the distance information and angle information output by the laser ranging sensor array, and combining with the position coordinates of the end effector of the robot to calculate multiple sets of spatial coordinate point data on the surface of the curved member; Inputting the multiple sets of spatial coordinate point data into a preset surface fitting model for calculation to obtain the spatial geometric equation of the curved member, and dividing the spatial geometric equation into multiple detection regions includes: Obtaining the distance information and angle information output by the laser ranging sensor array, where the laser ranging sensor array includes a central laser ranging sensor and multiple peripheral laser ranging sensors distributed in an annular array, and the installation positions of the central laser ranging sensor and the multiple peripheral laser ranging sensors determine a local coordinate system of the sensor; Converting the distance information and the angle information into first spatial coordinate point data in the local coordinate system of the sensor; establishing a coordinate transformation matrix based on the position coordinates of the end effector of the robot, and converting the first spatial coordinate point data into second spatial coordinate point data in the global coordinate system through the coordinate transformation matrix; Construct a local weighted objective function using the moving least squares method. The local weighted objective function includes a spatial weight function, and the spatial weight function adopts an exponential weighting form, where the exponential term is the negative of the ratio of the square of the distance between the point to be fitted and the data of the second spatial coordinate points to the square of the influence radius; perform spatial partitioning on the data of the second spatial coordinate points using an octree structure to obtain multiple local regions, and establish local coordinate systems in the multiple local regions; Solve the minimum value of the local weighted objective function in each of the local coordinate systems to obtain the coefficients of the local quadratic surface equation; combine the local quadratic surface equations of the multiple local regions to obtain a spatial geometric equation describing the entire surface component; Calculate the Gaussian curvature and mean curvature of each point on the surface of the surface component based on the spatial geometric equation; substitute the weighted sum of the Gaussian curvature and the mean curvature into the adaptive mesh size calculation formula, and in the adaptive mesh size calculation formula, the mesh size is proportional to the reciprocal square root of the curvature weighted sum; divide the spatial geometric equation into multiple overlapping detection regions according to the calculated mesh size.
3. The method according to claim 1, characterized in that, Select a detection position point as the detection center point of the ultrasonic probe in each detection region of the spatial geometric equation; use the differential geometry algorithm to calculate the surface normal vector at each detection center point; Establish a local coordinate system of the probe with the axis of the ultrasonic probe beam as the reference, and transform the normal vector from the global coordinate system to the local coordinate system of the probe. The pose transformation matrix is constructed as follows: In each detection region of the spatial geometric equation, calculate the geometric center coordinates of the detection region, and use the geometric center coordinates as the first detection position; establish an exponential weight function considering the Gaussian curvature and mean curvature of the surface, substitute the Gaussian curvature value and mean curvature value of the first detection position into the exponential weight function for calculation, and perform position compensation on the first detection position according to the calculation result to obtain the second detection position; calculate the minimum distance from the second detection position to the boundary of the detection region. When the minimum distance is greater than the product of the ultrasonic probe beam radius and the cosine value of the maximum incident angle, determine the second detection position as the detection center point of the ultrasonic probe; At each detection center point, use the second-order central difference method based on the curvature adaptive step size to calculate the partial derivative values of the surface, and obtain two tangent vectors along the parameter coordinate direction at the detection center point according to the partial derivative values; perform a cross product operation on the two tangent vectors to obtain the normal vector at the detection center point, and perform normalization processing on the normal vector to obtain a unit normal vector, and the unit normal vector is used to determine the direction of the axis of the ultrasonic probe beam; A local coordinate system of the probe is established with the axis of the ultrasonic probe beam as the reference, and the direction of the unit normal vector is determined as the positive direction of the Z-axis of the local coordinate system of the probe; the cross product operation of the unit vector of the X-axis of the global coordinate system and the unit vector of the Z-axis of the local coordinate system of the probe is performed and normalized to obtain the unit vector of the X-axis of the local coordinate system of the probe; the cross product operation of the unit vector of the Z-axis of the local coordinate system of the probe and the unit vector of the X-axis of the local coordinate system of the probe is performed to obtain the unit vector of the Y-axis of the local coordinate system of the probe; the three orthogonal unit vectors of the local coordinate system of the probe are combined by columns to construct a rotation matrix, and the rotation matrix and the spatial coordinates of the detection center point are combined to form a pose transformation matrix.
4. The method according to claim 3, wherein Based on the pose transformation matrix, the attitude angle parameters of the ultrasonic probe at each detection center point are calculated. The attitude angle parameters include pitch angle, yaw angle and roll angle, including: Nine elements of the rotation matrix are extracted based on the pose transformation matrix, and the yaw angle parameter, pitch angle parameter and roll angle parameter of the ultrasonic probe are calculated based on the rotation matrix using the ZYX Euler angle decomposition order. The yaw angle parameter represents the rotation angle of the ultrasonic probe around the Z-axis, the pitch angle parameter represents the rotation angle of the ultrasonic probe around the Y-axis, and the roll angle parameter represents the rotation angle of the ultrasonic probe around the X-axis; Based on the element in the first column of the third row of the rotation matrix, the calculation method of the pitch angle parameter is judged. When the absolute value of the element in the first column of the third row is equal to one, a fixed angle assignment is adopted. When the element in the first column of the third row is -1, the pitch angle parameter is assigned as positive ninety degrees. When the element in the first column of the third row is 1, the pitch angle parameter is assigned as negative ninety degrees. When the absolute value of the element in the first column of the third row is less than one, the negative value of the element in the first column of the third row is substituted into the arcsine function to calculate the pitch angle parameter; The cosine value of the pitch angle parameter is calculated and used as the singularity judgment basis. When the cosine value is not zero, the element in the first column of the second row of the rotation matrix is divided by the cosine value to obtain the first quotient value, the element in the first column of the first row of the rotation matrix is divided by the cosine value to obtain the second quotient value, the first quotient value and the second quotient value are substituted into the arctangent function to calculate the yaw angle parameter, the element in the second column of the third row of the rotation matrix is divided by the cosine value to obtain the third quotient value, the element in the third column of the third row of the rotation matrix is divided by the cosine value to obtain the fourth quotient value, and the third quotient value and the fourth quotient value are substituted into the arctangent function to calculate the roll angle parameter; When the cosine value is zero, the yaw angle parameter is assigned as zero, and the calculation method of the roll angle parameter is selected according to the positive and negative of the pitch angle parameter. When the pitch angle parameter is positive ninety degrees, the element in the second column of the first row and the element in the third column of the first row of the rotation matrix are substituted into the arctangent function to calculate the roll angle parameter. When the pitch angle parameter is negative ninety degrees, the negative value of the element in the second column of the first row and the negative value of the element in the third column of the first row of the rotation matrix are substituted into the arctangent function to calculate the roll angle parameter; Compare the calculated yaw angle parameter, pitch angle parameter, and roll angle parameter with their corresponding angle ranges respectively, and correct the parameters that exceed the angle range to ensure that the value range of the yaw angle parameter is from -180 degrees to +180 degrees, ensure that the value range of the pitch angle parameter is from -90 degrees to +90 degrees, ensure that the value range of the roll angle parameter is from -180 degrees to +180 degrees, calculate the change amount of the attitude angle parameter between adjacent detection center points and control it within the preset maximum change amount range; Substitute the Gaussian curvature value and the mean curvature value at the detection center point into a preset compensation function to calculate the attitude angle compensation amount, superimpose the attitude angle compensation amount with the yaw angle parameter, the pitch angle parameter, and the roll angle parameter respectively to obtain the compensated attitude angle parameter. When the cosine value corresponding to the compensated attitude angle parameter is less than the preset cosine threshold, perform a smooth transition process on the compensated attitude angle parameter using the spherical linear interpolation algorithm based on multiple reference points within the neighborhood of the detection center point to obtain the attitude angle parameter of the ultrasonic probe at each detection center point.
5. The method according to claim 4, characterized in that, Substituting the Gaussian curvature value and the mean curvature value at the detection center point into a preset compensation function to calculate the attitude angle compensation amount includes: Based on the principle that the Gaussian curvature value characterizes the local geometric features of the surface, a yaw angle compensation function using the arctangent function is preset. The yaw angle compensation function maps the Gaussian curvature value of the detection center point to the yaw angle compensation amount. When the Gaussian curvature value is positive, it indicates that the surface is elliptical and requires the least compensation. When the Gaussian curvature value is negative, it indicates that the surface is hyperbolic and requires the most compensation. Substitute the Gaussian curvature value of the detection center point into the yaw angle compensation function to obtain the corresponding yaw angle compensation amount; Based on the principle that the mean curvature value characterizes the concavity and convexity of the surface, a pitch angle compensation function using a linear function is preset. The pitch angle compensation function maps the mean curvature value of the detection center point to the pitch angle compensation amount. The sign of the mean curvature value determines the compensation direction. A positive value corresponds to a convex surface and requires an increase in the pitch angle, while a negative value corresponds to a concave surface and requires a decrease in the pitch angle. Substitute the mean curvature value of the detection center point into the pitch angle compensation function to obtain the corresponding pitch angle compensation amount; Based on the principle that the Gaussian curvature and the mean curvature jointly describe the surface characteristics, a roll angle compensation function using a weighted summation function is preset. The roll angle compensation function maps the Gaussian curvature value and the mean curvature value of the detection center point to the roll angle compensation amount. The weight of the Gaussian curvature value determines the compensation for the degree of distortion, and the weight of the mean curvature value determines the compensation for the degree of tilt. Substitute the Gaussian curvature value and the mean curvature value of the detection center point into the roll angle compensation function to obtain the corresponding roll angle compensation amount; According to the mechanical structure constraints of the ultrasonic probe, maximum compensation thresholds are respectively set for the yaw angle compensation amount, the pitch angle compensation amount, and the roll angle compensation amount, and the compensation amounts exceeding their respective maximum compensation thresholds are limited within the corresponding preset ranges to obtain limited compensation amounts that meet the mechanical constraints; the limited yaw angle compensation amount, pitch angle compensation amount, and roll angle compensation amount are respectively added to the original angle parameters of the current probe attitude to obtain the compensated probe attitude angle parameters.
6. The method according to claim 1, characterized in that, The actual attitude angle of the ultrasonic probe is detected in real time by angle encoders arranged on the three-axis servo motor assembly and compared with the expected attitude angle parameters in real time. When the detected attitude deviation exceeds the preset deviation threshold, the compensation controller is triggered to perform real-time attitude correction, including: A first angle encoder, a second angle encoder, and a third angle encoder are respectively arranged on the yaw axis, pitch axis, and roll axis of the three-axis servo motor assembly, and the signal output ends of the first angle encoder, the second angle encoder, and the third angle encoder are respectively connected to the signal processing unit; The signal processing unit samples and filters the angle signals output by the first angle encoder, the second angle encoder, and the third angle encoder, and converts the filtered angle signals into actual attitude angle data in the format of a standard communication protocol. The actual attitude angle data includes actual yaw angle data, actual pitch angle data, and actual roll angle data; Receive the expected attitude angle parameters sent by the probe control system. The expected attitude angle parameters include expected yaw angle parameters, expected pitch angle parameters, and expected roll angle parameters, and input the expected attitude angle parameters into the compensation controller; The compensation controller receives the actual attitude angle data sent by the signal processing unit in real time, performs a difference operation between the actual yaw angle data and the expected yaw angle parameters to obtain a yaw angle deviation, performs a difference operation between the actual pitch angle data and the expected pitch angle parameters to obtain a pitch angle deviation, and performs a difference operation between the actual roll angle data and the expected roll angle parameters to obtain a roll angle deviation; The compensation controller judges whether the yaw angle deviation, the pitch angle deviation, and the roll angle deviation exceed the corresponding preset deviation thresholds according to the preset yaw angle threshold, pitch angle threshold, and roll angle threshold. When any angle deviation exceeds the corresponding preset deviation threshold, attitude correction is triggered.
7. A system for automatically adjusting the normal direction of an ultrasonic probe for a curved surface component based on laser ranging, for implementing the method according to any one of claims 1 to 6, characterized in that: Including: The first unit is used to perform raster scanning measurement on the surface of the curved member through a multi-point laser ranging sensor array arranged on the end effector of the robot. The laser ranging sensor array includes a central ranging sensor and peripheral ranging sensors distributed in a ring array; collect the distance information and angle information output by the laser ranging sensor array, and calculate multiple groups of spatial coordinate point data on the surface of the curved member in combination with the position coordinates of the end effector of the robot; Input the multiple groups of spatial coordinate point data into a preset surface fitting model for calculation to obtain the spatial geometric equation of the curved member, and divide the spatial geometric equation into multiple detection regions; A second unit, configured to select a detection position point as the detection center point of the ultrasonic probe in each detection area of the spatial geometric equation; calculate the surface normal vector at each of the detection center points by using a differential geometry algorithm; establish a local probe coordinate system with the axis of the ultrasonic probe beam as the reference, convert the normal vector from the global coordinate system to the local probe coordinate system, and construct a pose transformation matrix; calculate the attitude angle parameters of the ultrasonic probe at each detection center point based on the pose transformation matrix, where the attitude angle parameters include a pitch angle, a yaw angle, and a roll angle; A third unit, configured to convert the attitude angle parameters into motion control instructions for the robot end effector; drive a three-axis servo motor assembly mounted on the robot end effector through the motion control instructions, where the three-axis servo motor assembly includes a pitch axis motor, a yaw axis motor, and a roll axis motor that are orthogonally arranged; detect the actual attitude angle of the ultrasonic probe in real time through an angle encoder arranged on the three-axis servo motor assembly, and compare it with the expected attitude angle parameters in real time. When the detected attitude deviation exceeds a preset deviation threshold, trigger a compensation controller to perform real-time attitude correction.
8. An electronic device, characterized in that, Comprising: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Mechanical arm joint positioning system for optical fiber ultrasonic detection scanning
CN121340226A
Ultrasonic self-adaptive detection method and system for curved surface component
CN122330290A
A curved surface component ultrasonic self-adaptive detection method and system
CN122330290B