Five-axis contour error control method based on variable gain iterative learning
Through the variable gain iterative learning control algorithm and the D-H parameter method synchronously correcting the tool position and attitude, the problem of large contour error in the complex working conditions of the five-axis CNC machine tool is solved, and high-precision and rapid convergence are achieved.
Patent Information
- Application Number
- CN202510662431.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-08-15
AI Technical Summary
When the existing five-axis CNC machine tools are processed with complex curved surface parts, the fixed gain iterative learning control method is difficult to meet the high-precision requirements and cannot adapt to the control needs under complex working conditions, resulting in large outline errors and slow convergence speed.
The variable gain iterative learning control algorithm is adopted to optimize the learning gain, adaptively adjust the control input, and combine the D-H parameter method and arc fitting method to estimate the contour error, so as to realize the synchronization correction of tool position and posture, and improve control accuracy and convergence speed.
The contour error control accuracy and convergence speed of five-axis machining are significantly improved, which can more effectively suppress contour errors under complex working conditions and meet the needs of high-precision machining.
Smart Images

Figure CN120491549A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of five-axis machining control of machine tools, and in particular to a five-axis contour error control method based on variable gain iterative learning. Background Art
[0002] Five-axis CNC machine tools are widely used in aerospace, automotive, and other fields for machining complex curved parts. By combining advanced computer control technology with high-precision machining techniques, these machines are able to complete machining tasks within stringent tolerances. In particular, high demands are placed on material strength, rigidity, and surface quality in the aerospace industry. Therefore, effectively controlling contour errors generated during machining becomes a key issue in improving machining accuracy.
[0003] During part machining, due to factors such as assembly errors, operational errors, and workpiece material properties, machining accuracy often fails to meet requirements. To achieve high-precision machining, many researchers have proposed different contour error control strategies. These strategies improve contour accuracy by monitoring the machining process in real time, predicting errors, and effectively compensating for them.
[0004] Currently, the main methods for controlling contour errors include cross-coupling control (CCC) and iterative learning control (ILC). The cross-coupling control method calculates the deviation between the actual position and the theoretical position and distributes the contour error to each feed axis, forming a closed-loop control. Although this method has made some progress in two-axis and three-axis machining, due to the more complex coupling relationship between the axes in five-axis machining, traditional control methods often cannot meet the requirements of high-precision machining. In recent years, research combined with iterative learning control has gradually become a hot topic for improving the accuracy of five-axis machining.
[0005] Due to its superior performance in repetitive tasks, ILC has gradually become an effective way to control contour errors in multi-axis motion systems. By providing feedback on the error measured in the previous machining, ILC can correct the control input for the next machining, thereby improving machining accuracy. In five-axis machining, scholars Barton et al. combined ILC with CCC and designed a cross-coupled iterative learning controller that can effectively compensate for contour errors with large curvature and complex geometric features. In recent years, scholars Li Jiangang et al. have proposed methods based on spatial iterative learning control. These methods can ignore the influence of time changes and transform the error dynamic model into the spatial domain, thereby improving control accuracy and system stability.
[0006] However, all of the aforementioned control methods employ fixed-gain iterative learning, which struggles to meet control requirements under complex operating conditions, resulting in suboptimal control performance. Fixed-gain control strategies are unable to adapt to contour changes and dynamic error characteristics during machining. This results in slow convergence and even potential undercompensation when processing trajectories with large curvature or rapid changes. This not only impacts overall control effectiveness but can also lead to fluctuations in machining accuracy, making it difficult to meet stringent contour error requirements, particularly in high-precision machining tasks.
[0007] To this end, this paper proposes a contour error control strategy based on variable gain iterative learning. By integrating variable gain adjustment into the iterative learning control framework, the proposed method improves the convergence speed and ensures more accurate contour error control. Summary of the Invention
[0008] The present invention proposes a five-axis contour error control method based on variable gain iterative learning. By introducing a variable gain iterative learning algorithm, it not only optimizes the control accuracy but also improves the convergence speed, thereby more effectively suppressing contour errors in complex and high-precision machining scenarios.
[0009] The present invention adopts the following technical solutions.
[0010] A five-axis contour error control method based on variable gain iterative learning, the method comprising the following steps:
[0011] Step 1: Establish the coordinate systems of the five-axis machine tool;
[0012] Step 2: Use DH parameter method to construct the kinematic model of the machine tool;
[0013] Step 3: Use arc fitting method to estimate the contour error, and ensure the synchronization of tool tip position contour error and tool posture contour error through posture ratio;
[0014] Step 4: Correct the position and posture of the tool based on the variable gain iterative learning control algorithm. By optimizing the learning gain, the control input is adaptively adjusted to reduce the contour error.
[0015] In step 1, the coordinate system includes the machine tool coordinate system, A-axis coordinate system, C-axis coordinate system, tool coordinate system and workpiece coordinate system;
[0016] Machine tool coordinate system O M -X M ,Y M ,Z M Located on the machine tool bed, it is the reference coordinate system for machine tool movement;
[0017] A-axis coordinate system O A -X A,Y A ,Z A Describes the rotational motion of the A-axis around the X-axis. The A-axis rotates to adjust the tilt angle between the tool and the workpiece.
[0018] C-axis coordinate system O C -X C ,Y C ,Z C Describes the rotational motion of the C-axis around the Z-axis. The rotation of the C-axis is used for planar rotation processing of the workpiece.
[0019] Tool coordinate system (O T -X T ,Y T ,Z T ) describes the position and posture of the tool end, and accurately controls the tool's motion path by adjusting the tool's position and posture;
[0020] Workpiece coordinate system (O W -X W ,Y W ,Z W ) describes the position and posture of the workpiece, and is used to define the spatial position and posture of the workpiece in the processing area to ensure the accuracy and precision of processing.
[0021] In step 2, the mapping relationship between the machine tool feed axis and the part processing trajectory is introduced into the kinematic model, and the tool spatial position and posture are calculated by the DH parameter method of the kinematic forward solution model to ensure that the tool can move according to the predetermined trajectory.
[0022] In step 2, the establishment of the kinematic model includes the following steps:
[0023] Step S1: Use the DH parameter method to obtain the total transformation matrix from the machine tool base to the workpiece:
[0024]
[0025] Where, γ represents the rotation angle of the C axis; α represents the rotation angle of the A axis; (X c ,Y c ,Z c ) represents the offset of the C-axis coordinate system relative to the machine tool coordinate system; (X t ,Y t ,Z t ) represents the offset of the workpiece coordinate system relative to the tool coordinate system;
[0026] Step S2: Assume that the expression of the tool tip position coordinate in the kinematics forward solution model is:
[0027]
[0028] Among them, P x ,P y ,P z Respectively represent the position coordinates of the tool tip point in the workpiece coordinate system;
[0029] Then the expression of tool posture vector is:
[0030]
[0031] Step S3: The inverse kinematics model is obtained by solving the given tool posture:
[0032]
[0033] In step three, the tool tip position contour error and tool posture contour error are defined, and the arc fitting method is used to estimate the contour error based on the actual tool tip position and the expected trajectory path.
[0034] In step 3, the contour error estimation process includes the following steps:
[0035] Step A1: Calculate the contour error for each actual tool tip position point using the arc method, find the closest discrete point on the corresponding desired trajectory, and use it as a reference point to calculate the contour error;
[0036] Step A2: Calculate the two adjacent interpolation points before and after the reference point, use the three-point method to fit the arc, solve the center position O0 of the arc, and deduce the compensation point P of the tool tip position. c ', therefore, the tool tip position profile error ε p The expression is:
[0037] ε p =||P c '-P a || Formula 6;
[0038] Among them, P a Indicates the actual tool tip position coordinates.
[0039] Step A3: Calculate the actual tool posture O a With compensation point O c 'Posture deviation, estimate tool posture contour error:
[0040] ε0=arccos(O c '·O a ) Formula 7.
[0041] In step 4, the contour error control algorithm based on variable gain iterative learning adjusts the control gain through multiple iterations, so that the control result after each iteration is more accurate, thereby reducing the contour error. The variable gain algorithm can dynamically adjust the learning gain according to the response of the system, thereby adapting to changes under different working conditions.
[0042] The contour error control algorithm based on variable gain iterative learning is:
[0043] a i,j+1 =a i,j +L'e i,j Formula 8;
[0044] Among them, a i,j represents the control input of the i-th feed axis after the j-th iteration, ε i,j Then it represents the contour error component of the i-th feed axis after the j-th iteration. The learning gain function acts on each axis in the same way. L' represents the learning gain obtained by adjusting the size of the contour error. Its calculation formula is:
[0045]
[0046] Among them, S1 and S2 are expressed as:
[0047]
[0048] Where sech(x) represents a hyperbolic secant function. δ represents a given contour error threshold, indicating the maximum allowable deviation. β is a constant used to adjust the degree of influence of contour error on the control process.
[0049] The control method further includes step five, which is to simulate or verify the control method through a simulation platform using the operation process of machining a pattern contour and machining an S-curved surface contour trajectory of a five-axis CNC machine tool.
[0050] In the step five, multiple simulation verifications are performed using MATLAB on a simulation platform. The control method can be compared with a fixed-gain iterative learning control method under typical trajectories of pattern profiles and S-curve profiles, and is experimentally verified on a five-axis CNC machine tool.
[0051] The control effect of the contour error control method is evaluated by the following two contour error indicators:
[0052] The first evaluation indicator is the absolute value of the maximum contour error (MAX) along the entire trajectory. This indicator is used to measure the extreme case of contour error and reflects the control method's ability to suppress the maximum contour error. Its calculation formula is:
[0053] ε max =max|ei |Formula 11;
[0054] Among them, e i is the contour error at the trajectory position point n;
[0055] The second error evaluation indicator is the root mean square (RMS) error, which is used to evaluate the steady-state performance of the contour error within the entire contour trajectory range. Its calculation formula is:
[0056]
[0057] Where N is the total number of sampling points on the trajectory.
[0058] The present invention proposes a contour error control strategy based on variable gain iterative learning, which improves the convergence speed and ensures more accurate contour error control by integrating variable gain adjustment into the iterative learning control framework.
[0059] In response to the application limitations of existing contour error control technologies in precision machining control systems, the present invention proposes an improved contour error control method. Existing contour error control methods have several shortcomings, primarily in their inability to adapt to the machining requirements of complex workpieces, resulting in large contour errors during high-precision control. Therefore, the present invention proposes a method based on variable-gain iterative learning control. By introducing a variable-gain iterative learning algorithm, this method not only optimizes control accuracy but also increases convergence speed, thereby more effectively suppressing contour errors in complex, high-precision machining scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0061] Attachment Figure 1 Schematic diagram of the flow of the five-axis contour error control method based on variable gain iterative learning according to the present invention;
[0062] Attachment Figure 2 Schematic diagram of coordinate system establishment and kinematic transformation of an example of the present invention;
[0063] Attachment Figure 3 A schematic diagram of the definition of the five-axis contour error of an example of the present invention;
[0064] Attachment Figure 4 Schematic diagram of the contour error estimation process of an example of the present invention;
[0065] Attachment Figure 5 Schematic diagram of tool posture profile error estimation in an example of the present invention;
[0066] Attachment Figure 6Schematic diagram of the five-axis contour error control framework of an example of the present invention;
[0067] Attachment Figure 7 Schematic diagram of the pattern outline trajectory of an example of the present invention;
[0068] Attachment Figure 8 Schematic diagram of the contour error control effect of FILC in track 1 of the example of the present invention;
[0069] Attachment Figure 9 Schematic diagram of the contour error control effect of VILC in track 1 of the example of the present invention;
[0070] Attachment Figure 10 Schematic diagram of the S-curve profile trajectory of an example of the present invention;
[0071] Attachment Figure 11 Schematic diagram of the contour error control effect of FILC in track 2 of the example of the present invention;
[0072] Attachment Figure 12 Schematic diagram of the contour error control effect of VILC in track 2 of the example of the present invention;
[0073] Attachment Figure 13 Schematic diagram of the AC five-axis CNC machine tool bed and operation panel of the embodiment of the present invention;
[0074] Attachment Figure 14 A schematic diagram of the feed axis structure of a five-axis machine tool according to an embodiment of the present invention;
[0075] Attachment Figure 15 A schematic diagram of a routine of the G237 code of an example of the present invention;
[0076] Attachment Figure 16 Schematic diagram of the control effect of fixed gain iterative learning contour error in an example of the present invention;
[0077] Attachment Figure 17 Schematic diagram of the control effect of variable gain iterative learning contour error in an example of the present invention. DETAILED DESCRIPTION
[0078] In order to further understand the content of the present invention, the specific implementation scheme of the present invention is described in detail by taking an AC type five-axis CNC machine tool as an example.
[0079] As shown in the figure, a five-axis contour error control method based on variable gain iterative learning includes the following steps:
[0080] Step 1: Establish the coordinate systems of the five-axis machine tool;
[0081] Step 2: Use DH parameter method to construct the kinematic model of the machine tool;
[0082] Step 3: Use arc fitting method to estimate the contour error, and ensure the synchronization of tool tip position contour error and tool posture contour error through posture ratio;
[0083] Step 4: Correct the position and posture of the tool based on the variable gain iterative learning control algorithm. By optimizing the learning gain, the control input is adaptively adjusted to reduce the contour error.
[0084] In step 1, the coordinate system includes the machine tool coordinate system, A-axis coordinate system, C-axis coordinate system, tool coordinate system and workpiece coordinate system;
[0085] Machine tool coordinate system O M -X M ,Y M ,Z M Located on the machine tool bed, it is the reference coordinate system for machine tool movement; A-axis coordinate system O A -X A ,Y A ,Z A Describes the rotational motion of the A-axis around the X-axis. The A-axis rotates to adjust the tilt angle between the tool and the workpiece.
[0086] C-axis coordinate system O C -X C ,Y C ,Z C Describes the rotational motion of the C-axis around the Z-axis. The rotation of the C-axis is used for planar rotation processing of the workpiece.
[0087] Tool coordinate system (O T -X T ,Y T ,Z T ) describes the position and posture of the tool end, and accurately controls the tool's motion path by adjusting the tool's position and posture;
[0088] Workpiece coordinate system (O W -X W ,Y W ,Z W ) describes the position and posture of the workpiece, and is used to define the spatial position and posture of the workpiece in the processing area to ensure the accuracy and precision of processing.
[0089] In step 2, the mapping relationship between the machine tool feed axis and the part processing trajectory is introduced into the kinematic model, and the tool spatial position and posture are calculated by the DH parameter method of the kinematic forward solution model to ensure that the tool can move according to the predetermined trajectory.
[0090] In step 2, the establishment of the kinematic model includes the following steps:
[0091] Step S1: Use the DH parameter method to obtain the total transformation matrix from the machine tool base to the workpiece:
[0092]
[0093] Where, γ represents the rotation angle of the C axis; α represents the rotation angle of the A axis; (X c ,Y c ,Z c ) represents the offset of the C-axis coordinate system relative to the machine tool coordinate system; (X t ,Y t ,Z t ) represents the offset of the workpiece coordinate system relative to the tool coordinate system;
[0094] Step S2: Assume that the expression of the tool tip position coordinate in the kinematics forward solution model is:
[0095]
[0096] Among them, P x ,P y ,P z Respectively represent the position coordinates of the tool tip point in the workpiece coordinate system;
[0097] Then the expression of tool posture vector is:
[0098]
[0099] Step S3: The inverse kinematics model is obtained by solving the given tool posture:
[0100]
[0101] In step three, the tool tip position contour error and tool posture contour error are defined, and the arc fitting method is used to estimate the contour error based on the actual tool tip position and the expected trajectory path.
[0102] In step 3, the contour error estimation process includes the following steps:
[0103] Step A1: Calculate the contour error for each actual tool tip position point using the arc method, find the closest discrete point on the corresponding desired trajectory, and use it as a reference point to calculate the contour error;
[0104] Step A2: Calculate the two adjacent interpolation points before and after the reference point, use the three-point method to fit the arc, solve the center position O0 of the arc, and deduce the compensation point P of the tool tip position. c ', therefore, the tool tip position profile error ε p The expression is:
[0105] ε p =||Pc '-P a || Formula 6;
[0106] Among them, P a Indicates the actual tool tip position coordinates.
[0107] Step A3: Calculate the actual tool posture O a With compensation point O c 'Posture deviation, estimate tool posture contour error:
[0108] ε0=arccos(O c '·O a ) Formula 7.
[0109] In step 4, the contour error control algorithm based on variable gain iterative learning adjusts the control gain through multiple iterations, so that the control result after each iteration is more accurate, thereby reducing the contour error. The variable gain algorithm can dynamically adjust the learning gain according to the response of the system, thereby adapting to changes under different working conditions.
[0110] The contour error control algorithm based on variable gain iterative learning is:
[0111] a i,j+1 =a i,j +L'e i,j Formula 8;
[0112] Among them, a i,j represents the control input of the i-th feed axis after the j-th iteration, ε i,j Then it represents the contour error component of the i-th feed axis after the j-th iteration. The learning gain function acts on each axis in the same way. L' represents the learning gain obtained by adjusting the size of the contour error. Its calculation formula is:
[0113]
[0114] Among them, S1 and S2 are expressed as:
[0115]
[0116] Where sech(x) represents a hyperbolic secant function. δ represents a given contour error threshold, indicating the maximum allowable deviation. β is a constant used to adjust the degree of influence of contour error on the control process.
[0117] The control method further includes step five, which is to simulate or verify the control method through a simulation platform using the operation process of machining a pattern contour and machining an S-curved surface contour trajectory of a five-axis CNC machine tool.
[0118] In the step five, multiple simulation verifications are performed using MATLAB on a simulation platform. The control method can be compared with a fixed-gain iterative learning control method under typical trajectories of pattern profiles and S-curve profiles, and is experimentally verified on a five-axis CNC machine tool.
[0119] The control effect of the contour error control method is evaluated by the following two contour error indicators:
[0120] The first evaluation indicator is the absolute value of the maximum contour error (MAX) along the entire trajectory. This indicator is used to measure the extreme case of contour error and reflects the control method's ability to suppress the maximum contour error. Its calculation formula is:
[0121] ε max =max|e i | Formula 11;
[0122] Among them, e i is the contour error at the trajectory position point n;
[0123] The second error evaluation indicator is the root mean square (RMS) error, which is used to evaluate the steady-state performance of the contour error within the entire contour trajectory range. Its calculation formula is:
[0124]
[0125] Where N is the total number of sampling points on the trajectory.
[0126] Example:
[0127] This example proposes a five-axis contour error control method based on variable gain iterative learning. The control process is as follows: Figure 1 As shown, the specific steps include:
[0128] First, as Figure 2 As shown, various coordinate systems of the machine tool are established, among which the machine tool coordinate system ( M -X M ,Y M ,Z M ) is located on the machine bed and is the reference coordinate system for machine tool movement. A -X A ,Y A ,Z A ) describes the rotation of the A-axis around the X-axis. The A-axis rotation can be used to adjust the tilt angle between the tool and the workpiece. C -X C ,Y C ,Z C) describes the rotation of the C-axis around the Z-axis. The rotation of the C-axis is usually used for plane rotation processing of the workpiece. Tool coordinate system (O T -X T ,Y T ,Z T ) describes the position and posture of the tool end. By adjusting the position and posture of the tool coordinate system, the tool motion path can be accurately controlled. W -X W ,Y W ,Z W ) describes the position and posture of the workpiece. The workpiece coordinate system defines the spatial position and posture of the workpiece in the processing area to ensure the accuracy and precision of processing.
[0129] The calculation process of the kinematic model of the AC type five-axis machine tool specifically includes the following steps:
[0130] Assume that in the initial state, the offset of the C-axis coordinate system relative to the machine tool coordinate system is (X c ,Y c ,Z c ), therefore, the coordinate system transformation from the base to the C axis is:
[0131]
[0132] The rotation matrix T2 is the coordinate system transformation from the C axis to the A axis, rotating around the Z axis by an angle of γ:
[0133]
[0134] The rotation matrix T3 is the matrix transformation from the A axis to the tool coordinate system, rotating around the X axis by an angle α:
[0135]
[0136] Assume that the offset of the workpiece coordinate system relative to the tool coordinate system is (X t ,Y t ,Z t ), matrix transformation from tool coordinate system to workpiece coordinate system:
[0137]
[0138] Combining the above transformation matrices, the total transformation matrix T from the machine tool base to the workpiece is:
[0139]
[0140] After the expansion and derivation of the transformation matrix, the expression of the tool tip position coordinates is:
[0141]
[0142] Among them, P x ,P y ,P z They respectively represent the position coordinates of the tool tip point in the workpiece coordinate system.
[0143] The initial direction of the tool posture in the tool coordinate system is [0,0,1,0] T , substitute the initial direction into the total transformation matrix T, and calculate the expression of the tool posture vector:
[0144]
[0145] The above-obtained kinematics forward solution model is the five-axis machine tool, while the inverse kinematics solution model reversely solves the feed rate of each moving axis of the machine tool by knowing the center point trajectory of the tool end and its posture change.
[0146] The rotation angle of the rotary axis can be obtained by solving the given tool posture:
[0147]
[0148] The expression of the inverse kinematics model of the moving axis is:
[0149]
[0150] Then, the contour error estimation model is established. Figure 3 As shown, ε p represents the tool tip position profile error, which is defined as the shortest distance from the actual tool tip position to the desired trajectory. (P c , O c ) is the tool position and posture information at the point on the desired trajectory closest to the current actual position. Tool posture profile error ε o Defined as the actual tool posture O a and the closest point tool posture O c The angular deviation between them.
[0151] Based on the definition of the contour error, the five-axis contour error is calculated using the arc method. The estimation process is as follows: Figure 4 shown.
[0152] First, for each actual tool tip position point, find the nearest discrete point corresponding to it on the expected trajectory and use it as the contour error reference point. Determine the nearest point of each actual tool tip position by comparing the distances:
[0153]
[0154] Among them, P a Represents the current actual tool tip position; P nRepresents the discrete points obtained by interpolation on the tool tip position trajectory. When the distance d is minimum, the corresponding expected tool tip position point P n The point P considered as the closest tool tip position c , that is, P c =P n .
[0155] Based on the obtained nearest tool tip position point P c , its adjacent interpolation point P n-1 and P n+1 are the reference tool tip positions of the previous and next interpolation values of the point. c The reference trajectory in the surrounding local area is given by P n-1 、P n and P n+1 The calculated arc is approximate. Assume that the coordinates of the three non-collinear points closest to the actual position are:
[0156]
[0157] Since these four points P n-1 、P n 、P n+1 and O0 are coplanar, so they satisfy the following equation:
[0158] A1x0+B1y0+C1z0+D1=0
[0159] Among them, A1, B1, C1, and D1 are:
[0160]
[0161] Since the center O0 to P n-1 、P n 、P n+1 The distances between these three points are equal, so we can get the following two linear equations:
[0162]
[0163] in:
[0164]
[0165] By solving the above equations, we can find P n-1 、P n 、P n+1 The coordinates of the center point O0 of the circumscribed circle of the arc formed by the three points are:
[0166]
[0167] P a ' is the actual tool tip position point Pa The calculation formula for the projection point on the fitted circular plane is:
[0168]
[0169] in, is the normal vector of the circular plane, which is calculated by the following formula:
[0170]
[0171] P c ' is the approximate arc and line segment O0P a ', and use this point as the contour error compensation point, which is calculated by the parametric equation of the circle:
[0172]
[0173] Therefore, the tool tip position profile error ε p It can be estimated by the following formula:
[0174] ε p =||P c '-P a ||
[0175] To ensure that the tool tip position and tool posture are synchronized to the same desired posture in the contour error calculation, the arc length ratio of the tool tip position and the tool posture related to their adjacent discrete points should be the same. Therefore, a scaling factor k is first defined to represent the tool tip position compensation point P c 'Relative to the discrete point P on the desired trajectory n-1 and P n The relative position of the compensation point P c 'Located on arc P n-1 P n Above, the calculation formula of the proportional factor k is:
[0176]
[0177] Among them, β1 and β2 are arc P c 'P n-1 and P c 'P n The corresponding central angle.
[0178] like Figure 5 As shown, O n-1 ,O n and O n+1 Represent the tool tip position point P n-1 ,P n and P n+1 The corresponding tool posture is O c' represents the tool posture contour error compensation point. O1 is composed of O n-1 ,O n and O n+1 The position information of the center of the circumscribed circle is expressed in spherical coordinates. The position coordinates of the center O1 are calculated in the same way as above.
[0179] Scale factor k and arc O c 'O n-1 and O c 'O n The relationship is as follows:
[0180]
[0181] Among them, θ1 and θ2 represent arc O c 'O n-1 and O c 'O n The angle corresponding to the center O1.
[0182] Use the quaternion formula to calculate the tool posture error compensation point O c 'Coordinate information of all points O n-1 ,O n Transform to the local coordinate system centered on O1:
[0183]
[0184] In the local coordinate system, the tool posture error compensation point O c1 The coordinates are:
[0185]
[0186] Where φ represents the arc O n-1 O n Corresponding angle: φ = θ1 + θ2; and express and Unitization.
[0187] Then, transform the coordinates into the global coordinate system:
[0188] O c '=O c1 +O1
[0189] According to the compensation point O of the tool posture c ' and the known actual tool posture O a , and then calculate the tool posture profile error, the formula is as follows:
[0190] ε0=arccos(O c'·O a )
[0191] The framework of the five-axis contour error control method proposed in this example is as follows Figure 6 As shown in the figure, the core idea is to optimize the learning gain and update the tool pose information during the machining process, and adopt adaptive gain adjustment to improve the iterative learning efficiency and control accuracy.
[0192] Before machining, the desired trajectory is planned and NC code is generated using UG software. The resulting code is then input into the CNC system after post-processing. After the machine tool completes machining, the actual trajectory data for the five axes is collected and converted into the actual trajectory in the workpiece coordinate system using a kinematic model. A contour error estimation model is then used to calculate the tool tip position and tool posture contour error.
[0193] Based on the calculated results, the contour error is evaluated using preset criteria. If the error meets the accuracy requirements, control is terminated. Otherwise, the tool position and learning gain are corrected using a variable-gain iterative learning method, updated to the reference trajectory, and an inverse kinematic transformation is performed to generate new NC code. This process is repeated until the contour error meets the accuracy requirements. In each iteration, the system recalculates and evaluates the contour error to achieve precision control, ultimately inputting a trajectory that meets the accuracy requirements for part machining.
[0194] The variable-gain iterative learning control (VILC) algorithm proposed in this example is described as follows. First, assume that a j is the system input after the jth iteration of contour error control, and the formula of the iterative learning control law is as follows:
[0195] a j+1 =a j +Lε j
[0196] Where L represents the learning gain, ε j represents the contour error after the jth iteration.
[0197] For each feed axis of a five-axis machine tool, the control formula can be further expressed as:
[0198] a i,j+1 =a i,j +L0ε i,j
[0199] Among them, a i,j represents the control input of the i-th feed axis after the j-th iteration, ε i,jThen it represents the contour error component of the i-th feed axis after the j-th iteration. The learning gain function acts on each axis in the same way. In order to further reduce the contour error, the learning gain is adjusted according to the control law. The specific formula of the VILC method is as follows:
[0200] a i,j+1 =a i,j +L'e i,j
[0201] Among them, L' represents the learning gain of the change obtained by adjusting the size of the contour error, and its calculation formula is:
[0202]
[0203] Among them, S1 and S2 can be expressed as:
[0204]
[0205] Where sech(x) represents a hyperbolic secant function. δ represents a given contour error threshold. β is a constant used to adjust the degree of influence of contour error on the control process. S1 and S2 represent adjustment factors related to contour error and iteration number j.
[0206] The VILC method achieves precise contour error control through different tuning functions. When the trajectory error is large, a larger learning gain is selected to accelerate error convergence. Conversely, when the error is small, a smaller learning gain is used to prevent error oscillation caused by noise, thereby improving system stability. By dynamically adjusting the learning gain of each axis, the system can optimize control effects within different iteration cycles and effectively reduce undertuning problems caused by static gain selection.
[0207] To validate the effectiveness of the proposed method, we conducted multiple simulations using the MATLAB simulation platform. We compared it with a fixed-gain iterative learning control (FILC) method to evaluate its performance under various complex trajectory settings. The simulations included two paths: a typical flower-shaped contour and an S-curve profile.
[0208] like Figure 7 As shown, firstly, a pattern contour with a large curvature change is adopted, and the contour of the yellow area is generated in UG through a curve group composed of two defined curves.
[0209] On this trajectory, a fixed gain iterative learning contour error control method is first used for simulation experiments, and the learning gain is set to 0.3. After eight iterations, the contour error control results are as follows: Figure 8shown.
[0210] Table 1 shows the contour error control effectiveness of the FILC method over eight iterations, calculating the maximum and root mean square (RMS) values of the contour errors. These results demonstrate that the contour error is effectively controlled using the FILC method. Specifically, the maximum tool tip position contour error decreased from 0.487142 mm to 0.256800 mm, a 47.28% reduction; the RMS value decreased from 0.097196 mm to 0.025780 mm, a 73.48% reduction. Furthermore, the maximum tool attitude contour error decreased from 0.005801 rad to 0.002062 rad, a 64.45% reduction; while the RMS value decreased from 0.003734 rad to 0.000693 rad, a 81.44% reduction.
[0211] Table 1 Contour error control effect of FILC in trajectory 1
[0212]
[0213] On the same trajectory, a simulation experiment was carried out using the variable gain iterative learning contour error control method. The condition for stopping the iteration was set to 80% of the contour error compensation effect. After only five iterations, the contour error could be reduced to the specified range.
[0214] Figure 9 Table 2 and Table 3 show the contour error control effects of the VILC method over five iterations. These results demonstrate a significant improvement in contour error accuracy. Specifically, the maximum value of the tool tip position contour error decreased from the initial 0.487142 mm to 0.269057 mm, a reduction of 44.77%. Similarly, the root mean square value of the tool tip position contour error decreased from 0.097196 mm to 0.020338 mm, a reduction of 80.10%. For the tool posture contour error, the maximum value decreased from 0.005801 rad to 0.002105 rad, a reduction of 63.71%, while the root mean square value decreased from 0.003734 rad to 0.000698 rad, a reduction of 81.30%.
[0215] Table 2 Contour error control effect of VILC in trajectory 1
[0216]
[0217]
[0218] In order to verify the application effect of the method proposed in this invention in different types of trajectories, especially the contour error control effect under irregular trajectories, a typical S-curve profile was selected as the second simulation trajectory path for verification, such as Figure 10shown.
[0219] Except for the different trajectory paths, the other conditions in the simulation are the same as those in the pattern contour simulation, ensuring the effectiveness of the comparison. Figure 11 As shown in Table 3, after eight iterations of compensation, the maximum tool tip position profile error decreased from 0.313256 mm to 0.050011 mm, a reduction of 84.04%; the RMS value decreased from 0.134315 mm to 0.025233 mm, a reduction of 81.24%. Simultaneously, the maximum tool attitude profile error decreased from 0.005778 rad to 0.001303 rad, a reduction of 77.45%; and the RMS value decreased from 0.001314 rad to 0.000240 rad, a reduction of 81.74%.
[0220] Table 3 Contour error control effect of FILC in trajectory 2
[0221]
[0222] The VILC method proposed in this example has better performance on the same S-surface trajectory. Figure 12 As shown in Table 4, after five iterations of contour error compensation, both the tool tip position and tool attitude contour errors were significantly reduced. The results are as follows: The maximum tool tip position contour error was significantly reduced from 0.313256 mm to 0.051142 mm, equivalent to a reduction of 83.67%. The root mean square value of the tool tip position contour error was reduced from 0.134315 mm to 0.026151 mm, a reduction of 80.53%. In addition, the maximum tool attitude contour error was reduced from 0.005778 rad to 0.001497 rad, a reduction of 74.08%, while the root mean square value of the attitude contour error decreased from 0.001314 rad to 0.000239 rad, a reduction of 81.81%.
[0223] Table 4 Contour error control effect of VILC in trajectory 2
[0224]
[0225]
[0226] The effectiveness of the proposed method was verified through simulation tests of VILC applied to flower-shaped contours and S-curve contour trajectories. The results show that the control effect of the root mean square error of both contours is around 80%, and compensation is completed within only five iterations. Compared with the FILC method, the VILC method proposed in this invention has a significantly improved convergence speed, and the contour error can be greatly reduced in the early stages of the iteration, which reduces the compensation time. The VILC method shows higher efficiency and accuracy in contour error control. Although these simulation results fully demonstrate the effectiveness of the algorithm, experimental verification is still needed on an actual five-axis CNC machine tool to ensure the consistency and reliability of the method under actual processing conditions.
[0227] The experiment was carried out on a five-axis CNC machine tool of Kede, model KMC600S U. Figure 13 The following figure shows the bed and operation panel of the experimental machine tool. The structure of the machine tool feed axis is as follows Figure 14 As shown in Figure 1, the machine tool adopts a gantry structure and is equipped with three linear motion axes, X, Y, and Z, and two rotation axes, A and C. To ensure the accuracy of data acquisition, the G237 CNC code is used in the experiment to collect the position information of the machine tool, as shown in Figure 1. Figure 15 Shown are the instructions and routines corresponding to the G237 code. The G237 code is often used together with G238 to control the start and end of data acquisition.
[0228] For the fixed-gain iterative learning control method, the iterative learning gain is set to a fixed value of 0.5, while the method proposed in the present invention adaptively adjusts the learning gain according to the size of the contour error, thereby being able to dynamically respond to changes in the contour error.
[0229] The experimental results of the fixed gain iterative learning control method are as follows Figure 16 The contour error data after each iterative control is recorded in Table 5. Due to the influence of experimental environmental factors, the experimental iteration number was only two compared to the simulation results. Despite the small number of iterations, after two iterations, the contour errors of the tool tip position and tool posture were effectively suppressed, and the errors were kept within a small range.
[0230] Specific experimental data are as follows: The maximum value of the tool tip position profile error was significantly reduced from 0.001811mm to 0.000565mm, a decrease of 68.79%. The root mean square error of the tool tip position profile error was reduced from 0.000964mm to 0.000374mm, a decrease of 61.19%. Similarly, the maximum value of the tool attitude profile error was reduced from 0.000193rad to 0.000108rad, a decrease of 43.67%, and the root mean square error of the attitude profile error was reduced from 0.000118rad to 0.000075rad, a decrease of 36.97%.
[0231] Table 5 Control effect of fixed gain iterative learning contour error
[0232]
[0233]
[0234] The experimental results of the variable gain control strategy proposed in this example are as follows Figure 17 As shown in Table 6, this method demonstrates superior control effectiveness in contour error control compared to the fixed-gain iterative learning control experimental results. The specific data are as follows: The maximum tool tip position contour error decreased from 0.001811 mm to 0.000509 mm, a reduction of 71.90%. The root mean square value of the tool tip position contour error significantly decreased from 0.000964 mm to 0.000337 mm, a reduction of 65.07%. Similarly, the maximum tool posture contour error decreased from 0.000193 rad to 0.000947 rad, a reduction of 50.95%, and the root mean square value of the posture contour error decreased from 0.000118 rad to 0.000061 rad, a reduction of 48.57%.
[0235] Table 6 Control effect of contour error through variable gain iterative learning
[0236]
[0237] The experimental results demonstrate that the proposed method has the advantage of rapid convergence, particularly when applied to complex contour trajectories. This suggests that the optimized control algorithm improves contour accuracy in complex part machining and effectively reduces tool tip position and tool posture contour errors. The variable-gain iterative learning control strategy, by dynamically adjusting the learning gain, can more flexibly respond to contour error variations under different machining trajectories, ensuring the efficiency and stability of the control system throughout the iterative process. This control strategy not only improves contour accuracy in complex part machining but also effectively reduces machining deviations caused by error accumulation, providing a reliable solution for high-precision CNC machining.
Claims
1. A five-axis contour error control method based on variable gain iterative learning, characterized by: The method comprises the following steps: Step 1: Establish the coordinate systems of the five-axis machine tool; Step 2: Use DH parameter method to construct the kinematic model of the machine tool; Step 3: Use arc fitting method to estimate the contour error, and ensure the synchronization of tool tip position contour error and tool posture contour error through posture ratio; Step 4: Correct the position and posture of the tool based on the variable gain iterative learning control algorithm. By optimizing the learning gain, the control input is adaptively adjusted to reduce the contour error.
2. The five-axis contour error control method based on variable gain iterative learning according to claim 1, characterized in that: In step 1, the coordinate system includes the machine tool coordinate system, A-axis coordinate system, C-axis coordinate system, tool coordinate system and workpiece coordinate system; Machine tool coordinate system O M -X M ,Y M ,Z M Located on the machine tool bed, it is the reference coordinate system for machine tool movement; A-axis coordinate system O A -X A ,Y A ,Z A Describes the rotational motion of the A-axis around the X-axis. The A-axis rotates to adjust the tilt angle between the tool and the workpiece. C-axis coordinate system O C -X C ,Y C ,Z C Describes the rotational motion of the C-axis around the Z-axis. The rotation of the C-axis is used for planar rotation processing of the workpiece. Tool coordinate system O T -X T ,Y T ,Z T Describe the position and posture of the tool end, and accurately control the tool's motion path by adjusting the tool's position and posture; Workpiece coordinate system O W -X W ,Y W ,Z W Describes the position and posture of the workpiece, and is used to define the spatial position and posture of the workpiece in the processing area to ensure the accuracy and precision of processing.
3. The five-axis contour error control method based on variable gain iterative learning according to claim 2, characterized in that: In step 2, the mapping relationship between the machine tool feed axis and the part machining trajectory is introduced into the kinematic model. The tool spatial position and posture are calculated by the DH parameter method of the kinematic forward solution model to ensure that the tool can move according to the predetermined trajectory. In step 2, the establishment of the kinematic model includes the following steps: Step S1: Use the DH parameter method to obtain the total transformation matrix from the machine tool base to the workpiece: Where, γ represents the rotation angle of the C axis; α represents the rotation angle of the A axis; (X c ,Y c ,Z c ) represents the offset of the C-axis coordinate system relative to the machine tool coordinate system; (X t ,Y t ,Z t ) represents the offset of the workpiece coordinate system relative to the tool coordinate system; Step S2: Assume that the expression of the tool tip position coordinate in the kinematics forward solution model is: Among them, P x ,P y ,P z Respectively represent the position coordinates of the tool tip point in the workpiece coordinate system; Then the expression of tool posture vector is: Step S3: The inverse kinematics model is obtained by solving the given tool posture:
4. The five-axis contour error control method based on variable gain iterative learning according to claim 2, characterized in that: In step three, the tool tip position contour error and tool posture contour error are defined, and the arc fitting method is used to estimate the contour error based on the actual tool tip position and the expected trajectory path.
5. The five-axis contour error control method based on variable gain iterative learning according to claim 2, characterized in that: In step 3, the contour error estimation process includes the following steps: Step A1: Calculate the contour error for each actual tool tip position point using the arc method, find the closest discrete point on the corresponding desired trajectory, and use it as a reference point to calculate the contour error; Step A2: Calculate the two adjacent interpolation points before and after the reference point, use the three-point method to fit the arc, solve the center position O0 of the arc, and deduce the compensation point P of the tool tip position. c ', therefore, the tool tip position profile error ε p The expression is: ε p =||P c '-P a ||Formula 6; Among them, P a Indicates the actual tool tip position coordinates. Step A3: Calculate the actual tool posture O a With compensation point O c 'Posture deviation, estimate tool posture contour error: ε0=arccos(O c '·O a ) Formula 7.
6. The five-axis contour error control method based on variable gain iterative learning according to claim 2, characterized in that: In step 4, the contour error control algorithm based on variable gain iterative learning adjusts the control gain through multiple iterations, so that the control result after each iteration is more accurate, thereby reducing the contour error. The variable gain algorithm can dynamically adjust the learning gain according to the response of the system, thereby adapting to changes under different working conditions.
7. The five-axis contour error control method based on variable gain iterative learning according to claim 6, characterized in that: The contour error control algorithm based on variable gain iterative learning is: a i,j+1 =a i,j +L'e i,j Formula 8; Among them, a i,j represents the control input of the i-th feed axis after the j-th iteration, ε i,j Then it represents the contour error component of the i-th feed axis after the j-th iteration. The learning gain function acts on each axis in the same way. L' represents the learning gain obtained by adjusting the size of the contour error. Its calculation formula is: Among them, S1 and S2 are expressed as: Where sech(x) represents a hyperbolic secant function. δ represents a given contour error threshold, indicating the maximum allowable deviation. β is a constant used to adjust the degree of influence of contour error on the control process.
8. The five-axis contour error control method based on variable gain iterative learning according to claim 1, characterized in that: The control method further includes step five, which is to simulate or verify the control method through a simulation platform using the operation process of machining a pattern contour and machining an S-curved surface contour trajectory of a five-axis CNC machine tool.
9. The five-axis contour error control method based on variable gain iterative learning according to claim 8, characterized in that: In the step five, multiple simulation verifications are performed using MATLAB on a simulation platform. The control method can be compared with a fixed-gain iterative learning control method under typical trajectories of pattern profiles and S-curve profiles, and is experimentally verified on a five-axis CNC machine tool.
10. The five-axis contour error control method based on variable gain iterative learning according to claim 9, characterized in that: The control effect of the contour error control method is evaluated by the following two contour error indicators. The first evaluation indicator is the absolute value of the maximum contour error MAX on the entire trajectory path. This indicator is used to measure the extreme case of contour error and reflects the control method's ability to suppress the maximum contour error. Its calculation formula is: ε max =max|e i |Formula 11; Among them, e i is the contour error at the trajectory position point n; The second error evaluation indicator is the root mean square (RMS) error, which is used to evaluate the steady-state performance of the contour error within the entire contour trajectory range. Its calculation formula is: Where N is the total number of sampling points on the trajectory.
