Contour error calculation method for numerical control machining equipment
By combining Newton's iteration method and the bisection method to calculate contour error, the problems of high cost, low real-time performance, and low accuracy in contour error calculation in CNC machining are solved, achieving high-precision and stable contour error calculation, which is suitable for high curvature trajectories.
Patent Information
- Application Number
- CN202511652807.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2045-11-12
AI Technical Summary
Existing technologies for calculating contour errors in CNC machining are costly, cannot be measured in real time, have low accuracy, and are unstable in calculations at high curvature trajectories, thus failing to meet the needs of high-end precision machining.
A method combining Newton's iteration method and the bisection method is adopted. The minimum value of the contour error evaluation function is determined by using the gradient descent method. The Newton's iteration method and the bisection method are dynamically switched to iterate and update the target time point within the potential time interval. By combining the speed of the Newton's iteration method and the stability of the bisection method, the contour error can be accurately solved.
It achieves high-precision, real-time calculation of contour errors, improves the reliability and robustness of calculation results, can handle high curvature trajectories, provides an efficient and stable calculation foundation, and lays a good foundation for subsequent contour error compensation.
Smart Images

Figure CN121165618A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of numerical control machining, and in particular to a profile error calculation method for a numerical control machining device. BACKGROUND
[0002] With the continuous development of manufacturing industry, the new generation of numerical control machining equipment requires performance indicators such as high precision, high efficiency, and high reliability. In terms of the current status of the numerical control machining industry, how to effectively improve the precision and efficiency in the numerical control machining process is a problem that needs to be solved in the field of machining technology.
[0003] The profile error is a core indicator for evaluating the profile machining quality, and is defined as the shortest distance from the actual position point of the tool near the expected point to the ideal profile trajectory. Profile tracking, as an important technical link in the field of precision machining, has an important influence on machining precision and efficiency. Profile error estimation is a key engineering technology for ensuring high precision, aiming to accurately and quickly estimate the profile error to provide a good premise for subsequent profile error compensation. The accuracy and speed of profile error calculation have a huge impact on the precision and efficiency of the entire numerical control machining operation, and are also a prerequisite for achieving high-precision motion control of numerical control machining equipment. In the prior art, the methods for obtaining profile error mainly include the following three types: 1. Profile error measurement method: measure the end-of-tool profile error by installing a laser interferometer, a ball bar instrument, a coordinate measuring machine, a vision camera, or a theodolite, etc. This method has high cost and high requirements for the measurement environment and space, and cannot be measured in real time, so it is not suitable for continuous processing scenarios in the automatic numerical control field.
[0004] 2. Approximate estimation method: such as task coordinate system method (TCF) and approximate circle estimation method, etc., which projects the error to the normal direction by geometric approximation. This method is simple to calculate, but can only meet the accuracy requirement at small curvature, and the accuracy estimation will deteriorate at high curvature trajectories or inflection points, resulting in significant errors, which cannot meet the needs of high-end precision machining.
[0005] 3. Precise calculation method: mainly based on numerical optimization methods such as Newton iteration method to solve the shortest distance from a point to a curve. This method has high accuracy in theory, but the Newton iteration method is sensitive to the initial value and has poor adaptability to non-convex curves, which leads to divergence or convergence to the non-desired local nearest point, thereby affecting the stability and reliability of the profile error calculation, and affecting the promotion and application of the method in the actual machining environment. SUMMARY
[0006] The present application proposes a profile error calculation method for a numerical control machining device to solve the above problems and technical needs. The technical scheme of the present application is as follows: A profile error calculation method for a numerical control machining device, the profile error calculation method comprising: For a desired trajectory curve The profile error calculation method comprises: An arbitrary desired position point , determining the actual position point closest to the first desired position point on the actual machining trajectory ; wherein, t represents a time point and The coordinates corresponding to any time point on the desired trajectory curve are ; Given the initial value of the Newton iteration method , and using the gradient descent method to determine the potential time interval in which the time point corresponding to the minimum value of the profile error evaluation function ; ; wherein, the profile error evaluation function is used to measure the distance between the actual position point and the coordinates corresponding to any time point on the desired trajectory curve , , , ; Initialize the target time point , and dynamically switch the Newton iteration method and the bisection method according to the value of the second derivative of the profile error evaluation function at the target time point to update the target time point within the potential time interval ; Calculate the deviation between the actual position point and the profile error point corresponding to the target time point on the desired trajectory curve as the profile error at the actual position point .
[0007] Further technical solutions are as follows: updating the target time point within the potential time interval comprises: Updating the target time point within the potential time interval according to the value of ; Using the updated target time point Update potential time intervals And based on the updated target time point and potential time interval Continue iterating until the iteration termination condition is met to obtain the target time point. .
[0008] Its further technical solution is, according to The value of the target time point is dynamically switched between Newton's iteration method and the binary search method. include: when Then, the reference time is calculated using Newton's iterative method. When reference time In the potential time interval When within the range, refer to the time. As the updated target time point ; when reference time Exceeding the potential time interval When the range is defined, the updated target time point is obtained using the binary search method. ; when Then, the updated target time point is obtained using the binary search method. .
[0009] A further technical solution involves using a binary search method to obtain the updated target time point. include: when At that time, according to Update target time point Otherwise, according to Update target time point .
[0010] Its further technical solution is to utilize the updated target time point. Update potential time intervals include: Calculate the profile error evaluation function Updated target time point The first derivative at According to the first derivative The value of will determine the left boundary of the potential time interval. or right boundary Corrected to the updated target time point .
[0011] Its further technical solution is based on the first derivative. The value of will determine the left boundary of the potential time interval. or right boundary The updated target time point is modified Comprising: When the profile error evaluation function At the updated target time point The first derivative The left boundary of the potential time interval The updated target time point is modified The right boundary of the potential time interval The updated target time point is modified .
[0012] Further, the technical scheme is to determine the potential time interval Comprising: The first derivative of the profile error evaluation function At the initial value ; ; When The value of is taken as the left boundary of the potential time interval , and the value of the right boundary of the potential time interval is determined within the range of ; When The value of is taken as the right boundary of the potential time interval , and the value of the left boundary of the potential time interval is determined within the range of .
[0013] Further, the technical scheme is to determine the potential time interval Further comprising: When The reference boundary is initialized When The value of is directly taken as the value of the right boundary of the potential time interval ; when The first derivative of the profile error evaluation function At the reference boundary ; When The value of is taken as the value of the right boundary of the potential time interval , and When and continue iteration; When The reference boundary is initialized When 0 as the left boundary of the potential time interval ; when , the contour error evaluation function at the reference boundary is calculated ; when , the value of is taken as the left boundary of the potential time interval ; when , the value of is taken and the iteration is continued; wherein, is the update step size.
[0014] A further technical solution is to iteratively update the target time point within the potential time interval . When the error of the target time point before and after the update is less than the convergence error , or when the number of iterations reaches the maximum number of iterations, it is determined that the iteration termination condition is reached and the target time point is obtained.
[0015] A further technical solution is that the contour error evaluation function .
[0016] The beneficial technical effects of the present application are: The present application discloses a contour error calculation method for a numerical control machining device, which takes the time point corresponding to the desired position point as the initial value of the Newton iteration method, and after determining the potential time interval in which the time point corresponding to the minimum value of the contour error evaluation function determined by the gradient descent method, the Newton iteration method and the bisection method are dynamically switched within the potential time interval to accurately solve the target time point, thereby quickly and reliably converging to the local optimum point closest to the desired position point. The method combines the speed of the Newton iteration method and the stability of the bisection method, improves the reliability and robustness of the contour error calculation result, and provides an efficient and stable calculation basis for subsequent profile accuracy control and real-time compensation. The method can realize high-precision and real-time calculation of the contour error, with a precision much higher than that of the approximation method, and can reliably process high-curvature trajectories. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 is a method flowchart of the contour error calculation method in an embodiment of the present application.
[0018] Figure 2 is a schematic diagram of determining the actual position point and the contour error point corresponding to the desired position point in an example.
[0019] Figure 3is a flow chart of a method for determining a potential time interval in an embodiment of the present application.
[0020] Figure 4 is a flow chart of a method for determining a target time point in an embodiment of the present application.
[0021] Figure 5 is a desired trajectory curve in an example.
[0022] Figure 6 is a profile error calculated using the profile error calculation method of the present application. Figure 5 is an enlarged schematic view of the profile error of the desired trajectory curve shown in a local area 510.
[0023] Figure 7 is a profile error calculated using the profile error calculation method of the present application. Figure 5 is an enlarged schematic view of the profile error of the desired trajectory curve shown in a local area 520.
[0024] Figure 8 is a profile error calculated using the profile error calculation method of the present application. Figure 5 is a deviation of the actual position point corresponding to each desired position point on the desired trajectory curve shown and the corresponding profile error point in the direction of .
[0025] Figure 9 is a profile error calculated using the profile error calculation method of the present application. Figure 5 is a deviation of the actual position point corresponding to each desired position point on the desired trajectory curve shown and the corresponding profile error point in the direction of . DETAILED DESCRIPTION
[0026] The specific embodiments of the present application will be further described below with reference to the accompanying drawings.
[0027] The present application discloses a profile error calculation method for a numerical control machining device, which comprises the following steps, please refer to the flow chart shown in Figure 1 . In order to facilitate the description of the position, the present application defines a plane coordinate system in advance, and any position can be represented by its coordinate in the plane coordinate system.
[0028] Step 110, obtaining the desired trajectory curve of the numerical control machining device during machining , and discretizing the desired trajectory curve to obtain a plurality of desired position points.
[0029] The numerical control machining device needs to be machined according to the desired trajectory curve in sequence during machining, so the positions on the desired trajectory curve are all associated with time points corresponding to any time point on the desired trajectory curve corresponding to the position coordinate corresponding to the time point is , i.e. the time sequence interval of the desired trajectory curve is .
[0030] discretize the continuous desired trajectory curve into a plurality of desired position points, each desired position point being the position corresponding to a time point on the desired trajectory curve , and let the time point corresponding to any desired position point in the processing order be , then the position of the desired position point can be denoted as , please refer to (a) in Figure 2 .
[0031] Step 120, sequentially traverse each desired position point, and for any desired position point traversed, determine the actual position point on the actual processing trajectory closest to the desired position point , which is the actual position point corresponding to the desired position point , please refer to (b) in . Figure 2
[0032] Step 130, define a profile error evaluation function , which is used to measure the distance between the actual position point and the coordinate corresponding to any time point on the desired trajectory curve . Considering that the first derivative and the second derivative of are needed to be calculated subsequently, in order to reduce the amount of calculation and speed up the calculation, in an embodiment, the Euclidean distance is not directly used to define , but the profile error evaluation function .
[0033] Step 140, give the initial value of Newton iteration method , i.e. directly take the time point corresponding to the desired position point as the initial value.
[0034] Step 150, determining the potential time interval where the time point corresponding to the minimum value of the profile error evaluation function is located by using gradient descent method .
[0035] are two variable parameters representing time points, and the time points correspond to two different positions on the expected trajectory curve respectively, so the time points are also within the time sequence interval of the expected trajectory curve, that is
[0036] The specific values of are determined by using gradient descent method to meet the requirements that the first order derivative of the profile error evaluation function at the time point is and the first order derivative of the profile error evaluation function
[0037] Please refer to the flow chart shown in Figure 3 , the method for determining the potential time interval includes the following steps: (1) First, calculate the first order derivative of the profile error evaluation function at the initial value of the Newton iteration method , and then determine whether
[0038] (2) When , take as the value of the left boundary of the potential time interval, and determine the value of the right boundary of the potential time interval within the range of . Specifically: Initialize the reference boundary , where is the update step length, which can be set by the user, and is generally taken as a small value, such as . Then first determine whether
[0039] When , it means that has reached or exceeded the time sequence interval , at this time, let and As the right boundary of the potential time interval The value of , that is, directly taking As the right boundary of the potential time interval The value of is used to obtain the potential time interval. .
[0040] when When, it means Still in the time series interval Within the range, the contour error evaluation function is further calculated. At the reference boundary The first derivative at .when At this moment As the right boundary of the potential time interval The value of the potential time interval is obtained. .when season And continue iterating, that is, continue to judge the updated... Does it meet the requirements? And repeat the above process.
[0041] (3) When At that time, As the right boundary of the potential time interval The value of, and in Determine the left boundary of the potential time interval within the range. The possible values are: Specifically: Initialize reference boundary Then determine whether it satisfies .
[0042] when Time indicates The time series interval has been reached or exceeded. At this time, And As the left boundary of the potential time interval The value of is taken as 0, which is directly used as the left boundary of the potential time interval. The value of is used to obtain the potential time interval. .
[0043] when When, it means Still in the time series interval Within the range, the contour error evaluation function is further calculated. At the reference boundary The first derivative at .when When As the left boundary of the potential time interval the potential time interval When , the is updated and the iteration continues, i.e., the updated is judged whether it satisfies and the above process is repeated.
[0044] For example, in the case of Figure 2 , the potential time interval is determined, indicating that the minimum value of the profile error evaluation function is located at the time point on the desired trajectory curve, corresponding to the position between the first desired position point , as shown in (c) in Figure 2 .
[0045] Step 160, initialize the target time point , according to the profile error evaluation function , the second derivative at the target time point dynamically switches the Newton iteration method and the bisection method to update the target time point within the potential time interval .
[0046] The purpose of the present application is to find the local optimal point closest to the first desired position point on the desired trajectory curve as the profile error point. This method of finding the local optimal point is more engineering significant than the method of finding the global optimal point, so the target time point is initialized to start from the first desired position point.
[0047] The Newton iteration method has good calculation speed, but poor adaptability to non-convex curves, so the present application jointly uses the Newton iteration method and the bisection method to combine the calculation speed of the Newton iteration method and the stability of the bisection method to determine the target time point includes the following process, please refer to the flowchart shown in Figure 4 : 1. First, update the target time point within the potential time interval according to the value of , specifically: (1) First, judge whether the second derivative of the profile error evaluation function at the current target time point satisfies .
[0048] (2) When , the condition of Newton iteration method is satisfied, then the reference time is calculated by Newton iteration method.
[0049] When the reference time is within the range of potential time interval , the reference time is taken as the updated target time point .
[0050] When the reference time is beyond the range of potential time interval , the reference time cannot be used, then the updated target time point is obtained by bisection method, specifically: The contour error evaluation function is calculated. The first derivative at the current target time point is calculated. When , the target time point is updated according to , otherwise the target time point is updated according to
[0051] (3) When , the condition of Newton iteration method is not satisfied, then the updated target time point is directly obtained by bisection method, the specific method is the same as above, which will not be repeated here.
[0052] 2. Regardless of which of the above is used to update the target time point , after the updated target time point is obtained, it is first determined whether the iteration termination condition is reached. The iteration termination condition here is a self-defined setting. In an embodiment, the convergence of the target time point is taken as the iteration termination condition, and the maximum number of iterations is set to avoid being unable to jump out of the loop.
[0053] Therefore, it is first detected whether the error of the target time point before and after the update is less than the convergence error . The convergence error is a self-defined value according to the accuracy requirement, for example, in an instance, it is taken as . When the error of the target time point before and after the update is less than the convergence error , it indicates that the target time point The iteration has converged. We have determined that the current iteration has reached the termination condition and are outputting the target time point. Proceed to step 170.
[0054] And when the target time points before and after the update The error is not yet less than the convergence error. "Time" indicates the target time point. If convergence has not yet occurred, further determine whether the maximum number of iterations has been reached. If the maximum number of iterations is reached, determine that the iteration termination condition has been met and output the target time point. Proceed to step 170.
[0055] 3. At the target time point If the iteration fails to converge and the maximum number of iterations has not been reached, it is determined that the iteration termination condition has not been met, and the updated target time point is used. Update potential time intervals ,include: Calculate the profile error evaluation function Updated target time point The first derivative at Then, based on the first derivative The value of will determine the left boundary of the potential time interval. or right boundary Corrected to the updated target time point Specifically: When the contour error evaluation function Updated target time point The first derivative at At that time, the left boundary of the potential time interval will be... Corrected to the updated target time point Otherwise, the right boundary of the potential time interval will be... Corrected to the updated target time point .
[0056] Then based on the updated target time point and potential time interval Continue iterating within the potential time interval after the current update. Within the range based on the current The value is dynamically switched between Newton's iteration method and the binary search method to update the target time point again. This continues until the iteration termination condition is met.
[0057] Step 170, calculate the actual location point and the expected trajectory curve at the target time point Corresponding contour error points The deviation between them is used as the actual position point The profile error at each actual position point can be calculated including the deviation of the coordinate in the x direction and the y direction, and the Euclidean distance between the actual position point and the profile error point as shown in (d) in the example of FIG. 6. The profile error at each actual position point can be calculated including the deviation of the coordinate in the x direction and the y direction, and the Euclidean distance between the actual position point and the profile error point as shown in (d) in the example of FIG. 6. In the x direction and the y direction, and the Euclidean distance between the actual position point and the profile error point as shown in (d) in the example of FIG. 6. In the x direction and the y direction, and the Euclidean distance between the actual position point and the profile error point as shown in (d) in the example of FIG. 6. In Figure 2 the x direction and the y direction, and the Euclidean distance between the actual position point and the profile error point as shown in (d) in the example of FIG. 6.
[0058] Continuing to traverse other expected position points on the expected trajectory curve and through the above steps 120-170, the profile error at each actual position point can be calculated including the deviation of the coordinate in the x direction and the y direction, and the Euclidean distance between the actual position point and the profile error point.
[0059] In one example, an experimental verification was performed on an XY platform composed of a ball screw module, both motors used GSHD-0032AGL2-LTLM type driver, connected to the GSN-024-LT-01 control card through the Glink-II bus, the control card is inserted into the host PCI-e slot, using visual studio for secondary development, the method provided in the present application is implemented on the host computer. The position data feedback was performed by the absolute value encoder of the servo motor with the multi-tomoe river protocol, the control card collected the data of the encoder, and the sampling period was 250us. Taking the heart-shaped trajectory as shown in FIG. 7 as an example, considering the smoothness of the motion, the expected trajectory curve was designed in the form of a cubic spline curve, and the trajectory equation was: Figure 5
[0060] Considering the spatial position limitation of the XY dual-axis platform, the amplitude was selected, the maximum value of the time sequence interval , represents seconds.
[0061] The above expected trajectory curve was discretized to obtain 1000 expected position points related to , the expected position point data was pressed into the motion control card, the data collection was started, and after the XY dual-axis platform was moved, the collected two motor encoder data was saved to an array. Each expected position point was traversed in turn, for any one expected position point traversed, the traversal method was used to find the nearest data point and its position in the data array, that is, the actual position point corresponding to the first expected position point was found. Since the time interval of the adjacent two expected position points is T / 1000=2ms=2000us, and the sampling period of the control card is 250us, the actual position point corresponding to each expected position point can be obtained from the sampled data.
[0062] Taking , The maximum number of iterations is 20, and the contour error is calculated according to the method of this application. Figure 5 A magnified view of the contour error of the expected trajectory curve at point 510 (dashed box) is shown below. Figure 6 As shown, Figure 5 A magnified view of the contour error of the expected trajectory curve at point 520 (dashed box) is shown below. Figure 7 As shown, in Figure 6 and Figure 7 In the diagram, the blue trajectory represents the desired trajectory curve, and the black trajectory represents the actual machining trajectory curve. Blue dots represent desired position points, and purple dots near each desired position point are contour error points at the corresponding actual position point. The red line segments represent the distances between the actual position points corresponding to the desired position points and their corresponding contour error points. The actual position points and corresponding contour error points for each desired position point, arranged sequentially on the desired trajectory curve according to the machining order, are located at... directional deviation such as Figure 8 As shown, in directional deviation such as Figure 9 As shown. By Figures 6-9 It can be seen that the contour error calculated according to the method of this application meets the requirements and can still maintain good results at large curvature, providing a good premise for subsequent contour error compensation.
[0063] The above descriptions are merely preferred embodiments of this application, and this application is not limited to the above embodiments. It is understood that other improvements and variations that can be directly derived or conceived by those skilled in the art without departing from the spirit and concept of this application should be considered to be included within the protection scope of this application.
Claims
1. A method for calculating the contour error of CNC machining equipment, characterized in that, The contour error calculation method includes: For the desired trajectory curve Any of the above Expected location points Determine the actual processing trajectory and the first The nearest actual location point to the desired location point ;in, Indicates a point in time and The expected trajectory curve at any time point The corresponding coordinates are , For the first The time points corresponding to the expected location points; Given the initial values of Newton's iteration method The contour error evaluation function is determined using the gradient descent method. The potential time interval corresponding to the minimum value Among them, the contour error evaluation function Used to measure actual location points at any time point on the expected trajectory curve Corresponding coordinates The distance between them , , ; Initialize target time point Based on the contour error evaluation function At the target time point Second derivative at The value of the variable is dynamically switched between Newton's iteration method and the bisection method to cover the potential time interval. Internal iterative update determines the target time point ; Calculate the actual location point and the expected trajectory curve at the target time point Corresponding contour error points The deviation between them is used as the actual position point Contour error at the location.
2. The contour error calculation method according to claim 1, characterized in that, In the potential time interval Internal iterative update determines the target time point include: In the potential time interval Within the range according to The value of the target time point is dynamically switched between Newton's iteration method and the binary search method. ; Utilize the updated target time point Update potential time intervals And based on the updated target time point and potential time interval Continue iterating until the iteration termination condition is met to obtain the target time point. .
3. The contour error calculation method according to claim 2, characterized in that, according to The value of the target time point is dynamically switched between Newton's iteration method and the binary search method. include: when Then, the reference time is calculated using Newton's iterative method. When reference time In the potential time interval When within the range, refer to the time. As the updated target time point ; when reference time Exceeding the potential time interval When the range is defined, the updated target time point is obtained using the binary search method. ; when Then, the updated target time point is obtained using the binary search method. .
4. The contour error calculation method according to claim 3, characterized in that, The updated target time point is obtained using the binary search method. include: when At that time, according to Update target time point Otherwise, according to Update target time point .
5. The contour error calculation method according to claim 2, characterized in that, Utilize the updated target time point Update potential time intervals include: Calculate the profile error evaluation function Updated target time point The first derivative at According to the first derivative The value of will determine the left boundary of the potential time interval. or right boundary Corrected to the updated target time point .
6. The contour error calculation method according to claim 5, characterized in that, According to the first derivative The value of will determine the left boundary of the potential time interval. or right boundary Corrected to the updated target time point include: When the contour error evaluation function Updated target time point The first derivative at At that time, the left boundary of the potential time interval will be... Corrected to the updated target time point Otherwise, the right boundary of the potential time interval will be... Corrected to the updated target time point .
7. The contour error calculation method according to claim 1, characterized in that, Determine the potential time interval include: Calculate the profile error evaluation function In the initial value The first derivative at ; when At that time, As the left boundary of the potential time interval The value of, and in Determine the right boundary of the potential time interval within the range. The possible values of ; when At that time, As the right boundary of the potential time interval The value of, and in Determine the left boundary of the potential time interval within the range. The value of .
8. The contour error calculation method according to claim 7, characterized in that, Determine the potential time interval Also includes: exist At that time, initialize the reference boundary. ,when Directly As the right boundary of the potential time interval The value of ; when At that time, calculate the contour error evaluation function. At the reference boundary The first derivative at ,when When As the right boundary of the potential time interval The value of , when season And continue iterating; exist At that time, initialize the reference boundary. ,when When 0 is directly used as the left boundary of the potential time interval, The value of ; when At that time, calculate the contour error evaluation function. At the reference boundary The first derivative at ,when When As the left boundary of the potential time interval The value of , when season And continue iterating; in, It updates the step size.
9. The contour error calculation method according to claim 2, characterized in that, In the potential time interval Internal iterative update determines the target time point Also includes: Target time points before and after the update The error is less than the convergence error. When the iteration count reaches the maximum number of iterations, the iteration termination condition is determined and the target time point is obtained. .
10. The contour error calculation method according to claim 1, characterized in that, Contour error evaluation function .
Citation Information
Patent Citations
Parameter curve cutter path oriented numerical control system contour error control method
CN102591257A
Multi-dimensional system contour error estimation method based on simplified Newton method
CN111830905A
Method of contour error modeling for cross-coupled control of CNC machines
KR1019990057121A