Five-axis machining tool path planning method for complex curved surface

By calculating Gaussian curvature and clustering regions using discrete surfaces, high-precision five-axis machining tool trajectories for complex surfaces are generated. This solves the problem of insufficient curvature feature mining in existing technologies and improves machining accuracy and adaptability.

CN120928774AActive Publication Date: 2025-11-11信阳星原智能科技有限公司

Patent Information

Application Number
CN202511042702.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2025-11-11
Estimated Expiration
2045-07-28

AI Technical Summary

Technical Problem

Existing technologies lack efficient curvature feature mining and clustering strategies in the machining of complex curved surfaces, resulting in insufficient surface fitting accuracy, sudden changes in tool load during machining, affecting surface quality and tool life, and unreasonable distribution of trajectory points, which affects machining accuracy.

Method used

Gaussian curvature is calculated by discrete surfaces, regions are clustered and fitted with equations, a spiral equation is constructed to generate cross-surface trajectories, the tool axis angle is optimized, and high-precision tool trajectory planning is generated by integrating full-process data.

Benefits of technology

It achieves high-precision and highly adaptable tool path planning for five-axis machining of complex curved surfaces, improving the machining accuracy and surface quality of curved surfaces and reducing tool wear.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120928774A_ABST
    Figure CN120928774A_ABST
Patent Text Reader

Abstract

The invention discloses a five-axis machining tool path planning method for a complex curved surface, and relates to the technical field of numerical control machining. Subregions are divided based on the Gaussian curvature of a curved surface model, and a region equation is fitted; projecting the sub-regions and screening to obtain a boundary point set, fitting a curved surface equation by adopting cubic NURBS, and performing normal vector and curvature constraint optimization to splice an optimal curved surface equation; setting a section plane, calculating a section curve, calculating an arc length based on a Simpson formula, and planning a track point coordinate sequence according to the curvature; constructing a spiral equation of adjacent section planes, calculating a spiral step length based on a Simpson formula according to a position and tangent continuous constraint solving coefficient, and generating a cross-plane track point sequence; in the section plane, based on lossless and cutting direction constraints, an optimal angle sequence is obtained through optimization of a genetic algorithm, and a cross-plane angle sequence is obtained through cosine interpolation; and a machining pose sequence is generated through integration, and high-precision machining of the complex curved surface is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of CNC machining technology, and more specifically to a five-axis tool trajectory planning method for machining complex curved surfaces. Background Technology

[0002] In the field of complex surface machining, five-axis machining is of great significance to industries such as aerospace and mold manufacturing because it can achieve more complex and high-precision surface machining. Precise toolpath planning can improve surface machining accuracy and surface quality, shorten machining time, reduce tool wear, and help high-end equipment manufacturing develop towards greater precision and efficiency, meeting the stringent surface quality requirements of complex products.

[0003] Existing technologies are insufficient in mining the curvature features of discrete points on complex surfaces and lack efficient clustering strategies to distinguish curvature clusters, causing region partitioning errors to affect the accuracy of subsequent surface fitting. Traditional surface fitting relies on the basic NURBS algorithm, where geometric abrupt changes can easily occur at the junctions of different sub-regions, leading to sudden changes in tool load during machining and affecting surface quality and tool life. In existing trajectory generation algorithms, parameter step size planning relies on experience or simple equidistant strategies without incorporating dynamic curvature adjustment, resulting in unreasonable trajectory point distribution, uneven tool movement, and reduced machining accuracy. Summary of the Invention

[0004] This invention addresses the shortcomings of existing technologies by proposing a five-axis tool trajectory planning method for complex curved surfaces. For five-axis machining of complex curved surfaces, the method calculates curvature of discrete surfaces, clusters and divides regions, fits equations, generates trajectory points through the cutting plane, constructs spiral equations to generate cross-surface trajectories, optimizes tool axis angles using a genetic algorithm and interpolates cross-surface angles, and finally integrates the entire process data to generate a machining pose sequence, achieving high-precision and highly adaptable tool trajectory planning.

[0005] The technical solution to achieve the objective of this invention is as follows:

[0006] A five-axis toolpath planning method for machining complex curved surfaces includes the following steps:

[0007] Discrete surface model and calculate the Gaussian curvature of discrete points to obtain the discrete point set. Clustering is used to determine curvature clusters. Region growing and convex hull calculations are then used to obtain a set of sub-regions for each curvature cluster. Each sub-region is resampled and its region equation is fitted. m and κ m Let be the coordinates and Gaussian curvature of the m-th discrete point, respectively, and M be the total number of discrete points;

[0008] Each sub-region is projected onto a plane, and the boundary point set of each sub-region is identified and selected. The regional surface equation of each sub-region is fitted using a cubic NURBS algorithm, and the splicing is optimized based on normal vector constraints and curvature constraints to generate the optimal surface equation. u and v are the horizontal and vertical parameters, respectively;

[0009] Set N cross-sectional planes and calculate the equation of the optimal surface for each. The equation of the intersection curve is obtained, the arc length of the curve of each intersection plane is calculated based on Simpson's formula, and the parameter step size of each intersection plane is planned based on curvature to generate the trajectory point coordinate sequence of each intersection plane.

[0010] Construct the helical equations for adjacent cross-sections and solve for the helical coefficients based on positional and tangent continuity constraints. Then, combine Simpson's formula with the maximum travel distance d. max The spiral step length is calculated step by step to generate a sequence of cross-plane trajectory point coordinates between adjacent cross-sections;

[0011] Construct the tool axis vector g in each cutting plane to We set lossless constraints and cutting direction constraints to maximize the satisfaction. We use a genetic algorithm to optimize the optimal angle sequence of each cross-section and generate the optimal cross-plane angle sequence of adjacent cross-sections by cosine interpolation.

[0012] Integrate the trajectory point coordinate sequence and optimal angle sequence of each cross-section plane, and the cross-plane trajectory point coordinate sequence and optimal cross-plane angle sequence of adjacent cross-section planes to construct the machining pose sequence and forward it to the five-axis machining center.

[0013] Furthermore, M discrete points are generated on the surface model, and the neighborhood N(p) of the m-th discrete point is determined by KD-tree search. m ), p m Given the coordinates of the m-th discrete point, the least squares method is used to fit the neighborhood N(p) m The equation of the local tangent plane at the m-th discrete point is obtained, and the normal vector of the m-th discrete point is determined based on the coefficients of the first-order terms. Calculate the direction vector of the vertical axis The normal vector of the m-th discrete point The included angle and the neighborhood N(p) m The coordinates of a point within a given area in the world coordinate system are transformed to the normal vector of the m-th discrete point. The local coordinates in the local coordinate system of the vertical axis are fitted to the neighborhood N(p) using a quadratic polynomial. m The local surface function of any point in the local coordinate system is obtained, and the Hessian matrix is ​​constructed based on the coefficients of the quadratic terms. The maximum principal curvature of the m-th discrete point is obtained by eigenvalue decomposition of the Hessian matrix. and minimum principal curvature Multiplying them together yields the Gaussian curvature κ at the m-th discrete point.m Calculate the Gaussian curvature of M discrete points to obtain the discrete point set.

[0014] Furthermore, the set of sub-regions for each curvature cluster is obtained using region growing and convex hull calculation, including the following steps:

[0015] Select the unlabeled discrete point with the largest Gaussian curvature in the i-th curvature cluster as the seed point of the growth queue and label it. The i-th curvature cluster is obtained by Kmeans++ clustering discrete points according to Gaussian curvature, i∈{1,2,3}.

[0016] All neighboring points of the seed point are determined by KD tree search. The Gaussian curvature difference between each neighboring point and the seed point is calculated and compared with the curvature threshold. The curvature threshold is equal to the Gaussian curvature of the seed point multiplied by the scaling factor.

[0017] Add unmarked neighborhood points that are less than or equal to the curvature threshold to the growth queue, use them as new seed points and mark them, perform neighborhood search on the new seed points, and ignore neighborhood points that are greater than the curvature threshold or that are already marked.

[0018] Repeat until no new seed point can be found, and a growth queue is obtained. The seed point of the new growth queue is selected again based on whether there are unlabeled discrete points in the i-th curvature cluster, or a sub-region point set is constructed based on the discrete points of each growth queue.

[0019] Construct the minimum bounding box of each sub-region point set in the i-th curvature cluster and use the convex hull generation algorithm to calculate the sub-region corresponding to each sub-region point set, thereby generating the sub-region set of the i-th curvature cluster.

[0020] Specifically, the density ρ of the sub-region in the third curvature cluster is set to the initial density value ρ0, and the mean Gaussian curvature of each sub-region in the first and second curvature clusters is calculated. The density ρ of each subregion in the first and second curvature clusters is set to the initial density value ρ0 and the mean Gaussian curvature. The product of the linear correction formula is used, and Poisson disk sampling is employed. The minimum sampling radius r is calculated based on the density ρ of the sub-region. Within the j-th sub-region of the i-th curvature cluster, a discrete point whose minimum distance to the sub-region boundary is greater than or equal to the minimum sampling radius r is randomly selected and added to the active list. When the active list is not empty, the center point of the sphere in the active list is randomly selected and random sampling is performed within the sampling radius r. Points that do not exceed the sub-region boundary are added to the sub-region point set, and points whose minimum distance to the sub-region boundary is greater than or equal to the minimum sampling radius r are added to the active list while the selected center point is removed. This process is iterated until the active list is empty, resulting in the sub-region point set of the j-th sub-region in the i-th curvature cluster. The corresponding region equation is obtained by fitting a quadratic polynomial.

[0021] Specifically, the j-th sub-region in the i-th curvature cluster is projected onto the xoy plane and meshed. Mesh grids with no discrete points inside and discrete points in adjacent grids, or grids with fewer than a threshold number of discrete points inside, are marked as boundary grids. A candidate boundary point set for the j-th sub-region in the i-th curvature cluster is constructed based on the discrete points in all boundary grids and filtered using a recursive partitioning algorithm. The starting and ending points of the candidate boundary point set are connected to form line segments. The candidate boundary points located in the middle of the two endpoints of the line segment are taken as the midpoints of the line segments, and the distance from the midpoint to the line segment is calculated. If the distance is greater than the distance threshold, the line segment is split and the midpoint of each line segment is reselected. If the distance is less than or equal to the distance threshold, the midpoint of the line segment is removed and reselected. This process is repeated recursively until all candidate boundary points are traversed, resulting in the boundary point set for the j-th sub-region in the i-th curvature cluster.

[0022] Furthermore, a cubic NURBS algorithm is used to fit the regional surface equation of each sub-region, and the splicing is optimized based on normal vector constraints and curvature constraints to generate the optimal surface equation. Includes the following steps:

[0023] We select cubic B-spline basis functions to fit the boundary point set of the j-th sub-region in the i-th curvature cluster, and iteratively adjust the control points to minimize the region surface equation s of the j-th sub-region in the i-th curvature cluster. i,j (u,v) and the region equation The error is used to generate the region surface equation s of the j-th sub-region in the i-th curvature cluster. i,j (u,v);

[0024] Define a normal vector constraint that requires the angle between the normal vectors of any two spatially adjacent sub-regions to be less than or equal to an angle threshold, and define a curvature constraint that requires the curvature deviation between any two spatially adjacent sub-regions to be less than or equal to a dynamic curvature threshold.

[0025] The optimization objective is to minimize the weighted sum of the angles between the normal vectors of any two spatially adjacent sub-regions and the sum of their curvature deviations. A gradient descent algorithm is used to optimize the control points until the optimization objective converges, yielding the optimal region surface equations for all sub-regions. These optimal surface equations are then concatenated.

[0026] Furthermore, N cutting planes are set up and their equations with the optimal surface are calculated respectively. The equation of the intersection curve is obtained, and the arc length of the curve at each intersection plane is calculated based on Simpson's formula, including the following steps:

[0027] Set N equally spaced cutting planes and solve the optimal surface equations simultaneously. The equation of the intersecting plane with the nth intersecting plane is z = z n The equation F of the intersection curve of the nth intersecting plane is obtained.n (u,v)=0, where z n Let be the vertical axis value of the nth cutting plane in the world coordinate system;

[0028] The equation F of the intersection curve of the nth cutting plane is determined using the ray method. n The horizontal parameter corresponding to the first solution of (u,v)=0 With longitudinal parameters Substitute into the optimal horizontal axis mapping Mapping with the optimal vertical axis The coordinates of the first solution are obtained.

[0029] Based on the intersection curve equation F of the nth intersecting plane n (u,v)=0 constructs the Jacobian matrix J of the nth cut-off plane. n Using Newton's iteration method, in the a-th iteration, the (a+1)-th approximate solution is equal to the a-th approximate solution minus the Jacobian matrix J. n The inverse matrix multiplied by the a-th approximate solution is substituted into the intersection curve function F. n Approximate values ​​obtained from (u,v);

[0030] Calculate the approximate value corresponding to the (a+1)th approximate solution and determine whether it is less than the minimum threshold. If it is less than the minimum threshold, calculate the solution coordinates of the (a+1)th approximate solution. If it is greater than or equal to the minimum threshold, discard it.

[0031] Repeat the iteration until Q solution coordinates are obtained in the nth intercept plane. Then, use the polar coordinate sorting method to calculate the (q+1)th solution coordinates. Coordinates of the qth solution The length of the solution segment d(q, q+1) is determined by statistically analyzing the solution segment lengths. The coordinates of the Q solutions within the nth intersecting plane are then determined with respect to the parameter t. n Parametric equations are formed, and the equations of the nth cutting plane and the optimal surface are obtained by fitting the equations using the B-spline algorithm. The equation of the intersection curve F n (x n (t n ),y n (t n ),z n ) = 0, where x n (t n ) and y n (t n ) are the x-axis parameter functions of the nth cross-section plane. n (t n ) and the vertical axis parameter function y n (t n ).

[0032] Furthermore, based on Simpson's formula, the arc length of the curve for each cross-section is calculated, and the parameter step size for each cross-section is planned based on curvature to generate a sequence of trajectory point coordinates for each cross-section, including the following steps:

[0033] In the nth intersecting plane, the first derivative x′ of the horizontal axis n (t n ), first derivative x′ on the vertical axis n (t n The arithmetic square root of f is defined as the infinitesimal arc length f of the curve intersecting the nth plane. n (t n The arc length L of the intersection curve of the nth intersecting plane is calculated using Simpson's formula. n ;

[0034] Based on the first derivative of the horizontal axis x n ′(t n ), second derivative x′ on the horizontal axis n ′(t n ), first derivative of the vertical axis y n ′(t n ), the second derivative of the vertical axis y′ n The curvature parameter κ of the intersection curve of the nth intersecting plane is constructed using the formula ′(t). n (t n Substitute the coordinates of the q-th solution. Corresponding parameters The corresponding curvature value is calculated. It is then compared with a fixed threshold, which is the reciprocal of the surface model size R;

[0035] If it is greater than or equal to a fixed threshold, the parameter range will be adjusted. Inner parameter step size Set as initial parameter step size The product of the product with the fixed threshold and divided by the parameter Corresponding curvature value If it is less than a fixed threshold, the parameter range will be adjusted. Inner parameter step size Set as initial parameter step size With parameter step size In the parameter range Internal trajectory parameters are added, including the parameter range. Initial parameter step size Equal to the maximum travel distance d of the tool max Divide by parameter Corresponding arc length infinitesimal element

[0036] Based on the intersection curve equation F n (x n (tn ),y n (t n ),z n The formula ) = 0 converts the trajectory parameters on the intersection curve of the nth cutting plane into the corresponding trajectory point coordinates, generating the trajectory point coordinate sequence P of the nth cutting plane. n W n This represents the total number of trajectory points on the nth cross-section.

[0037] Furthermore, the helical equations of adjacent cross-sections are constructed and the helical coefficients are solved based on position constraints and tangent continuity constraints, including the following steps:

[0038] Let the number of spiral turns be h, and calculate the W-th spiral of the nth cross-section. n coordinates of trajectory points Intersecting tangent vector The coordinates of the first trajectory point on the (n+1)th cross-section plane Intersecting tangent vector

[0039] Set the spiral equation from the nth cutting plane to the (n+1)th cutting plane. Let be the helical parameters from the nth cutting plane to the (n+1)th cutting plane.

[0040] Set positional constraints, requiring the coordinates F of the first cross-plane trajectory point to be... n,n+1 (0) and the coordinates of the last cross-plane trajectory point F n,n+1 (1) The Wth segment of the nth intersecting plane respectively n coordinates of trajectory points The coordinates of the first trajectory point on the (n+1)th cross-section plane coincide;

[0041] Set a tangent continuity constraint, requiring the W-th tangent of the nth cutting plane to be continuous. n coordinates of trajectory points The coordinates of the first trajectory point on the (n+1)th cross-section plane The direction of the tangent at the intersection is consistent with the direction of the intersecting tangent vector;

[0042] Solving the spiral equations simultaneously from the nth to the (n+1)th cutting plane Calculate the helix equation based on positional constraints and tangent continuity constraints. Horizontal axis helical coefficient and vertical axis helical coefficient

[0043] Specifically, the spiral equations from the nth to the (n+1)th cross-sections are calculated based on Simpson's formula. first-order spiral derivative of the horizontal axis and the first derivative of the vertical axis spiral Calculate the infinitesimal element of the spiral arc length Starting from the coordinates of the first cross-plane trajectory point, substitute the spiral parameters corresponding to the coordinates of the first cross-plane trajectory point into the infinitesimal element of the spiral arc length. Take the reciprocal and then divide it by the maximum movement distance d. max Multiply to obtain the first spiral step size Determine the coordinates of the second cross-plane trajectory point and the corresponding spiral parameters, and repeat this process until the second cross-plane trajectory point is reached. When the helical parameter corresponding to the coordinates of the first cross-plane trajectory point is greater than or equal to 1, the first... The coordinates of each cross-plane trajectory point are set as the coordinates of the last cross-plane trajectory point, generating a sequence P of cross-plane trajectory point coordinates from the nth cutting plane to the (n+1)th cutting plane. n,n+1 , This represents the total number of cross-plane trajectory points from the nth cutting plane to the (n+1)th cutting plane.

[0044] Specifically, the angle θ of the cutting tool is defined as including the deflection angle θ. ob With the tilt angle θ in Construct the tool axis vector g to Within the nth cutting plane, a non-destructive constraint is set requiring that the cosine value of the angle between the tool axis vector and the normal vector at each trajectory point in the nth cutting plane is less than or equal to a cosine threshold. A cutting direction constraint is set requiring that the tool axis vector at each trajectory point in the nth cutting plane (z = z) ≤ z n The projection direction vector at the nth cutting plane is in the same direction as the intersection tangent vector. The dot product of the tool axis vector and the normal vector at all trajectory points within the nth cutting plane is defined as the lossless satisfaction. The negative cosine of the angle between the projection direction vector and the intersection tangent vector at all trajectory points within the nth cutting plane, plus 1, is defined as the cutting satisfaction. A genetic algorithm is used to iteratively update the angles at all trajectory points with the goal of maximizing the lossless satisfaction and the cutting satisfaction, thus obtaining the optimal angle sequence for the nth cutting plane.

[0045] Specifically, the optimal angle sequence from the nth intercept plane The optimal angle sequence of the (n+1)th intercept plane Obtain the Wth from each n coordinates of trajectory points Optimal angle and the coordinates of the first trajectory point Optimal angle The optimal span angle sequence from the nth to the (n+1)th cross-section is generated using cosine interpolation. That is, the first The optimal cross-plane angle Equal to the Wth digit in the nth intersecting planen coordinates of trajectory points The optimal angle at point n plus the optimal angle sequence of the (n+1)th intercept plane Coordinates of the first trajectory point With the Wth segment in the nth intersecting plane n coordinates of trajectory points The optimal angle difference is linearly extrapolated, and the extrapolation coefficients are linearly related to the optimal span angle. order Multiply by π to get the total number of points on the cross-plane trajectory from the nth to the (n+1)th cross-plane. The cosine value of the ratio.

[0046] Compared with existing technologies, this invention calculates Gaussian curvature using a discrete surface model and clusters it to determine curvature clusters. Sub-regions are generated through region growing and equation fitting. Boundary points are identified by projecting sub-regions, and the surface equations are fitted and optimized using a cubic NU RBS algorithm. Intersection planes are set to calculate intersection curves, and trajectory points are generated based on Simpson's formula and parameter step size planning. Spiral equations for adjacent intersection planes are constructed, coefficients are solved, and step size is calculated to generate cross-plane trajectories. Tool axis vectors are constructed within the intersection planes, and angle sequences are optimized using a genetic algorithm and cosine interpolation is applied to cross-plane angles. Finally, the machining pose sequence is integrated to generate a complete machining pose sequence. From sub-region division, surface fitting, trajectory generation to tool axis optimization, this invention innovatively improves the accuracy and adaptability of five-axis machining trajectory planning for complex surfaces. Attached Figure Description

[0047] Figure 1 This is a flowchart of a five-axis tool path planning method for machining complex curved surfaces.

[0048] Figure 2 This is a flowchart of the region growth process in this invention;

[0049] Figure 3 The flowchart for generating the optimal surface equation in this invention is shown below;

[0050] Figure 4 This is a flowchart of the Newton iteration method in this invention. Detailed Implementation

[0051] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0052] like Figure 1 As shown, this invention discloses a five-axis tool path planning method for machining complex curved surfaces, comprising the following steps:

[0053] The surface model is uniformly discretized and the Gaussian curvature of each discrete point is calculated to obtain the discrete point set. Curvature clusters are determined by curvature clustering, and within each curvature cluster, a set of sub-regions is obtained through region growing and convex hull calculation. Based on density ρ, each sub-region is resampled, and the region equation for each sub-region is obtained by least squares fitting. m and κ m Let be the coordinates and Gaussian curvature of the m-th discrete point, respectively, and M be the total number of discrete points;

[0054] Each sub-region is projected onto a two-dimensional plane. Candidate boundary points among discrete points within each sub-region are identified and filtered to obtain the boundary point set for each sub-region. The regional surface equation of each sub-region is fitted using a cubic NURBS algorithm, and the splicing is optimized based on normal vector constraints and curvature constraints to generate the optimal surface equation. Where u and v are the horizontal and vertical parameters in the cubic NURBS algorithm, respectively;

[0055] N cross-sectional planes are set at a preset height along the vertical axis of the world coordinate system, respectively corresponding to the optimal surface equation. Solve the equations of the intersection curves of N intersecting planes simultaneously, calculate the arc length of the curve for each intersecting plane based on Simpson's formula, and adaptively plan the parameter step size for each intersecting plane based on curvature to generate the coordinate sequence of trajectory points for each intersecting plane.

[0056] Construct the spiral equation between adjacent cross-sections, set position constraints and tangent continuity constraints and solve the spiral coefficient. Based on Simpson's formula and the maximum tool travel distance, gradually deduce the spiral step size between trajectory points to generate a cross-plane trajectory point coordinate sequence between adjacent cross-sections.

[0057] Within each cross-sectional plane, based on the tool's deflection angle θ ob With the tilt angle θ in Construct the tool axis vector g to We establish lossless constraints and cutting direction constraints, aiming to maximize lossless satisfaction and cutting satisfaction. We optimize the optimal angle sequence of each cross-section using a genetic algorithm, and generate the optimal cross-plane angle sequence between each cross-section and the next cross-section using cosine interpolation.

[0058] The N cross-sectional plane trajectory point coordinate sequences are concatenated row-wise with the trajectory point coordinates and optimal angles of the same trajectory points in the optimal angle sequence to generate N cross-sectional plane planar machining pose sequences. The N-1 cross-plane trajectory point coordinate sequences are concatenated column-wise with the cross-plane trajectory point coordinates and optimal cross-plane angles of the same cross-plane trajectory points in the corresponding optimal cross-plane angle sequence to generate N-1 cross-plane machining pose sequences. The N cross-sectional plane planar machining pose sequences are arranged from low to high according to the cross-sectional plane height. The cross-plane machining pose sequences are inserted into the machining pose sequences of the two connected cross-sectional planes to generate machining pose sequences and forward them to the five-axis machining center.

[0059] Furthermore, M uniformly distributed discrete points are generated on the surface model, starting from the coordinates p of the m-th discrete point. m Starting from this point, a neighborhood search is performed using a KD-tree to determine the neighborhood N(p) of the m-th discrete point. m Based on neighborhood N(p) m For discrete points in the array, the equation of the local tangent plane at the m-th discrete point is fitted using the least squares method. The normal vector of the m-th discrete point is then determined based on the coefficients of the first-order terms of the local tangent plane equation. Calculate the direction vector of the vertical axis of the world coordinate system The normal vector of the m-th discrete point The included angle and based on the geometric transformation formula, the neighborhood N(p) of the m-th discrete point. m The coordinates (x, y, z) of any point within the array are transformed to the normal vector of the m-th discrete point. The local coordinates (x) in the local coordinate system of the vertical axis lo ,y lo ,z lo ), where x, y, and z are the horizontal, vertical, and triangular values ​​of the world coordinate system, respectively. lo y lo and z lo Let N(p) represent the x, y, and y axes of the local coordinate system, respectively. Then, in the local coordinate system of the m-th discrete point, a quadratic polynomial is used to fit the neighborhood N(p) of the m-th discrete point. m The vertical axis value z at any point within the range lo Regarding the x-axis value lo and the vertical axis value y lo The local surface function is obtained, and a 2×2 Hessian matrix is ​​constructed based on the quadratic coefficients of the local surface function. The maximum principal curvature at the m-th discrete point is obtained by eigenvalue decomposition of the Hessian matrix. and minimum principal curvature Multiplying yields the Gaussian curvature at the m-th discrete point. Wherein, the maximum principal curvature of the m-th discrete point and minimum principal curvature Let κ represent the curvature of the local surface at the m-th discrete point, reflecting the directions of most severe and gentlest curvature, respectively. m This reflects the curvature type of the local surface at the m-th discrete point. The Gaussian curvature of the M discrete points is calculated using the same method to obtain the discrete point set.

[0060] Furthermore, curvature clusters are determined through curvature clustering, and a set of sub-regions within each curvature cluster is obtained through region growing and convex hull calculation, including the following steps:

[0061] The number of clusters is set to 3, and Kmeans++ is used to analyze the discrete point set based on Gaussian curvature. Iterative clustering is performed to obtain the first curvature cluster, the second curvature cluster, and the third curvature cluster, which correspond to discrete points with high curvature, medium curvature, and low curvature, respectively.

[0062] like Figure 2 As shown, the unmarked discrete point with the largest Gaussian curvature in the i-th curvature cluster is selected as the seed point of the growth queue and marked as "grown", i∈{1,2,3};

[0063] A neighborhood search is performed on the seed point using a KD-tree to determine all neighboring points of the seed point.

[0064] Multiply the Gaussian curvature of the seed point by a scaling factor to obtain the curvature threshold, calculate the Gaussian curvature difference between each neighboring point and the seed point, and compare it with the curvature threshold to determine the result.

[0065] Add unmarked neighborhood points that are less than or equal to the curvature threshold to the growth queue. Use the neighborhood points added to the growth queue as new seed points and mark them as "grown". Continue to search for neighborhoods for the new seed points, ignoring neighborhood points that are greater than the curvature threshold or that are already marked.

[0066] The loop repeats until no new seed point can be found, resulting in a growth queue. Then, it is determined whether there are any unmarked discrete points in the i-th curvature cluster.

[0067] If it exists, then select the unmarked discrete point with the largest Gaussian curvature in the i-th curvature cluster as the seed point of the new growth queue and perform neighborhood search and comparison judgment.

[0068] If it does not exist, then construct a sub-region point set for each discrete point in each growth queue of the i-th curvature cluster, and obtain all sub-region point sets of the i-th curvature cluster;

[0069] The minimum bounding box is constructed based on the discrete points in the point set of each sub-region of the i-th curvature cluster. The convex hull generation algorithm is used to calculate the convex hull of each sub-region point set to obtain the sub-region corresponding to each sub-region point set of the i-th curvature cluster. The sub-region set of the i-th curvature cluster is then generated by combining the points. The convex hull generation algorithm is an existing algorithm and will not be described in detail.

[0070] Specifically, the density ρ is set based on the curvature cluster type to which the sub-region belongs. For sub-regions in the third curvature cluster, the density ρ is set to the initial density value ρ0. For sub-regions in the first and second curvature clusters, the mean Gaussian curvature of discrete points within the sub-region is calculated. Density ρ is set as the initial density value ρ0 and the mean Gaussian curvature. The product of the linear corrections is as follows:

[0071]

[0072] Where α is a correction coefficient pre-set based on the dimensions of the surface model, Poisson disk sampling is used, and the minimum sampling radius is calculated based on the sphere volume formula and density ρ. In the j-th sub-region of the i-th curvature cluster, randomly select a discrete point whose minimum distance to the sub-region boundary is greater than or equal to the minimum sampling radius r and add it to the active list. If the active list is not empty, randomly select a point from the active list as the center point. Randomly sample M0 points within a sphere of sampling radius r. Add points that do not exceed the sub-region boundary to the sub-region point set. Add points whose minimum distance to the sub-region boundary is greater than or equal to the minimum sampling radius r to the active list and remove the center point from the active list. Iterate until the active list is empty, thus obtaining the sub-region point set of the j-th sub-region in the i-th curvature cluster. Use a quadratic polynomial basis function Φ = [1, x, y, x...]. 2 ,xy,y 2 ] T Construct the system of equations z = βΦ, and solve for the coefficient vector β = [β1, β2, β3, β4, β5]. T The region equation of the j-th sub-region in the i-th curvature cluster is obtained by fitting. The region equation of the j-th subregion in the i-th curvature cluster It reflects the distribution trend of discrete points in the j-th sub-region of the i-th curvature cluster.

[0073] Specifically, the j-th sub-region in the i-th curvature cluster is projected onto the xoy plane of the world coordinate system, and the xoy plane is meshed. Based on the boundary point identification rule, meshes with zero internal discrete points and whose adjacent meshes contain discrete points of the j-th sub-region in the i-th curvature cluster, or meshes with fewer internal discrete points than a threshold, are marked as boundary meshes. The discrete points within the boundary meshes are used as candidate boundary points to form the candidate boundary point set for the j-th sub-region in the i-th curvature cluster. A recursive partitioning algorithm is used to filter the candidate boundary point set. The first and last candidate boundary points in the set are used as the start and end points, respectively, and connected to form a line segment. The candidate boundary points located between the start and end points are selected. Candidate boundary points are selected and used as the midpoints of line segments. The distance from the midpoint to the line segment is calculated. If the distance is greater than the distance threshold, the line segment is split and the midpoint is used as the end point of the first line segment and the starting point of the second line segment. The midpoint is selected again for each line segment. If the distance is less than or equal to the distance threshold, the midpoint selected this time is removed and the midpoint of the line segment is selected again. This process is repeated recursively until all candidate boundary points in the candidate boundary point set are processed, resulting in the boundary point set of the j-th sub-region in the i-th curvature cluster. The quantity threshold is set to one-third of the average density of the j-th sub-region in the i-th curvature cluster. The average density of the j-th sub-region in the i-th curvature cluster is equal to the total number of discrete points in the j-th sub-region in the i-th curvature cluster divided by the projected area.

[0074] like Figure 3 As shown, further, the cubic NURBS algorithm is used to fit the regional surface equation of each sub-region, and the splicing is optimized based on normal vector constraints and curvature constraints to generate the optimal surface equation. Includes the following steps:

[0075] A cubic B-spline basis function is selected to perform NURBS fitting on the boundary point set of the j-th sub-region in the i-th curvature cluster, in order to minimize the region surface equation s of the j-th sub-region in the i-th curvature cluster. i,j (u,v) and the region equation of the j-th subregion in the i-th curvature cluster Using the error as the objective, the control points of the cubic NURBS algorithm are iteratively adjusted to generate the region surface equation s of the j-th sub-region in the i-th curvature cluster. i,j (u,v) uses the same method to calculate the regional surface equation of each sub-region in the three curvature clusters in turn. Here, u and v are the horizontal and vertical parameters in the cubic NURBS algorithm, respectively. They can be converted into coordinates (x,y,z) in world coordinates by mapping x(u,v), y(u,v) on the horizontal axis, and z(u,v) on the vertical axis. u,v∈[0,1]. The cubic NURBS algorithm is an existing algorithm and will not be elaborated on in detail.

[0076] Define a normal vector constraint that requires the angle between the normal vectors of any two spatially adjacent sub-regions to be less than or equal to an angle threshold, where the region surface equation s of the sub-region is... i,j The product of the partial derivatives of (u,v) with respect to the horizontal parameter u and the vertical parameter v is the normal vector of the subregion.

[0077] The curvature constraint is defined to require that the curvature deviation between any two spatially adjacent sub-regions is less than or equal to the dynamic curvature threshold. The dynamic region threshold is equal to 0.01 times the mean curvature of the two spatially adjacent sub-regions. The curvature is calculated by numerical differentiation approximation, which is an existing algorithm and will not be elaborated on further.

[0078] The optimization objective is to minimize the weighted sum of the angles between the normal vectors of any two spatially adjacent sub-regions and the sum of their curvature deviations. A gradient descent algorithm is used to optimize the control points of all sub-regions in three NURBS iterations. In each iteration, the partial derivative of the optimization objective with respect to the control points is calculated, and the control points are updated along the negative gradient direction with a fixed learning rate until the optimization objective converges. This process yields the optimal region surface equations for all sub-regions. The optimized optimal region surface equations for all sub-regions in the three curvature families are then concatenated. Optimal surface equations for generating surface models in, and These are the optimal horizontal axis mapping, optimal vertical axis mapping, and optimal vertical axis mapping, respectively. Since the least squares method and the cubic NURBS algorithm are both applied to individual sub-regions and do not consider the boundary splicing problem between adjacent sub-regions, direct splicing is prone to concavity, convexity, and staggering problems, making it impossible for adjacent sub-regions to transition smoothly. Through the optimization and adjustment of normal vector constraints and curvature constraints, the continuity at the boundary of adjacent sub-regions is ensured, so that adjacent sub-regions can be spliced ​​smoothly.

[0079] Furthermore, N cross-sectional planes are set at a preset height along the vertical axis of the world coordinate system, respectively corresponding to the optimal surface equation. Solving the equations of the intersection curves of N intersecting planes simultaneously involves the following steps:

[0080] Based on the surface model dimension R and a preset height R / N, N cross-sectional planes are set along the vertical axis of the world coordinate system at the preset height R / N. The equation of the nth cross-sectional plane is z = z n , z n Let z be the vertical axis value of the nth cutting plane in the world coordinate system. n =nR / N;

[0081] Simultaneous optimal surface equations The equation of the intersecting plane with the nth intersecting plane is z = z n The equation of the intersection curve of the nth intersecting plane is obtained. And the equation of the intersection curve of the nth intersecting plane is F n When the surface model is complex, directly calculating the analytical solution for (u,v)=0 has extremely high complexity or may not be possible.

[0082] The equation F of the intersection curve of the nth cutting plane is determined using the ray method. n The horizontal parameter corresponding to the first solution of (u,v)=0 With longitudinal parameters And substitute it into the optimal horizontal axis mapping Mapping with the optimal vertical axis Obtain the first solution coordinates within the nth intercept plane. The ray casting method is an existing algorithm and will not be discussed in detail.

[0083] Calculate the equation F of the intersection curve of the nth intersecting plane. n The partial derivatives of (u,v) = 0 with respect to the horizontal parameter u and the vertical parameter v are used to construct the Jacobian matrix J of the nth cutoff plane. n ;

[0084] like Figure 4 As shown, Newton's iteration method is used, based on the Jacobian matrix J. n Establish the equation of the intersection curve F n The recursive formula for the solution of (u,v)=0 in the a-th iteration is as follows:

[0085]

[0086] in, and The equations of the intersection curves are F n The horizontal and vertical parameters corresponding to the a-th approximate solution of (u,v)=0 are the same as the horizontal and vertical parameters corresponding to the (a+1)-th approximate solution obtained by iterative recursion in the a-th round.

[0087] The lateral parameters corresponding to the (a+1)th approximate solution and longitudinal parameters Substitute into the intersection curve function F n (u,v) yields the approximate value corresponding to the (a+1)th approximate solution. If the approximate value corresponding to the (a+1)th approximate solution If the value is less than the minimum threshold, then the (a+1)th approximate solution is taken as the intersection curve equation F. n Find the solution to (u,v)=0 and calculate the corresponding solution coordinates. If the approximate value corresponding to the (a+1)th approximate solution is... If the value is greater than or equal to the minimum threshold, it is discarded.

[0088] Repeat the iteration until the coordinates of Q solutions within the nth intercept plane are obtained. Using the polar coordinate sorting method, with the first solution coordinate... Using the origin of the polar coordinate system, calculate the coordinates of the remaining Q-1 solutions relative to the coordinates of the first solution in sequence. The coordinates are sorted by angle, and Q is the total number of preset solution coordinates;

[0089] Calculate the coordinates of the (q+1)th solution. Coordinates of the qth solution The length of the solution segment d(q, q+1) is determined by statistically analyzing the lengths of the solution segments. The coordinates of the Q solutions within the nth intersecting plane are then calculated. Regarding parameter t n Perform parametric equations, where t n ∈[0,1], coordinates of the (q+1)th solution Corresponding parameters Equal to the coordinates of the first solution coordinates up to the (q+1)th solution The sum of the lengths of all solution segments divided by the coordinates of Q solutions The total length of the line segment is calculated as follows:

[0090]

[0091] Where b∈{1,…,q}, c∈{1,…,Q-1}, the coordinates of the (q+1)th solution are... This corresponds to the coordinates of the (q+1)th solution parameter. The equations of the nth cross-section and the optimal surface are obtained by fitting using the B-spline algorithm. The equation of the intersection curve F n (x n (t n ),y n (t n ),z n ) = 0, where x n (t n ) and y n (t n Let x be the x-axis parametric function of any point on the intersection curve of the nth intersecting plane. n (t n ) and the vertical axis parameter function y n (t n ), and Then it is the x-axis parameter function x n (t n ) and the vertical axis parameter function y n (t n Substitute parameters The calculated value obtained.

[0092] Furthermore, the arc length L of the curve at the nth cross-section is calculated based on Simpson's formula. n And based on curvature adaptive programming, the parameter step size Δt of the nth cross-section plane is determined. n To generate the sequence of trajectory point coordinates for the nth intercept plane, the following steps are included:

[0093] Based on the x-axis parameter function x n (t n ) and the vertical axis parameter function y n (t n Regarding parameter t n The first derivative x′ on the horizontal axis n (t n ), first derivative x′ on the vertical axis n (t n The arithmetic square root of a curve is defined as the arc length infinitesimal element of the curve intersecting the nth plane.

[0094] The arc length L of the intersection curve of the nth intersecting plane is calculated using Simpson's formula. n The details are as follows:

[0095]

[0096] Among them, Z odd and Z even Represent the set of odd numbers and the set of even numbers respectively;

[0097] Based on the first derivative of the horizontal axis x n ′(t n ), second derivative x′ on the horizontal axis n ′(t n ), first derivative of the vertical axis y n ′(t n ), the second derivative of the vertical axis y′ n The curvature parameter κ of the intersection curve of the nth intersecting plane is constructed using the formula ′(t). n (t n The details are as follows:

[0098]

[0099] The coordinates of the q-th solution Corresponding parameters Substitute the curvature parameter κ of the intersection curve of the nth intersecting plane into the formula. n (t n ) Calculated parameters Corresponding curvature value

[0100] If parameter Corresponding curvature value The parameter range is greater than or equal to the reciprocal of the surface model size R. Inner parameter step size Set as initial parameter step size The product of the surface model dimension R and the reciprocal divided by the parameter Corresponding curvature value If parameter Corresponding curvature value Less than the reciprocal of the surface model size R, the parameter range Inner parameter step size Set as initial parameter step size With parameter step size In the parameter range Internal trajectory parameters are added, including the parameter range. Initial parameter step size Equal to the maximum travel distance d of the tool max Divide by parameter Corresponding arc length micro-element

[0101] Obtain all trajectory parameters on the intersection curve of the nth intersecting plane and substitute them into the intersection curve equation F. n (x n (t n ),y n (t n ),z nIf ) = 0, calculate W within the nth cross-section. n Given the coordinates of several trajectory points, generate the sequence of trajectory point coordinates for the nth intercept plane. in, For the wth n The coordinates of the trajectory points, W n Let be the total number of trajectory points on the nth cross-section, and let the coordinates of the 1st trajectory point be... With W n coordinates of trajectory points The coordinates of the first solution are respectively and the coordinates of the Qth solution Essentially, the trajectory point coordinate sequence P n It is obtained by adaptively adding Q solution coordinates based on the curvature changes between adjacent solution coordinates, on the basis of the original Q solution coordinates.

[0102] Furthermore, construct the spiral equation from the nth cutting plane to the (n+1)th cutting plane. Setting positional constraints and tangent continuity constraints, and solving for the helix coefficient, includes the following steps:

[0103] With the Wth of the nth cross-section n coordinates of trajectory points The coordinates of the first trajectory point across the first cross plane are given by the coordinates of the first trajectory point on the (n+1)th cross plane. For the last cross-plane trajectory point, set the number of spiral turns to h, based on the nth cutting plane and the optimal surface equation. The equation of the intersection curve F n (x n (t n ),y n (t n ),z n ) = 0 and the (n+1)th cutting plane and the optimal surface equation The equation of the intersection curve F n+1 (x n+1 (t n+1 ),y n+1 (t n+1 ),z n+1 ) = 0 Calculate the W-th th cross-section of the nth cross-section respectively n coordinates of trajectory points Intersection tangent vector at the point The coordinates of the first trajectory point on the (n+1)th cross-section plane Intersection tangent vector at the point This is because the parameter corresponding to the coordinates of the first trajectory point in each cross-section is 0, and the parameter corresponding to the coordinates of the last trajectory point is 1;

[0104] Set the spiral equation from the nth cutting plane to the (n+1)th cutting plane. Specifically as follows:

[0105]

[0106] in, and The W-th of the nth cross-section n coordinates of trajectory points The horizontal and vertical axis values, and The coordinates of the first trajectory point on the (n+1)th cross-section are respectively The horizontal and vertical axis values, and Spiral equations The horizontal axis helical coefficient and the vertical axis helical coefficient, Let be the helical parameters from the nth cutting plane to the (n+1)th cutting plane.

[0107] Set positional constraints to require the coordinates F of the first cross-plane trajectory point of the spiral trajectory from the nth cross-plane to the (n+1)th cross-plane. n,n+1 (0) and the coordinates of the last cross-plane trajectory point F n,n+1 (1) The Wth segment of the nth intersecting plane respectively n coordinates of trajectory points The coordinates of the first trajectory point on the (n+1)th cross-section plane Overlap, that is

[0108] Set a tangent continuity constraint, requiring the helical trajectory to be on the W-th tangent plane at the nth intersection. n coordinates of trajectory points The tangent direction at point W is the same as that at point n. n coordinates of trajectory points Intersection tangent vector at the point The coordinates of the first trajectory point on the (n+1)th cross-section are consistent in direction. The tangent direction at point n and the coordinates of the first trajectory point on the (n+1)th intersecting plane Intersection tangent vector at the point The direction is consistent, that is, solving the spiral equation. Regarding the helical parameters from the nth to the (n+1)th cross-section. First-order spiral derivative Substituting 0 and 1 into the first-order spiral derivative vectors, they are respectively equal to the W-th vector of the nth intersecting plane. n coordinates of trajectory points Intersection tangent vector at the point The coordinates of the first trajectory point on the (n+1)th cross-section plane Intersection tangent vector at the point Right now

[0109] By simultaneously solving the spiral equations from the nth to the (n+1)th cross-sections Positional constraints and tangent continuity constraints can be used to calculate the spiral equation through algebraic elimination. Horizontal axis helical coefficient and vertical axis helical coefficient Specifically as follows:

[0110]

[0111] Specifically, based on Simpson's formula, the spiral equation from the nth cutting plane to the (n+1)th cutting plane. Spiral arc length infinitesimal element in, and First-order spiral derivatives The first-order spiral derivatives along the horizontal and vertical axes are calculated by substituting the spiral parameters corresponding to the coordinates of the first cross-plane trajectory point into the infinitesimal element of the spiral arc length. And take the reciprocal and the maximum travel distance d of the tool. max Multiply to obtain the first spiral step size Since the helical parameter corresponding to the coordinates of the first cross-plane trajectory point is 0, the helical parameter corresponding to the coordinates of the second cross-plane trajectory point is equal to the helical step size of the first point. And substitute the infinitesimal element of the spiral arc again. To calculate the coordinates of the third cross-plane trajectory point, and so on until the... When the helical parameter corresponding to the coordinates of the first cross-plane trajectory point is greater than or equal to 1, the first... The coordinates of each cross-plane trajectory point are set as the coordinates of the last cross-plane trajectory point. The coordinates of the cross-plane trajectory points are then labeled according to the order of the spiral parameters corresponding to their respective coordinates. Generate the coordinate sequence P of the cross-plane trajectory points from the nth cutting plane to the (n+1)th cutting plane. n,n+1 , This represents the total number of cross-plane trajectory points from the nth cutting plane to the (n+1)th cutting plane.

[0112] Specifically, the angle of the cutting tool is defined as θ = [θ ob ,θ in ], where θ ob and θ in Let g be the tool's rake angle and tilt angle, respectively. Then the tool axis vector g to =[sinθ in cosθ ob sinθ in sinθ ob cosθ inWithin the nth cutting plane, a lossless constraint is set to require the trajectory point coordinate sequence P of the nth cutting plane. n The cosine of the angle between the tool axis vector and the normal vector at each trajectory point is less than or equal to the cosine threshold. The normal vector at each trajectory point is obtained by substituting the horizontal parameter u and vertical parameter v corresponding to the coordinates of each trajectory point into the optimal surface equation. The partial derivatives of the transverse parameter u and the longitudinal parameter v are multiplied together to obtain the coordinate sequence P of the trajectory points of the nth cutting plane, which is required by the cutting direction constraint. n The tool axis vector at each trajectory point is on the nth cutting plane z = z n The projection direction vector at point P is in the same direction as the intersection tangent vector at each trajectory point. The trajectory point coordinate sequence P... n The dot product of the tool axis vector and the normal vector at all trajectory point coordinates is defined as the lossless satisfaction degree. The larger the lossless satisfaction degree, the less likely the tool is to cut into the curved surface and cause damage. The trajectory point coordinate sequence P n The cutting satisfaction score is defined as the negative of the cosine of the angle between the projected direction vector and the intersecting tangent vector at all trajectory point coordinates, plus 1. The closer the cutting satisfaction score is to 1, the more consistent the directions of the projected direction vector and the intersecting tangent vector are. A genetic algorithm is used to process the trajectory point coordinate sequence P. n The angles at all trajectory points are used as optimization variables. The optimization is performed iteratively to maximize both lossless satisfaction and cutting satisfaction, ultimately yielding the optimal angle sequence for the nth cutting plane. Among them, the genetic algorithm is an existing algorithm and will not be discussed in detail.

[0113] Specifically, the optimal angle sequence from the nth intercept plane Obtain the Wth n coordinates of trajectory points Optimal angle The optimal angle sequence from the (n+1)th cutting plane Obtain the coordinates of the first trajectory point. Optimal angle The optimal span angle sequence from the nth to the (n+1)th cross-section is generated using cosine interpolation. Among them, the The optimal cross-plane angle The specific formula for cosine interpolation is as follows:

[0114]

[0115] in, and The optimal angle sequence for the nth cutting plane. W in the middle n coordinates of trajectory points The optimal angle at point n and the optimal angle sequence at the (n+1)th cutting plane Coordinates of the first trajectory point The optimal angle at that location. This represents the total number of cross-plane trajectory points from the nth cutting plane to the (n+1)th cutting plane.

[0116] This invention discloses a five-axis tool trajectory planning method for complex curved surfaces. For five-axis tool trajectory planning of complex curved surfaces, it achieves significant benefits through the collaborative implementation of multiple key steps: First, the surface model is discretized and the Gaussian curvature is calculated. Then, sub-regions are divided and fitted through operations such as clustering and region growing. Precise region processing lays the foundation for subsequent trajectory planning, making surface feature recognition more accurate and ensuring the reliability of machining data. The sub-regions are projected and fitted and optimized using a cubic NURBS algorithm to generate the optimal surface equation, improving the surface fitting accuracy and smoothness, thus enhancing the machining accuracy. The surface quality is improved; the intersection curve is calculated by setting the cutting plane, and the trajectory points are generated by planning the parameter step size based on Simpson's formula. The cross-surface trajectory is constructed by combining the solution of the spiral equation and the step size calculation, so that the trajectory points are reasonably distributed and the cross-surface movement is smooth, avoiding machining vibration and errors; the tool axis vector is constructed in the cutting plane, and the angle sequence is optimized by the genetic algorithm and the cross-surface angle is interpolated. The machining constraints are fully considered, the tool axis posture is optimized, and the machining efficiency and surface quality are improved; finally, various sequences are integrated to generate the machining pose sequence, realizing high-precision and high-adaptability planning of five-axis machining trajectory for complex curved surfaces, effectively improving machining accuracy.

[0117] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A five-axis tool trajectory planning method for machining complex curved surfaces, characterized in that, Includes the following steps: Discrete surface model and calculate Gaussian curvature of discrete points to obtain discrete point set and cluster to determine curvature cluster. Use region growing and convex hull to calculate sub-region set of each curvature cluster, resample each sub-region and fit the region equation of each sub-region. Each sub-region is projected onto a plane and the corresponding set of boundary points is identified and filtered out. The regional surface equation of each sub-region is fitted using the cubic NURBS algorithm and optimized and stitched based on normal vector constraints and curvature constraints to generate the optimal surface equation. Set up the cutting planes and calculate the intersection curve equations with the optimal surface equations respectively. Calculate the curve arc length of each cutting plane based on Simpson's formula and plan the parameter step size of each cutting plane based on curvature to generate the trajectory point coordinate sequence of each cutting plane. Construct the helical equations of adjacent cross-sections and solve the helical coefficients based on position constraints and tangent continuity constraints. Calculate the helical step size stepwise based on Simpson's formula to generate a sequence of cross-plane trajectory point coordinates for adjacent cross-sections. In each cross-section, a tool axis vector is constructed, and lossless constraints and cutting direction constraints are set. With the goal of maximizing the satisfaction, the optimal angle sequence of each cross-section is obtained by optimization through a genetic algorithm, and the optimal cross-plane angle sequence of adjacent cross-sections is generated by cosine interpolation. By integrating the trajectory point coordinate sequence and optimal angle sequence of each cross-section, and the cross-section trajectory point coordinate sequence and optimal cross-section angle sequence of adjacent cross-sections, a processing pose sequence is generated.

2. The five-axis tool path planning method for complex curved surfaces as described in claim 1, characterized in that, The optimal surface equation is generated by fitting the regional surface equation of each sub-region using the cubic NURBS algorithm and optimizing the stitching based on normal vector constraints and curvature constraints. The steps include: We select a cubic B-spline basis function to fit the boundary point set of the j-th sub-region in the i-th curvature cluster, iteratively adjust the control points to minimize the error between the region surface equation and the region equation of the j-th sub-region in the i-th curvature cluster, and generate the region surface equation of the j-th sub-region in the i-th curvature cluster. Define a normal vector constraint that requires the angle between the normal vectors of any two spatially adjacent sub-regions to be less than or equal to an angle threshold, and define a curvature constraint that requires the curvature deviation between any two spatially adjacent sub-regions to be less than or equal to a dynamic curvature threshold. The optimization objective is to minimize the weighted sum of the angle between the normal vectors of any two spatially adjacent sub-regions and the sum of their curvature deviations. The gradient descent algorithm is used to optimize the control points until the optimization objective converges, at which point the optimal region surface equations for all sub-regions are obtained, and the optimal surface equations are then spliced ​​together.

3. The five-axis tool path planning method for complex curved surfaces as described in claim 1, characterized in that, The process of setting the cutting planes and calculating the intersection curve equations with the optimal surface equation, and calculating the arc length of the curve for each cutting plane based on Simpson's formula, includes the following steps: Set N cutting planes, and solve the equations of the optimal surface and the cutting plane of the nth cutting plane simultaneously to obtain the intersection curve equation of the nth cutting plane; The horizontal and vertical parameters corresponding to the first solution of the intersection curve equation of the nth intersecting plane are determined by the ray method. The coordinates of the first solution are obtained by substituting them into the optimal horizontal axis mapping and the optimal vertical axis mapping. Construct the Jacobian matrix of the nth intersecting plane based on the equation of the intersection curve of the nth intersecting plane, and use Newton's iteration method to recursively derive the (a+1)th approximate solution based on the ath approximate solution in the ath iteration. Calculate the approximate value corresponding to the (a+1)th approximate solution and determine whether it is less than the minimum threshold. If it is less than the minimum threshold, calculate the solution coordinates of the (a+1)th approximate solution. If it is greater than or equal to the minimum threshold, discard it. Repeat the iteration until Q solution coordinates are obtained in the nth cross plane. Using the polar coordinate sorting method, calculate the length of the solution segment between the (q+1)th solution coordinate and the qth solution coordinate. Based on the statistics of the solution segment length, parametrically transform the Q solution coordinates in the nth cross plane with respect to the parameters. Use the B-spline algorithm to fit the intersection curve equation of the nth cross plane and the optimal surface equation.

4. The five-axis tool path planning method for complex curved surfaces as described in claim 1, characterized in that, The arc length of the curve for each cross-section is calculated based on Simpson's formula, and the parameter step size for each cross-section is planned based on curvature to generate the coordinate sequence of trajectory points for each cross-section, including the following steps: Within the nth intersecting plane, calculate the arc length infinitesimal of the intersection curve of the nth intersecting plane and use Simpson's formula to calculate the curve arc length of the intersection curve of the nth intersecting plane; Determine the curvature parameter formula of the intersection curve of the nth intersecting plane, substitute it into the parameter corresponding to the qth solution coordinate to calculate the corresponding curvature value and compare it with a fixed threshold. Define the parameter range as the parameter corresponding to the qth solution coordinate to the parameter corresponding to the (q+1)th solution coordinate. If the parameter step size is greater than or equal to the fixed threshold, the parameter step size within the parameter interval is set to the product of the initial parameter step size and the fixed threshold divided by the curvature value of the qth solution coordinate. If the parameter step size is less than the fixed threshold, the parameter step size within the parameter interval is set to the initial parameter step size. The trajectory parameters are added within the parameter interval using the parameter step size. The initial parameter step size is equal to the maximum moving distance divided by the arc length element calculated by substituting the parameter corresponding to the qth solution coordinate. Based on the intersection curve equation, the trajectory parameters on the intersection curve of the nth intersection plane are converted into the corresponding trajectory point coordinates, generating the trajectory point coordinate sequence of the nth intersection plane.

5. The five-axis tool path planning method for complex curved surfaces as described in claim 1, characterized in that, The helical equations for adjacent cross-sections are constructed, and the helical coefficients are solved based on position constraints and tangent continuity constraints, including the following steps: Set the number of spiral turns, and calculate the W-th value of the nth cross-section. n The intersection tangent vector of the coordinates of the trajectory points and the intersection tangent vector of the coordinates of the first trajectory point of the (n+1)th cutting plane are used to set the spiral equation from the nth cutting plane to the (n+1)th cutting plane. Set positional constraints, requiring that the coordinates of the first cross-plane trajectory point and the last cross-plane trajectory point be respectively aligned with the W-th coordinate of the nth cross-plane. n The coordinates of the first trajectory point coincide with the coordinates of the first trajectory point on the (n+1)th cutting plane; Set a tangent continuity constraint, requiring the W-th tangent of the nth cutting plane to be continuous. n The tangent direction at the coordinates of the first trajectory point and the coordinates of the first trajectory point on the (n+1)th intersecting plane is consistent with the direction of the intersection tangent vector; Combine the helical equations, positional constraints, and tangent continuity constraints from the nth to the (n+1)th cross-sections to calculate the helical coefficients along the horizontal and vertical axes of the helical equations.

6. The five-axis tool path planning method for complex curved surfaces as described in claim 1, characterized in that, Based on Simpson's formula, calculate the first-order spiral derivatives along the horizontal and vertical axes of the spiral equation from the nth to the (n+1)th cross-section, and calculate the spiral arc length infinitesimal. Starting from the coordinates of the first cross-section trajectory point, substitute the spiral parameters corresponding to the coordinates of the first cross-section trajectory point into the spiral arc length infinitesimal, take the reciprocal, and multiply it by the maximum movement distance to obtain the first spiral step size. Based on the first spiral step size, determine the coordinates of the second cross-section trajectory point and the corresponding spiral parameters, and so on recursively until the nth cross-section. When the helical parameter corresponding to the coordinates of the first cross-plane trajectory point is greater than or equal to 1, the first... The coordinates of each cross-plane trajectory point are set as the coordinates of the last cross-plane trajectory point, generating a sequence of cross-plane trajectory point coordinates from the nth cutting plane to the (n+1)th cutting plane. This represents the total number of cross-plane trajectory points from the nth cutting plane to the (n+1)th cutting plane.

7. The five-axis tool path planning method for complex curved surfaces as described in claim 1, characterized in that, The process of obtaining the sub-region set for each curvature cluster using region growing and convex hull calculation includes the following steps: Select seed points in the curvature cluster, mark them, and construct a growth queue; Search for and determine the neighboring points of the seed point, calculate the Gaussian curvature difference between each neighboring point and the seed point, and compare it with the curvature threshold; Add unmarked neighborhood points that are less than or equal to the curvature threshold to the growth queue, mark them as new seed points, and continue searching for the neighborhood of the new seed points; Repeat until no new seed point can be found, and then stop to obtain the growth queue. Based on whether there are unlabeled discrete points in each curvature cluster, decide to reselect the seed point of the new growth queue or construct a sub-region point set based on the discrete points of each growth queue. Construct the minimum bounding box of each sub-region point set in the curvature cluster and use the convex hull generation algorithm to calculate the sub-region corresponding to each sub-region point set, thereby generating the sub-region set of the curvature cluster.

8. The five-axis tool path planning method for complex curved surfaces as described in claim 1, characterized in that, M discrete points are generated on the surface model. The neighborhood of the m-th discrete point is determined by KD-tree search. The local tangent plane equation of the m-th discrete point is obtained by fitting the neighborhood of the m-th discrete point using the least squares method. The normal vector of the m-th discrete point is determined based on the coefficient of the first term. The angle between the direction vector of the vertical axis and the normal vector of the m-th discrete point is calculated. The coordinates of the points in the neighborhood of the m-th discrete point in the world coordinate system are transformed to the local coordinates in the local coordinate system with the normal vector of the m-th discrete point as the vertical axis. The local surface function of any point in the neighborhood of the m-th discrete point in the local coordinate system is fitted by a quadratic polynomial. The Hessian matrix is ​​constructed based on the coefficient of the quadratic term. The maximum principal curvature and minimum principal curvature of the m-th discrete point are obtained by eigenvalue decomposition of the Hessian matrix and multiplied to obtain the Gaussian curvature of the m-th discrete point.

9. The five-axis tool path planning method for complex curved surfaces as described in claim 1, characterized in that, Poisson disk sampling is used. The minimum sampling radius is calculated based on the density of the sub-region. In the j-th sub-region of the i-th curvature cluster, a discrete point whose minimum distance to the sub-region boundary is greater than or equal to the minimum sampling radius is randomly selected and added to the active list. When the active list is not empty, the center point of the sphere in the active list is randomly selected and random sampling is performed within the sampling radius. Points that do not exceed the sub-region boundary are added to the sub-region point set. Points whose minimum distance to the sub-region boundary is greater than or equal to the minimum sampling radius are added to the active list and the selected center point is removed. This process is repeated until the active list is empty. The sub-region point set of the j-th sub-region in the i-th curvature cluster is obtained. The corresponding region equation is obtained by fitting a quadratic polynomial, where i∈{1,2,3}.

10. The five-axis tool path planning method for complex curved surfaces as described in claim 1, characterized in that, The lossless constraint requires that the cosine of the angle between the tool axis vector and the normal vector at each trajectory point in the nth cross-section is less than or equal to a cosine threshold. The cutting direction constraint requires that the projection direction vector of the tool axis vector at each trajectory point in the nth cross-section is in the same direction as the intersection tangent vector. The dot product of the tool axis vector and the normal vector at all trajectory points in the nth cross-section is defined as the lossless satisfaction. The negative of the cosine of the angle between the projection direction vector and the intersection tangent vector at all trajectory points in the nth cross-section plus 1 is defined as the cutting satisfaction. A genetic algorithm is used to iteratively update the angles at all trajectory points with the goal of maximizing the lossless satisfaction and the cutting satisfaction, so as to obtain the optimal angle sequence of the nth cross-section.

Citation Information

Patent Citations

  • Milling spindle speed sinusoidal modulation parameter optimization method

    CN105843177A

  • Curved-surface machining cutter track planning method using cutting force fluctuation as constraint

    CN106125666A

  • Cutter path automatic generation method for complex curved surface grinding

    CN112518433A

  • Tool path planning method for five-axis machine tool machining based on three-section type horn curve

    CN113433889A

  • Track planning method and device and computer readable storage medium

    CN113485250A

Cited By

  • Complex curved surface slow tool servo turning trajectory optimization method based on curvature gradient clustering and trajectory error constraint

    CN121187141A

  • Complex curved surface precision turning method capable of achieving equal cutting length of cutting edge

    CN121578745A

  • Five-axis numerical control machine tool cutter positioning method and system for machining engine cylinder cover

    CN121979097A