International Journal of Machine Tools & Manufacture 45 (2005) 433–444 www.elsevier.com/locate/ijmactool
Adaptive interpolation scheme for NURBS curves with the integration of machining dynamics Xianbing Liua,*, Fahad Ahmada, Kazuo Yamazakia, Masahiko Morib a
IMS-Mechatronics Laboratory, Department of Mechanical and Aeronautical Engineering, University of California, One Shields Avenue, Davis, CA 95616 5294, USA b Mori Seiki Co. LTD., 2-35-16, Meieki, Nakamura, Nagoya, Aichi 450-0002 Japan Received 27 July 2004; accepted 2 September 2004 Available online 14 November 2004
Abstract This paper develops a comprehensive interpolation scheme for non-uniform rational B-spline (NURBS) curves, which does not only simultaneously meet the requirements of both constant feedrate and chord accuracy, but also real-time integrates machining dynamics in the interpolation stage. Although the existing work in this regard has realized the importance to simultaneously consider chord error and machining dynamics, none has really incorporated these in one complete interpolation scheme. In this paper, machining dynamics is considered for three aspects: sharp corners or feedrate sensitive corners on the curves, components with high frequencies or frequencies matching machine natural ones and high jerks. A look-ahead module was developed for detecting and adaptively adjusting the feedrate at the sharp corners. By Fast Fourier Transform (FFT) analysis with a moving window in the interpolation stage identified were some special frequency components such as those containing high frequencies or with frequencies matching machine natural ones. Then, the notch filtering or time spacing method was used to eliminate these components. To more completely reduce feedrate and acceleration fluctuations, the jerk-limited algorithm was also developed. Finally, the interpolated feedrate was further smoothened with B-spline fitting method and the NURBS curves were re-interpolated with the smoothened feedrate. During the interpolation, the chord error was repeatedly checked and confined in the prescribed tolerance. Two NURBS curves were used as examples to test the feasibility of the developed interpolation scheme. q 2004 Elsevier Ltd. All rights reserved. Keywords: NURBS curves; Constant feedrate; Chord error tolerance; Machining dynamics
1. Introduction Parametric surfaces are extensively being applied to a wide range of industries such as automotive, aerospace and dies/molds. For machining, parametric surfaces are discretized into a set of parametric curves through a process called tool-path planning and then trajectory planning is executed to interpolate each curve. In this paper, the toolpath planning process is assumed finished and the interpolation for the parametric curves is the study concentration. There are different representations for parametric curves, mainly including Bezier, B-spline, cubic spline and non-uniform rational B-spline (NURBS). Among these * Corresponding author. Tel.: C1 530 754 7687; fax: C1 530 752 8253. E-mail address:
[email protected] (X. Liu). 0890-6955/$ - see front matter q 2004 Elsevier Ltd. All rights reserved. doi:10.1016/j.ijmachtools.2004.09.009
representations, NURBS have gained wide popularity to gradually become the industry standard [1] because they: † offer one common mathematical form for both standard analytical shapes (e.g. conics) and free-form shapes; † provide the flexibility to design a large variety of shapes; † can be evaluated reasonably fast by numerically stable and accurate algorithms; † are invariant under affine as well as perspective transformations; † are generalizations of non-rational B-splines, and nonrational and rational Bezier curves and surfaces. NURBS curves have been employed by many CAD/ CAM systems as a fundamental geometry representation because their evaluation is reasonably fast and
434
X. Liu et al. / International Journal of Machine Tools & Manufacture 45 (2005) 433–444
Fig. 1. A sample NURBS curve used for testing the developed interpolation scheme.
computationally stable. Hence to efficiently use the data inside the CAD systems, the solution is to develop a generic interpolator based on NURBS, which can handle any kinds of geometries. In this paper, a comprehensive interpolation scheme has been developed for NURBS curve interpolation. As shown in Fig. 1, a NURBS curve is used as one example to test the developed trajectory planning step by step. This curve consists of a straight-line segment and an arbitrary curve segment joining together at a sharp corner. The conventional approach for surface machining, which only provides linear and circular interpolators, use a sequence of linearized segments to approximate a curve. These linearized segments are subsequently sent to the CNC system [2–5]. This conventional approach leads to a large number of fluctuations in feedrate due to the segmentation and also produces large data file. For a general parametric surface machining, this method is inefficient and error prone. ‘Parametric interpolator’ has been proposed to overcome the shortcomings of the linear/circular interpolations and to improve the accuracy and efficiency of machining [6,7]. Generally, there are two kinds of implementations of parametric interpolation. Uniform interpolation was developed by Bedi et al. [8] by setting the curve parameter increment as a constant, in which the feed-rate is unable to be controlled, but the error tolerance requirement is satisfied in generating interpolation points. The second one called constant speed interpolation focuses on maintaining a constant feedrate along the curve. To reduce speed fluctuation during the interpolation process, Shpitalni et al. [7] and Huang et al. [9] developed the first-order approximation interpolation algorithms using Euler and Taylor’s expansions, respectively. These firstorder approximation interpolation algorithms provide a uniform curve speed during the interpolation process. Furthermore, the second-order approximation and speedcontrolled interpolation algorithms proposed by Yang and Kong [6] and Yeh and Hsu [10], respectively, yield more precise results. However, the erroneous quadratic term in the expansion leads to inefficiency in handling variable feedrates, as shown by Farouki and Tsai [11]. Also, the error
tolerance control is not explicitly incorporated into the interpolation scheme. For high quality machining, it is important to reduce feedrate fluctuation and to control chord error under certain tolerance, simultaneously. Combining the advantages of the above two algorithms, Yeh and Hsu [12] have developed an adaptive method. In their method, the feedrate will be required to be constant most of the time and will be changed only if the chord error exceeds the prescribed tolerance. However, none of the above-discussed algorithms has explicitly considered machining dynamics. For modern high-speed CNC machining process, machining dynamics is an important factor. For example, if the acceleration/deceleration in interpolation is out of machine capability, excessive vibration and fluctuation will deteriorate the machining quality. Traditionally, machining dynamics is left to the last stage at the CNC controller such as giving a fixed acceleration or deceleration rather than considered in the stage of trajectory planning stage. Different research efforts have been oriented to consider machining dynamics in trajectory planning stage. Basically, there are three considerations: sharp corners or feedrate sensitive corners on the curves, high jerks, and high frequency components or components with frequencies matching machine natural ones. Sharp corners along the trajectory are difficult to track for CNC controllers. Deceleration/acceleration at sharp corners is easily out of machine capability. Weck and Ye [13] combined Inverse Compensation Filter (ICF), which filtered out the high frequency components at sharp corners, and a zero phase error-tracking controller (ZPETC) [14] to achieve more accurate corner tracking. Butler et al. [15] approximated sharp corners by using arcs of smaller radius than the position feedback resolution and adjusted the acceleration/deceleration at the corners by slowing down the feedrate. High jerks mean dramatic changes on acceleration/ deceleration profile, which may be out of machine tool drivers’ ability. In order to obtain a smooth acceleration/ deceleration profile, some researchers have developed jerklimited trajectory planning. Erkorkmaz and Altintas [16] proposed a jerk-limited trajectory generation strategy for quintic spline interpolation, in which trapezoidal acceleration/deceleration profile along the tool-path was obtained by imposing limits on the second derivatives (jerk) of feedrate. Similarly, using trapezoidal acceleration/deceleration profile, Nam and Yang [17] developed a real-time procedure for generating jerk-limited kinematical profile. Yong and Narayanaswami [18] realized the importance of simultaneously achieving a uniform feedrate, confined chord errors and jerk-limitation. However, only the feedrate sensitive corners were considered in their paper. The parametric interpolator developed in their work confined chord errors to predetermined tolerances at these corners. The adjusted velocity profiles still contained sharp changes, which would result in large acceleration/deceleration fluctuations.
X. Liu et al. / International Journal of Machine Tools & Manufacture 45 (2005) 433–444
Another important factor neglected in the existing parametric interpolators is components containing high frequencies or frequencies matching the machine natural modes. If the cutting tool motion acceleration/deceleration profile contains high frequency components or components with frequencies matching the machine natural modes, uncontrollable vibrations will happen, which degrades the machining accuracy. As discussed above, Weck and Ye [13] used ICF to filter out the high frequency components at sharp corners. However, none of the existing interpolators has explicitly and systematically considered these undesired frequency components. This paper adopts adaptive-feedrate interpolation to confine chord error under a prescribed tolerance and keep constant feedrate at most of the time. The chord error will be checked through the whole interpolation scheme. During the adaptive interpolation, the interpolated trajectory is realtime checked by a look-ahead module for feedrate sensitive corners. If one sharp corner is met, re-interpolation will be employed to adjust the velocity profile in this zone to accommodate the machine’s acceleration/deceleration capability while simultaneously satisfying the chord error requirements. Those undesired frequency components discussed above should be identified explicitly and then removed. For this purpose, Fast Fourier Transform (FFT) analysis with a moving window is implemented to conduct frequency analysis on the acceleration/deceleration profile of the interpolated trajectory. The time intervals, in which the undesired frequencies occur, can also be observed. After the frequency analysis, notch filtering is applied to filter out those undesired components or time-spacing method is employed to slow down the motion in these zones to avoid these components. An alternative method to smooth acceleration/deceleration profile after the look-ahead module is the aforementioned jerk-limited planning, which is also incorporated into this study. Finally, a comprehensive parametric interpolation scheme is developed for NURBS curves.
435
2.1. NURBS curve and architecture of the interpolation scheme As mentioned above, the NURBS curve shown in Fig. 1 has been used to test the different modules of the developed interpolation scheme. This curve has the following parameters: Control points : ð0:0; 0:0; 0:0Þ ð0:2; 0:2; 0:0Þ ð0:4; 0:4; 0:0Þ ð0:5; 0:5; 0:0Þ ð0:8; 0:5; 0:0Þ ð0:9; 0:5; 0:0Þ ð1:3; 0:7; 0:0Þ Knot vector :
f0; 0; 0; 0; 0:5; 0:5; 0:5; 1; 1; 1; 1; 1g
Weights :
f1111111g
This research modifies the interpolation points according to sharp corners, velocity and acceleration/deceleration fluctuations real-time during the interpolation. The architecture of the interpolation scheme is shown in Fig. 2, which includes all the function modules discussed above. The inputs to the real-time NURBS interpolator are the geometric information, such as the knot vector, weights, control points and cutting conditions such as the feedrate. The basic idea is that † The adaptive method is implemented to conduct the first interpolation, in which feedrate is kept constant for most time and chord error is controlled under the prescribed tolerance; † The interpolated trajectory during the first interpolation is real-time checked by the look-ahead module for the feedrate sensitive corners. If one sharp corner is met, reinterpolation will be employed to adjust the velocity profile in this zone to accommodate the machine’s acceleration/deceleration capability while simultaneously satisfying the chord error requirements;
2. Development and implementation of the interpolation scheme This section firstly explains the NURBS curve used for the trajectory-planning test, the overall architecture of the planning scheme and the definition of chord error. Secondly, the adaptive feedrate interpolation algorithm is discussed, followed by the look-ahead module for sharp corners. Finally, this section presents the methods to reduce the acceleration/deceleration fluctuations: notch filtering or time spacing after FFT analysis with a moving window, and jerk-limited method. Fig. 2. Overall architecture of the developed interpolation scheme.
436
X. Liu et al. / International Journal of Machine Tools & Manufacture 45 (2005) 433–444
† To further reduce velocity and acceleration/deceleration fluctuations, there are two parallel ways: jerk-limited method and FFT analysis with a moving window plus notch filtering or time spacing. Inside these modules, chord error is checked and guaranteed under the prescribed tolerance. 2.2. Chord error To achieve high machining accuracy, chord error must be controlled during interpolation. There are two different methods for calculating the chord error. Eq. (1) is a direct and approximate method (as shown in Fig. 3(a)) based on the assumption of very small interpolation steps. ui C uiC1 Pðui Þ C PðuiC1 Þ (1) d z P K 2 2 The other method uses curve curvature to calculate the chord error as shown in Fig. 3(b) and expressed in Eq. (2) [1]. sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 2 L di Z ri K r2i K i (2) 2 where riZ1/Ki, ri and Ki are the radius of curvature and curvature at the parameter value ui, respectively. Li equals to kPðuiC1 ÞK Pðui Þk. The curvature Ki is given by the following equation. 2 dCX ðuÞ d2 CY ðuÞ Y ðuÞ d CX ðuÞ K dCdu uZui du du2 du2 Ki Z (3) dCðuÞ 3 du uZu i
This paper uses Eq. (2) to calculate the chord errors since it gives a more accurate result. 2.3. Adaptive interpolation algorithm As aforementioned, to produce smooth surfaces and to achieve high machining quality, the machining feedrate (V) should be constant when the cutting tool tracks the cutting trajectory. Also, the chord error has to be controlled under the prescribed value. The feedrate is one of the factors determining the chord error. Usually, the faster the feedrate, the larger the chord error. The adaptive method has been developed to achieve these two goals, in which the feedrate is kept to be constant at most of the time and the feedrate is
Fig. 3. Approximations of chord error.
adaptively adjusted when the chord error exceeds the predefined value. To keep the chord error within a tolerance range, the feedrate (V) along the curve has to be changed adaptively depending on the curvature during the interpolation process. The chord error is calculated according to Eq. (2). If this error is below the predefined value, the feedrate is kept unchanged. However, if the chord error exceeds the predefined value, the feedrate is adaptively adjusted so that the chord error does not exceed that value according to the following equation [12]. Vðui Þ Z
2 TS
qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi r2i K ðri K dmax Þ2
(4)
where TS is the sampling time and dmax the allowable maximum chord error. The calculated feedrate value is then substituted into Eq. (5) to calculate the next parameter value u from the previous value. Eq. (5) is obtained from Taylor expansion. V$TS ukC1 Z uk C qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi dx 2 dy 2 dz 2 C C uZuk du du du
2 2 2 dy d y 2 dx d x dz d z du $ du2 C du $ du2 C du $ du2 $ðV$TS Þ C ð5Þ dy 2 dz 2 2 dx 2 2 du C du C du uZuk Fig. 4 shows the chord error after the adaptive interpolation for the sample curve. From Fig. 4, one can see that the chord error has been confined less than 3 nm, which can satisfy most applications. Fig. 5 illustrates the velocity profile just after the adaptive interpolation. Except the period (about 5.8–7.2 s) when the chord error exceeds 3 nm tolerance and the feedrate is adjusted to confine the chord error, the feedrate is kept constant for most time. Fig. 5 also clearly shows an abrupt jumping in the velocity profile at the curve sharp corner. Sharp changes are also observed at the two ends of the adaptively adjusted zone. For smooth machining, the abrupt jumping should be removed and the sharp changes should be smoothened.
Fig. 4. Chord error profile just after adaptive interpolation.
X. Liu et al. / International Journal of Machine Tools & Manufacture 45 (2005) 433–444
437
After detecting a sharp corner, the re-interpolation algorithm is employed to re-plan the feedrate in this zone, which is explained as follows:
Fig. 5. Velocity profile only with adaptive interpolation.
2.4. Development of the look-ahead module for feedrate sensitive corners The abrupt jumping of velocity at the sharp corner makes machine almost impossible to follow (as shown in Fig. 5). In this paper, a look-ahead module is developed and embedded inside the adaptive interpolation part to simultaneously consider the requirement of confined chord error and the acceleration/deceleration capabilities of the machine at sharp corners during the interpolation. This module includes two parts: detection of the sharp corners and re-interpolation in the zones including the sharp corners. The detection algorithm for sharp corners is based on the first geometrical derivatives of the NURBS curve. Mathematically, a discontinuity of the first geometric derivative means a sharp corner on the curve. The first geometric derivatives are calculated based on the first parametric derivatives at the time of interpolation. In the developed interpolation scheme, the first parametric derivatives are numerically calculated as follows Dxi x K xiK1 Z i Dui ui K uiK1 Dyi y K yiK1 Z i Dui ui K uiK1
(6)
(7)
(1) The maximum allowable feedrate at the sharp corner is determined based on chord error tolerance by Eq. (4). In this paper, the maximum allowable feedrate is set to zero at the sharp corner for simplification. This means that the feedrate is firstly decelerated to zero and then accelerated to the desired value; (2) The starting point of deceleration and the end point of acceleration are determined with the consideration of the machine capability, which is similar to that used by Yong and Narayanaswami [18]. The difference between this paper and their work [18] is that the look-ahead module is integrated into the adaptive interpolation in real-time, which reduces the interpolation time; (3) From the stored position of the detected sharp corner, the interpolation shifts back by a certain number of interpolation points determined by the above two steps. For the sample NURBS curve (Fig. 1), the interpolation was shifted back 400 points; (4) The distance between the point denoting the sharp corner position and the point, which is 400 interpolation points before, is calculated; (5) The velocity at the point, which is 400 interpolation points before, is the commanded value or that determined by Eq. (4). The expected velocity at the corner point is that determined by Step 1. Hence, the required deceleration can be calculated; (6) Using the deceleration and the velocity at a particular point, the velocity at the next sample point can be calculated. This procedure is continued from the replanning starting point until the point representing the sharp corner is reached; (7) The acceleration stage after the re-interpolation reaches the sharp corner is developed in a similar manner. Fig. 6 shows the velocity profile of the sample NURBS curve (Fig. 1) after the adaptive interpolation
Therefore, the first geometric derivative can be obtained as Dyi y K yiK1 Z i Dxi xi K xiK1
(8)
At each interpolation point, the value of the first geometric derivative is compared with that at the previous interpolation point. If the difference between the two values is larger than a prescribed tolerance ER (Eq. (9)), this means that a sharp corner is hit. These two interpolation points are then stored and given to the re-interpolation part. DyiC1 Dyi (9) Dx K Dx R ER iC1 i
Fig. 6. Velocity profile after adaptive interpolation with the look-ahead module included.
438
X. Liu et al. / International Journal of Machine Tools & Manufacture 45 (2005) 433–444
Fig. 7. Chord error profile after adaptive interpolation with the look-ahead module included.
with the look-ahead module included. Compared to Fig. 5, it is observed that the abrupt jumping at the sharp corner position on the velocity profile has been eliminated. The deceleration/acceleration at this position has been planned according to the machine capability. It should be noted that the velocity is not exactly zero in the profile due to numerical error, although it is assumed zero during the replanning. The sharp changes (indicated by the circles in Fig. 6) in the velocity profile means dramatic jumpings in the acceleration profile, which also has to be avoided. Fig. 7 shows the chord error after adaptive interpolation with the look-ahead module included, which is confined less than 3 nm. Compared to Fig. 4, one can see the chord error keeps the same. 2.5. Methods for the reduction of velocity and acceleration fluctuations There are two parallel methods to further consider machining dynamics and reduce velocity and acceleration fluctuations. Notching filtering or time spacing based on FFT analysis with a moving window provides an explicit way to eliminate the components containing high frequencies or frequencies matching machine natural ones in the interpolated acceleration profile. Jerk-limited method smoothens the acceleration profile by re-planning the jerks of high magnitude. The following sections discuss these two methods in detail. 2.5.1. FFT analysis with a moving window It is important to avoid high frequencies or machine natural frequencies for achieving shock-free machining. This paper uses FFT routine with a moving Hamming window, whose size is 256 interpolation points, to analyze the frequencies of the acceleration at interpolation points after the first interpolation (referring to Fig. 2). The output of the first interpolation gives the interpolation points and the varying velocities along the curve. This is then used to calculate the accelerations of three axes, which is analyzed
by the FFT routine with a moving Hamming window in this paper. FFT is a discrete Fourier transform algorithm, which generally falls into two classes: decimation in time, and decimation in frequency. In this paper, decimation in time is used. Windows are used to selectively analyze the data record and truncate the record rather than to analyze the entire data record. Simply truncating the data by a rectangular window leads to the leakage effect, by which certain other frequencies are obtained in FFT results actually not present in the original signal. To avoid large discontinuities, the Hamming window was used in the research. The fundamental idea of the Hamming window is to gradually taper the data at the end of the record, and therefore to avoid the abrupt truncation by a rectangular window. For a record consisting of N points indexed from 0 to NK1, the appropriate equation for Hamming window is 2pn wðnÞ Z 0:54 K 0:46 cos ; 0% n% N K 1 (10) N K1 In this paper, the acceleration–time data are multiplied by the Hamming window and then analyzed by FFT. High frequency components can be observed directly from the FFT result. Comparing the analyzed frequencies with machine natural frequencies, one can identify unwanted frequencies, which will cause excessive vibration in machining, and the interpolation points where those unwanted frequencies happen. Fig. 8 shows the FFT analysis result of X-axis acceleration for the curve shown in Fig. 1. 2.5.2. Notch filtering Two methods have been used to avoid these unwanted frequency components after FFT analysis: notch filtering and time spacing. In notch filtering, the interpolation points only in those intervals where the undesired frequencies occur are filtered, and the rest of the interpolation points remain the same. There are two types of notch filters: finite impulse response (FIR) filter and infinite impulse response (IIR) filter. In this paper, an IIR filter, Butterworth IIR
Fig. 8. FFT analysis result of X-axis acceleration after the first interpolation.
X. Liu et al. / International Journal of Machine Tools & Manufacture 45 (2005) 433–444
439
Fig. 9. Contour error caused by notch filtering.
Fig. 11. Acceleration profile just after adaptive interpolation and the lookahead module.
bandstop filter of order 4, was chosen. The transfer function of an IIR filter is given by the following equation PLK1 Kl lZ0 bl z HðzÞ Z (11) PMK1 1 C mZ0 am zKm
2.5.3. Time spacing The second approach, which is called the time spacing method, is to slow down the cutting tool in those time intervals. The detailed algorithm of timing spacing method is summarized as follows.
where the filter coefficients am and bl were obtained by MATLAB. With notch filtering, one major drawback is the induced contour error due to time delay. Fig. 9 shows the contour error along the trajectory of Fig. 1. For testing purpose, 10 and 20 Hz were assumed to match two natural frequencies of an imagined machine tool. The maximum contour error reaches around 4 mm, which is pretty big and is mainly caused by the time delay during filtering. Also, the velocity profile is distorted and has large fluctuations, which will lead to large changes of acceleration. Therefore, although notch filtering removes the undesired frequencies, it results in large contour error and large fluctuations in velocity and acceleration. However, the introduction of FFT analysis with a moving window in the interpolation stage is very helpful to analyze the interpolation points in frequency domain and identify undesired frequency components. The developed FFT analysis module is portable in the interpolation scheme.
† Store the undesired frequencies and the interpolation points where the undesirable frequency components occur obtained from FFT analysis with a moving Hamming window; † Identify the first and last interpolation points of each interval where the undesirable frequencies occur; † A time spacing factor is decided based on the reduced distance traveled in each interval; † With Eq. (5), the increment of parameter u can be obtained. The increment of u will be reduced by multiplying the time spacing factor. In order to avoid abrupt change in velocity, in the beginning of the interval, the time spacing factor gradually decreases from 1 to the value decided by the above step. Then, the factor will keep this value. At the end of the interval, the time spacing factor gradually increases from the decided value to 1. Therefore, the velocity will smoothly change without any abrupt jumping.
Fig. 10. Velocity profile after time spacing modification.
Fig. 12. Acceleration profile after the time spacing re-interpolation.
440
X. Liu et al. / International Journal of Machine Tools & Manufacture 45 (2005) 433–444
some sharp changes in the velocity profile have be smoothened and therefore the acceleration changes at these points have been reduced. Fig. 11 shows the acceleration profile just after the adaptive interpolation and look-ahead module without the time spacing re-interpolation. Fig. 12 shows the acceleration profile after the time-spacing reinterpolation. Comparing these two figures, one can observe that the magnitude of the acceleration change has been reduced. However, the elimination of the fluctuations in the acceleration profile is not complete. Sharp changes or jumpings still present.
Fig. 13. Schematic of jerk-limited algorithm.
† At the end of the above step, the modified interpolation point may not match the one at the end of the interval from the previous interpolation. There are two ways to solve this issue. When getting close to the end of the interval, the points are compared with the corresponding points from the previous interpolation. If the points are the same or very close to each other, this interval will stop. The other way is to use the parameter value u at the end of the interval to re-interpolate. In this way, the motion of the cutting tool is slowed down in a smooth and continuous manner. Time spacing does not increase interpolation chord error. However, the acceleration for each axis is reduced. Fig. 10 shows the velocity profile after time spacing in the intervals with abrupt acceleration changes. Comparing Fig. 10 with Fig. 7, one can see that
2.5.4. Jerk-limited trajectory planning Alternatively, jerk-limited trajectory planning is another method to more completely reduce velocity and acceleration fluctuations. The basic idea behind the jerk-limited trajectory planning is that the jerk areas before and after the re-planning should be the same. This is done by modulating the time intervals in which high jerks occur. The high jerk change is reshaped as a rectangular profile with a specified constant jerk value. Fig. 13 illustrates this method. The jerk, acceleration, feedrate and distance profile before and after the jerk-limited trajectory planning are shown in the left and right side of the figure, respectively. Suppose the cutting tool is decelerating rapidly giving rise to an instantaneous jumping in the jerk value. The area under this jerk curve is found out and then reshaped as a rectangular region as shown in the right hand of Fig. 13. The new acceleration, feedrate and distance profile are then derived by integration to make sure that the final values of these parameters are the same as before. The detailed derivation of the jerk-limited trajectory planning is explained as follows. Approximating the instantaneous jerk change as a triangle, one can get the following relation equating the jerk areas before and after jerk reshaping. 1 !Jmax !Told Z Tnew !Jnew 2
Fig. 14. Jerk profile just after the adaptive interpolation and look-ahead module.
(12)
X. Liu et al. / International Journal of Machine Tools & Manufacture 45 (2005) 433–444
441
Fig. 15. Jerk profile after the jerk-limited re-planning.
where JmaxZMax instantaneous value of jerk ToldZTime interval in which this jerk occurs TnewZNew modified time interval JnewZNew constant value of jerk Therefore, the new jerk amplitude can be calculated by Jnew Z
Told !Jmax 2Tnew
(13)
If AnewZThe final acceleration value, Anew is the area under the jerk profile. That is Anew Z Jnew !Tnew
(14)
or
Fig. 17. Velocity profile after jerk-limited re-planning and further smoothening with a spline function.
or
Anew Z
Told !Jmax 2
(15)
If finitial and ffinal denote the initial and final feedrates, respectively, one can obtain acceleration by integration
1 ffinal Z finitial C !Anew !Tnew 2 Therefore, Tnew Z
1 2 ffinal Z finitial C !Jnew !Tnew 2
Fig. 16. Acceleration profile after the jerk-limited re-planning.
(17)
2 !ðffinal K finitial Þ Anew
(18)
(16)
Fig. 18. Another sample NURBS curve used in testing the developed interpolation scheme.
442
X. Liu et al. / International Journal of Machine Tools & Manufacture 45 (2005) 433–444
and the dramatic changes (as shown in Fig. 11) in the acceleration profile have been eliminated. Compared to the time spacing method (Fig. 12), the jerk-limited re-planning is more efficient in smoothening the acceleration profile and reducing the acceleration fluctuations. Fig. 17(a) shows the velocity profile after the jerk-limited trajectory planning. Comparing Figs. 6, 10 and 17(a), one can find that the velocity profile after the jerk-limited trajectory planning is the smoothest one, which is consistent with the observation of the acceleration profile. The chord error after the jerk-limited trajectory planning is the same as that shown in Fig. 7. One additional module in the developed interpolation scheme is the further smoothening of the obtained velocity profile after the jerk-limited re-planning with a spline function. Considered that the cutting tool starts acceleration from static in the actual machining, an initial planning for velocity has also been included in the interpolator. Fig. 17(b) shows the velocity profile after the further smoothening and initial planning. From this figure, one can see that one optimum velocity profile has been obtained. To further illustrate the efficiency of the developed interpolation scheme, another NURBS curve as shown in
Fig. 19. Jerk profiles before and after jerk-limited re-planning.
Similarly, by integrating the velocity, the distance traveled can be obtained as 1 3 Sfinal Z Sinitial C finitial !Tnew C !Jnew !Tnew 6
(19)
An optimum value of Tnew can be obtained by recursive calculation such that Sfinal is satisfied. The value of Tnew is used to calculate Jnew, which is then used to find out the new feedrate profile for calculating the new interpolation points. By this re-planning, the original linear or higher order jerk profile is replace by a constant. Therefore, the order of the acceleration and velocity profiles are correspondingly reduced, which will be easier for the machine controller to follow. Fig. 14 shows the jerk profile for the sample curve just after the adaptive interpolation and look-ahead module. From this figure, one can see that the changes of jerk are dramatic and sharp, and the magnitude of the jerk changes ranges from K120 to 40. After the jerk-limited re-planning, as shown in Fig. 15, the magnitude of jerks has dramatically decreased from K120 to 40 to K1 to 2. Also, the changes of the jerks are much smoother when compared to Fig. 14 without the jerk-limited re-planning. After the jerk-limited re-planning, the acceleration profile correspondingly becomes smoother (as shown in Fig. 16)
Fig. 20. Acceleration profiles before and after jerk-limited re-planning.
X. Liu et al. / International Journal of Machine Tools & Manufacture 45 (2005) 433–444
Fig. 18 was also tested. The parameters for this curve is as follows: Control points : ð0:02; 0:27;0Þ ð0:11; 0:36;0Þ ð0:19; 0:44;0Þ ð0:27; 0:52;0Þ ð0:35; 0:44;0Þ ð0:43; 0:36;0Þ ð0:52; 0:27;0Þ ð0:43; 0:18;0Þ ð0:35; 0:10;0Þ ð0:27; 0:02;0Þ ð0:19; 0:10;0Þ
443
As discussed above, the jerk-limited re-planning method is more efficient in reducing the fluctuations in the velocity and acceleration profiles than other methods do. The following will only present the re-interpolation results by the jerk-limited method. Figs. 19–21(a) show the jerk, acceleration and velocity profiles just after the adaptive interpolation. Figs. 19–21(b) show these profiles with the jerk-limited re-interpolation including the look-ahead module. From these figures, one can see that the magnitudes of jerk and acceleration have been reduced significantly after the jerk-limited re-interpolation. The abrupt jumpings in the velocity profile were replaced by the gradual deceleration and acceleration after the jerk-limited re-interpolation. All these modifications have made the interpolated trajectory much easier be followed by the CNC controller. Because this curve consists of four linear segments, the chord error is zero along the trajectory.
ð0:11; 0:18;0Þ ð0:02; 0:27;0Þ Knot vector :
ð0;0;0; 0;0:25; 0:25; 0:25; 0:5;0:5; 0:5; 0:75; 0:75; 0:75; 1;1; 1;1Þ
Weights :
f111111111111g
Fig. 21. Velocity profiles before and after jerk-limited re-planning.
3. Conclusions A comprehensive and generalized parametric interpolator for NURBS curves has successfully been developed, which simultaneously achieved a uniform feedrate at most of the time, confined chord error under the prescribed tolerance at every interpolation point as well as respecting the machine dynamic characteristics in the interpolation stage. Machining dynamics is considered for three aspects: sharp corners or feedrate sensitive corners of the curves, avoiding high frequency components or components containing frequencies matching machine natural ones in the interpolated trajectory and high jerks. In the trajectory planning method, a look-ahead module was developed to detect sharp corners on the NURBS curves. Then, the feedrate at these corners was modified by an acceleration and deceleration method to meet the chord error requirement and satisfy the machine acceleration and deceleration capability. For the first time, the interpolated points were analyzed by FFT with a moving window to identify the undesired frequencies. Then, notch filtering was utilized to selectively eliminate these frequency components in the interpolated points to avoid excessive vibrations in machining. Alternatively, a method called time spacing was to directly modify the feedrate and therefore eliminated the undesired frequency components in the interpolation points, which guaranteed the exact trajectory generation and shock free motion simultaneously. In order to reduce the fluctuations in the velocity and acceleration profiles, the jerk-limitation method was also planned in this paper. The algorithm for the real-time jerk-limitation planning in the interpolation has been discussed in detail. The developed interpolation scheme has effectively combined different important factors, which were considered separately in the existing researches. The simulation
444
X. Liu et al. / International Journal of Machine Tools & Manufacture 45 (2005) 433–444
result showed that the fluctuations in the velocity as well as acceleration profiles have been significantly reduced with the developed scheme. This interpolation scheme has simultaneously satisfied the requirement of chord accuracy, constant feedrate and machining dynamics for the first time. With this scheme, an optimum interpolation result can be achieved.
Acknowledgements The authors wish to express their sincere appreciation for the generous support from Mori Seiki Co., Ltd, which made this research possible.
References [1] D.F. Rogers, Introduction to NURBS: with Historical Perspective, Morgan Kaufmann, Los Altos, CA, 2000. [2] Y. Koren, Control of machine tools, ASME Transaction Journal of Manufacturing Science and Engineering 119 (1997) 749–755. [3] Y. Koren, C.C. Lo, M. Shpitalni, CNC interpolators: algorithm and analysis, ASME Winter Annual Meeting PED-vol. 64 (1993) 83–92. [4] J. Hwang, Interference-free tool-path generation in the NC machining of parametric compound surfaces, Computer-Aided Design 24 (1992) 667–677. [5] S. Kawabe, F. Kimura, T. Sata, Generation of NC commands for sculptured surface machining from 3-coordinate measuring data, Annals of CIRP 30 (1981) 369–372. [6] D.C.H. Yang, T. Kong, Parametric interpolator versus linear interpolator for precision surface machining, Computer-Aided Design 26 (3) (1994) 225–234.
[7] M. Shpitalni, Y. Koren, C.C. Lo, Real-time curve interpolators, Computer-Aided Design 26 (11) (1994) 832–838. [8] S. Bedi, I. Ali, N. Quan, Advanced interpolation techniques for CNC machines, ASME Journal of Engineering for Industry 115 (1993) 329–336. [9] J.T. Huang, D.C.H. Yang, A generalized interpolator for command generation of parametric curves in computer controlled machines, Japan/USA Symposium on Flexible Automation 1 (1992) 393–399. [10] S. Yeh, P. Hsu, The speed-controlled interpolator for machining parametric curves, Computer-Aided Design 31 (1999) 349–357. [11] R. Farouki, Y. Tsai, Exact Taylor series coefficients for variablefeedrate CNC curve interpolators, Computer-Aided Design 33 (2001) 155–165. [12] S. Yeh, P. Hsu, Adaptive-feedrate interpolation for parametric curves with a confined chord error, Computer-Aided Design 34 (2002) 229– 237. [13] M. Weck, G. Ye, Sharp corner tracking using the KF control strategy, Annals of CIRP 39 (1) (1990) 437–441. [14] M. Tomizuka, Zero phase error tracking algorithm for digital control, ASME Transaction Journal of Dynamics Systems, Measurement, and Control 109 (1987) 65–68. [15] J. Butler, B. Haack, M. Tomizuka, Reference generation for high-speed coordinated motion of a two-axis system, Symposium on Robotics, Winter Annual Meeting of ASME DSC11 (1998) 457– 470. [16] K. Erkorkmaz, Y. Altintas, High speed CNC system design. Part I. Jerk-limited trajectory generation and quintic spline interpolation, International Journal of Machine Tools and Manufacture 41 (2001) 1323–1345. [17] S. Nam, M. Yang, A study on a generalized parametric interpolator with real-time jerk-limited acceleration, Computer-Aided Design 36 (2004) 27–36. [18] T. Yong, R. Narayanaswami, A parametric interpolator with confined chord errors, acceleration and deceleration for NC machining, Computer-Aided Design 35 (2003) 1249–1259.