Numerical control turning adaptive compensation control method based on contour error prediction model

By using an adaptive compensation control method based on a contour error prediction model, the workpiece contour is automatically detected and fitted, and the tool compensation value is adjusted, which solves the "flattening" phenomenon in CNC turning and improves machining accuracy and efficiency.

CN121559970APending Publication Date: 2026-02-24CHANGZHI QINGHUA MACHINERY FACTORY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511809073.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-03
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

In CNC turning precision machining, especially when machining workpieces with poor rigidity for a long time, the phenomenon of "flattening" is common, which leads to the roundness of circular cross sections exceeding the tolerance. Existing technologies lack effective means to proactively and comprehensively predict and compensate for multi-source errors in a timely manner.

Method used

An adaptive compensation control method based on a contour error prediction model is adopted. The workpiece contour coordinates are detected automatically or manually, and the actual contour is calculated and fitted using the least squares method, NX curve fitting method and trigonometric functions. The tool compensation value is automatically adjusted, and a CNC compensation program is compiled to improve accuracy.

Benefits of technology

It improves the machining accuracy of the curved and other related contours of parts, reduces machining costs, increases machining efficiency, and enables proactive prediction and compensation of errors caused by clamping deformation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121559970A_ABST
    Figure CN121559970A_ABST
Patent Text Reader

Abstract

The invention provides a numerical control turning adaptive compensation control method based on a contour error prediction model, and belongs to the technical field of numerical control turning compensation control. In order to solve the technical problem that contour errors occur in the numerical control turning machining process, actual contour coordinate values of at least three positions of a workpiece to be detected are collected in an automatic or manual detection mode; on the basis of the collected coordinate values, one of a least square method, an NX curve fitting method and trigonometric function calculation is adopted, arc fitting processing is conducted on the collected data, an arc contour with the minimum error is solved, and the actual contour value of the workpiece is obtained; according to the calculated actual contour value of the workpiece, running a preset program, automatically adjusting a cutter compensation value, and controlling compensation operation; the method is applied to adaptive compensation control of numerical control turning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention provides an adaptive compensation control method for CNC turning based on a contour error prediction model, belonging to the field of CNC turning compensation control technology. Background Technology

[0002] In the field of CNC turning precision machining, the shape error accuracy of parts, such as roundness and cylindricity, is one of the key performance indicators. However, in actual production, especially when machining continuously for a long time or machining workpieces with poor rigidity, the phenomenon of "flattening" is common, that is, the roundness of the machined circular cross-section is out of tolerance. The main reasons for this problem are:

[0003] This problem stems primarily from three factors:

[0004] The radius of curvature (R angle) of the cutting tool tip gradually wears down during the cutting process, causing changes in the cutting geometry and directly resulting in contour errors.

[0005] During the machining process, under the combined effects of cutting force, clamping force and cutting heat, the process system (machine tool-tool-workpiece) will undergo elastic deformation and thermal deformation, causing the actual machining path of the tool to deviate from the programmed path, resulting in errors in the machining contour;

[0006] The deviation between the theoretical tool tip radius and the actual value of the tool R angle in the CNC turning program can also lead to machining errors in the contour.

[0007] Currently, the industry mainly adopts passive solutions or post-event compensation when solving the above problems, such as periodic tool changes, trial cutting and tool setting, and manual adjustment of offset. There is a lack of an effective means to proactively and comprehensively predict and compensate for multi-source errors in a timely manner. There is an urgent need to develop a more automated error detection and compensation method. Summary of the Invention

[0008] To address the technical problems existing in the background art, the present invention adopts the following technical solution: providing an adaptive compensation control method for CNC turning based on a contour error prediction model, including the following detection and compensation methods:

[0009] Step 1: Collect at least three actual contour coordinate values ​​of the workpiece to be tested using automatic or manual detection methods;

[0010] Step 2: Based on the collected coordinate values, use one of the following methods—least squares, NX curve fitting, or trigonometric function calculation—to perform arc fitting on the collected data, solve for the arc contour with the smallest error, and obtain the actual contour value of the workpiece.

[0011] Step 3: Based on the calculated actual contour values ​​of the workpiece, run the preset program to automatically adjust the tool compensation values ​​and control the compensation operation.

[0012] The method for processing the collected data using the least squares method in step two is as follows:

[0013] The least squares method is used to minimize the sum of the squares of the distances between the approximating arc and all points on the curve, ensuring that the arc best approximates the curve. This includes:

[0014] The general equation for a circular arc is defined as follows:

[0015] ;

[0016] This equation is a quadratic nonlinear equation, with the center coordinates of the circle being (A, B) and the radius of the arc being:

[0017] R= ;

[0018] Let z = Transforming the equation into a linear function, the error of each point on the curve relative to the arc is:

[0019] ;

[0020] Based on the above formula, the function deviation value is obtained, and based on the function deviation value, the error balance formula is obtained as follows:

[0021] Q= ;

[0022] According to the rules for finding extrema, to minimize the value of Q, the following must be satisfied:

[0023] ;

[0024] Then, based on the coordinate values ​​of the three points obtained in step one, i.e., n=3, create a system of univariate equations containing three equations and solve for the values ​​of A, B, and C.

[0025] The method for processing the collected data using the NX curve fitting method in step two is as follows:

[0026] Using the curve fitting function in NX software, the approximate circular arc profile is obtained, including:

[0027] Select the "Fit Curve" function, then select the "Fit Circle" option from the drop-down list. Select each point in sequence to obtain the approximate curve, and add dimensions to obtain the curve's radius and center coordinates.

[0028] The method for processing the collected data using trigonometric functions in step two is as follows:

[0029] All deformation errors are defined as being caused by the compensation error of the tool tip radius. The approximation arc radius is calculated using trigonometric functions. O in the contour trajectory curve is defined as the programmed contour center, O1 as the actual approximation upper arc center position, and O2 as the actual approximation contour center position. AB is known, D is determined by measurement, and O2A = D / 2. Therefore:

[0030] O2B= ;

[0031] Let the programming contour be R0, the approximation contour be R, and R = R0 + r. In right triangle ΔABO1, according to the Pythagorean theorem, we obtain:

[0032] ;

[0033] Given O1A = R = R0 + r and O1B = O2B + r, substituting these into the above equation, we get:

[0034] ;

[0035] From the above formula, we can obtain:

[0036] r= ;

[0037] If the value of r is positive, the radius of the approximating contour is greater than the programmed radius;

[0038] If the value of r is negative, the radius of the approximating contour is smaller than the programmed radius.

[0039] The specific method for step three is as follows:

[0040] Based on the actual contour values ​​obtained from the fitting in step two, a numerical control compensation program is developed, including:

[0041] After using the G10 command to compensate and adjust the fillet radius or wear of the corresponding tool tip, the control operation is performed.

[0042] After assigning compensation values ​​to the system variables corresponding to the tool tip radius or tool tip radius wear of the corresponding tool number, control operations are performed.

[0043] The advantages of this invention compared to the prior art are as follows: This invention provides an adaptive compensation control method for CNC turning based on a contour error prediction model. It mainly adopts three methods for fitting and calculating circular arc contours, and constructs three mathematical compensation models. These models can be flexibly selected according to the actual parts, improving operational flexibility. Furthermore, by adopting corresponding programming control methods, using special instructions and system variables, and writing dedicated macro programs, automatic compensation of compensation data can be achieved. This can significantly improve the machining accuracy of the arc and other related contour shapes of the parts, increase machining efficiency, and reduce machining costs. Attached Figure Description

[0044] The present invention will be further described below with reference to the accompanying drawings:

[0045] Figure 1 This is a flowchart of the CNC turning adaptive compensation control method of the present invention;

[0046] Figure 2 This is a schematic diagram of fitting an arc using NX software in an embodiment of the present invention;

[0047] Figure 3 This is a schematic diagram of the trigonometric function calculation of contour deviation in an embodiment of the present invention;

[0048] Figure 4 This is a schematic diagram of the compensation interface of the CNC system in an embodiment of the present invention. Detailed Implementation

[0049] like Figure 1 As shown, this invention provides an adaptive compensation control method for CNC turning based on a contour error prediction model. This method establishes a mathematical model between tool wear, tool error, machining deformation, and contour error, uses a corresponding algorithm to predict the actual machining contour, and adaptively adjusts the tool radius compensation value through the CNC program accordingly. This effectively suppresses the shape error caused by flattening and improves the machining accuracy of the workpiece's arc and other related contours. This invention can compensate for machining deformation caused by clamping deformation. For example, when machining the inner arc surface of a thin-walled part, the part will have a certain degree of deformation after the clamping force is released. To ensure the shape accuracy of the part, reverse compensation (i.e., "flattening") can be performed in advance based on the detection value. After the clamping force is released, the arc surface shape accuracy of the part is improved.

[0050] To facilitate calculation, this invention primarily selects three contour values ​​of the workpiece to be measured, and automatically calculates and adjusts the relevant data by running a preset program. The process includes contour data extraction, actual contour calculation, and data compensation adjustment. Specifically, the coordinate values ​​of the three actual contours are extracted first through automatic or manual detection. Then, the actual contour values ​​are calculated using one of the following methods: least squares method, NX software circle fitting function, or trigonometric function calculation. Finally, based on the calculation results, a special program is run to automatically adjust the tool compensation values, thereby improving the contour machining accuracy.

[0051] Furthermore, before performing compensation control, this invention needs to establish a corresponding contour error prediction model. To calculate and approximate the contour arc curve, a series of points are taken on the processed contour, and then the data is fitted with an arc to solve for the arc contour with the smallest error. The calculation models for solving the approximate contour mainly include the following:

[0052] (1) Least squares method:

[0053] Least squares is a mathematical optimization technique that minimizes the sum of the squares of the distances between the approximating arc and all points on the curve, thus ensuring that the arc best approximates the curve. Specifically, it includes:

[0054] The general equation for a circular arc is defined as follows:

[0055] ;

[0056] This equation is a quadratic nonlinear equation, with the center coordinates of the circle being (A, B) and the radius of the arc being:

[0057] R= ;

[0058] Since quadratic nonlinear equations are not easily fitted by least squares, let z = The equation can be transformed into a linear function, and the error of each point on the curve relative to the arc is:

[0059] (2)

[0060] Formula (2) represents the function deviation value, and the error balance formula can be expressed as:

[0061] Q= (3)

[0062] According to the rules for finding extrema, to minimize the value of Q, the following formula holds:

[0063] (4)

[0064] Then, take three points, i.e., n=3, create a system of three equations in one variable, and solve for A, B, and C.

[0065] (2) NX curve fitting method:

[0066] This invention uses the curve fitting function in NX software to obtain an approximate circular arc profile. Specifically, select the curve fitting function, then select the "fit circle" option from the drop-down list, and finally select each point in sequence to obtain the approximate curve. Dimensions are then added to obtain the curve's radius and center coordinates. Figure 2 As shown.

[0067] (3) Calculate the approximate radius of the arc using trigonometric functions:

[0068] This method first defines all deformation errors as being caused by the compensation error of the tool tip radius, and its actual contour trajectory curve is as follows: Figure 3 As shown in the figure, the black line represents the programming outline, and the red line represents the actual approximation outline.

[0069] In the diagram, O is the center of the programmed contour, O1 is the actual approximation of the upper arc center position, and O2 is the actual approximation of the contour center position. Since AB is known, D can be determined through measurement, and O2A = D / 2, we can deduce:

[0070] O2B= (5)

[0071] Let the programming contour be R0, the approximation contour be R, and R = R0 + r. In right triangle ΔABO1, according to the Pythagorean theorem, we can obtain the following equation:

[0072] (6)

[0073] Given O1A=R=R0+r and O1B=O2B+r, substituting into equation (6), we obtain equation (7):

[0074] (7)

[0075] From the above formula, we can obtain:

[0076] r= (8)

[0077] If the value of r is positive, the radius of the approximating contour is greater than the programmed radius; otherwise, it is less than the programmed radius.

[0078] This invention selects appropriate error compensation models for different situations and performs circular arc fitting processing on the collected data, wherein:

[0079] For CNC systems with fast data processing speed, model (1) can be selected, which approximates the contour with high accuracy. For machining parts with high accuracy requirements, but for CNC systems with weak computing power, model (2) can be selected for fitting. For general parts machining, model (3) can be selected for fitting. This method has slightly lower fitting accuracy than the previous two methods, but can meet the fitting accuracy requirements of most parts contours. If the roundness accuracy requirement is high or the error is small, and the dimensional accuracy requirement is not high, the roundness error can also be reduced by adjusting the X-axis wear.

[0080] Combining the above fitting methods, a numerical control compensation program is developed for compensation control. There are two main methods for program development:

[0081] (1) Use the G10 command to directly compensate and adjust the fillet radius or wear of the corresponding tool tip;

[0082] (2) Directly assign values ​​to the corresponding tool tip radius or the system variable corresponding to the tool tip radius wear.

[0083] like Figure 4The CNC system compensation interface shown uses the G10 instruction for programming when executing (1). G10 is a programmable data input instruction that can automatically adjust the coordinate system and tool compensation data. The instruction format is as follows:

[0084] G10P_X_Z_R_Q_;

[0085] P: Offset sign;

[0086] 1-64: Tool wear offset command;

[0087] 10000+(1-64): Tool geometry offset value command;

[0088] (1-64) Offset number;

[0089] X_: X-axis offset value (absolute);

[0090] Z_: Z-axis offset value (absolute);

[0091] R_: Tool tip radius offset value (absolute);

[0092] Q_: Knife point number;

[0093] The G10 command described above can be used to compensate for multiple offset values. The compensation value for the tool tip radius is obtained through the calculation method described above. In addition, the G11 command cannot cancel the offset value assigned by G10, so this should be noted when using it.

[0094] When executing the system variable assignment method of compilation (2), the system variables are shown in Table 1 and Table 2 below. The calculated relevant data can be assigned to the corresponding system variables for control.

[0095] Table 1 System variables for tool compensation storage area C;

[0096]

[0097] Table 2 System variables for tool compensation values;

[0098]

[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An adaptive compensation control method for CNC turning based on a contour error prediction model, characterized in that: The following detection compensation methods are included: Step 1: Collect at least three actual contour coordinate values ​​of the workpiece to be tested using automatic or manual detection methods; Step 2: Based on the collected coordinate values, use one of the following methods—least squares, NX curve fitting, or trigonometric function calculation—to perform arc fitting on the collected data, solve for the arc contour with the smallest error, and obtain the actual contour value of the workpiece. Step 3: Based on the calculated actual contour values ​​of the workpiece, run the preset program to automatically adjust the tool compensation values ​​and control the compensation operation.

2. The adaptive compensation control method for CNC turning based on a contour error prediction model according to claim 1, characterized in that: The method for processing the collected data using the least squares method in step two is as follows: The least squares method is used to minimize the sum of the squares of the distances between the approximating arc and all points on the curve, ensuring that the arc best approximates the curve. This includes: The general equation for a circular arc is defined as follows: ; This equation is a quadratic nonlinear equation, with the center coordinates of the circle being (A, B) and the radius of the arc being: R= ; Let z = Transforming the equation into a linear function, the error of each point on the curve relative to the arc is: ; Based on the above formula, the function deviation value is obtained, and based on the function deviation value, the error balance formula is obtained as follows: Q= ; According to the rules for finding extrema, to minimize the value of Q, the following must be satisfied: ; Then, based on the coordinate values ​​of the three points obtained in step one, i.e., n=3, create a system of univariate equations containing three equations and solve for the values ​​of A, B, and C.

3. The adaptive compensation control method for CNC turning based on a contour error prediction model according to claim 1, characterized in that: The method for processing the collected data using the NX curve fitting method in step two is as follows: Using the curve fitting function in NX software, the approximate circular arc profile is obtained, including: Select the "Fit Curve" function, then select the "Fit Circle" option from the drop-down list. Select each point in sequence to obtain the approximate curve, and add dimensions to obtain the curve's radius and center coordinates.

4. The adaptive compensation control method for CNC turning based on a contour error prediction model according to claim 1, characterized in that: The method for processing the collected data using trigonometric functions in step two is as follows: All deformation errors are defined as being caused by the compensation error of the tool tip radius. The approximation arc radius is calculated using trigonometric functions. O in the contour trajectory curve is defined as the programmed contour center, O1 as the actual approximation upper arc center position, and O2 as the actual approximation contour center position. AB is known, D is determined by measurement, and O2A = D / 2. Therefore: O2B= ; Let the programming contour be R0, the approximation contour be R, and R = R0 + r. In right triangle ΔABO1, according to the Pythagorean theorem, we obtain: ; Given O1A = R = R0 + r and O1B = O2B + r, substituting these into the above equation, we get: ; From the above formula, we can obtain: r= ; If the value of r is positive, the radius of the approximating contour is greater than the programmed radius; If the value of r is negative, the radius of the approximating contour is smaller than the programmed radius.

5. The adaptive compensation control method for CNC turning based on a contour error prediction model according to claim 1, characterized in that: The specific method for step three is as follows: Based on the actual contour values ​​obtained from the fitting in step two, a numerical control compensation program is developed, including: After using the G10 command to compensate and adjust the fillet radius or wear of the corresponding tool tip, the control operation is performed. After assigning compensation values ​​to the system variables corresponding to the tool tip radius or tool tip radius wear of the corresponding tool number, control operations are performed.