A method for motion trajectory optimization in industrial robot ultrasonic scanning
By optimizing the B-spline curve fitting and the equality constraint matrix, a smooth trajectory with C2 continuity is generated, which solves the problems of unstable robotic arm motion and low scanning quality in traditional methods, and achieves high-quality ultrasonic detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHENGDU LIANKE AEROTECH CO LTD
- Filing Date
- 2026-04-16
- Publication Date
- 2026-06-23
AI Technical Summary
Traditional B-spline fitting methods for ultrasonic scanning of industrial robots suffer from problems such as oversensitivity to noise and small steps, insufficient smoothness or distortion, difficulty in embedding equation constraints, resulting in unstable robot arm movement and low scanning quality.
By combining B-spline curve fitting with a smoothing penalty term and an equality constraint matrix, a C2 continuous smooth trajectory is generated through KKT equation optimization to ensure that key points are strictly passed. Uniform arc length sampling is then performed to generate a smooth trajectory point sequence for the robotic arm.
This improved the stability of the robotic arm's movement and the consistency of the ultrasonic probe's acoustic coupling, reduced the risk of missed detections and misjudgments, and ensured the integrity and reliability of the imaging data.
Smart Images

Figure CN122034003B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robot trajectory optimization technology, specifically to a method for optimizing the motion trajectory of an industrial robot in ultrasonic scanning. Background Technology
[0002] Ultrasonic nondestructive testing (NDT) is a core tool for modern industrial quality control and structural health monitoring, and is widely used in aerospace, nuclear power equipment, rail transportation, precision manufacturing, and other fields. Among them, ultrasonic C-scan imaging technology obtains two-dimensional or three-dimensional distribution information of internal defects by systematically scanning the surface of a workpiece, and has advantages such as high detection sensitivity and intuitive imaging. To achieve efficient and reliable automated ultrasonic testing, industrial robots are widely used to perform motion control of ultrasonic probes. The smoothness, continuity, and positional accuracy of their motion trajectory directly affect the ultrasonic coupling effect, data acquisition quality, and the accuracy of final defect identification.
[0003] In real-world industrial applications, the surface of the workpiece to be inspected is often not an ideally smooth plane. Instead, it contains geometric discontinuities such as microsteps, local protrusions, and depressions caused by machining errors, assembly gaps, structural transitions, or measurement noise. These features result in irregular disturbances in the path point sequence obtained through 3D scanning or CAD model discretization. If these are directly used for robotic arm trajectory planning, the following prominent problems will arise:
[0004] For example, abrupt changes in discrete path points can cause drastic changes in the speed and acceleration of the robotic arm during movement, which not only increases mechanical wear and causes vibration, but may also lead to trajectory tracking deviations due to servo system response delays; or the probe posture may not be able to maintain stability at the point of abrupt change in path, affecting the consistency of acoustic coupling between the ultrasonic probe and the workpiece surface, resulting in fluctuations in echo signal intensity, a decrease in signal-to-noise ratio, and even missed detections or misjudgments; and the discontinuous distribution of path points can cause uneven local density of the scanning trajectory, insufficient scanning coverage in some areas, forming detection blind spots, and affecting the integrity and reliability of imaging data.
[0005] To overcome the above problems, traditional trajectory smoothing methods often employ B-spline curve fitting techniques to generate continuous paths by approximating discrete points. However, traditional B-spline fitting methods have significant limitations when applied to ultrasonic scan trajectory optimization:
[0006] Overemphasizing fitting accuracy can lead to curves becoming overly sensitive to noise and minor steps; while excessive smoothing can cause deviations from the actual geometric contours of the workpiece, especially at critical features such as boundaries and hole edges. Furthermore, traditional methods struggle to embed equality constraints during the fitting process, making it impossible to ensure that the trajectory accurately passes through critical locations such as the starting point, ending point, and transition point required by the process, affecting the controllability and repeatability of the detection path. In addition, traditional least squares fitting lacks an effective filtering mechanism for local geometric noise such as small-scale protrusions and steps, which can easily lead to unnecessary fluctuations in the fitted curve.
[0007] Therefore, we propose a method to improve path continuity, thereby enhancing scanning quality and the operational stability of the robotic arm. Summary of the Invention
[0008] The purpose of this invention is to provide a method for optimizing the motion trajectory in ultrasonic scanning of industrial robots, which solves the problems of unstable posture and low scanning quality in traditional robot scanning processes.
[0009] This invention is achieved through the following technical solution:
[0010] like Figure 1 The method for optimizing the motion trajectory in ultrasonic scanning of an industrial robot, as shown, specifically includes:
[0011] S1. Obtain the discrete path point set of the workpiece surface, and divide the path points into strictly constrained points and smooth points according to the rate of change of the normal direction at each path point;
[0012] S2. Based on the discrete path point set, calculate the node vector, and then construct the B-spline representation curve containing unknown control points, the fitting error term, and the smoothing penalty term;
[0013] S3. Construct an equality constraint matrix based on strict constraint points;
[0014] S4. Combine the fitting error term, the smoothing penalty term and the equality constraint matrix to construct and solve the KKT equation system to obtain the optimal solution of the control point. Substitute the optimal control point into the B-spline characterization curve to obtain the optimized B-spline curve.
[0015] S5. Perform uniform arc length sampling on the optimized B-spline curve to generate a smooth trajectory point sequence for the robotic arm motion;
[0016] S6. Determine the normal direction for each point in the generated sequence of trajectory points;
[0017] S7. Drive the robot's movements based on the sequence of trajectory points and the normal direction of each trajectory point.
[0018] Furthermore, in step S2, the chord length method is used to calculate the node vector based on the discrete path points.
[0019] Furthermore, the B-spline characterization curve is constructed, and the specific calculation formula is as follows:
[0020]
[0021] in, For spline order, For node vectors, For the basis function value matrix, There are M control points to be identified, and their corresponding control point matrix is as follows: ;
[0022] Constructing a spline curve matrix based on B-spline characterization curves The specific calculation formula is as follows:
[0023]
[0024] The fitting error term is constructed based on the spline curve matrix, and the calculation formula is as follows:
[0025]
[0026] In the formula, These are discrete path points;
[0027] Its corresponding least squares equation is: .
[0028] Furthermore, a smoothing penalty term is constructed, with the following specific steps:
[0029] Construct a second-order difference matrix The calculation formula is:
[0030]
[0031] Based on this difference matrix, a smoothing penalty term is constructed, and its calculation formula is as follows:
[0032]
[0033] in, To control the trade-off between fitting accuracy and smoothness.
[0034] Furthermore, based on the strict constraint points, an equality constraint matrix is constructed. The specific calculation formula is as follows:
[0035]
[0036] In the formula, For a strictly constrained set of points, This is the control point matrix.
[0037] Furthermore, the KKT equation system is constructed, and the specific calculation formula is as follows:
[0038]
[0039] in, To prevent singular small perturbation terms in the matrix, It is a Lagrange multiplier.
[0040] Furthermore, the step of uniformly sampling the optimized B-spline curve to generate a smooth trajectory point sequence for the robotic arm's motion specifically includes:
[0041] S51. Calculate the arc length parameter function of the optimized B-spline curve;
[0042] S52. Within the total arc length interval, set the target sampling point number and generate a set of uniformly distributed target arc length values;
[0043] S53. For each target arc length value, the corresponding curve parameter value is obtained by numerical inverse solution method;
[0044] S54. Substitute the curve parameter values into the optimized B-spline curve equation to calculate the trajectory points in space, forming a sequence of trajectory points with uniform arc length distribution.
[0045] Furthermore, the arc length parameter function of the optimized B-spline curve is calculated using the following formula:
[0046]
[0047] in, It is the first derivative of the B-spline curve.
[0048] Furthermore, in step S6, generating normal directions for smooth points specifically includes: for strictly constrained points, inheriting the original normal direction; for smooth points, generating a smooth transition between the normal directions of the first and last strictly constrained points through spherical linear interpolation.
[0049] Furthermore, the smooth transition between the normal directions of the strictly constrained points at the beginning and end through spherical linear interpolation specifically includes:
[0050] Determine the normal directions of the first and last strictly constrained points corresponding to the smoothing interval containing the smoothing point;
[0051] Calculate the angle between the two normal directions;
[0052] Based on the relative position parameter of the smoothing point within the interval, the normal direction is obtained by interpolation using the following formula:
[0053]
[0054] in, The direction of the normal to the strictly constrained point at the beginning. The normal direction of the strictly constrained point at the tail end. The angle between the two normal directions. This refers to the relative position parameter.
[0055] The technical solution of the present invention has at least the following advantages and beneficial effects:
[0056] This invention discloses a method for optimizing motion trajectory in ultrasonic scanning of industrial robots. By constructing a B-spline fitting model with a smoothing penalty term, it can automatically filter out irregular disturbances in path points caused by small steps, protrusions, or measurement noise on the workpiece surface, thereby generating a smooth trajectory with C2 continuity. This fundamentally avoids sudden changes in speed and acceleration caused by the robotic arm directly tracking discrete points, significantly improves motion stability, and reduces mechanical wear and vibration.
[0057] Meanwhile, by intelligently dividing strict constraint points and smooth points based on the rate of change of normal, and introducing an equality constraint matrix in the optimization, it is ensured that while filtering noise, the trajectory can be strictly and accurately passed through key process points (such as boundaries, hole edges, start points, and end points), preventing geometric distortion caused by traditional over-smoothing, and ensuring the geometric fidelity and process controllability of the scanning path.
[0058] Based on this, the smoothness of the robotic arm's movement ensures the stability of the ultrasonic probe's posture, enabling the probe and the workpiece surface to maintain a good and consistent acoustic coupling state, thereby obtaining a stable echo signal with a high signal-to-noise ratio and reducing the risk of missed detections and misjudgments. Furthermore, by sampling the optimized B-spline curve with uniform arc length, a sequence of trajectory points that are equidistantly distributed in space can be obtained. This makes the robotic arm's scanning speed uniform, avoiding insufficient scanning coverage or differences in data acquisition density caused by uneven density of trajectory points, eliminating detection blind spots, and ensuring the integrity and consistency of ultrasonic C-scan imaging data. Attached Figure Description
[0059] Figure 1 This is a schematic diagram of a motion trajectory optimization method for ultrasonic scanning of an industrial robot according to the present invention;
[0060] Figure 2 This is a schematic diagram of the method for generating a smooth trajectory point sequence for robotic arm motion according to the present invention;
[0061] Figure 3 This is a schematic diagram of the motion trajectory optimization system for ultrasonic scanning of an industrial robot according to the present invention. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0063] Example 1
[0064] like Figures 1-2 The method for optimizing the motion trajectory in ultrasonic scanning of an industrial robot, as shown, specifically includes:
[0065] S1. Obtain the discrete path point set of the workpiece surface, and divide the path points into strictly constrained points and smooth points according to the rate of change of the normal direction at each path point;
[0066] The discrete path point set is obtained from the CAD model or 3D scanning. Each point in the set contains its 3D coordinates and corresponding surface normal vector. The rate of change of the normal direction at each path point relative to its neighboring points is calculated (e.g., by calculating the angle between the normal vectors of neighboring points, or by calculating the difference / curvature approximation of the normal vectors). Regions with large rates of change typically correspond to geometric discontinuities on the workpiece surface, such as:
[0067] Real key features: edges, corners, hole boundaries, and step transitions;
[0068] Significant noise points or tiny bumps / depressions introduced by the measurement;
[0069] The algorithm distinguishes the state of each path point in the point set by setting a threshold for the rate of change. Path points exceeding the threshold are defined as strictly constrained points. These points are considered to be geometric or process key points that must be passed precisely, and the algorithm will impose strict equality constraints on these points. Path points below the threshold are defined as smooth points. These points are located in relatively flat or continuously changing regions, and their positional noise and small-scale irregularities can be safely smoothed out without affecting the overall geometry and process requirements.
[0070] Furthermore, this step, through intelligent screening based on physical meaning, pre-distinguishes "feature points that must maintain shape" (i.e., strictly constrained points) and "ordinary points that can be smoothed" (i.e., smoothed points). This allows the subsequent constrained optimization model (KKT equations) to simultaneously pursue two objectives: strictly maintaining shape at constrained points and sufficiently denoising at smoothed points, which is the logical prerequisite for achieving high-quality scanning trajectories. Moreover, by using the objective geometric indicator of the rate of change of normal, the vast majority of key process points can be automatically and objectively identified and automatically marked as "strictly constrained points," greatly improving the automation and intelligence level of the method and reducing the reliance on human experience.
[0071] Ultimately, the division results of this step directly determine where the probe attitude must be strictly maintained and where the attitude can be smoothly changed, thereby ensuring the coupling quality of key areas while achieving overall smoothness of attitude movement and avoiding unnecessary jitter.
[0072] S2. Based on the discrete path point set, calculate the node vector, and then construct the B-spline characterization curve with unknown control points, the fitting error term, and the smoothing penalty term. The purpose is to establish a least squares B-spline fitting model with regularization (smoothing penalty).
[0073] Specifically, the chord length method is used to calculate the node vector based on discrete path points. Compared to uniform parameterization, the chord length method makes the parameters... The increment is proportional to the actual spatial distance (chord length) between adjacent data points. This is more in line with the physical meaning of the motion trajectory and can effectively avoid unnecessary distortion or oscillation of the curve in areas where data points are unevenly distributed, laying the foundation for high-quality curve approximation;
[0074] To ensure the generated B-spline curve closely approximates the original discrete path points and reflects the true geometric contour of the workpiece, a least squares method is used to define the fitting error term. This ensures the shape preservation of the optimization process and is the fundamental guarantee for trajectory accuracy. To prevent the curve from overfitting noise points and causing local jitter, a smoothing penalty term based on the second-order difference of control points is introduced, measuring the degree of "torsion" or "fluctuation" in the control point sequence.
[0075] In addition, the specific formula for constructing the B-spline characterization curve is as follows:
[0076]
[0077] in, For spline order, For node vectors, For the basis function value matrix, There are M control points to be identified, and their corresponding control point matrix is as follows: ;
[0078] Constructing a spline curve matrix based on B-spline characterization curves The specific calculation formula is as follows:
[0079]
[0080] The fitting error term is constructed based on the spline curve matrix, and the calculation formula is as follows:
[0081]
[0082] In the formula, These are discrete path points;
[0083] Its corresponding least squares equation is: .
[0084] In addition, the specific steps for constructing the smoothing penalty term are as follows:
[0085] Construct a second-order difference matrix The calculation formula is:
[0086]
[0087] Based on this difference matrix, a smoothing penalty term is constructed, and its calculation formula is as follows:
[0088]
[0089] in, To control the trade-off between fitting accuracy and smoothness, This is the control point matrix.
[0090] By defining a fitting error term and a smoothing penalty term, the vague engineering concepts of "accuracy" and "smoothness" are quantified into specific scalar objective functions. More importantly, this is achieved through a single parameter. Users can intuitively and continuously adjust the balance between these two to adapt to workpieces with different surface qualities (noise levels) and different scanning process requirements.
[0091] Furthermore, B-spline curves inherently possess the excellent characteristic of continuity. The smoothing penalty term, by suppressing the second-order difference of control points, further encourages the generation of curves with gentler curvature changes from the root of optimization. The combination of these two factors ensures that the final generated trajectory is not only high-order continuous in a functional sense, but also has a gentler curvature change, providing a perfect geometric path for generating motion commands with smooth velocity and acceleration; and the smoothing penalty term... This directly penalizes the high-frequency components of the control point sequence. During the optimization process, in order to minimize the overall objective, the algorithm automatically "sacrifices" a portion of the fitting to high-frequency noise in exchange for a smoother overall control point sequence, thus naturally filtering out these small-scale interferences on the output curve without the need for a specially designed filter.
[0092] S3. Based on the strict constraint points, construct the equality constraint matrix. The core principle of this step is to transform the uncompromising process and geometric requirements represented by the "strict constraint points" intelligently identified in step S1 into linear equality constraints that must be absolutely satisfied in the optimization problem. Since there are multiple strict constraint points, the basis function values of each constraint point are arranged in rows, and all constraint points constitute a matrix equation. The specific calculation formula is as follows:
[0093]
[0094] In the formula, For a strictly constrained set of points, The vector of control points to be found;
[0095] By using an equality constraint matrix, the algorithm "isolates" key feature points (strict constraint points) from the optimization objective. The optimization process can freely balance fitting and smoothing in the smooth point region, but it has absolutely no right to change the position of these constraint points. This is similar to sculpting: first, fix a few key outline points with nails, then polish the middle part, resulting in a final work that is smooth yet retains its basic form.
[0096] Furthermore, in ultrasonic testing, the starting and ending points of the scanning path, the weld centerline, and specific cross-sectional lines have strict process requirements. Therefore, this embodiment transforms these textual process requirements, which rely on human experience and attention, into automatically executed mathematical rules embedded in the algorithm core through steps S1 and S3. As long as the constraint points are correctly identified and input, the algorithm output will 100% meet these process requirements, eliminating the uncertainty of human operation and greatly improving the controllability, repeatability, and standardization of the testing process.
[0097] S4. Combine the fitting error term, the smoothing penalty term and the equality constraint matrix to construct and solve the KKT equation system to obtain the optimal solution of the control point. Substitute the optimal control point into the B-spline characterization curve to obtain the optimized B-spline curve.
[0098] The specific calculation formula for constructing the KKT equation system is as follows:
[0099]
[0100] in, To prevent singular small perturbation terms in the matrix, For Lagrange multipliers;
[0101] in It integrates the curvature information of the fitted term and the curvature / penalty information of the smoothing term, and drives the solution control points. At the same time, it approximates the data points while maintaining smoothness. Ensure the matrix in the top left corner is positive definite, thereby avoiding [problems caused by] The potential for numerical solution failures due to rank deficiency or ill-conditioned problems greatly enhances the numerical stability of the algorithm.
[0102] , 0 and 0 together constitute the mathematical expression of the constraint part in KKT conditions;
[0103] Used to drive fitting, Used for imposing constraints.
[0104] Furthermore, the KKT equations equivalently transform the original optimization problem into a linear system of equations. This means that without iteration, the global optimal solution under given constraints can be obtained directly through a single numerical solution. This eliminates the uncertainty and parameter tuning burden of traditional iterative methods, ensures the uniqueness and optimality of the solution, and makes the algorithm behavior completely predictable and repeatable. Ultimately, the KKT equations integrate the three inherently conflicting objectives of "minimizing fitting error," "maximizing smoothness," and "strictly satisfying constraints" into a unified mathematical framework for collaborative solution. Lagrange multipliers automatically appear in the solution, and their values themselves reflect the "trade-offs" or "costs" that need to be made in the optimization objective to satisfy each constraint.
[0105] This approach of obtaining the comprehensive optimal solution by solving a single system is more systematic, rigorous, and efficient than dealing with these objectives separately or using multi-stage heuristics. It ensures that the final generated curve is the only curve that can achieve the optimal fit and smoothing of the comprehensive objective under all hard constraints.
[0106] S5. Perform uniform arc length sampling on the optimized B-spline curve to generate a smooth trajectory point sequence for the robotic arm motion, specifically including:
[0107] S51. Calculate the arc length parameter function of the optimized B-spline curve. The calculation formula is as follows:
[0108]
[0109] in, It is the first derivative of a B-spline curve; it is calculated from the starting point of the curve. To any parameter The cumulative arc length at that point, It is the first derivative of the B-spline curve, and its magnitude represents the instantaneous "velocity";
[0110] S52. Within the total arc length interval, set the target sampling point number and generate a set of uniformly distributed target arc length values;
[0111] The number of sampling points is , In the formula, This represents the total length of the fitted curve. It sets the spacing between each path point on the curve, for each given target arc length. beg , making , will be obtained Substitute into the spline curve formula To calculate a spatial coordinate point ;
[0112] S53. For each target arc length value, the corresponding curve parameter value is obtained by numerical inverse solution method;
[0113] S54. Substitute the curve parameter values into the optimized B-spline curve equation to calculate the trajectory points in space, forming a sequence of trajectory points with uniform arc length distribution;
[0114] In step S5, the generated trajectory points are equidistantly distributed on the actual path through uniform arc length sampling. When the robotic arm controller (such as in position mode) tracks these points at fixed time intervals, its spatial motion speed naturally remains constant. This provides a fundamental guarantee for obtaining high-quality and consistent ultrasonic detection data. In addition, since most industrial robot trajectory interpolators (such as linear and circular interpolation) inherently pursue uniform spatial motion, the uniform arc length point sequence provided in this step includes uniform spatial point spacing, so that the robotic arm does not need to frequently accelerate / decelerate due to sudden changes in point spacing, reducing acceleration steps, thereby further smoothing the motion process, reducing vibration, tracking errors and mechanical wear, perfectly matching the underlying control logic, simplifying trajectory execution layer planning, and improving trajectory tracking accuracy and overall system stability.
[0115] Furthermore, the path points with equidistant arc lengths mean that the "time window" or "number of probe coverages" per unit length of working surface is the same on the scanning path. This ensures the integrity and consistency of the detection coverage and eliminates detection blind spots or data density differences caused by improper path planning from the root of sampling geometry.
[0116] S6. Determine the normal direction for each point in the generated trajectory point sequence, where the original normal direction is inherited for strictly constrained points; this strategy is directly derived from the classification in step S1. At geometrically / technically critical points, not only must the position be precisely passed through, but the ideal orientation of the probe (usually requiring the probe axis to be perpendicular to the workpiece surface) must also be definite and uncompromising. Directly inheriting the original normals of these points obtained from the CAD model or measurements ensures the absolute correctness of the ultrasonic incident angle at critical features from the source, which is the physical basis for obtaining effective echo signals;
[0117] For smooth points, spherical linear interpolation is used to smoothly transition between the normal directions of the first and last strictly constrained points; in the smooth region between two strictly constrained points, the workpiece surface geometry changes continuously, and the probe posture should also be smoothly adjusted accordingly.
[0118] The process involves a smooth transition between the normal directions of the strictly constrained points at the beginning and end using spherical linear interpolation, specifically including:
[0119] Determine the normal directions of the first and last strictly constrained points corresponding to the smoothing interval containing the smoothing point;
[0120] Calculate the angle between the two normal directions;
[0121] Based on the relative position parameter of the smoothing point within the interval, the normal direction is obtained by interpolation using the following formula:
[0122]
[0123] in, The direction of the normal to the strictly constrained point at the beginning. The normal direction of the strictly constrained point at the tail end. The angle between the two normal directions. This refers to the relative position parameter.
[0124] This step actually uses a smooth spatial rotation curve (attitude trajectory) to approximate the real complex normal field. This filters out high-frequency noise in the normal data and outputs a practical attitude trajectory that, although not perfectly matching every microscopic surface undulation, has the correct overall trend and excellent motion performance.
[0125] S7. Drive the robot's movements based on the sequence of trajectory points and the normal direction of each trajectory point.
[0126] Example 2
[0127] like Figure 3 The system shown is a motion trajectory optimization system for ultrasonic scanning of industrial robots, comprising:
[0128] The path point acquisition and classification module is used to acquire a discrete set of path points on the workpiece surface and classify the path points into strictly constrained points and smooth points according to the rate of change of the normal direction at each path point.
[0129] The curve modeling and error construction module is used to calculate the node vector based on the discrete path point set, and then construct the B-spline characterization curve with unknown control points, the fitting error term, and the smoothing penalty term.
[0130] The constraint matrix construction module is used to construct equality constraint matrices based on strict constraint points;
[0131] The KKT solution and curve generation module is used to combine the fitting error term, smoothing penalty term and equality constraint matrix to construct and solve the KKT equation system, obtain the optimal solution of the control point, and substitute the optimal control point into the B spline characterization curve to obtain the optimized B spline curve.
[0132] The uniform sampling module is used to sample the optimized B-spline curve with uniform arc length to generate a smooth trajectory point sequence for the robot arm's motion.
[0133] The normal direction generation module is used to determine the normal direction for each point in the generated trajectory point sequence.
[0134] Example 3
[0135] An electronic device, comprising:
[0136] Processor, memory, communication interface;
[0137] The memory is used to store the executable instructions of the processor;
[0138] The processor is configured to execute the motion trajectory optimization method in ultrasonic scanning of an industrial robot by executing the executable instructions.
[0139] A readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method for optimizing the motion trajectory in ultrasonic scanning of an industrial robot.
[0140] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for optimizing the motion trajectory in ultrasonic scanning of industrial robots, characterized in that, Specifically, it includes: S1. Obtain the discrete path point set of the workpiece surface, and divide the path points into strictly constrained points and smooth points according to the rate of change of the normal direction at each path point; The state of each path point in the point set is distinguished by a preset rate of change threshold. Path points that exceed the rate of change threshold are defined as strictly constrained points, and path points that are below the rate of change threshold are defined as smooth points. S2. Based on the discrete path point set, calculate the node vector, and then construct the B-spline representation curve containing unknown control points, the fitting error term, and the smoothing penalty term; S3. Construct an equality constraint matrix based on strict constraint points; S4. Combine the fitting error term, the smoothing penalty term and the equality constraint matrix to construct and solve the KKT equation system to obtain the optimal solution of the control point. Substitute the optimal control point into the B-spline characterization curve to obtain the optimized B-spline curve. S5. Perform uniform arc length sampling on the optimized B-spline curve to generate a smooth trajectory point sequence for the robotic arm motion; S6. Determine the normal direction for each point in the generated sequence of trajectory points; For strictly constrained points, the original normal direction is inherited; for smooth points, they are generated by spherical linear interpolation to smoothly transition between the normal directions of the first and last strictly constrained points. S7. Drive the robot's movements based on the sequence of trajectory points and the normal direction of each trajectory point.
2. The method for optimizing motion trajectory in ultrasonic scanning of industrial robots according to claim 1, characterized in that: In step S2, the chord length method is used to calculate the node vector based on the discrete path points.
3. The method for optimizing motion trajectory in ultrasonic scanning of industrial robots according to claim 1, characterized in that: The specific formula for constructing the B-spline characterization curve is as follows: in, For spline order, For node vectors, For the basis function value matrix, There are M control points to be identified, and their corresponding control point matrix is as follows: ; Constructing a spline curve matrix based on B-spline characterization curves The specific calculation formula is as follows: The fitting error term is constructed based on the spline curve matrix, and the calculation formula is as follows: In the formula, These are discrete path points; Its corresponding least squares equation is: In the formula, Basis function value matrix The transpose of .
4. The method for optimizing motion trajectory in ultrasonic scanning of industrial robots according to claim 3, characterized in that: The specific steps to construct the smoothing penalty term are as follows: Construct a second-order difference matrix The calculation formula is: Based on this difference matrix, a smoothing penalty term is constructed, and its calculation formula is as follows: in, To control the trade-off between fitting accuracy and smoothness, This is the control point matrix.
5. The method for optimizing motion trajectory in ultrasonic scanning of industrial robots according to claim 4, characterized in that: The equation constraint matrix is constructed based on strict constraint points. The specific calculation formula is as follows: In the formula, It is a set of strictly constrained points.
6. The method for optimizing the motion trajectory in ultrasonic scanning of industrial robots according to claim 5, characterized in that: The KKT equation system is constructed, and the specific calculation formula is as follows: in, To prevent singular small perturbation terms in the matrix, It is a Lagrange multiplier.
7. The method for optimizing motion trajectory in ultrasonic scanning of industrial robots according to claim 6, characterized in that: The step of uniformly sampling the optimized B-spline curve to generate a smooth trajectory point sequence for the robotic arm motion specifically includes: S51. Calculate the arc length parameter function of the optimized B-spline curve; S52. Within the total arc length interval, set the number of target sampling points and generate a set of uniformly distributed target arc length values; S53. For each target arc length value, the corresponding curve parameter value is obtained by numerical inverse solution method; S54. Substitute the curve parameter values into the optimized B-spline curve equation to calculate the trajectory points in space, forming a sequence of trajectory points with uniform arc length distribution.
8. The method for optimizing motion trajectory in ultrasonic scanning of industrial robots according to claim 7, characterized in that: The arc length parameter function of the optimized B-spline curve is calculated using the following formula: in, It is the first derivative of the B-spline curve.
9. The method for optimizing motion trajectory in ultrasonic scanning of industrial robots according to claim 1, characterized in that: The process of smoothly transitioning between the normal directions of the strictly constrained points at the beginning and end through spherical linear interpolation specifically includes: Determine the normal directions of the first and last strictly constrained points corresponding to the smoothing interval containing the smoothing point; Calculate the angle between the two normal directions; Based on the relative position parameter of the smoothing point within the interval, the normal direction is obtained by interpolation using the following formula: in, The direction of the normal to the strictly constrained point at the beginning. The normal direction of the strictly constrained point at the tail end. The angle between the two normal directions. This refers to the relative position parameter.