Five-axis side milling test piece contour error prediction method considering tool pose
By introducing spline curve fitting and particle swarm optimization algorithms into five-axis side milling, combined with homogeneous coordinate transformation, the accuracy and efficiency problems of contour error prediction in five-axis CNC milling are solved, realizing high-precision and rapid prediction and error analysis of complex surfaces.
Patent Information
- Application Number
- CN202610119765.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-28
- Publication Date
- 2026-03-03
AI Technical Summary
Existing technologies make it difficult to accurately and quickly predict the contour error of test pieces in five-axis CNC milling, especially on test pieces with complex shapes and tool positions. The computational load is large and the fitting results have not been effectively optimized.
By substituting the toolpath code of five-axis side milling into a spatial error model that considers tool length, and combining spline curve fitting and particle swarm optimization algorithms, the pose data of the tool center point is calculated. The tool is then offset using a homogeneous coordinate transformation method to obtain the actual cutting contact point trajectory of the specimen, thus achieving high-precision contour error prediction.
It achieves high-precision and rapid prediction of the contour error of five-axis machined specimens, is applicable to complex shaped surfaces, reduces computational complexity, and provides reliable data support for machining quality evaluation and error compensation.
Smart Images

Figure CN121589665A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of five-axis CNC milling, and more specifically to a method for predicting the contour error of a five-axis side-milling specimen considering tool position. Background Technology
[0002] In five-axis CNC milling, the working accuracy of the machine tool is an important testing indicator. This is reflected in standards such as (GB / T39967-2021, Accuracy Inspection of S-shaped Specimens for Five-Axis Machining Centers [S]) and (GB / T 20957.2-2007, Inspection Conditions for Precision Machining Centers Part 2: Geometric Accuracy Inspection of Vertical or Universal Spindle Head Machine Tools with Vertical Spindle). ZThe recommended test pieces and testing methods are used for inspection in the five-axis side milling process. Among the test pieces, the S-type test piece and the truncated cone test piece have relatively complex ruled surface features. They are generally processed by five-axis side milling, which can well reflect the working accuracy of the five-axis machine tool. The standard specifies that the test indicators for the two are the cross-sectional profile of the S-type test piece at a certain height and the circular profile of the conical side surface of the truncated cone test piece, respectively. It can be seen that when using the trial cutting method to measure the working accuracy of five-axis side milling, the profile error is the most widely used, and its measurement and calculation methods are also relatively mature. Gao Xiulan et al. (Gao Xiulan, Lu Kaijiang. Error Analysis and Compensation Method of Five-axis Side Milling CNC Machining [J]. Mechanical Design and Manufacturing, 2005(6):3.) analyzed the geometric fitting relationship between the tool and the non-developable ruled surface in five-axis side milling CNC machining. Combined with the tool position calculation results, the machining error was obtained by solving the limit distance from any point on the machined surface to the tool profile surface family. Liao Ping (Liao Ping. Accurate calculation of complex surface profile error based on genetic algorithm and segmentation approximation method [J]. Journal of Mechanical Engineering, 2010(10):7.) proposed a segmentation approximation algorithm based on the minimum distance from the measuring point to the surface, combined with the characteristics of non-uniform rational B-spline (NURBS) surface. At the same time, the genetic algorithm was improved to solve the contradiction of the traditional algorithm. The final steps are easy to implement by computer and have high accuracy. Yu Zhixian et al. (Yu Zhixian, Chen Guangsheng. Calculation and prediction method of five-axis CNC machine tool profile error [J]. Mechanical and Electrical Engineering, 2024, 41(10):1723-1733.) proposed a method for calculating and predicting the profile error of five-axis machine tools based on Simulink digital twin model. A digital twin prediction model was established for overcutting, undercutting and singular point defects that occur in the machining process. The prediction results are consistent with the actual machining characteristics. Yu Hangzhuo et al. (Yu Hangzhuo, Qin Shengfeng, Ding Guofu, et al. Research on the prediction technology of the rotational contour error of the side milling tool [J]. China Mechanical Engineering, 2020, 31(3):8.) considered the tool wear and deformation in side milling and obtained the tool rotational contour through experiments. The tool contour obtained by this method can make the tool contact point position more accurate and improve the prediction accuracy of the contour error from the tool to the specimen. Ding Guofu et al. of Southwest Jiaotong University (Southwest Jiaotong University. A method for predicting the point contour error of the side milling surface of a part: 201810940066.7 [P]. 2021-01-29.) proposed a method for calculating the point contour of the side milling surface of a part. The machining contour error is obtained by fitting the surface with NURBS. However, this method does not consider the specific tool length at the height of the test contour of the specimen. Starting from the entire contour surface, a large number of control points are required and the amount of calculation is large. Furthermore, there is no further verification and optimization of the fitting results. Summary of the Invention
[0003] To address the aforementioned deficiencies or improvement needs of existing technologies, this invention provides a method for predicting the contour error of a five-axis side-milling test piece considering tool pose. The method substitutes the toolpath code of the five-axis side-milling test piece into a spatial error model that considers tool length, calculates the tool pose data corresponding to the tool center point of the contour, and then uses a spline curve fitting method to fit the pose data to a trajectory. This is combined with a particle swarm optimization algorithm to improve the accuracy of the fitted trajectory. Finally, a homogeneous coordinate transformation method is used to offset the tool center point along the radius to obtain the actual cutting contact point trajectory of the test piece, achieving high-precision and rapid prediction of the contour error of a five-axis machined test piece.
[0004] To achieve the above objectives, according to one aspect of the present invention, a method for predicting the contour error of a five-axis side-milling specimen considering tool pose is provided, comprising the following steps: S1 establishes a spatial position transformation relationship calculation model: When obtaining the G-code coordinates of each axis of the machine tool during side milling of the target workpiece, based on multibody system theory and homogeneous transformation matrix, the homogeneous transformation matrix describing the static relationship between adjacent components is... T ijp Homogeneous transformation matrix describing the motion relationship T ijs Multiply the data sequentially along the machine tool's motion chain to ultimately establish the motion data P for each axis of the machine tool. w To the workpiece forming point P t Spatial position transformation relationship calculation model; S2 Focusing Tool Length Calculation and Trajectory Point Set Acquisition: Based on a fixed height z The cross-sectional profile error of 0 is used as the detection index, and the forming point P is... t of Z Coordinate P tz = z Substituting 0 into the transformation relationship calculation model established in step S1, the specific tool length L required for machining the cross-sectional contour is obtained by inverse solution; then the tool length L is correlated with the machine tool axis motion G-code coordinates P. w Substituting the transformation relationship calculation model established in step S1 into the forward direction, the set of motion trajectory points of the tool center point is calculated; S3 Intelligent Algorithm Optimizes Trajectory Fitting: Introduces a spline fitting curve method, in... Z = z On the plane of 0, ideal motion trajectory curves L are constructed based on the set of tool center point motion trajectories obtained in step S2. ideal and the actual trajectory curve L actual Since the two curves lie in the same plane, we only study the two-dimensional coordinates and use the particle swarm optimization algorithm for parameter iterative optimization. S4 Cutting Contact Trajectory Calculation and Contour Error Solution: Combining the tool posture parameters, the homogeneous coordinate matrix transformation is performed on the tool center point motion trajectory point set optimized in step S3; then, the tool center point is offset along the radial direction by the corresponding cross section projection length to obtain the tool cutting contact trajectory point set; finally, by calculating the spatial distance between corresponding points in the tool cutting contact trajectory point set, the cross section contour error at the predicted point set is obtained.
[0005] Preferably, step S1 specifically includes the following steps: S11: Collect the G-code coordinates of each axis movement during the side milling of the S test piece on the machine tool, and at the same time, comprehensively measure the various geometric errors of the machine tool to obtain complete error data; S12: Based on multibody system theory, establish dedicated coordinate systems on key components of the milling machine, including linear axes. X , Y , Z Rotation axis A , B , C And the spindle, cutting tools and workpiece; S13: The homogeneous transformation matrix describing the static relationship between adjacent components is transformed using a homogeneous transformation matrix. T ijp Homogeneous transformation matrix describing the motion relationship T ijs Multiplying the data sequentially along the machine tool's motion chain yields the motion data P for each axis of the machine tool. w To the workpiece forming point P t Spatial position transformation relationship; S14: Solve for the forming point P t Spatial location, and expressed as column vector P t (P tx , P ty , P tz , 1) T express.
[0006] Preferably, the tool center point motion trajectory point set in step S2 includes the tool center point ideal motion trajectory point set P. tideal With the actual motion trajectory point set P tactual That is, when the geometric error parameter in the transformation relationship calculation model established in step S1 is set to 0, the ideal motion trajectory point set P without considering the influence of error is obtained. tideal When the measured geometric error data is substituted into the transformation relationship calculation model established in step S1, the actual motion trajectory point set P containing the error influence is obtained. tactual .
[0007] Preferably, step S3 specifically includes the following steps: S31: Introduce the spline fitting curve method, and apply the ideal motion trajectory point set P of the tool center point obtained in step S2 to each of the following steps: tideal With the actual motion trajectory point set P tactual Perform fitting, in Z = z On the plane of 0, construct the ideal motion trajectory curve L based on the ideal and actual motion trajectory point sets respectively. ideal and the actual trajectory curve L actual The two curves lie on the same plane, allowing for the study of only... x , y Two-dimensional coordinates; S32: Using the particle swarm optimization algorithm, the coordinate fitting curve of the motion trajectory points is denoted as... And preset the residual tolerance of the fit as tol The constructed optimization objective function is denoted as . ; S33: By iteratively solving the optimization objective function constructed in step S32, and ensuring that the Euclidean distance between the fitted curve and the original trajectory points is less than the preset residual tolerance, determine the optimal weight parameter p, and output the optimized ideal trajectory point set P. ti_new With the actual motion trajectory point set P ta_new .
[0008] Preferably, the objective function expression is:
[0009] in, Represents the fitted curve. The second derivative of the fitted curve is given by the fitting point ( ). x i f( x i ))and( x i , y i ), This represents the Lagrange multiplier.
[0010] Preferably, step S4 specifically includes the following steps: S41: The set of ideal motion trajectory points P obtained after fitting and optimization in step S3 ti_new and the actual motion trajectory point set P ta_new All Z = z On the 0 plane, the coordinates of the optimized motion trajectory points are in the form of ( x P , y P , z 0); S42: Use the optimized motion trajectory points from step S41 as the tool's central axis. l a At the intersection with the cross section, considering the tool radius r and orientation, it is radially aligned with the normal. l n The point after the direction offset radius r is Q( x Q , y Q , z Q The vector of the tool generatrix at point Q is the vector of the tool tangential contact line. l r ( α , β , γ ), with the tool center axis l a They are parallel to each other and expressed as point-to-point; S43: The initial tool orientation is... l 0(l x , l y , l z Based on the G-code corresponding to the actual point, coordinate transformation is performed along the motion chain from the tool to the workpiece to obtain the tool contact line vector. l r The result of the direction vector calculation; S44: Obtain the tangent line of the cross section based on the expression of the fitted curve in step S32. l s ( x s , y s , 0), because the offset normal l n Simultaneously with the tangent of the cross section l s and the vector of the cutting tool contact line l r The offset normal vector is obtained by calculating the cross product when the vectors are perpendicular. l n ; S45: Further calculate Q( x Q , y Q , z Q Coordinates, the actual cutting contact point O to be determined. x O , y O , z O In space, a straight line l rThe coordinates of the tool cutting contact point O are obtained by substituting them into the point-direction formula in step S42. S46: Obtain the ideal tool contact point O after offsetting via step S45. ti The point set P constituted ti_new and the corresponding actual cutting contact point O of the tool ta The point set P constituted ta_new Calculate the set of points P that form the ideal motion trajectory. ti_new With the actual motion trajectory point set P ta_new The distance between points is used to obtain the cross-sectional profile error E at the predicted point set.
[0011] As a preferred option, the relationship between the coordinates of the optimized motion trajectory point and point Q in step S42 is as follows:
[0012] Where r represents the tool radius, ( x P , y P , z 0) represents the motion trajectory point after optimization in step S41, Q(x) Q , y Q , z Q ) indicates that in step S42, ( x P , y P , z 0) Along the radial direction of the normal l n The point after the direction offset radius r, l n express( x P , y P , z 0) The normal vector on the fitted curve.
[0013] Preferably, the point-directed expression in step S42 is:
[0014] in, α ,、 β , γ The vectors representing the cutting edge of the tool are represented sequentially. l r of x , y , z Axis coordinates, Q(x) Q , y Q , z Q ) indicates that in step S42, (x P , y P , z 0) Along the radial direction of the normal l n The point after the directional offset radius r.
[0015] Preferably, step S43 yields the tool cutting contact vector. l r The direction vector expression is:
[0016] Among them, l x l y l z The initial positions of the tool are represented sequentially. l 0 x , y , z Axis coordinates; a , b , c This indicates the rotating axis present on the kinematic chain on the machine tool tool side. A , B , C The rotation angle of the axis.
[0017] Preferably, step S44 yields the offset normal vector. l n The expression for calculating the cross product is:
[0018] Where, x s y s 0 and 0 are the tangents of the cross section, respectively. l s The x, y, and z axis coordinates; α, β, and γ are the vectors representing the tool's tangential contact line, respectively. l r The x, y, and z coordinates.
[0019] In summary, the technical solutions conceived by this invention have the following beneficial effects compared with the prior art: 1. This invention substitutes the toolpath code of a five-axis side-milling test piece into a spatial error model that considers tool length, calculates the tool pose data corresponding to the tool center point of the contour, fits the pose data to the trajectory by introducing a spline curve fitting method, improves the accuracy of the fitted trajectory by combining a particle swarm optimization algorithm, and finally obtains the actual cutting point trajectory of the test piece by offsetting the tool along the radius using a homogeneous coordinate transformation method, thereby achieving high-precision and rapid prediction of the contour error of a five-axis machined test piece; 2. Compared with existing methods, the present invention is more flexible in controlling fitting accuracy and smoothness. It can achieve optimal smoothing of trajectory curves while meeting machining accuracy requirements. It is especially suitable for side milling error prediction of complex-shaped surfaces such as free-form surfaces and irregular cross-sections. 3. This invention is specifically designed for side milling machining scenarios and can accurately output workpiece cross-sectional contour error data, providing reliable data support for the quantitative evaluation of machining quality, the formulation of error compensation schemes, and the optimization of machining process parameters for equipment such as five-axis side milling machines; 4. Compared with the relatively complex surface fitting scheme in the prediction of the point contour error of the side milling surface of the part, the present invention focuses on the cross-sectional contour of the specimen at a specific height, and replaces the full surface fitting with targeted curve fitting, which greatly reduces the amount of data processing and computational complexity. Attached Figure Description
[0020] Figure 1 yes AC Schematic diagram of a five-axis machining center with dual rotary tables.
[0021] Figure 2 This is a schematic diagram of the topology of a multibody system.
[0022] Figure 3 This is a schematic diagram of the toolpath before calculating the tool length.
[0023] Figure 4 This is a schematic diagram of the toolpath after calculating the tool length.
[0024] Figure 5 This is a magnified view of the tool attitude calculation. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0026] Please see Figure 1 and Figure 5 The present invention provides a method for predicting the contour error of a five-axis side-milling specimen considering tool pose, comprising the following steps: S1 establishes a spatial position transformation relationship calculation model: Obtain the G-code coordinates of each axis of the machine tool during side milling of the target workpiece. Based on multibody system theory and homogeneous transformation matrix, the homogeneous transformation matrix describing the static relationship between adjacent components is... T ijp Homogeneous transformation matrix describing the motion relationship Tijs Multiply the data sequentially along the machine tool's motion chain to ultimately establish the motion data P for each axis of the machine tool. w To the workpiece forming point P t The spatial position transformation relationship calculation model; selecting the S-type test piece that meets the machine tool machining accuracy testing requirements in the standard as the side milling machining object, and using... AC The rotary table five-axis machine tool is a specific application example. The basic configuration of the machine tool is as follows: Figure 1 As shown.
[0027] Step S1 specifically includes the following steps: S11: Collect the G-code coordinates of each axis movement during the side milling of the S-type test piece on the machine tool, and simultaneously measure all geometric errors of the machine tool to obtain complete error data; the spatial position transformation relationship calculation model constructed above includes two core inputs: one is 37 geometric errors obtained from the actual measurement of the five-axis machine tool, specifically covering the straightness error, deflection error, roll error, pitch error, positioning error of each axis, as well as the perpendicularity error between each pair of axes; the other is the G-code coordinates of each axis of the machine tool during the side milling of the S-type test piece, which is expressed as a column vector P w (P wx , P wy , P wz , 1) T Based on multibody system theory and the homogeneous transformation matrix method, the motion data P of each axis of the machine tool is further constructed. w To the workpiece forming point P t The corresponding spatial position transformation relationship calculation model is then established. Specifically, the model first extracts the relative motion relationships of key machine tool components and establishes a simplified topological model.
[0028] S12: Based on multibody system theory, establish dedicated coordinate systems on key components of the milling machine, including linear axes. X , Y , Z Rotation axis A , B , C And the spindle, cutting tools and workpiece; S13: The homogeneous transformation matrix describing the static relationship between adjacent components is transformed using a homogeneous transformation matrix. T ijp Homogeneous transformation matrix describing the motion relationship T ijs Multiplying the data sequentially along the machine tool's motion chain yields the motion data P for each axis of the machine tool. w To the workpiece forming point P t Spatial position transformation relationship; S14: Solve for the forming point P t Spatial location, and expressed as column vector P t (Ptx , P ty , P tz , 1) T This means, that is:
[0029] In the formula, the homogeneous transformation matrix describing the static and dynamic relationships between a typical body j and its neighboring lower-order body i is used. T ij To be more specific, this refers to general writing describing stillness. T ijp General writing describing motion T ijs . i and j The superscript indicates the component number along two different motion chains of the workpiece and the tool, where the segment from the bed to the specimen is... n w The distance from the bed to the cutting tool end is n t The topology is as follows: Figure 2 As shown.
[0030] S2 Focusing Tool Length Calculation and Trajectory Point Set Acquisition: Based on a fixed height z The cross-sectional profile error of 0 is used as the detection index, and the forming point P is... t of Z Coordinate P tz = z Substituting 0 into the transformation relationship calculation model established in step S1, the specific tool length L required for machining the cross-sectional contour is obtained by inverse solution; then the tool length L is correlated with the machine tool axis motion G-code coordinates P. w Substituting the transformation relationship calculation model established in step S1 into the forward direction, the set of motion trajectory points of the tool center point is calculated; In step S2, the tool center point motion trajectory point set includes the tool center point ideal motion trajectory point set P. tideal With the actual motion trajectory point set P tactual That is, when the geometric error parameter in the transformation relationship calculation model established in step S1 is set to 0, the ideal motion trajectory point set P without considering the influence of error is obtained. tideal When the measured geometric error data is substituted into the transformation relationship calculation model established in step S1, the actual motion trajectory point set P containing the error influence is obtained. tactual .
[0031] Depending on the specific test specimen's testing parameters, the cross-sectional profile at a fixed height is typically used as the core testing parameter. The spatial position vector P of the forming point is then used. t (P tx , P ty , P tz, 1) T middle Z Coordinate P tz Set to this fixed height z 0, and then substitute it into the model of spatial position transformation of the forming point in step S1, and obtain the specific tool length L when the tool is machining the cross-sectional contour line by reverse solution. The tool length is calculated by the homogeneous transformation matrix from the motion axis of the spindle mounting part to the stationary tool, which is specifically constructed according to the actual mounting axis and orientation of the tool. After completing the solution of the tool length L, L is compared with the coordinate vector P of the motion G code of each axis of the machine tool. t Substituting the spatial position transformation relationship model from step 1 into the forward model, we calculate the motion trajectory point set of the tool center point in two scenarios: when the geometric error parameter in the model is set to 0, we obtain the ideal motion trajectory point set P without considering the error effect. tideal When measured geometric error data is substituted into the model, the actual motion trajectory point set P containing the influence of the error is obtained. tactual The spatial motion trajectory is converted into the forming point trajectory on the cross section of the specimen, such as... Figure 3 and Figure 4 As shown.
[0032] S3 Intelligent Algorithm Optimizes Trajectory Fitting: Introduces a spline fitting curve method, in... Z = z On the plane of 0, ideal motion trajectory curves L are constructed based on the set of tool center point motion trajectories obtained in step S2. ideal and the actual trajectory curve L actual Since the two curves lie in the same plane, we only study the two-dimensional coordinates and use the particle swarm optimization algorithm for parameter iterative optimization. S31: Introduce the spline fitting curve method, and apply the ideal motion trajectory point set P of the tool center point obtained in step S2 to each of the following steps: tideal With the actual motion trajectory point set P tactual Perform fitting, in Z = z On the plane of 0, construct the ideal motion trajectory curve L based on the ideal and actual motion trajectory point sets respectively. ideal and the actual trajectory curve L actual The two curves lie on the same plane, allowing for the study of only... x , y Two-dimensional coordinates; S32: Using the particle swarm optimization algorithm, the coordinate fitting curve of the motion trajectory points is denoted as... And preset the residual tolerance of the fit as tol The constructed optimization objective function is denoted as . ; To address the challenge of balancing accuracy and smoothness in traditional fitting methods, a particle swarm optimization algorithm is employed to iteratively optimize the fitting results. During the optimization process, the coordinates of the motion trajectory points are denoted as... And preset the residual tolerance of the fit as tol , tol The magnitude of the numerical value should be much smaller than the magnitude of the specimen contour error in the actual measurement to ensure fitting accuracy. The optimization objective function can be expressed as:
[0033] in, This indicates the fitted curve, to the left of the plus sign. Let represent the second derivative of the fitted curve, and its square integral characterizes the smoothness of the fitted curve. The right side passes through the fitted point ( x i f( x i ))and( x i , y i The sum of squared residuals characterizes the accuracy of the fitted data; simultaneously, the Lagrange multiplier method is introduced to transform the constrained optimization problem into an unconstrained optimization algorithm. This represents the Lagrange multiplier.
[0034] S33: By iteratively solving the optimization objective function constructed in step S32, and ensuring that the Euclidean distance between the fitted curve and the original trajectory points is less than the preset residual tolerance, determine the optimal weight parameter p, and output the optimized ideal trajectory point set P. ti_new With the actual motion trajectory point set P ta_new .
[0035] S4 Cutting Contact Point Trajectory Calculation and Contour Error Solution: Combining tool posture parameters, the homogeneous coordinate matrix transformation is performed on the tool center point motion trajectory point set optimized in step S3; then, the tool center point is offset along the radial direction by the corresponding cross-sectional projection length to obtain the tool cutting contact point trajectory point set; finally, by calculating the spatial distance between corresponding points in the tool cutting contact point trajectory point set, the cross-sectional contour error at the predicted point set is obtained. Specifically, the following steps are included: S41: The set of ideal motion trajectory points P obtained after fitting and optimization in step S3 ti_new and the actual motion trajectory point set P ta_new All Z = z On the 0 plane, the coordinates of the optimized motion trajectory points are in the form of ( x P , y P , z 0), zoom in on the local area of the contour trajectory point as follows: Figure 5 As shown.
[0036] S42: Use the optimized motion trajectory points from step S41 as the tool's central axis. l a At the intersection with the cross section, considering the tool radius r and orientation, it is radially aligned with the normal. l n The point after the direction offset radius r is Q( x Q , y Q , z Q The coordinates of the two are related as follows:
[0037] Where r represents the tool radius, ( x P , y P , z 0) represents the motion trajectory point after optimization in step S41, Q(x) Q , y Q , z Q ) indicates that in step S42, ( x P , y P , z 0) Along the radial direction of the normal l n The point after the direction offset radius r, l n express( x P , y P , z 0) The normal vector on the fitted curve.
[0038] The vector of the tool generatrix at point Q, i.e., the vector of the tool tangential contact line. l r ( α , β , γ ), with the tool center axis l a Parallel to each other, represented as point-to-point:
[0039] in, α ,、 β , γ The vectors representing the cutting edge of the tool are represented sequentially. l r of x , y ,z Axis coordinates, Q(x) Q , y Q , z Q ) indicates that in step S42, ( x P , y P , z 0) Along the radial direction of the normal l n The point after the directional offset radius r.
[0040] S43: The initial tool orientation is... l 0(l x , l y , l z ), moving to a certain contour point along A The shaft rotated a radian, along B The shaft rotated b radian, along C The shaft rotated c In general, a five-axis machine tool only has two rotation axes. Based on the G-code corresponding to the actual point position, coordinate transformation is performed along the motion chain from the tool to the workpiece to obtain the tool tangent vector. l r Direction vector calculation results (in terms of tool-) A - B - C - Taking the workpiece sequence as an example:
[0041] Among them, l x l y l z The initial positions of the tool are represented sequentially. l 0 x , y , z Axis coordinates; a , b , c This indicates the rotating axis present on the kinematic chain on the machine tool tool side. A , B , C The rotation angle of the axis.
[0042] S44: Obtain the tangent line of the cross section based on the expression of the fitted curve in step S32. l s ( x s , y s , 0), because the offset normal l n Simultaneously with the tangent of the cross sectionl s and the vector of the cutting tool contact line l r The offset normal vector is obtained by calculating the cross product when the vectors are perpendicular. l n Its expression is:
[0043] Where, x s y s 0 and 0 are the tangents of the cross section, respectively. l s The x, y, and z axis coordinates; α, β, and γ are the vectors representing the tool's tangential contact line, respectively. l r The x, y, and z coordinates.
[0044] S45: Q can be further calculated. x Q , y Q , z Q Coordinates, the actual cutting contact point O to be determined. x O , y O , z O In space, a straight line l r Above, and located on the plane where the contour trajectory point is located, that is z O = z 0; Substitute its coordinates into the point-direction equation to solve for the coordinates of the tool contact point O, the expression is:
[0045] S46: Obtain the ideal tool contact point O after offsetting via step S45. ti The point set P constituted ti_new and the corresponding actual cutting contact point O of the tool ta The point set P constituted ta_new Calculate the set of points P that form the ideal motion trajectory. ti_new With the actual motion trajectory point set P ta_new The distance between points is used to obtain the cross-sectional profile error E at the predicted point set.
[0046] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for predicting the contour error of a five-axis side-milling specimen considering tool pose, characterized in that, Includes the following steps: S1 establishes a spatial position transformation relationship calculation model: When obtaining the G-code coordinates of each axis of the machine tool during side milling of the target workpiece, based on multibody system theory and homogeneous transformation matrix, the homogeneous transformation matrix describing the static relationship between adjacent components is... T ijp Homogeneous transformation matrix describing the motion relationship T ijs Multiply the data sequentially along the machine tool's motion chain to ultimately establish the motion data P for each axis of the machine tool. w To the workpiece forming point P t Spatial position transformation relationship calculation model; S2 Focusing Tool Length Calculation and Trajectory Point Set Acquisition: Based on a fixed height z The cross-sectional profile error of 0 is used as the detection index, and the forming point P is... t of Z Coordinate P tz = z Substituting 0 into the transformation relationship calculation model established in step S1, the specific tool length L required for machining the cross-sectional contour is obtained by inverse solution; then the tool length L is compared with the G-code coordinates P of each axis of the machine tool. w Substituting the transformation relationship calculation model established in step S1 into the forward direction, the set of motion trajectory points of the tool center point is calculated; S3 Intelligent Algorithm Optimizes Trajectory Fitting: Introduces a spline fitting curve method, in... Z = z On the plane of 0, ideal motion trajectory curves L are constructed based on the set of tool center point motion trajectories obtained in step S2. ideal and the actual trajectory curve L actual The particle swarm optimization algorithm is used for iterative parameter optimization. S4 Cutting Contact Trajectory Calculation and Contour Error Solution: Combining the tool posture parameters, the homogeneous coordinate matrix transformation is performed on the tool center point motion trajectory point set optimized in step S3; then, the tool center point is offset along the radial direction by the corresponding cross section projection length to obtain the tool cutting contact trajectory point set; finally, by calculating the spatial distance between corresponding points in the tool cutting contact trajectory point set, the cross section contour error at the predicted point set is obtained.
2. The method for predicting the contour error of a five-axis side-milling specimen considering tool pose as described in claim 1, characterized in that, Step S1 specifically includes the following steps: S11: Collect the G-code coordinates of each axis movement during the side milling of the S test piece on the machine tool, and at the same time, comprehensively measure the various geometric errors of the machine tool to obtain complete error data; S12: Establish dedicated coordinate systems on key components of the milling machine based on the multibody system theory; S13: The homogeneous transformation matrix describing the static relationship between adjacent components is transformed using a homogeneous transformation matrix. T ijp Homogeneous transformation matrix describing the motion relationship T ijs Multiplying the data sequentially along the machine tool's motion chain yields the motion data P for each axis of the machine tool. w To the workpiece forming point P t Spatial position transformation relationship; S14: Solve for the forming point P t Spatial location, and expressed as column vector P t (P tx , P ty , P tz , 1) T express.
3. The method for predicting the contour error of a five-axis side-milling specimen considering tool pose as described in claim 1, characterized in that, In step S2, the tool center point motion trajectory point set includes the tool center point ideal motion trajectory point set P. tideal With the actual motion trajectory point set P tactual That is, when the geometric error parameter in the transformation relationship calculation model established in step S1 is set to 0, the ideal motion trajectory point set P without considering the influence of error is obtained. tideal When the measured geometric error data is substituted into the transformation relationship calculation model established in step S1, the actual motion trajectory point set P containing the error influence is obtained. tactual .
4. The method for predicting the contour error of a five-axis side-milling specimen considering tool pose as described in claim 3, characterized in that, Step S3 specifically includes the following steps: S31: Introduce the spline fitting curve method, and apply the ideal motion trajectory point set P of the tool center point obtained in step S2 to each of the following steps: tideal With the actual motion trajectory point set P tactual Perform fitting, in Z = z On the plane of 0, construct the ideal motion trajectory curve L based on the ideal and actual motion trajectory point sets respectively. ideal And the actual trajectory curve L actual The two curves lie on the same plane, allowing for the study of only... x , y Two-dimensional coordinates; S32: Using the particle swarm optimization algorithm, the coordinate fitting curve of the motion trajectory points is denoted as... And preset the residual tolerance of the fit as tol The constructed optimization objective function is denoted as . ; S33: By iteratively solving the optimization objective function constructed in step S32, and ensuring that the Euclidean distance between the fitted curve and the original trajectory points is less than the preset residual tolerance, determine the optimal weight parameter p, and output the optimized ideal trajectory point set P. ti_new With the actual motion trajectory point set P ta_new .
5. The method for predicting the contour error of a five-axis side-milling specimen considering tool pose as described in claim 4, characterized in that, The objective function expression is: in, Represents the fitted curve. The second derivative of the fitted curve is given by the fitting point ( ). x i f( x i ))and( x i , y i ), This represents the Lagrange multiplier.
6. The method for predicting the contour error of a five-axis side-milling specimen considering tool pose as described in claim 4, characterized in that, Step S4 specifically includes the following steps: S41: The set of ideal motion trajectory points P obtained after fitting and optimization in step S3 ti_new and the actual motion trajectory point set P ta_new All Z = z On the 0 plane, the coordinates of the optimized motion trajectory points are in the form of ( x P , y P , z 0); S42: Use the optimized motion trajectory points from step S41 as the tool's central axis. l a At the intersection with the cross section, considering the tool radius r and orientation, it is radially aligned with the normal. l n The point after the direction offset radius r is Q( x Q , y Q , z Q The vector of the tool generatrix at point Q is the vector of the tool tangent line. l r ( α , β , γ ), with the tool center axis l a They are parallel to each other and expressed as point-to-point; S43: The initial tool orientation is... l 0(l x , l y , l z Based on the G-code corresponding to the actual point, coordinate transformation is performed along the motion chain from the tool to the workpiece to obtain the tool contact line vector. l r The result of the direction vector calculation; S44: Obtain the tangent line of the cross section based on the expression of the fitted curve in step S32. l s ( x s , y s , 0), because the offset normal l n Simultaneously with the tangent of the cross section l s and the vector of the cutting tool contact line l r The offset normal vector is obtained by calculating the cross product when the vectors are perpendicular. l n ; S45: Further calculate Q( x Q , y Q , z Q Coordinates, the actual cutting contact point O to be determined. x O , y O , z O In space, a straight line l r The coordinates of the tool cutting contact point O are obtained by substituting them into the point-direction formula in step S42. S46: Obtain the ideal tool contact point O after offsetting via step S45. ti The point set P constituted ti_new and the corresponding actual cutting contact point O of the tool ta The point set P constituted ta_new Calculate the set of points P that form the ideal motion trajectory. ti_new With the actual motion trajectory point set P ta_new The distance between points is used to obtain the cross-sectional profile error E at the predicted point set.
7. The method for predicting the contour error of a five-axis side-milling specimen considering tool pose as described in claim 6, characterized in that, The relationship between the coordinates of the optimized motion trajectory point and point Q in step S42 is as follows: Where r represents the tool radius, ( x P , y P , z 0) represents the motion trajectory point after optimization in step S41, Q(x) Q , y Q , z Q ) indicates that in step S42, ( x P , y P , z 0) Along the radial direction of the normal l n The point after the direction offset radius r, l n express( x P , y P , z 0) The normal vector on the fitted curve.
8. The method for predicting the contour error of a five-axis side-milling specimen considering tool pose as described in claim 6, characterized in that, The expression for the point-directed form in step S42 is: in, α ,、 β , γ The vectors representing the cutting edge of the tool are represented sequentially. l r of x , y , z Axis coordinates, Q(x) Q , y Q , z Q ) indicates that in step S42, ( x P , y P , z 0) Along the radial direction of the normal l n The point after the directional offset radius r.
9. The method for predicting the contour error of a five-axis side-milling specimen considering tool pose as described in claim 6, characterized in that, Step S43 obtains the tool contact line vector. l r The direction vector expression is: Among them, l x l y l z The initial positions of the tool are represented sequentially. l 0 x , y , z Axis coordinates; a , b , c This indicates the rotating axis present on the kinematic chain on the machine tool tool side. A , B , C The rotation angle of the axis.
10. The method for predicting the contour error of a five-axis side-milling specimen considering tool pose as described in claim 6, characterized in that, Step S44 yields the offset normal vector. l n The expression for calculating the cross product is: Where, x s y s 0 and 0 are the tangents of the cross section, respectively. l s The x, y, and z axis coordinates; α, β, and γ are the vectors representing the tool's contact line. l r The x, y, and z coordinates.
Citation Information
Patent Citations
A method for predicting the point contour error of the side milled surface of a part
CN108803487B