A circular tool path approximation method based on B-spline and coordinate transformation

By using the B-spline and coordinate transformation method in the CNC machining system, the arc segments in the tool path trajectory are approximately represented, which solves the problem of insufficient smoothness of the tool path trajectory, and achieves efficient approximation processing and precise processing effects.

CN116088421BActive Publication Date: 2025-04-18BEIHANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310003995.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-03
Publication Date
2025-04-18
Estimated Expiration
2043-01-03

AI Technical Summary

Technical Problem

In the existing CNC machining system, the smoothness of the tool path trajectory is insufficient, resulting in a decrease in machine tool vibration and machining accuracy. The existing approximation methods are difficult to ensure that the approximation error is within a given threshold, affecting machining efficiency.

Method used

Using a method based on B-spline and coordinate transformation, the arc trajectory and its tangent vector are represented by polar coordinates, and a third-order B-spline approximation is used to represent the straight line segment trajectory, and the selection of control points is used to ensure continuous position and tangential continuity.

Benefits of technology

The smoothness of the tool path trajectory is improved, ensuring that the approximate error is within a given threshold, important geometric information is retained, and computing efficiency and processing efficiency are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116088421B_ABST
    Figure CN116088421B_ABST
Patent Text Reader

Abstract

The present invention discloses a circular arc tool path trajectory approximation method based on B-spline and coordinate transformation, comprising: step one, based on the straight line segment trajectory at both ends of the circular arc segment trajectory in the tool path trajectory, calculating the tangent vectors on both sides of the circular arc segment trajectory, and converting the Cartesian coordinates of the circular arc segment trajectory and the tangent vector into polar coordinates; step two, in the polar coordinate system, comprehensively considering the threshold of the approximate error and the restriction that the approximate trajectory does not self-intersect, determining the characteristic length of the B-spline as the approximate trajectory of the circular arc segment trajectory; step three, according to the position continuity and tangent continuity conditions, calculating the control point of the B-spline through the characteristic length of the B-spline, and obtaining the expression of the B-spline in the polar coordinate system; converting the polar coordinates of the B-spline into Cartesian coordinates, and obtaining the approximate trajectory of the circular arc segment trajectory. The method proposed by the present invention can obtain a trajectory that is continuous in both position and tangent under the premise of ensuring contour error and non-overlapping, which is more conducive to the processing of the circular arc tool path trajectory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of numerical control machining and manufacturing, and relates to a circular arc tool path trajectory approximation method based on B-spline and coordinate transformation. By using a third-order B-spline curve to approximate the circular arc tool path trajectory, the smoothness of the overall trajectory is improved while ensuring the fitting accuracy. Background Art

[0002] In the current CNC machining system, the most common tool path format is a combined trajectory consisting of continuous tiny line segments and arc segments. Since the trajectory is only continuous in position at the intersection of two adjacent line segments or arc segments, the direction of the tool may change greatly here. If the tool speed is too high at this time, the speed change here is very large, causing violent vibration of the machine tool, seriously affecting the machining accuracy; if the tool speed is reduced, frequent acceleration and deceleration will reduce the machining efficiency.

[0003] In order to improve the smoothness of the trajectory, it is generally chosen to sacrifice some accuracy to approximate the tool path trajectory. The current approximation methods are mainly divided into two categories: global approximation methods and local approximation methods. The global approximation method usually uses a high-order continuous curve to replace multiple continuous trajectory segments in the tool path trajectory. The approximation curve usually requires iteration to determine, which makes it difficult to implement this type of method in real time. The local approximation method usually inserts a tiny curve into adjacent trajectory segments to replace part of the two trajectory segments. Since a tiny curve is introduced between every two trajectory segments, the amount of data for this type of method is too large. In addition, both methods are difficult to ensure that the approximate trajectory passes through the key points of the original trajectory (i.e., the endpoints of each trajectory segment), which may lead to the loss of important geometric information. Summary of the invention

[0004] In the approximation of the tool path trajectory, on the one hand, the smoothness of the tool path trajectory should be improved, and on the other hand, the approximation error should be limited. The approximation error refers to the Hausdorff distance between the original tool path trajectory and the approximate trajectory. In order to ensure the processing accuracy, the distance cannot exceed a given threshold. The present invention approximates the combined tool path trajectory composed of continuous tiny line segments and circular arc segments. First, the circular arc trajectory and the tangent vectors on both sides of the Cartesian coordinate system are represented by polar coordinates, where the circular arc trajectory is a straight line segment in the polar coordinate system. Then, the third-order B-spline in the polar coordinate system is used to approximate the straight line segment. By selecting the control points, the constraint of the approximation error can be achieved, and the position continuity and tangential continuity can be guaranteed. Finally, the approximate B-spline in the polar coordinates is converted into Cartesian coordinates, and the approximation of the circular arc trajectory is completed. The present invention specifically adopts the following technical solutions:

[0005] A circular tool path approximation method based on B-spline and coordinate transformation includes the following steps:

[0006] Step 1, based on the straight line segments at both ends of the arc segment trajectory in the tool path trajectory, calculate the tangent vectors on both sides of the arc segment trajectory, and convert the Cartesian coordinates of the arc segment trajectory and the tangent vector into polar coordinates;

[0007] Step 2: In the polar coordinate system, considering the threshold of the approximate error and the restriction that the approximate trajectory does not intersect itself, determine the characteristic length of the B-spline as the approximate trajectory of the circular arc segment trajectory;

[0008] Step three, according to the position continuity and tangential continuity conditions, the control points of the B-spline are calculated through the characteristic length of the B-spline to obtain the expression of the B-spline in the polar coordinate system; the polar coordinates of the B-spline are converted into Cartesian coordinates to obtain the approximate trajectory of the arc segment trajectory.

[0009] Further, the step 1 is specifically as follows:

[0010] The arc segment trajectory is given by Indicates that P 1 and P 2 are the starting point and end point of the arc segment respectively; the Cartesian coordinates of the starting point and end point are converted into polar coordinates, and the calculation formula is as follows:

[0011]

[0012] Where O is the origin of the two-dimensional Cartesian coordinate system, P i,x and P i,y For endpoint P i The horizontal and vertical coordinates in the two-dimensional Cartesian coordinate system are: Representation vector The modulus length, arctan() is the inverse tangent function; therefore, the arc segment trajectory in the Cartesian coordinate system Convert to a straight line segment trajectory in polar coordinate system

[0013] remember The straight line segments on both sides are and Then the direction of entering the arc segment is The direction of leaving the arc segment is The two tangent vectors T 1 ,T 2 The Cartesian coordinates are converted to polar coordinates using the following formula:

[0014]

[0015] in Represents the inner product of two vectors.

[0016] Further, the step 2 is specifically as follows:

[0017] Using third-order B-spline to approximate the trajectory of straight line segments in polar coordinates Make the B-spline and the straight line segment trajectory The endpoints of the two are coincident, and the Hausdorff distance is less than the given threshold e max , and the tangent direction at the endpoint of the B-spline is 1 ,S 2 Consistency;

[0018] Calculate the trajectory of a straight line segment Length And calculate the two tangent vectors S 1 and S 2 With R 1 R 2 The angle α 1 and α 2 , the specific formula is as follows:

[0019]

[0020] The approximate trajectory B-spline does not intersect itself, so the characteristic length of the B-spline is l 1 and l 2 The calculation formula is as follows:

[0021]

[0022] where |cos(α i )| means cos(α i )’s absolute value.

[0023] Further, the step three is specifically as follows:

[0024] According to the position continuity and tangent continuity conditions, the control points of the B-spline are calculated by the characteristic length of the B-spline:

[0025]

[0026] From this we get the expression of B-spline in polar coordinate system Where N i,3 (u) is the B-spline basis function defined on the knot vector U, knot vector U = [0 0 0 0 1 1 1 1];

[0027] For any parameter u i , the coordinates of the corresponding point in the polar coordinate system are Convert the polar coordinates of the B-spline to Cartesian coordinates according to the following formula:

[0028]

[0029] The final approximate trajectory of the arc segment is obtained.

[0030] Compared with the prior art, the present invention has the following beneficial effects:

[0031] (1) The approximate trajectory passes through the key points of the original trajectory (i.e., the endpoints of each trajectory segment), retaining important geometric information.

[0032] (2) It is computationally efficient and can be implemented in real time without adding too many trajectory segments.

[0033] (3) Strictly control the Hausdorff distance between the approximate trajectory and the original trajectory to ensure position continuity and tangential continuity. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is the overall process of the present invention;

[0035] Figure 2 Here is an example of a circular arc segment trajectory and the straight line segment trajectories on both sides;

[0036] Figure 3 is the error band of the arc segment trajectory in the Cartesian coordinate system;

[0037] Figure 4 It is the straight line trajectory and its approximate trajectory in the polar coordinate system;

[0038] Figure 5 It is the arc trajectory and its approximate trajectory in the Cartesian coordinate system. DETAILED DESCRIPTION

[0039] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only for illustration and are not intended to limit the present invention.

[0040] The present invention provides a circular arc tool path trajectory approximation method based on B-spline and coordinate transformation, such as Figure 1 As shown, the following steps are included:

[0041] Step 1: Polar coordinate conversion of arc segment trajectory and tangent vector;

[0042] For the circular tool path trajectory that needs to be approximated in Cartesian coordinates, we only need to consider the two-dimensional plane where the circular arc segment trajectory is located. Through coordinate transformation, the center of the circle can be made to coincide with the origin of the two-dimensional coordinate system. Therefore, in this two-dimensional coordinate system, the circular arc segment trajectory can be expressed as Indicates that P 1 and P 2 are the starting point and end point of the arc segment. First, convert the Cartesian coordinates of the two endpoints into polar coordinates. The specific calculation formula is as follows:

[0043]

[0044] Where O is the origin of the coordinate system, P i,x and P i,y For endpoint P i The horizontal and vertical coordinates in the two-dimensional Cartesian coordinate system are: Representation vector The modulus of arctan() is the inverse tangent function. Arc segment trajectory in Cartesian coordinate system Straight line trajectory in polar coordinates

[0045] The direction of the tool when entering the arc segment trajectory is determined by the straight line segments at both ends of it. The straight line segments on both sides are and Then the direction of entering the arc segment The direction of leaving the arc segment is Similarly, the Cartesian coordinates in these two directions are converted into polar coordinates. The specific calculation formula is as follows:

[0046]

[0047] in represents the inner product of these two vectors.

[0048] Step 2: Determine the characteristic length of the approximate trajectory B-spline in the polar coordinate system;

[0049] In step 1, the arc segment trajectory and the tangent vector T 1 ,T 2 The Cartesian coordinates of have been converted to polar coordinates. In this step, a third-order B-spline is used to approximate the straight line segment trajectory in polar coordinates. Make the B-spline and the straight line segment trajectory endpoints coincide, and the Hausdorff distance is less than the given threshold e max , and the tangent direction at the endpoint of the B-spline is 1 ,S 2 Consistent.

[0050] First calculate the straight line segment trajectory Length And calculate the two tangent vectors S 1 and S 2 With R 1 R 2 The angle α 1 and α 2 , the specific formula is as follows:

[0051]

[0052] In order to prevent the approximate trajectory B-spline from self-intersection, the characteristic length l 1 and l 2 The calculation formula is as follows:

[0053]

[0054] where |cos(α i )| means cos(α i )’s absolute value.

[0055] Step 3: Determination of the approximate trajectory B-spline in the polar coordinate system and conversion to Cartesian coordinates;

[0056] In step 2, the characteristic length l of the approximate trajectory B-spline in the polar coordinate system 1 and l 2 Once the B-spline parameters are determined, the specific parameters of the B-spline are determined. Here, the third-order B-spline is used, and the node vector U = [0 0 0 0 1 1 1 1], and only the control points need to be determined. In order to ensure positional continuity and tangential continuity, based on the characteristic length determined in step 2, the calculation formula of the control points of the B-spline is as follows:

[0057]

[0058] From this we get the expression of B-spline in polar coordinate system Where N i,3 (u) is the B-spline basis function defined on the node vector U.

[0059] For any parameter u i , the coordinates of the corresponding point in the polar coordinate system are Convert the polar coordinates of the B-spline to Cartesian coordinates according to the following formula:

[0060]

[0061] The final approximate trajectory of the arc segment trajectory is obtained. Using the approximate trajectory to replace the original arc segment trajectory can obtain a trajectory that is continuous in both position and tangent direction under the premise of ensuring contour error and non-overlap, which is more conducive to the processing of tool path trajectory.

[0062] The specific implementation of the circular arc tool path trajectory approximation method based on B-spline and coordinate transformation provided by the present invention is described in detail below through a specific embodiment.

[0063] Embodiment 1:

[0064] As Figure 2 The tool path shown in the figure is used as an example to implement the steps of the present invention. The tool path consists of two straight line segments and one arc segment. The first track segment is a straight line segment. The second trajectory segment is an arc segment The third trajectory segment is a straight line segment In the Cartesian coordinate system, their coordinates are Q 1 =(-0.75,0),P 1 =(0,1),P 2 =(1,0) and Q 2 =(0,-0.75).

[0065] In step 1, the arc segment is calculated by formula (1) The polar coordinates of the two endpoints are R 1 =(1,π / 2) and R 2 =(1,0), and the arc segment trajectory in the Cartesian coordinate system Convert to straight line trajectory in polar coordinates Then the straight line trajectory and Calculate the tangential direction T of the arc segment 1 =(0.6,0.8) and the tangential direction T leaving the arc 2 =(-0.8,-0.6). By formula (2), the tangent vector T 1 and T 2 The Cartesian coordinates are converted into polar coordinates to obtain S 1 =(-0.8,0.6) and S 2 =(-0.8,-0.6).

[0066] In step 2, set the threshold e of the Hausdorff distance max =0.1, that is, the distance between the original arc segment trajectory and the approximate trajectory does not exceed 0.1. Figure 3 The dotted line in the middle is the error band of the arc segment trajectory, that is, the approximate trajectory should be within the error band. The straight line segment trajectory is calculated The length of L = π / 2, two tangent vectors S 1 and S 2 With R 1 R 2 The angle α 1 =0.9273 and α 2 =0.9273. Using formula (4) to calculate the characteristic length, we get l 1 =0.125 and l 2 =0.125.

[0067] In step 3, the control points are calculated based on the characteristic length and formula (5) to obtain B 0 =(1,1.5708),B 1 =(1,1.4958),B2 =(1.1,0.075),B 3 =(1,0). Substituting into the expression of B-spline, we get the approximate trajectory in polar coordinate system as follows Figure 4 The midpoint line is shown. The polar coordinates are converted into Cartesian coordinates by formula (6), and the approximate trajectory in the Cartesian coordinate system is obtained as follows: Figure 5 The midpoint line is shown.

Claims

1. A circular tool path approximation method based on B-spline and coordinate transformation, characterized in that: The following steps are involved: Step 1, based on the straight line segments at both ends of the arc segment trajectory in the tool path trajectory, calculate the tangent vectors on both sides of the arc segment trajectory, and convert the Cartesian coordinates of the arc segment trajectory and the tangent vector into polar coordinates; Step 2: In the polar coordinate system, considering the threshold of the approximate error and the restriction that the approximate trajectory does not intersect itself, determine the characteristic length of the B-spline as the approximate trajectory of the circular arc segment trajectory; Step 3: According to the position continuity and tangential continuity conditions, the control points of the B-spline are calculated by the characteristic length of the B-spline to obtain the expression of the B-spline in the polar coordinate system; the polar coordinates of the B-spline are converted into Cartesian coordinates to obtain the approximate trajectory of the arc segment; The step 1 is specifically as follows: The arc segment trajectory is given by Indicates that P1 and P2 are the starting point and end point of the arc segment respectively; the Cartesian coordinates of the starting point and end point are converted into polar coordinates, and the calculation formula is as follows: Where O is the origin of the two-dimensional Cartesian coordinate system, P i,x and P i,y For endpoint P i The horizontal and vertical coordinates in the two-dimensional Cartesian coordinate system are: Representation vector The modulus length, arctan() is the inverse tangent function; therefore, the arc segment trajectory in the Cartesian coordinate system Convert to a straight line segment trajectory in polar coordinate system remember The straight line segments on both sides are and Then the direction of entering the arc segment is The direction of leaving the arc segment is Convert the Cartesian coordinates of the two tangent vectors T1 and T2 into polar coordinates. The calculation formula is as follows: in Represents the inner product of two vectors; The step 2 is specifically as follows: Using third-order B-spline to approximate the trajectory of straight line segments in polar coordinates Make the B-spline and the straight line segment trajectory The endpoints of the two are coincident, and the Hausdorff distance is less than the given threshold e max , and the tangent direction at the endpoints of the B-spline is consistent with S1 and S2; Calculate the trajectory of a straight line segment Length And calculate the angles α1 and α2 between the two tangent vectors S1 and S2 and R1R2. The specific formula is as follows: The approximate trajectory B-spline does not intersect itself, and the calculation formulas of the characteristic lengths l1 and l2 of the B-spline are as follows: where |cos(α i )| means cos(α i )’s absolute value.

2. The circular arc tool path trajectory approximation method based on B-spline and coordinate transformation according to claim 1 is characterized in that: The step three is specifically as follows: According to the position continuity and tangent continuity conditions, the control points of the B-spline are calculated by the characteristic length of the B-spline: From this we get the expression of B-spline in polar coordinate system Where N i,3 (u) is the B-spline basis function defined on the knot vector U, knot vector U = [0 0 0 0 1 1 1 1]; For any parameter u i , the coordinates of the corresponding point in the polar coordinate system are Convert the polar coordinates of the B-spline to Cartesian coordinates according to the following formula: The final approximate trajectory of the arc segment is obtained.

Citation Information

Patent Citations

  • Numerical control machining tool path optimization method based on asymmetric PH curve

    CN114721327A

  • Numerically controlled curved surface machining unit

    US20020002420A1