Trajectory smoothing method for micro line segments, medium and machine tool numerical control equipment

Through B-spline fitting and cubic Bezier curve interpolation, the trajectory of tiny line segments is solved, and the velocity curve and surface are not smooth in surface processing with large workpiece curvature is achieved, and efficient workpiece processing is achieved.

CN114488941BActive Publication Date: 2024-11-29SYMG SHANGHAI INTELLIGENCE SYST CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202011254697.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-11
Publication Date
2024-11-29
Estimated Expiration
2040-11-11

AI Technical Summary

Technical Problem

When the prior art cannot effectively deal with curved surfaces with large curvature of the workpiece, the speed curve is not smooth and the workpiece surface is not smooth, which affects the processing quality and efficiency.

Method used

By obtaining data points on the workpiece processing trajectory, continuous micro segment identification and preprocessing are performed, and B-spline fitting and cubic Bezier curve interpolation are used to optimize the trajectory of the micro line segments to ensure the smoothness of the velocity curve and the height of the workpiece surface Finish.

Benefits of technology

The deviation of the B-spline trajectory is controlled, the trajectory of the Bezier curve is controlled, the internal continuity of the fitting curve and the continuity of the connection are improved, and the surface quality and machining efficiency of the workpiece are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114488941B_ABST
    Figure CN114488941B_ABST
Patent Text Reader

Abstract

The present invention provides a trajectory smoothing method, medium and machine tool numerical control equipment for a tiny line segment, the trajectory smoothing method for the tiny line segment includes obtaining data points on a workpiece processing trajectory, performing continuous micro-segment identification on the data points to determine data points suitable for curve fitting, and using the trajectory formed by the data points as a continuous micro-segment; pre-processing the continuous micro-segment to optimize the continuous micro-segment by processing bad points on the trajectory; performing spline fitting on the optimized continuous micro-segment to obtain a B-spline trajectory, and interpolating two adjacent B-spline trajectories to smooth the tiny line segment through the B-spline trajectory. The present invention provides an algorithm for fitting tiny line segments into cubic B-spline curves, the fitted B-spline trajectory is smoother than the trajectory composed of the original tiny line segments, thereby improving the processing quality of the workpiece surface, making the speed smooth, the acceleration continuous, and improving the workpiece processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of five-axis machining, and relates to a curved surface machining method, in particular to a trajectory smoothing method for a tiny line segment, a medium and a machine tool numerical control device. Background Art

[0002] In the existing CNC machining technology, line segments are generally used to describe the machining path. In order to approximate the original shape of the workpiece on the surface with large curvature, a large number of tiny line segments are needed to describe it. If a large number of tiny line segments are directly processed, the system needs to accelerate and decelerate frequently, which will cause fluctuations in speed and acceleration, affecting the machining quality and efficiency of the workpiece surface. One solution to this problem is to use spline curves to re-describe the path of the trajectory to be processed, that is, to perform trajectory smoothing. However, the current trajectory smoothing method that uses a large number of tiny line segments to describe the surface needs to be further improved in terms of the smoothness of the velocity curve and the surface finish of the machined workpiece.

[0003] Therefore, how to provide a trajectory smoothing method, medium and machine tool CNC equipment for tiny line segments to solve the defects of the existing technology that cannot ensure the high smoothness of the velocity curve and the high smoothness of the workpiece surface when processing the curved surface with large curvature of the workpiece has become a technical problem that needs to be urgently solved by technical personnel in this field. Summary of the invention

[0004] In view of the shortcomings of the prior art mentioned above, the purpose of the present invention is to provide a trajectory smoothing method, medium and machine tool CNC equipment for tiny line segments, which are used to solve the problem that the prior art cannot ensure the high smoothness of the velocity curve and the high smoothness of the workpiece surface when processing the curved surface with large curvature of the workpiece.

[0005] To achieve the above-mentioned purpose and other related purposes, the present invention provides a method for smoothing the trajectory of a tiny line segment on one hand, and the method for smoothing the trajectory of a tiny line segment includes: acquiring data points on a workpiece processing trajectory, performing continuous micro-segment identification on the data points to determine data points suitable for curve fitting, and using the trajectory constituted by them as a continuous micro-segment; pre-processing the continuous micro-segment to optimize the continuous micro-segment by processing bad points on the trajectory; performing spline fitting on the optimized continuous micro-segment to obtain a B-spline trajectory, and interpolating two adjacent B-spline trajectories to smooth the tiny line segment through the B-spline trajectory.

[0006] In one embodiment of the present invention, the step of acquiring data points on the workpiece processing trajectory and identifying continuous micro-segments of the data points includes: determining the Euclidean distance and angle between each adjacent trajectory segment formed by the data points; and taking the trajectory segment corresponding to the Euclidean distance being less than a first preset threshold and the angle being less than a second preset threshold as the continuous micro-segment.

[0007] In one embodiment of the present invention, the step of preprocessing the continuous micro-segments to optimize the continuous micro-segments by processing the bad points of the trajectories includes: optimizing the bad points of the trajectories by the correspondence between the data points in the continuous micro-segments and the surface of the model to be processed.

[0008] In one embodiment of the present invention, the step of performing spline fitting on the optimized continuous micro-segment to obtain a B-spline trajectory, and performing interpolation processing on two adjacent B-spline trajectories includes: determining whether the number of data points of the continuous micro-segment is less than a preset number threshold; if so, performing fitting on all data points of the continuous micro-segment; if not, using the preset number threshold as the fitting number of data points, and selecting data points of the fitting number from all data points of the continuous micro-segment for fitting.

[0009] In one embodiment of the present invention, the step of fitting the data points includes: calculating the node parameters of the data points, and determining the node vectors of the cubic B-spline according to the node parameters; determining the control points of the cubic B-spline in combination with the node parameters and the node vectors; calculating the fitting errors of the cubic B-spline curves corresponding to the control points, and determining the successfully fitted data points by judging the fitting errors to form a cubic B-spline curve; fitting another cubic B-spline curve to the data points after the cubic B-spline curve to form another cubic B-spline curve; and connecting two adjacent cubic B-spline curves by using a cubic Bezier curve.

[0010] In one embodiment of the present invention, the step of determining the control points of the cubic B-spline by combining the node parameters and the node vectors includes: calculating a basis function matrix based on the node parameters and the node vectors; and determining a control point matrix by combining the basis function matrix and a matrix formed by the data points, wherein the control point matrix includes the control points of the cubic B-spline.

[0011] In one embodiment of the present invention, the step of calculating the fitting error of the cubic B-spline curve corresponding to the control point and determining the successfully fitted data point by judging the fitting error to form a cubic B-spline curve includes: judging whether the fitting error is greater than a fitting error threshold; if so, reducing one data point in the continuous micro-segment and recalculating the fitting error of the cubic B-spline curve corresponding to the control point until the recalculated fitting error meets the fitting accuracy requirement; if not, judging that the fitting error meets the fitting accuracy requirement and fitting to generate the cubic B-spline curve.

[0012] In one embodiment of the present invention, the step of connecting two adjacent cubic B-spline curves through a cubic Bezier curve includes: connecting the two adjacent cubic B-spline curves according to the last two control points of the one cubic B-spline curve, the first two control points of the other cubic B-spline curve, and the control points of the cubic Bezier curve.

[0013] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the trajectory smoothing method of the micro-line segment when executed by a processor.

[0014] The last aspect of the present invention provides a machine tool numerical control device, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the machine tool numerical control device executes the trajectory smoothing method of the tiny line segment.

[0015] As described above, the method for smoothing the trajectory of a tiny line segment, the medium and the numerical control equipment for a machine tool according to the present invention have the following beneficial effects:

[0016] (1) The B-spline trajectory deviation of the present invention is controllable: the least squares method is used to approximate the original data points, the smoothness of the workpiece surface is improved and the deviation is guaranteed to be controllable. The calculation of the node vector is in line with engineering practice. The shape of the B-spline curve fitted in this way is reasonable and the curve fitting success rate is high.

[0017] (2) The deviation trajectory of the Bezier curve is controllable, and the control points of the cubic Bezier curve can be directly inferred using the deviation limit.

[0018] (3) Second-order continuity inside the fitting curve: Both the cubic B-spline curve and the cubic Bezier curve are G2 continuous. The fitted curve trajectory ensures the smoothness of the processing speed and the continuity of the acceleration, avoiding the sudden change of the machine tool speed and acceleration. It can effectively improve the surface quality of the workpiece and the processing efficiency.

[0019] (4) First-order continuity at the curve junction: The junction of the cubic B-spline curve and the cubic Bezier curve is G1 continuous. The speed continuity is ensured at the curve junction, which can effectively improve the surface quality and processing efficiency of the workpiece. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a principle flow chart of a method for smoothing the trajectory of a tiny line segment in one embodiment of the present invention.

[0021] Figure 2 It is a schematic diagram of continuous micro segments in one embodiment of a trace smoothing method for micro line segments of the present invention.

[0022] Figure 3It is a diagram showing the principle of fitting judgment of a trajectory smoothing method of a tiny line segment in one embodiment of the present invention.

[0023] Figure 4 It is a data point fitting flow chart of a trajectory smoothing method of a tiny line segment in one embodiment of the present invention.

[0024] Figure 5 It is a curve fitting effect diagram of a trajectory smoothing method of a tiny line segment in one embodiment of the present invention.

[0025] Figure 6 The diagram shows the actual processing effect of the trajectory smoothing method of a tiny line segment in one embodiment of the present invention.

[0026] Figure 7 It is a schematic diagram showing the structural connection of a machine tool numerical control device in one embodiment of the present invention.

[0027] Component number description

[0028] 7 CNC machine tool equipment

[0029] 71 Processor

[0030] 72 Memory

[0031] Steps S11 to S13

[0032] Steps S131 to S133

[0033] Steps S41 to S45 DETAILED DESCRIPTION

[0034] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0035] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0036] The trajectory smoothing method of the micro segment described in the present invention uses a cubic B-spline curve to fit the optimized continuous micro segment. The B-spline curve has the advantages of strong convexity and local modifiability. In engineering practice, due to the real-time requirement, the number of control points of a B-spline curve cannot be increased infinitely, so it is necessary to constrain the number of control points of a single B-spline curve; in order to improve the success rate of each fitting and reduce the number of iterations, it is necessary to constrain the number of data points for each fitting. The trajectory points of the continuous micro segment are segmented and fitted. The cubic B-spline curve is used to fit a number of continuous micro segment trajectories within the range allowed by the chord height error. A micro segment between two cubic B-spline curves is connected with a cubic Bezier curve within the range allowed by the chord height error. Therefore, a large number of micro segments can be described by a continuous spline curve, which can approximate the original sample model. The interpolation based on the continuous spline curve can make the velocity curve smoother and the surface finish of the workpiece higher.

[0037] The following will be combined Figures 1 to 7 The principles and implementation methods of a trajectory smoothing method for a tiny line segment, a medium and a machine tool numerical control device of this embodiment are explained in detail, so that those skilled in the art can understand the trajectory smoothing method for a tiny line segment, a medium and a machine tool numerical control device of this embodiment without creative work.

[0038] See also Figure 1 , which is a principle flow chart of a method for smoothing the trajectory of a tiny line segment according to an embodiment of the present invention. Figure 1 As shown, the trajectory smoothing method of the micro segment specifically includes the following steps:

[0039] S11, acquiring data points on the workpiece processing trajectory, performing continuous micro-segment recognition on the data points to determine data points suitable for curve fitting, and using the trajectory constituted by the data points as continuous micro-segments.

[0040] In this embodiment, S11 includes:

[0041] (1) Determine the Euclidean distance and angle between each adjacent trajectory segment formed by the data points.

[0042] (2) The trajectory segment corresponding to the Euclidean distance being smaller than the first preset threshold and the angle being smaller than the second preset threshold is taken as the continuous micro-segment.

[0043] See also Figure 2 , which is a schematic diagram of continuous micro segments in an embodiment of the method for smoothing the trajectory of micro segments of the present invention. Figure 2 As shown, the data points of the workpiece processing trajectory, i.e., the CAM (Computer Aided Manufacturing) trajectory, are P1P2...P n-1 P n, the angle between the front and rear segments is recorded as θ1θ2...θ n-3 θ n-2 , the length between the front and rear segments is L1L2...L n-2 L n-1 . Note the system preset trajectory fitting deviation E max .

[0044] Specifically, during recognition, the Euclidean distance between data points should not be too large and the angle should change smoothly. Therefore, the Euclidean distance parameter (the first preset threshold) is set to d max , the angle parameter (second preset threshold) is θ max , parameter d max and θ max Set according to engineering experience.

[0045] The Euclidean distance in the continuous trajectory is less than the Euclidean distance parameter d max , and the angle is less than the angle parameter θ max The trajectory segment is a continuous micro segment, such as Figure 2 As shown, P i ...P j The length and angle of the line segment between them are both less than the preset parameters, that is, P i ...P j The data points between are continuous micro-segments.

[0046] S12, pre-processing the continuous micro-segments to optimize the continuous micro-segments by processing bad points on the track.

[0047] In this embodiment, the bad points of the trajectory are optimized by the correspondence between the data points in the continuous micro-segment and the surface of the model to be processed. i ...P j The bad points of the trajectory are preprocessed. When a data point deviates significantly from the surface of the model to be processed, it is considered to be a bad point of the trajectory and the bad point is processed. The processing method includes elimination and bad point optimization according to the correction or compensation method in the prior art. Figure 2 , assuming that the continuous micro segment P i ...P j No bad points were found in the track, and the track points after preprocessing were recorded as Q i ...Q j .

[0048] S13, performing spline fitting on the optimized continuous micro-segments to obtain a B-spline trajectory, and performing interpolation processing on two adjacent B-spline trajectories to smooth the micro-line segments through the B-spline trajectory.

[0049] Specifically, the spline fitting of continuous micro-segments includes cubic B-spline approximation and cubic Bezier curve interpolation. The least squares method is used for approximation. max Within the range, use the cubic B-spline curve to approximate the trajectory point Q i ...Q j . In engineering practice, due to the requirements of real-time and accuracy, it was found in the test that in matrix inversion, the accuracy meets the requirements when the matrix size is 4×4, so the number of control points of each B-spline curve is set to 6 in the present invention. In order to improve the success rate of fitting and ensure the real-time performance of trajectory fitting, the number of trajectory points of the continuous micro-segments for the first fitting is set to N, and N is generally taken as 20 in actual use. It should be noted that the number of control points and the number of trajectory points N of the B-spline curve in other embodiments can also be adaptively adjusted by taking other reasonable values ​​within the scope of the principle implementation of the trajectory smoothing method of the micro-segments.

[0050] See also Figure 3 , which is a schematic diagram showing the fitting judgment principle of the trajectory smoothing method of a tiny line segment in one embodiment of the present invention. Figure 3 As shown, S13 includes:

[0051] S131, judging whether the number of data points of the continuous micro-segment is less than a preset number threshold. Specifically, the preset number threshold refers to the number of trajectory points of the continuous micro-segment fitted for the first time being N.

[0052] S132: If yes, fit all data points of the continuous micro-segments.

[0053] Specifically, if (j-i+1)<N, then directly i …Q j Perform fitting. The number of data points of the continuous micro-segments actually fitted is denoted as m.

[0054] S133: If not, the preset number threshold is used as the fitting number of data points, and data points equal to the fitting number are selected from all data points of the continuous micro-segments for fitting.

[0055] If (j-i+1)≥N, then for consecutive points Q i ...Q i+N-1 A total of N data points are fitted with cubic B-spline based on least squares.

[0056] See also Figure 4 , which is a data point fitting flow chart of the trajectory smoothing method of a micro segment of the present invention in one embodiment. The spline fitting of continuous micro segments includes cubic B-spline approximation and cubic Bezier curve interpolation. Figure 4 As shown, the steps of data point fitting in S132 and S133 specifically include:

[0057] S41, calculating the node parameters of the data points, and determining the node vectors of the cubic B-spline according to the node parameters.

[0058] Specifically, the chord length method is used to calculate the node parameters of the corresponding data points make, The specific calculation formula is:

[0059]

[0060] In formula (1), m represents the number of data points of the continuous micro-segment actually fitted, t = 2, ..., m, i represents the subscript value of Qi, and the trajectory point after preprocessing is Q i …Q j .

[0061] Based on the calculated data point parameters Determine the B-spline knot vector U, specifically U = [0, 0, 0, 0, u5, u6, 0, 0, 0, 0]. The specific calculation method of the knot vector U is as follows:

[0062]

[0063] In formula (2), k = 1, 2; p is 3, indicating a cubic B-spline; R=I*k+1-j (wherein, j=floor(I*k+1)), floor means rounding down.

[0064] S42, determining control points of the cubic B-spline in combination with the node parameters and the node vectors.

[0065] In this embodiment, S42 includes:

[0066] (1) Calculate a basis function matrix according to the node parameters and the node vectors.

[0067] Calculate the control points of the cubic B-spline. According to the data point parameters and the node vector U to calculate the basis function matrix.

[0068]

[0069]

[0070] In formula (3) and formula (4), m represents the number of data points of the continuous micro-segments actually fitted, and n represents the constraint parameter of the number of control points, where n=6.

[0071] (2) Determine a control point matrix by combining the basis function matrix and the matrix formed by the data points, wherein the control point matrix includes the control points of the cubic B-spline.

[0072] Calculate the control point matrix D of the cubic B-spline curve by the least squares method:

[0073]

[0074] in, Q main =[Q i+1 , ..., Q i+m-1 ] T .

[0075] S43, calculating the fitting error of the cubic B-spline curve corresponding to the control point, and determining the successfully fitted data point by judging the fitting error to form a cubic B-spline curve.

[0076] In this embodiment, S43 includes: determining whether the fitting error is greater than a fitting error threshold; if so, reducing one data point in the continuous micro-segment, and recalculating the fitting error of the cubic B-spline curve corresponding to the control point until the recalculated fitting error meets the fitting accuracy requirement; if not, determining that the fitting error meets the fitting accuracy requirement, and fitting to generate the cubic B-spline curve.

[0077] Specifically, the fitting error of the cubic B-spline curve corresponding to the control point P is calculated. The calculation formula of the fitting error is:

[0078]

[0079] In formula (6), Indicates that the fitted B-spline curve has parameters The value at t = 1, ..., m, g = i, ..., j, so let E = [e1, ..., e m ].

[0080] The fitting error is calculated using the following formula:

[0081] FitE=max(E) Formula (7)

[0082] If the calculated cubic B-spline curve fitting error FitE is greater than the fitting error limit E max , then reduce one data point and refit, that is, the trajectory point Q i ...Q j-1 A total of (ji) trajectory points are fitted, and the fitting error (fitting accuracy) is calculated until the fitting accuracy meets the requirements.

[0083] S44, fitting another cubic B-spline curve to the data points after the cubic B-spline curve to form another cubic B-spline curve.

[0084] Specifically, the trajectory point of successful fitting (fitting error meets the requirements) is recorded as Q i ...Q f (i<f≤j), thus fitting to form a cubic B-spline curve, then the trajectory point Q f+1 ...Q j The same cubic B-spline method is used to fit between them, thereby forming another cubic B-spline curve.

[0085] S45, connecting two adjacent cubic B-spline curves by using a cubic Bezier curve.

[0086] In this embodiment, S45 includes: connecting two adjacent cubic B-spline curves according to the last two control points of the one cubic B-spline curve, the first two control points of the other cubic B-spline curve and the control points of the cubic Bezier curve.

[0087] Specifically, Q f Q f+1 Use cubic Bezier curves to connect adjacent cubic B-spline curves between two points. Let the unit first-order derivative at the end point of the previous B-spline curve be T e , the unit first-order derivative at the starting point of the latter B-spline curve is T s The calculation of the first-order derivative of the B-spline curve is a conventional mathematical method and will not be described in detail here.

[0088] The control points of the cubic Bezier curve are B1, B2, B3 and B4, then the expression of the cubic Bezier curve is:

[0089] X(u)=B1(1-u) 3 +3B2u(1-u)+3B3u 2 (1-u)+B4u 3 Formula (8)

[0090] In formula (8), 0≤node parameter u≤1. Where, B1=Q f ; B2=B1+T e *d;B4=Q f+1 ; B3=B4-T s *d;

[0091] The calculation formula of d is: d = min (E max / sin(θ1),E max / sin(θ2),||Q f+1 -Q f || / 2), where E max For the fitting error limit, T = Q f+1 -Q f , θ1 is the vector Te and T, θ2 is the angle between the vector T s and the angle between T.

[0092] In a practical application of this embodiment, the trajectory smoothing method of the micro-line segment is used to perform spline fitting on 31 original data points to be fitted in the workpiece machining trajectory. The G01 (G01 is a linear interpolation instruction in the CNC machining technical instruction) code contains 31 original data points to be fitted:

[0093]

[0094]

[0095] Each row in the above matrix is ​​a set of coordinates (x, y, z), representing a data point. The fitting error limit of the cubic B-spline curve is 0.005.

[0096] Through steps S11 and S12, points suitable for fitting are found out among the 31 data points. All the 31 data points in the above matrix are suitable for fitting.

[0097] The determined data points are fitted in step S13, including cubic B-spline approximation and cubic Bezier curve interpolation.

[0098] (1) 3rd order B-spline approximation: Read the first 20 data points (i.e., the 1st to 20th data points) in the data point matrix as the data point matrix Q for this fitting. Use the chord length method to parameterize Q to obtain the data point parameters corresponding to each data point. According to the obtained Calculate the node vector U = [0, 0, 0, 0.3294, 0.6631, 1, 1, 1, 1]. The cubic B-spline curve with 6 control points is approximated to 20 data points using the least squares method to obtain the control point matrix of the cubic B-spline curve

[0099] Then continue fitting the 21st to 31st data points in the data point matrix Data. Get the node vector U of the cubic B-spline curve = [0, 0, 0, 0, 0.3327, 0.6666, 1, 1, 1, 1]; the control point matrix

[0100]

[0101]

[0102] (2) Cubic Bezier curve interpolation: Connect the two B-splines with a cubic Bezier curve based on the control points of the previous B-spline and the control points of the next B-spline. That is, connect the 20th and 21st data points with a cubic Bezier curve.

[0103] See also Figure 5 , which is a curve fitting effect diagram of the trajectory smoothing method of a tiny line segment of the present invention in one embodiment. Figure 5 As shown, the curve fitting effect of the above 31 data points is shown, where the circles are the original data points. It can be seen that the fitting curve in the figure is highly consistent with the original data points.

[0104] See also Figure 6 , which shows the actual processing effect of the trajectory smoothing method of a tiny line segment in one embodiment of the present invention. Figure 6 As shown, Figure (a) is a workpiece processed by the trajectory smoothing method in the prior art, and Figure (b) is a workpiece processed by the trajectory smoothing method of the tiny line segments of the present invention. It can be seen that compared with Figure (a), Figure (b) has a smoother trajectory and a higher processing quality of the workpiece surface.

[0105] The protection scope of the trajectory smoothing method of a tiny line segment described in the present invention is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present invention are included in the protection scope of the present invention.

[0106] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the trajectory smoothing method of the tiny line segment is implemented.

[0107] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned computer-readable storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various computer storage media that can store program codes.

[0108] See also Figure 7 , which is a schematic diagram of the structural connection of a machine tool numerical control device in one embodiment of the present invention. Figure 7 As shown, this embodiment provides a machine tool numerical control device 7, which includes: a processor 71 and a memory 72; the memory 72 is used to store computer programs, and the processor 71 is used to execute the computer programs stored in the memory, so that the machine tool numerical control device executes each step of the trajectory smoothing method of the tiny line segment.

[0109] The memory 72 may include a random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0110] The above-mentioned processor 71 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0111] In summary, the trajectory smoothing method, medium and machine tool numerical control equipment of the micro-line segment of the present invention realizes the controllable deviation of the B-spline trajectory: the original data points are approximated by the least squares method, the smoothness of the workpiece surface is improved and the deviation is guaranteed to be controllable, and the calculation of the node vector conforms to the actual engineering practice. The shape of the fitted B-spline curve in this way is reasonable and the success rate of curve fitting is high. The deviation trajectory of the Bezier curve is controllable, and the control points of the third-order Bezier curve can be directly inferred by the deviation limit. The fitting curve is second-order continuous inside: the cubic B-spline curve and the cubic Bezier curve are both G2 continuous. The fitted curve trajectory ensures the smoothness of the processing speed and the continuity of the acceleration, avoiding the sudden change of the machine tool speed and acceleration. It can effectively improve the surface quality and processing efficiency of the workpiece. The curve connection is first-order continuous: the connection between the cubic B-spline curve and the cubic Bezier curve is G1 continuous. The curve connection ensures speed continuity, which can effectively improve the surface quality and processing efficiency of the workpiece. The present invention effectively overcomes various shortcomings in the prior art and has a high industrial utilization value.

[0112] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A trajectory smoothing method for tiny line segments, It is characterized in that The trajectory smoothing method of the micro-line segment includes: Acquire data points on the workpiece processing trajectory, perform continuous micro-segment identification on the data points to determine data points suitable for curve fitting, and use the trajectory formed by the data points as a continuous micro-segment; including: determining the Euclidean distance and angle between each adjacent trajectory segment formed by the data points; and using the trajectory segment corresponding to the Euclidean distance being less than a first preset threshold and the angle being less than a second preset threshold as the continuous micro-segment; Preprocessing the continuous micro-segments to optimize the continuous micro-segments by processing bad points of the track; Spline fitting is performed on the optimized continuous micro-segments to obtain a B-spline trajectory, and interpolation processing is performed on two adjacent B-spline trajectories to smooth the micro-line segments through the B-spline trajectory.

2. The method for smoothing the trajectory of a micro line segment according to claim 1, It is characterized in that The step of preprocessing the continuous micro-segments to optimize the continuous micro-segments by processing the bad points of the track includes: The bad points of the trajectory are optimized through the correspondence between the data points in the continuous micro-segments and the surface of the model to be processed.

3. The method for smoothing the trajectory of a micro line segment according to claim 1, It is characterized in that The step of performing spline fitting on the optimized continuous micro-segments to obtain a B-spline trajectory and performing interpolation processing on two adjacent B-spline trajectories comprises: Determine whether the number of data points in the continuous micro-segment is less than a preset number threshold; If yes, all data points of the continuous micro-segment are fitted; if no, the preset number threshold is used as the fitting number of data points, and data points equal to the fitting number are selected from all data points of the continuous micro-segment for fitting.

4. The method for smoothing the trajectory of a micro line segment according to claim 3, It is characterized in that The step of data point fitting comprises: Calculating the node parameters of the data points, and determining the node vectors of the cubic B-spline according to the node parameters; Determining control points of a cubic B-spline in combination with the node parameters and the node vector; Calculating the fitting error of the cubic B-spline curve corresponding to the control point, and determining the successfully fitted data point by judging the fitting error to form a cubic B-spline curve; Fitting another cubic B-spline curve to the data points after the cubic B-spline curve to form another cubic B-spline curve; Two adjacent cubic B-spline curves are connected by cubic Bezier curves.

5. The method for smoothing the trajectory of a micro line segment according to claim 4, It is characterized in that The step of determining the control points of the cubic B-spline by combining the node parameters and the node vectors comprises: Calculate a basis function matrix according to the node parameters and the node vectors; A control point matrix is ​​determined by combining the basis function matrix and the matrix formed by the data points, wherein the control point matrix includes the control points of the cubic B-spline.

6. The method for smoothing the trajectory of a micro line segment according to claim 4, It is characterized in that The step of calculating the fitting error of the cubic B-spline curve corresponding to the control point and determining the successfully fitted data point by judging the fitting error to form a cubic B-spline curve comprises: Determining whether the fitting error is greater than a fitting error threshold; If so, reduce one data point in the continuous micro-segment, recalculate the fitting error of the cubic B-spline curve corresponding to the control point, until the recalculated fitting error meets the fitting accuracy requirement; if not, determine that the fitting error meets the fitting accuracy requirement, and fit to generate the cubic B-spline curve.

7. The method for smoothing the trajectory of a micro line segment according to claim 4, It is characterized in that The step of connecting two adjacent cubic B-spline curves by using a cubic Bezier curve comprises: According to the last two control points of the one cubic B-spline curve, the first two control points of the other cubic B-spline curve and the control points of the cubic Bezier curve, two adjacent cubic B-spline curves are connected.

8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the trajectory smoothing method of a tiny line segment described in any one of claims 1 to 7 is implemented.

9. A machine tool numerical control device, It is characterized in that include: Processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the machine tool numerical control device executes the trajectory smoothing method of a tiny line segment as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Error-controllable short line segment trajectory smoothing method

    CN109571473A

  • Error-controllable four-axis industrial robot B-spline transition type smooth trajectory generating method

    CN109664303A

  • Numerically controlled machining method, numerically controlled machine tool and computer storage medium

    CN111684374A

  • Curve fine-segmentation method and numerical controller provided with spline interpolation function

    JP1998240329A

  • Numerically controlled machining method, numerically controlled machine tool and computer storage medium

    WO2020133049A1