,,,*
1.College of Mechanical and Electrical Engineering,Nanjing University of Aeronautics and Astronautics,Nanjing 210016,P.R.China;2.Jiangsu Key Laboratory of Precision and Micro?manufacturing Technology,Nanjing University of Aeronautics and Astronautics,Nanjing 210016,P.R.China;3.College of Mechanical and Electrical Engineering,Hohai University,Changzhou 213022,P.R.China
Abstract: Existing curve fitting algorithms of NC machining path mainly focus on the control of fitting error,but ignore the problem that the original discrete cutter position points are not enough in the high curvature area of the tool path. It may cause a sudden change in the drive force of the feed axis,resulting in a large fluctuation in the feed speed.This paper proposes a new non-uniform rational B-spline(NURBS)curve fitting optimization method based on curvature smoothing preset point constraints. First,the short line segments generated by the CAM software are optimally divided into different segment regions,and then the curvature of the short line segments in each region is adjusted to make it smoother. Secondly,a set of characteristic points reflecting the change of the curvature of the fitted curve is constructed as the control apex of the fitted curve,and the curve is fitted using the NURBS curve fitting optimization method based on the curvature smoothing preset point constraint. Finally,the curve fitting error and curve volatility are analyzed with an example,which verifies that the method can significantly improve the curvature smoothness of the high-curvature tool path,reduce the fitting error,and improve the feed speed.
Key words:curvature smoothing;NC machining path;NURBS curve fitting;weighted constraint
High-speed five-axis NC machining has be?come an important technology for efficient machin?ing of complex surface parts in aerospace. Howev?er,the smoothness of tool paths is still a major fac?tor affecting five-axis high-speed and high-precision machining. At present,most CAM software gener?ates tool paths in accordance with the ISO 6983 standard by approximating short line segments to the original design curve. In the high-speed cutting process,this method may cause frequent fluctua?tions in the feed speed,which seriously affects the cutting efficiency and machining surface quality.
Tool path smoothing optimization is the key to solve such problems. At present,there are mainly two methods to realize smoothing optimization of tool path:Polynomial curve interpolation and spline curve fitting. The polynomial curve interpolation method requires all data points on the tool path to pass through,resulting in a large amount of calcula?tion and poor real-time performance. The spline curve fitting method replaces the traditional short line segment with a spline curve,and the tool path is more superior in terms of geometric accuracy,continuity and code length. Spline curve fitting main?ly includes Bezier curve fitting,PH curve fitting,Bspline curve fitting,non-uniform rational B-spline(NURBS)curve fitting and so on[1]. Among them,NURBS curve fitting provides a common mathemat?ical form,which is used to accurately represent stan?dard analysis shapes,free curves and curved surfac?es. It is the mainstream method of current tool path smoothing optimization research.
Many scholars at home and abroad have used NURBS curves to study tool path smoothing.Ref.[2]divided the curve into several small line seg?ments by identifying sharp corners,and used the feed rate modification equation to adjust the feed speed for interpolation,and the effectiveness of the algorithm were verified through experiments.Ref.[3]used the least square progressive and itera?tive approximation(LSPIA)algorithm to iterative?ly optimize the NURBS curve,which improved the fitting accuracy of the NURBS curve. Refs.[4-6]used different iterative methods for the parameter in?crement of the sampling period of the NURBS pa?rameter curve,which improved the NURBS fitting accuracy and calculation efficiency. Refs.[7-8]ob?tained a good path curve smoothness by correcting the acceleration and jerk of the drive axis in the sen?sitive area of the NURBS tool path feed contour.Based on work coordinate system(WCS),synchro?nization parameters between the bicubic NURBS curve of the tool tip translation trajectory and the tool axis rotation trajectory and the corresponding line segments were constructed,and a five-axis an?gular smooth transition algorithm is proposed[9].Aiming at the change of machining speed caused by contour error,a NURBS curve interpolation algo?rithm with adaptive acceleration and deceleration control in the sensitive region of feed speed muta?tion was proposed[10]. Ref.[11]proposed a NURBS curve interpolation method with real-time flexible acceleration/deceleration control,which verified the smoothness and effectiveness of the interpolation.The above methods mainly focus on the control of fitting errors,but ignore the curvature fluctuations caused by the accuracy of the original nodes.
In the research on node division,part of the re?search adopted the interval equal division method,which divided the entire parameter space intonp+1 parts equally. The method can achieve a better fitting effect when the curvature changes little.Ref.[12]searched for a set of characteristic points that can characterize the unevenness of the curve by setting the threshold of the turning angle of adjacent short line segments. Ref.[13]analyzed the corners of adjacent short line segments and the double-chord error based on the data point model of the corner fea?ture to conduct node division. However,the above?mentioned research methods have poor fitting ef?fects in high-curvature curve fitting situations,which easily cause discontinuous and rapid rotation of the rotating shaft,affecting the smoothness con?trol of the feed speed.
This paper proposes a new NURBS curve fit?ting optimization method based on curvature smoothing preset point constraints. First,the short line segments generated by the CAM software are optimally divided into different segment regions,and then the curvature of the short line segments in each region is adjusted to make it smoother. Then,a point set reflecting the characteristics of curve cur?vature change is constructed as the control vertex of the fitted curve. Finally,based on these control ver?tices and the constraint conditions that require the fitting curve to strictly pass the curvature smoothing preset point,the new NURBS curve fitting method mentioned is used for fitting.
Because there are sharp points in the original design of the processing path,direct fitting the cut?ter location points will cause a smooth global transi?tion,which violates the design intention. There?fore,before the curvature smoothing pre-adjust?ment,it is necessary to optimally divide the short line segments generated by the CAM software into different segment regions,and then perform curve fitting for each region. This paper adopts a method based on the length ratio and the turning angle of ad?jacent short line segments. The length ratio and the turning angle between the short line segments are shown in Fig.1,wherePi,Pi+1,…,Pi+7are contin?uous data points,andLi,Li+1,… ,Li+6are the lengths between adjacent data points.
Fig.1 Length ratio and turning angle of adjacent short line segments
The arc curve is regarded as the fitting curve as the analysis object in order to simplify the descrip?tion in this section. The relationship between the fit?ting error and the length ratio of adjacent short line segments can be expressed as
whereLiandLi+1are the lengths of two adjacent short line segments,θis the turning angle fromLitoLi+1andξlrthe fitting error of the curve. The length ratio of adjacent short line segmentsεLi Li+1can be expressed as
Whenθis fixed,it can be seen thatξlrincreas?es with the increase ofεLi Li+1.
Assuming that two adjacent short line seg?ments have the same length,the relationship be?tween the fitting error and the turning angle of the adjacent short line segment can be expressed as
whereLis the length of the short line segment,θthe turning angle,andξtathe fitting error of the curve.Whenθincreases,ξtaalso increases.
The process of optimally dividing short line segments into different segment regions is shown in Fig.2 where the length ratio thresholdεrland the ro?tation angle thresholdεθdepend on the maximum al?lowable chord height error. At pointPi+4,according to the length ratio threshold and the corner threshold of the adjacent short line segments,the continuous short line segment chain is divided into two segment regions,which are represented by black and blue in Fig.1,respectively.
Fig.2 Process of optimally dividing short line segments into different segment regions
From the viewpoint of CNC machining,the smaller the curvature or the smaller the curvature fluctuation is,the smoother the feed speed and the easier the processing speed will be,which is benefi?cial to the vibration suppression of the machine tool.Considering that the curvature of the fitted curve by the conventional method fluctuates greatly,fitting the curve first and then smoothly,the curvature will produce a large amount of computation. This sec?tion uses a curvature smoothing pre-adjustment method to pre-adjust the original cutter position point,which is used to obtain the smallest fluctua?tion of curvature. Since it is meaningless to directly discuss the curvature of the broken line tool path composed of short line segments,this method uses three non-collinear points as a circle to estimate the curvature of the fitted curve. When the radius of the circle made is smaller than a certain threshold,the fitting error is used as a constraint condition to ad?just the position of the intermediate point,thereby adjusting the radius of the circle,and the adjustment range can be used as a parameter of curvature smoothing. The adjusted point is referred to herein as the curvature smoothing preset point.
Fig.3 shows the pre-adjustment of the radius of curvature of the three-point fitting curve in the order ofPi,Pi+1andPi+2,anddρis the pre-adjusted dis?tance.RandOare the radius and center of the circle made by three points. The calculation process of the curvature smoothing preset point is shown in Fig.4.The minimum machining circle radiusRεdepends on the actual machining conditions,and the allow?able radial errorξpdepends on the process require?ments. The pre-adjusted distancedρis the distance moved by the intermediate pointPi+1toward the centerO. This parameter can be used as a process?ing optimization coefficient for setting according to process requirements during processing. If the ma?chining process requires high machining accuracy,it can be set to a smaller value or zero. If the process?ing technology requires high stability,it can be set to a larger value until the allowable valueξpof the fitted radial error. In this paper,the calculation ofdρtakes another way,which is shown in Fig.4.
Fig.3 Pre-adjustment of curvature of the fitting curves made by the sequence of three points
A NURBS curve can be expressed in rational fractions. Suppose thatR(u) represents a NURBS curve and is expressed as
whereVirepresents the control point,withe weight ofVifactor,pthe degree of NURBS,n+1 the number of the control points,uthe interpolation pa?rameter,andNi,p(u)thepth order canonical Bspline basis functions.widetermines the degree of influence ofVion the shape of the curve. Since there is no analytical relationship betweenwiand the change of the curve,wi= 1(i= 0,1,…,n)is generally used to simplify the calculation,after which the NURBS curve degenerates into a Bspline curve. Generally,in order to facilitate engi?neering applications,the value ofpis two or three.This paper will establish a data point set that can characterize the basic shape of the curve and the characteristics of the concave-convex shape,calcu?late the required node vector,and finally adjust the coordinates and number of the control verticesVito change the curve geometry and meet the require?ments of accurate fitting.
1.3.1 Method for screening trajectory featurepoints in segmented regions based on in?flection points and curvature extreme points
According to the aforementioned curvature smoothing pre-adjustment method,a set of trajecto?ry characteristic data points composed of curvature smoothing pre-adjustment points,start point and end point can be established. In order to fully reflect the basic shape of the curve and the characteristics of the concave-convex shape,the data point set needs to be further expanded.
(1)Inflection point judgment method
The inflection point can reflect the concaveconvex morphological characteristics of the curve,and it is widely used in the field of shape analysis.This section starts from the definition of the inflec?tion point,searches,distinguishes and initially ob?tains the inflection point in the continuous short line segment by calculating the change trend of the curve near a certain point on the curve. Suppose two pointsP1(x1,y1)andP2(x2,y2)on the plane,speci?fy the direction of the directed line segment asP1P2,and the points on the plane that are not on the straight lineP1P2are divided into two categories.The inner point aboutP1P2is the point on the clock?wise side of the straight line where the directed line segment is located;the outer point aboutP1P2is the point on the counterclockwise side of the line.The direction discriminant formula for the direction of pointP(x,y)is expressed as
For any pointP(x,y),we can obtain as fol?lows:
②WhenD12(x,y)> 0,P(x,y)is the outer point ofP1P2;
③WhenD12(x,y)= 0,P(x,y)is onP1P2.
Fig.5 reflects all cases whereP(x,y)is rela?tively inside and outside.
Fig.5 Judgement of point position
For the inflection point,it must be judged in a continuous time series point,and the concavity and convexity of the curve can be determined for three points on the curve that are not on the same straight line. Therefore,for the inflection point judgment,at least four consecutive points are required. Fig.6 shows the judgment of the inflection point ofP3(x3,y3),whereP1(x1,y1),P2(x2,y2),P3(x3,y3),P4(x4,y4)are four consecutive points. CalculateD12(x3,y3)andD23(x4,y4),respectively. IfD12(x3,y3)?D23(x4,y4)< 0,P3(x3,y3)is the inflection point of the curve.
Fig.6 Judgment of inflection point
For the spatial line segment,you can first proj?ect the short line segment chain to theXY,YZ,andZXplanes,and then judge the inflection point.As long as the point is judged to be an inflection point on the projection curve in any plane,it can be considered as an inflection point on the fitting curve in the space where it is located.
(2)Feature data point set selection
Since the inflection points can only reflect the overall concave and convex features of the NURBS curve,for the concave and convex features between the inflection points, the corresponding feature points must also be extracted. The extreme points of curvature can reflect the concave and convex char?acteristics of the curve,and are widely used in path trajectory planning. Theoretical analysis and experi?ments have proved that if the NURBS curve is di?vided into intervals by each node of the node vector,there is at most one point of the maximum curvature in any one interval[14]. The inflection point is the node of the NURBS curve,so the maximum curva?ture point can be used to determine the concave and convex characteristics of the curve between the in?flection points. Finally,the initial feature data point set is composed of the starting point,the end point,the curvature smoothing preset point,the inflection point,and the maximum curvature point between the inflection points.
LetP={P0,P1,…,Pl}be a set of continu?ous discrete tool position points,wherelis the num?ber of the points,and the selection steps of the fea?ture data point set are as follows:
When I graduated from the U.S. Merchant Marine5 Academy in 1969, my educated dad was happy. Standard Oil of California had hired me for its oil-tanker fleet. I had a great career ahead of me, yet I resigned after six months with the company and joined the Marine Corps6 to learn how to fly. My educated dad was devastated7. Rich dad congratulated me.
①Estimate the radius of curvatureRiof the pointPion the original short line segment chain based on the three-point circle,where 0
②Use the curvature smoothing preset method to smooth the required curvature and obtain the cur?vature smooth preset point.
③Apply the inflection point discrimination method to filter out the inflection point.
④Apply the fast numerical algorithm of microneighborhood analysis[15]to extract the local maxi?mum points of curvature between inflection points.
The points obtained according to the above steps,together with the start point and the end point of the original cutter position points,form the initial characteristic data point set of the curve to be fittedQ={Q0,Q1,…,Qm},whereQ∈P,m≤l.
1.3.2 Node vector based on centripetal parame?terization
In the parametric curve fitting problem,the dis?tribution principle of the node vector valueuiis not unique. For the same set of value points,even if the same curve fitting algorithm is used,curve trajecto?ries with different fitting effects will be obtained un?der different allocation principles. Reasonable pa?rameterization can ensure that the coefficient matrix is reversible when solving the control points in the reverse direction,and the equation system will not produce ill-conditioned solutions,and at the same time make the generated curve smoother. Centripe?tal parameterization of type value points is a relative?ly reasonable parameterization method. Under the condition of centripetal parameterization,the differ?ence between the parameter values of adjacent points is the ratio of the square root of the curve length at the two points to the square root of the en?tire curve length. Because the length of the NURBS curve cannot be accurately calculated,generally the sum of the lengths of all short line segments be?tween the two value points is approximated as the curve length. Combined with the parameter normal?ization requirements,there are the following
wherem+1 is the number of initial feature data points,Lt-1,tthe length of the short line segment be?tween adjacent feature points,andLsumthe sum of square roots of the length of the curve from the start point to the end point of this segment region.Lt-1,tandLsumare expressed as
whereQiis the initial feature data point. In this pa?per,we select the B-spline basis function of degree three,and calculate the node vectorUof the NURBS curve from Eqs.(6—8).Uis expressed as
1.3.3 New NURBS fitting method based on cur?vature smoothing preset point constraint
The general least squares NURBS curve fitting does not pass through the intermediate data points except for the start and the end points,but this easi?ly makes the radius of curvature of the fitted curve fluctuate larger,which causes the fluctuation of the feed speed to become larger. In this paper,we use a least squares NURBS curve fitting algorithm[16]. In the process of algorithm implementation,we select the weight factorwi= 1(0≤i≤n),the degreep=3,and the node vectorU=[0,0,0,u0,u1,u2,…,um-1,um,1,1,1]T. On this basis,we use the established initial feature data point setQto cal?culate a set of control verticesV,and we propose a new NURBS fitting algorithm based on curvature smoothing preset point constraints to perform curve fitting on the selected initial data points. The curve is required to pass the curvature smoothing preset point accurately to ensure fitting accuracy during fit?ting.
From the normative nature of NURBS and the weighting factorswi= 1(0 ≤i≤n),we can see that for eachQk(0 ≤k≤m),there is a corre?sponding pointR(uk)on the NURBS fitting curve,whereuk(0 ≤k≤m)is the corresponding parame?ter value. The NURBS curve fitting equation is ex?pressed as
According to the parameter properties of NURBS,we can conclude that the basis function degreep,the number of control pointsn+ 1,and the number of nodesm+ 1 satisfy
The initial number of control points ism-pob?tained from Eq.(11).
In the fitting process,since the number of nodes is greater than the number of control points,there must be a fitting deviation betweenQkandR(uk),which is expressed as follows
For the sake of simplicity,Eq.(12) is ex?pressed in matrix form as follows
where
In equations,QandNare known,andVis to be solved.Whenm>n,the fitting problem re?quires the residual vector of the over-determined Eq.(13)to be the smallest under a certain norm||r||t,which is expressed as follows
For the curvature smoothing preset point,the fitting curve must pass them accurately,which is ex?pressed as follows
Usually ||r||ttakes 2 norm and Eq.(15)can be converted to a linear least squares problem,to en?sure that Eq.(14)is differentiable toV. When rank(N)=n(n According to the aforementioned node division method,that is,the selection of trajectory feature points,it can be ensured that each inner node inter?val in the defined domain contains at least one dis?crete point. Therefore,the matrixNTNis positive definite,the Gaussian elimination method or LU de?composition method can be used to solve the linear equations to obtainV,whereVican be two-dimen?sional coordinates (x,y) or three-dimensional space coordinates(x,y,z). The NURBS curve fitted based on the selected set of characteristic data points does not necessarily pass other characteristic points and other non-charac?teristic points except for the curvature smoothing preset point,so cutter position point deviation and chord height error may still exist. When these errors exceed the allowable range,this paper uses the me?dian method to insert new feature points before and after the cutter position points that cause the devia?tion to obtain a new type value feature point set.Then update the node vector and the number of con?trol points,and re-calculate the NURBS fitting cal?culation until all the cutter position point deviations meet the requirements. In addition,it is also neces?sary to consider that the discontinuities at the con?nection points of different curve fitting segments still cause sudden acceleration in the processing pro?cess. In order to ensure the continuity required in the design at the connection point of the fitting seg?ment,cubic curve interpolation or Bezier curve in?terpolation is used to smooth the transition between curves[17]. In order to verify the effect of the curve fitting optimization algorithm proposed in this paper,a sec?tion of NURBS curve with known parameters is se?lected,and the CAD/CAM discretizes it into a tool path connected by short line segments. The pro?posed algorithm is used to re-fit the curve,and ana?lyze the fitting error and curvature fluctuation by comparing with the original NURBS curve. As shown in Fig.7,the original design curve to be processed comes from the dxf file generated in AutoCAD software. The NURBS parameters are as follows:p= 3,wi= 1,i= 0(0 ≤i≤n),the number of control pointsn+1 = 8,the number of nodesm+1 = 12. The experiment uses MAS?TER CAM software to generate NC code,sets the dispersion tolerance to 10 μm, and generates 100 G01 short line segments,involving 101 cutter position points. For CAM software,theoretically,the path cutter position point after the NURBS curve is discretized on the curve. However,the NURBS curve must have a chord height error com?pared with the original design curve. Fig.8 shows the original NURBS curve and discrete cutter posi?tion points directly displayed in a certain CNC sys?tem. After statistics,the chord height error of each discrete short line segment is all within 10 μm of the set error control value,as shown in Fig.9. Fig.7 A NURBS curve with known parameters in space Fig.8 Original NURBS curve and discrete cutter position points displayed by the CNC system Fig.9 Chord height error of discrete tool path of original NURBS curve According to the curve fitting optimization method proposed in this paper,NURBS fitting is performed on the above-mentioned trajectory of dis?crete short line segments. Considering that the ma?chining accuracy of the machine tool used in the ex?periment is generally 0.001—0.01 mm,the fitting error is set to 5 μm. Table 1 shows the results of NURBS fitting by dividing the short line segments into different segment regions. Due to the recon?struction of the node vector,the feature point set generated by the node division divides the original single-segment NURBS curve into four segments.The number of original feature points generated by each node vector is not the same. The number of feature points for generating the node vector is about 2/3 of that of discrete cutter position points,and the number of control vertices is about 1/3 of that of dis?crete cutter position points. Comparison of the trajectory error between the optimized fitting NURBS curve and the original NURBS curve is the best basis for evaluating the fit?ting effect. According to the equidistant parameters,the original NURBS curve and the optimized fitting curve are subdivided into 300 parts for curve draw?ing. Fig.10 shows the fitting error of the curve after optimized fitting,and Fig.11 is a histogram of fit?ting error distribution. It can be seen from Fig.10 that most of the fitting errors are distributed below 3 μm,and the maximum error is about 5 μm. Com?pared with the maximum chord height error of 10 μm for discrete tool path of original NURBS curve in Fig.9,the fitting accuracy is doubled. Fig.10 Fitting error of discrete tool path of the optimized NURBS curve Fig.11 Fitting error distribution histogram In the case of continuous short line segments,for cutter position points with a large radius of curva?ture,the interpolation speed is more limited by the maximum feed rate of the machine tool,and less limited by the normal acceleration. For cutter posi?tion points with small curvature radius,the slight change of the coordinates of the curvature smooth?ing preset point has a great influence on the curva?ture radius. Two results are shown in Fig.12,where the continuous line represents the radius of curvature calculated directly according to the origi?nal NURBS curve,and the dashed line represents the radius of curvature calculated after the curvature smoothing pre-adjustment process. From Fig.12,we can conclude that the curvature of the cutter posi?tion point with a small curvature radius can be effec?tively increased,and the curvature fluctuation can be reduced. Fig.12 Curvature smoothing pre-adjustment result In Table 2,P0,P1andP2are three consecutive points in the plane that constitute two short line seg?ment trajectories. After calculation,the radius of curvature before adjustment is 53.984 mm. Finetune theXcoordinate ofP1to 0.002 mm according to the curvature smoothing method,the adjusted ra?dius of curvature is 121.025 mm,and the radius of curvature is expanded by about 2.24 times. Under the same constraint of the feed normal acceleration of the machine tool,according to the proportional relationship between the maximum feed rate and the square root of the radius of curvature,it can be con?cluded that the planned feed rate at this point is in?creased to 1.5 times the original feed rate. There?fore,curvature radius of a point on the high curva?ture part of the curve becomes larger after the curva?ture is pre-adjusted,which has a positive effect on reducing the fluctuation of the high curvature curve.In addition,because of the increase in the curvature radius,the speed planned at this point will also in?crease under the condition that the normal accelera?tion of the machine tool remains unchanged,which has a positive effect on improving the processing speed. Table 2 Comparison of curvature radius before and af?ter three?point curvature smoothing preset For the current high-speed five-axis NC ma?chining,the problem of interpolation impact still ex?ists in the high curvature area of the NURBS fitting tool path. This paper proposes a new NURBS curve fitting optimization method based on the curvature smoothing preset point constraint. Through the fit?ting comparison experiment,the following conclu?sions are drawn. (1)Adjusting the radius of the fitting circle of any three consecutive non-collinear points in the short line segment chain can reduce the curvature fluctuation of the fitted curve. (2)The proposed NURBS curve fitting opti?mization method can improve the fitting accuracy of the curve and reduce the curvature fluctuation,thereby improving the speed stability of the curve in?terpolation. (3)The results of the fitting example show that the accuracy of curve fitting is doubled,the cur?vature fluctuation of the high curvature part of the fitted tool path is reduced,and the feed speed is in?creased,which verifies the effectiveness of the pro?posed method.2 Fitting Experiment and Analysis
2.1 Fitting error analysis
2.2 Curvature volatility analysis
3 Conclusions
Transactions of Nanjing University of Aeronautics and Astronautics2021年3期