Five-axis machining cutter position and cutter axis vector real-time optimization method based on cutting contour surface

Through the method based on cutting profile calculation and compensation, the problems of insufficient smoothness of tool axis vector and nonlinear error in five-axis machining are solved, and the tool position error and tool axis vector are simultaneously optimized, which improves machining accuracy and surface quality.

CN119937452APending Publication Date: 2025-05-06GUILIN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510066802.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In five-axis machining, there are problems such as insufficient smoothness of tool axis vector, reduced machining stability and limited machining efficiency. It is difficult for the prior art to optimize the smooth control of tool position error and tool axis vector at the same time, and there is a lack of a real-time compensation mechanism.

Method used

A five-axis machining nonlinear error optimization method based on cutting profile surface calculation and compensation is proposed. By establishing a spatial relationship model between the tool contact and the cutting profile surface, the spatial deviation is analyzed in real time, and combining dynamic compensation and interpolation optimization algorithms, the smooth transition of the tool axis vector and the precise control of the machining trajectory are realized.

Benefits of technology

It effectively reduces the nonlinear error of the machining trajectory, improves the accuracy and surface quality of complex surface machining, realizes the simultaneous optimization of tool position error and tool axis vector, and has real-time compensation capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119937452A_ABST
    Figure CN119937452A_ABST
Patent Text Reader

Abstract

The invention discloses a real-time optimization method for a five-axis machining tool position and a tool axis vector based on a cutting contour surface. The method is used for solving the problems that an interpolation tool contact deviates from a target cutting contour surface track and the change of the tool axis vector is not smooth in the machining process. A shortest distance model between an interpolation cutter contact and a cutting contour surface is established, the coordinate of the shortest distance point and the shortest distance are calculated, the cutter point compensation direction is defined in the shortest distance direction, and a cutter point compensation vector is obtained accordingly. A cutter axis vector is optimized by combining a linear interpolation and quaternion spherical linear interpolation hybrid algorithm, and smooth transition of angle change and track continuity are ensured. And the compensated tool nose position and the optimized tool axis vector generate the feeding increment of each axis of the machine tool through a real-time post-processing module, and real-time interpolation and compensation operation are realized, so that the five-axis machining precision and the track stability are improved, and the method is suitable for high-precision scenes of complex curved surface machining.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer numerical control (CNC), and in particular to a technology for compensating the nonlinear error of a tool axis vector smoothing and a tool contact point trajectory in five-axis machining in the field. Background Art

[0002] Five-axis machining technology is widely used in aerospace, automobile manufacturing, mold processing and other fields due to its high precision and high flexibility in complex surface machining. Compared with three-axis CNC machine tools, five-axis CNC machine tools achieve the motion control of the tool in five degrees of freedom by adding two rotating coordinate axes. However, the complexity of this multi-axis linkage also brings many technical challenges in the machining process, especially the control of the tool contact point and the tool axis vector.

[0003] During five-axis machining, the dynamic adjustment of the tool axis vector directly affects the contact state between the tool and the workpiece and the cutting effect. If the tool axis vector changes too dramatically during machining, the following problems may occur: 1) Insufficient machining path smoothness: Sudden changes in the tool axis direction will cause discontinuity in the motion of the machine tool's rotary axis, thus affecting the smoothness of the machining path. 2) Reduced machining stability: Unstable tool axis vectors will cause increased tool vibration, affecting machining accuracy and workpiece surface quality. 3) Limited machining efficiency: Improper tool axis vector control may require frequent adjustments to the machining path, increasing computing overhead and machining time.

[0004] In addition, since the rotation axis of the five-axis machine tool introduces more degrees of freedom, the deviation between the theoretical tool contact trajectory and the actual tool contact trajectory is inevitable, resulting in nonlinear errors in the machining trajectory. This error is usually manifested as a sudden change in the tool position deviation and the direction of the tool axis vector, which directly affects the accuracy and surface quality of complex surface machining. At present, the main methods for compensating and reducing the nonlinear error of the machining trajectory and the smoothness of the tool axis vector are: 1) Optimizing the tool position to reduce the trajectory error. For example, the interpolation algorithm based on the uniform distribution of the angle space improves the machining accuracy in areas with large angle changes by constructing a uniform grid. However, this method has limited effect on areas with small angle changes and fails to achieve overall error compensation of the tool contact trajectory. 2) Tool axis vector optimization. In order to improve the smoothness of the tool axis vector, some studies have adopted linear interpolation technology to calculate the transition path of the tool axis direction by interpolation. However, in areas with large angle changes, linear interpolation is prone to sudden changes in direction, affecting machining stability and surface quality. In order to overcome this problem, some studies have introduced quaternion spherical linear interpolation to achieve a smooth transition of the tool axis vector by interpolating along the spherical path. However, the computational complexity of quaternion spherical linear interpolation is high, and it will increase unnecessary computational costs when applied in areas with small angle changes. 3) Tool path optimization. For the optimization of machining paths, researchers have proposed technologies such as uniform step error control, collision detection planning, and cutting force distribution optimization. These methods can improve some machining quality, but they are mostly based on local optimal strategies and do not optimize from the perspective of overall trajectory nonlinear errors. 4) Traditional interpolation technology is usually based on the processing of discrete points, and it is difficult to achieve the continuity and smoothness of the overall trajectory. To improve this problem, researchers have proposed a variety of interpolation methods. For example, the post-processing algorithm based on the total differential method can reduce geometric errors to a certain extent and optimize the continuity of the tool path. However, this method has limited effect in real-time and complex surface machining scenarios. In addition, some studies have introduced local smooth interpolation algorithms to reduce the error accumulation between interpolation points by optimizing local paths. However, this method relies on discrete nodes and fails to optimize errors from the overall interpolation space, which can easily lead to trajectory discontinuity or reduced surface quality.

[0005] Although the above methods have alleviated the nonlinear error problem in five-axis machining to a certain extent, they have not yet taken into account the smooth control of tool position error and tool axis vector at the same time, and lack a real-time compensation mechanism. Therefore, developing a real-time compensation method that can simultaneously optimize tool position and tool axis vector and reduce the nonlinear error of machining trajectory is of great significance for improving five-axis machining accuracy and surface quality. Summary of the invention

[0006] This paper proposes a five-axis machining nonlinear error optimization method based on cutting profile calculation and compensation, which mainly targets the tool contact point trajectory deviation and tool axis vector smooth transition problems, thereby improving the accuracy and surface quality of complex surface machining. By real-time analysis of the spatial deviation between the tool contact point and the cutting profile, combined with dynamic compensation and interpolation optimization algorithms, precise control of the machining trajectory and error reduction can be achieved.

[0007] The technical solution adopted by the present invention to solve the above technical problems is:

[0008] 1) Establish a spatial relationship model between the tool contact point and the cutting contour surface to describe the deviation characteristics between the actual tool trajectory and the cutting contour surface, providing a basis for subsequent compensation calculations.

[0009] 2) Based on real-time interpolation calculation, the spatial deviation between the theoretical position of the tool contact point and the actual position on the cutting contour surface is analyzed. By calculating the closest point from the tool contact point to the cutting contour surface, the over-cut or under-cut area is determined, and the trajectory nonlinear error is accurately quantified.

[0010] 3) In order to solve the problem of sudden changes in the direction of the tool axis vector in the area of ​​large angle changes, a hybrid interpolation algorithm is used for optimization. In the area of ​​small angle changes, linear interpolation is used to improve the calculation efficiency; in the area of ​​large angle changes, quaternion spherical linear interpolation is used to achieve a smooth transition of the tool axis direction, improving the stability of processing and trajectory continuity.

[0011] 4) For machining path segments where the nonlinear error exceeds the allowable range, the tool contact trajectory is adjusted to optimize the distribution of the tool's actual interpolation points, thereby reducing the error caused by overcutting or undercutting. Combined with the characteristics of the cutting contour surface, precise compensation is implemented in the error-significant area to improve the accuracy of the machining trajectory. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 These are three situations and their impacts of the interpolation tool contact point position in five-axis machining.

[0013] Figure 2 It is the solution for the closest point from the tool contact point to the cutting contour surface.

[0014] Figure 3 A comparison of linear interpolation paths and quaternion spherical interpolation paths.

[0015] Figure 4 It is a process of nonlinear error compensation and tool axis vector optimization. DETAILED DESCRIPTION

[0016] In five-axis machining, the interpolation tool contact point often deviates from the ideal cutting profile surface, resulting in nonlinear errors. These deviations are particularly evident in the machining of complex surfaces. Based on the spatial relationship between the interpolation tool contact point and the tool cutting profile surface, the following situations can be determined: Undercut: The interpolation tool contact point is outside the tool body, indicating that the tool cannot reach the expected path and removes insufficient material ( Figure 1 a). Overcutting: The interpolation tool contact point is inside the tool body, the tool exceeds the expected path, and removes too much material ( Figure 1 b). Normal cutting: The interpolation tool contact point is precisely positioned on the tool cutting edge, following the expected path and removing the correct amount of material ( Figure 1 c). Overcutting and undercutting issues not only affect machining accuracy, but also have a negative impact on surface quality. In contrast, normal cutting ensures the best machining results while maintaining accuracy and surface integrity.

[0017] The tool selected for the present invention is a spherical tool. First, the initial position must be defined, and the tool tip is aligned with the origin of the workpiece coordinate system, the tool axis is aligned with the Z axis of the workpiece coordinate system, and the direction in which the tool tip points to the machine tool spindle is the Z+ direction. The tool tip coincides with the origin of the workpiece coordinate system, that is, the tool tip point coordinates are (0,0,0). Since the tool tip points in the Z+ direction, the tool axis unit vector is (0,0,1). The characteristic of a spherical tool is that no matter which direction it rotates, the position of the tool tip point (the outermost end of the sphere) is fixed. Under this setting, if the tool tip point is aligned with the origin at the beginning and no movement is made in the Z-axis direction, the center of the sphere will be on the Z axis, exactly at the radius of the sphere. The position of That is, the coordinates of the center point of the sphere are The cutting edge line that realizes cutting when the tool contacts the workpiece rotates around the tool axis to form a cutting profile surface. The cutting profile surface equation is:

[0018] In the tool location data file generated by the CAM software, each linear interpolation machining program path segment contains the tool tip position coordinates of the interpolation starting point (A s ), tool axis unit vector (B s ), tool contact point position coordinates (C s ) and the tool tip position coordinates of the interpolation end point (A e ), tool axis unit vector (B e ), tool contact point position coordinates (C e ) are respectively expressed as (a s , b s , c s , I s , J s , K s , x s ,y s , zs ) and (a e , b e , c e , I e , J e , K e , x e ,y e , z e ).

[0019] Since the cutting contour of the spherical tool is formed by the interpolated tool tip point, the center point of the sphere is transformed along with the interpolated tool tip point. Therefore, we only need to find the coordinate transformation formula of the tool tip point, and then multiply it by the initial center point to find the cutting contour surface equation during the interpolation process. Because it is a five-axis CNC machine tool, it consists of 3 translation axes and 2 rotation axes, so the coordinate transformation formula contains translation and rotation. For the rotation axis, assume that the angle of rotation of the A axis around the x-axis is θ Ai Its rotation matrix R(θ Ai ) is shown in formula (1):

[0020]

[0021] Similarly, the angle of rotation of the C axis around the z axis is θ Ci , its rotation matrix R(θ Ci ) is shown in formula (2):

[0022]

[0023] The combined rotation matrix R is shown in formula (3):

[0024]

[0025] Interpolation tool axis vector B i (I i , J i , K i ) is the rotation matrix R multiplied by the initial tool axis unit vector (0, 0, 1) as shown in formula (4).

[0026]

[0027] Right now

[0028]

[0029] Since the five-axis CNC machine tool finally recognizes five coordinates (tool tip coordinates and rotational motion control coordinates in the machine tool coordinate system), the rotational motion control coordinates are calculated next. i Divide by I i Get θ Ai and θ Ci As shown in formula (5).

[0030]

[0031] The tool axis unit vector (B s ) and (B e ) into formula (5) to obtain the starting and ending rotation angles (θ As ,θ Cs ) and (θ Ae ,θ Ce During the five-axis linear interpolation process, the rotational motion control coordinates (θ Ai ,θ Ci )for

[0032]

[0033] The obtained rotation motion control coordinates (θ Ai ,θ Ci ) is substituted into formula (4) to obtain the interpolation tool axis vector B i (I i , J i , K i ).

[0034] After considering rotation, we need to consider translation. The interpolation tool tip point is obtained by interpolating the tool axis point D. i It is calculated by reverse calculation, that is, by formula (7).

[0035] A i =D i -L×B i (7)

[0036] Where L is the swing length of the tool.

[0037] The interpolation start tool tip position coordinates (A s ) and the starting tool axis unit vector (B s ), and the interpolation end tool tip position coordinates (A e ) and the end tool axis unit vector (B e ) into formula (7) to obtain the starting and ending tool axis points D s and D e , according to the data sampling principle, the interpolation tool axis point D is obtained i As shown in formula (8).

[0038]

[0039] Where n is the number of interpolation cycles, which can be obtained by the distance from the starting tool tip point to the ending tool tip point, i = 0, 1, ... n.

[0040] Substitute the interpolation tool axis point into equation (8) to obtain the interpolation tool tip point A i (a i , b i , c i ) as shown in formula (9).

[0041]

[0042] That is, we get the translation matrix T(a i , b i , c i )for

[0043]

[0044] Because the center point of the original cutting profile surface is The interpolation sphere center point M of the cutting contour surface after rotation and translation i (o i , p i ,s i ) is obtained by formula (10).

[0045]

[0046] In order to reduce the sharp fluctuation of tool feed speed caused by correcting the tool tip position, the compensation distance should be kept as short as possible. The coordinates of the point on the cutting contour surface with the shortest distance to the interpolation tool contact point (hereinafter referred to as the shortest distance point) are defined as the shortest distance point coordinates. The interpolation tool contact point coordinates C can be calculated by formula (11). i (x i ,y i , z i ).

[0047]

[0048] like Figure 2 As shown in the figure, in order to make the distance between the cutting contour surface and the interpolation tool contact point as short as possible, the intersection of the extended line from the center of the sphere to the theoretical interpolation tool contact point and the cutting contour surface is the shortest distance point. i (o i , p i ,s i ) points to the theoretical knife contact C i (x i ,y i , z i ) direction unit vector f i (u i , v i , w i ) is obtained by formula (12).

[0049]

[0050] where ||·|| is the length (Euclidean norm) of the direction vector.

[0051] At the same time, calculate the distance τ between each interpolation tool contact point and the shortest point i (hereinafter referred to as the shortest distance). Since the shortest distance from the sphere to any point is the distance from the interpolation tool contact point to the sphere center minus the absolute value of the sphere radius, for the interpolation tool contact point C i (x i ,y i , z i ) and interpolation sphere center point M i (o i , p i ,s i ), the shortest distance τ corresponding to each interpolation tool contact i It is calculated by formula (13).

[0052]

[0053] The shortest point C′ i (x′ i , y′ i , z′ i )Through interpolation tool contact C i (x i ,y i , z i ) plus the direction unit vector multiplied by the shortest distance, which can be calculated using formula (14).

[0054]

[0055] Define the shortest distance τ i is the nonlinear error of the knife contact, such as Figure 2 As shown, define the shortest distance point C′ i (x′ i , y′ i , z′ i ) points to interpolation tool contact C i (x i ,y i , z i ) is the interpolation tool tip compensation direction, and the direction unit vector is -f i (-u i , -v i , -w i ), define the shortest distance τ i is the interpolation tool tip compensation amount, and the tool tip compensation vector is obtained from it. The interpolation tool tip point A′ after compensation i (a′ i , b′ i, c′ i ) is obtained by formula (15).

[0056]

[0057] The compensated sphere center point M′ i (o′ i , p′ i , q′ i ) is obtained by formula (16).

[0058]

[0059] The nonlinear error τ′ of the knife contact after compensation i It is obtained by formula (17).

[0060]

[0061] Substituting equations (12), (13) and (15) into the formula, we can obtain the specific interpolation tool tip coordinate A′: i (a′ i , b′ i , c′ i ) is shown in formula (18):

[0062]

[0063] In addition to the coordinates of the tool contact point, the accuracy of the tool axis vector is also very important. Optimizing the tool axis vector is a key technology to improve machining accuracy, surface quality and cutting stability in five-axis machining. Linear interpolation connects each interpolation point with a straight line (the dotted line path in the figure), and fails to accurately follow the actual curved path (the solid arc path in the figure). Figure 3 You can see the interpolation point B i The points are distributed along a straight line, while the actual path is a curve, which leads to path deviation. Especially in the middle part of the figure, there is a large deviation between the linear interpolation path and the actual arc path, which directly affects the motion accuracy. At the same time, due to the uneven distribution of interpolation points, Figure 3 It can be clearly seen that the arc length of the middle section is larger than that of the two ends, resulting in an uneven angle change. In the middle area, the angle changes faster, resulting in uneven motion. This uneven arc length also makes it difficult to maintain a constant motion speed, requiring frequent adjustments, increasing the complexity of control. In addition, due to the uneven path, the device may cause jitter due to abrupt angle changes during high-speed or precision motion, affecting the overall trajectory quality. Therefore, linear interpolation is insufficient when it comes to high precision, smoothness, and complex curve paths.

[0064] The present invention uses quaternion spherical linear interpolation to ensure that the arc length and angle of each interpolation are the same, so that the tool axis vector is interpolated along the large arc of the sphere. Quaternion is a complex number expansion containing four components, expressed as q = (g, u, v, w), where g is the real part, and v, w are the imaginary parts. Quaternion can be expressed as:

[0065]

[0066] In the formula represents the unit rotation axis vector, and θ represents the rotation angle

[0067] Therefore, when converting the tool axis vector (which can also be regarded as the rotation axis) into a quaternion, we need to construct a quaternion based on the rotation axis vector and the rotation angle. The present invention defines the starting tool axis unit vector as (0, 0, 1)

[0068] The rotation axis vector can be obtained by the starting tool axis unit vector B a (0, 0, 1) and the end point tool axis vector B b (I b , J b , K b ). The cross product of these two tool axis vectors is the rotation axis vector. It can be obtained by the following formula

[0069] B axis =B a ×B b =(0-J b , I b -0,0)=(-J b , I b ,0) (20)

[0070] The rotation axis vector needs to be normalized. From the following formula

[0071]

[0072] The rotation angle θ is calculated by the following formula:

[0073] θ=arccos(B a ·B b )=arccos(K b ) (twenty two)

[0074] The tool axis unit vector (B s ) and (B e ) is substituted into equation (21) and equation (22) to obtain the unit rotation axis vector and and the rotation angle θ s =arccos(Ks ) and θ e =arccos(K e ), and then substitute it into formula (19) to obtain its corresponding quaternion (q s ) and (q e ) is shown in the following formula

[0075]

[0076] like Figure 3 As shown, the unit quaternion (q s ) and (q e ) is θ, which can be obtained by equation (25), i and q s The angle between q i and q e The angle between Assuming q by linear interpolation formula i As shown in the following formula, we need to find a suitable and

[0077]

[0078] Also available: Use q s Multiplying both sides of (24) gives:

[0079]

[0080] Since according to the definition of dot product, the dot product of two identical unit quaternions is equal to 1, equation (25) can be simplified to:

[0081]

[0082] Use q e Multiplying both sides of (24) gives:

[0083]

[0084] Similarly, formula (27) is simplified to:

[0085]

[0086] Combining equations (26) and (28) to simplify, we can obtain:

[0087]

[0088] So the quaternion spherical linear interpolation formula is as follows:

[0089]

[0090] Where Θ represents the angle of the quaternion and is obtained by the following formula:

[0091] Θ=arccos(cos(Θ))=arccos{max[-1,min(1,cos(Θ))]}=arccos{max[-1,min(1,q s ·q e )]} (30)

[0092] in:

[0093]

[0094] Spherical linear interpolation is not without flaws. When q s ·q e When the dot product is negative, the subsequent interpolation will be performed along the spherical path opposite to the shortest path. When the result is negative, negating one of the two quaternions can ensure that it is interpolated along the shortest spherical path.

[0095] In addition, when the angle Θ is very small, sin(Θ) will be small enough. At this time, the denominator is very small, which causes the value divided by sin(Θ) to become very large. At this time, the spherical linear interpolation formula will become very unstable and the stability will be greatly reduced. In the case of small angles, the defects of linear interpolation will be greatly reduced. In the case of small angles, linear interpolation and quaternion spherical linear interpolation are almost the same in angle changes, but there is a significant difference in calculation time. The calculation time of quaternion spherical linear interpolation is significantly higher than that of linear interpolation. Therefore, using linear interpolation in a small angle range can obtain an interpolation effect similar to that of quaternion spherical linear interpolation and significantly reduce the calculation cost. However, in the case of large angles, the angle change of quaternion spherical linear interpolation is smoother and more uniform, while the angle change of linear interpolation fluctuates greatly. Although the calculation time of linear interpolation is lower, it is difficult to maintain a smooth transition of direction in large angle scenarios. Therefore, in order to ensure the accuracy and continuity of the interpolation path, a faster linear interpolation is used at small angles, while a quaternion spherical linear interpolation is used at large angles to ensure a smooth and stable interpolation effect. Therefore, the present invention proposes a hybrid interpolation method based on an angle threshold [Θ]: when the angle of the tool axis vector is less than the threshold, a faster linear interpolation is used, and when the angle is greater than the threshold, a quaternion spherical linear interpolation is used. This choice can ensure the computational efficiency of small-angle interpolation while ensuring the smoothness and directional consistency of large-angle interpolation, thereby balancing accuracy and computational cost under different interpolation requirements. Through this method of dynamically selecting the interpolation method, the path continuity and interpolation efficiency in complex surface processing can be effectively improved, providing a flexible and efficient solution for multi-axis processing in practical applications.

[0096] Finally, the quaternion after spherical linear interpolation is converted back to the tool axis vector. The rotated vector b can be calculated by the following formula i (κ i , I′ i , J′ i K′ i ), the corresponding imaginary part is the compensated tool axis vector B′ i .

[0097]

[0098] In the formula (q i ) -1 Yes i The inverse of (for unit quaternions, the inverse is equal to the conjugate) Represents quaternion multiplication, q0 represents the starting tool axis unit vector B a The quaternion of (0, 0, 1) is q0 = (0, 0, 0, 1).

[0099] For the quaternion q i =(g i ,u i , v i , w i ), whose conjugate (also inverse) is:

[0100] (q i ) -1 =(g i , -u i , -v i , -w i ) (32)

[0101] For the quaternion q a =(g a ,u a , v a , w a ) and q b =(g b ,u b , v b , w b ),product The weight of

[0102]

[0103] The rotated vector b is obtained by equation (33): i (κ i , I′ i , J′ i K′ i ) Extract the imaginary part to get the compensated tool axis vector B′i (I′ i , J′ i K′ i ) Then the compensated tool axis vector B′ i (I′ i , J′ i K′ i ) is substituted into formula (5) to obtain the angle of the rotation axis after compensation (θ′ Ai ,θ′ Ci ), the interpolation tool tip coordinate A′ after compensation mentioned in the previous section i (a′ i , b′ i , c′ i ) and the rotation axis angle (θ′ Ai ,θ′ Ci ) Input the real-time post-processing module to calculate the feed coordinate increment of each axis of the tool machine to complete a real-time interpolation and compensation operation.

[0104] like Figure 4 As shown, the tool position file generated by UG is read by C++, the nine coordinates of discrete data are extracted, the adjacent tool position data are selected, and the coordinates of the interpolation tool tip point are calculated using formula (9). The tool tip is transformed from the origin to the interpolation tool tip, and the tool axis is transformed from the Z axis of the workpiece coordinate system to the interpolation tool axis unit vector. Combined with the coordinate transformation matrix (9) at this time, the interpolation sphere center point of the cutting contour surface in the workpiece coordinate system is calculated. The distance between the interpolation tool contact point and the shortest distance point is calculated by formula (13), and the coordinates of the point on the cutting contour surface with the shortest distance to the interpolation tool contact point (hereinafter referred to as the shortest distance point) are calculated by formula (14). It is judged whether this shortest distance is greater than the allowable error. If it is greater than the allowable error, the direction from the shortest distance point to the interpolation tool contact point is defined as the interpolation tool tip compensation direction, and the shortest distance is defined as the interpolation tool tip compensation amount, so as to obtain the tool tip compensation vector. The tool is translated as a whole, and the translation vector is defined as the tool tip compensation vector. The interpolation tool tip position coordinates after compensation are calculated by formula (18). Then, the tool axis vector is optimized by quaternion spherical linear interpolation to obtain the compensated tool axis vector. The angle θ of the adjacent tool axis vectors is calculated. If the angle is greater than the angle threshold [θ], the compensated tool axis vector B′ is obtained by quaternion spherical interpolation method through formula (31): i If the angle is less than or equal to the angle threshold [θ], it is converted into the rotation axis coordinates through equation (5), and the interpolated tool tip position coordinates after compensation are input into the real-time post-processing module to calculate the feed coordinate increments of each axis of the tool machine, completing a real-time interpolation and compensation operation.

Claims

1. A real-time optimization method for tool position and tool axis vector of five-axis machining based on cutting contour surface, characterized in that By calculating the spatial deviation between the tool contact point and the cutting contour surface in real time, the tool contact point trajectory deviation caused by tool swing is accurately compensated. At the same time, according to the changing characteristics of the tool axis vector, a dynamic interpolation algorithm is used to optimize the smooth transition of the tool axis vector to ensure the accuracy of the tool contact point trajectory and the continuity of the tool axis vector direction during machining, thereby significantly improving the trajectory accuracy and workpiece surface quality of five-axis machining. The specific steps include the following: First, taking a spherical tool as an example, the tool tip is first aligned with the origin of the workpiece coordinate system, the tool axis is aligned with the Z axis of the workpiece coordinate system, and the direction of the tool tip pointing to the machine tool spindle is the Z+ direction. The cutting edge line where the tool contacts the workpiece to achieve cutting is rotated around the tool axis to form a cutting contour surface, and the cutting contour surface equation is obtained. (in is the radius of the spherical tool), transform the tool tip from the origin to the interpolation tool tip A i (a i ,b i ,c i ), and calculate A through the relationship with the interpolation tool axis point i =D i -L×B i (Where L is the swing length of the tool, B i is the interpolation tool axis unit vector, through Ask for, D i The tool axis is transformed from the workpiece coordinate system Z axis to the interpolation tool axis unit vector, combined with the coordinate transformation matrix at this time Find the interpolation sphere center point M i (o i , p i ,s i ), thus obtaining the new equation of the cutting contour surface in the workpiece coordinate system, and interpolating the sphere center point M i (o i , p i ,s i ) points to the theoretical knife contact C i (x i ,y i , z i ) direction unit vector f i (u i , v i , w i )pass Then, the nonlinear error of the tool contact point is calculated and compensated. According to the geometric relationship between the interpolation tool contact point and the cutting contour surface, the coordinates of the closest point on the cutting contour surface to the interpolation tool contact point are calculated, and the nonlinear error is quantified. At the same time, the coordinates of the point on the cutting contour surface with the shortest distance to the interpolation tool contact point are calculated as the actual interpolation tool contact point. i (x i ,y i , z i ) plus the direction unit vector multiplied by the shortest distance. In order to reduce the sharp fluctuation of the tool feed speed caused by the correction of the tool tip position, the compensation distance should be as short as possible. Therefore, the direction from the nearest point to the interpolation tool contact point is defined as the interpolation tool tip compensation direction, and the shortest distance is defined as the interpolation tool tip compensation amount. In this way, the tool tip compensation vector is obtained, and the tool is translated as a whole. The translation vector is defined as the tool tip compensation vector. The interpolation tool tip position coordinates after compensation are calculated. Then, the tool axis vector is smoothly optimized and an angle threshold is set. If the angle threshold is less than the angle threshold, the tool axis vector adopts linear interpolation. If the angle threshold is greater than the angle threshold, the tool axis vector adopts quaternion spherical linear interpolation. The quaternion spherical linear interpolation formula is (q i is the tool axis vector quaternion corresponding to the quaternion spherical linear interpolation), through Find the rotated vector b i (κ i , I′ i , J′ i K′ i ), the corresponding imaginary part is the compensated tool axis vector B′ i The coordinates and the interpolated tool tip point coordinates are input into the real-time post-processing module to calculate the feed coordinate increments of each axis of the tool machine, and a real-time interpolation and compensation operation is completed. The present invention improves the trajectory accuracy and surface quality in five-axis machining through dynamic compensation of tool contact point errors and smooth optimization of tool axis vectors, and is suitable for high-precision manufacturing scenarios of complex surfaces.