- About this Journal ·
- Abstracting and Indexing ·
- Aims and Scope ·
- Annual Issues ·
- Article Processing Charges ·
- Articles in Press ·
- Author Guidelines ·
- Bibliographic Information ·
- Citations to this Journal ·
- Contact Information ·
- Editorial Board ·
- Editorial Workflow ·
- Free eTOC Alerts ·
- Publication Ethics ·
- Reviewers Acknowledgment ·
- Submit a Manuscript ·
- Subscription Information ·
- Table of Contents

Advances in Mechanical Engineering

Volume 2013 (2013), Article ID 974152, 9 pages

http://dx.doi.org/10.1155/2013/974152

## Look-Ahead Algorithm with Whole S-Curve Acceleration and Deceleration

School of Mechanical Engineering and Automation, Beihang University, Beijing 100191, China

Received 5 April 2013; Accepted 12 May 2013

Academic Editor: Shao Zili

Copyright © 2013 Youdong Chen et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

Tool paths of a complex contour machining generated by commercial CAD/CAM systems are mainly composed of many short linear/circular blocks. Though the look-ahead algorithms can improve speed and accuracy in the machining of short linear/circular segments, most of them just deal with linear segments with trapezoid acceleration and deceleration (acc/dec). In addition, the look-ahead algorithms with S-curve acc/dec are too complex to adopt the equivalent S-curve profile by approximation algorithm. To increase the smoothness of feedrate profile and machining efficiency of continuous short line and circle machining, this paper presents a feedrate profile generation approach and corresponding look-ahead algorithm with whole S-curve acc/dec. With the proposed look-ahead scheme, the feedrate profiles with S-curve acc/dec can work efficiently in a lot of short line and circle segments. Thus, the machining productivity can be increased and the feedrate profiles are smooth. The simulation and experiments verify the feasibility and validity of the proposed approach.

#### 1. Introduction

Tool paths are currently generated by commercial CAD/CAM systems. Curves are usually approximated to a number of linear/circular blocks in CAD/CAM systems according to the feedrate and accuracy in CNC machining. During high-speed machining, the rapid and abrupt change of direction at the corner between two adjacent blocks causes vibration which is harmful to the machine mechanics and the surface finish. Therefore, to maintain the machining quality, the feedrate at the corner is set to zero in conventional NC machining, which may lead to low efficiency.

To maintain the machining quality and improve the efficiency with multiple paths within machining parameter constraints, many approaches have been proposed. One of approaches is parametric interpolation algorithms [1, 2], which generates a curved cutter path directly without segmentation contour processing. However, the computation load is heavy and inevitable errors are introduced by employing a truncated Taylor series. At the same time, there are a lot of actual workpieces described by the linear and circular codes. Therefore, there is a need to research the linear and cicular interpolation algorithm.

One of the most efficient approaches is look-ahead interpolators. In order to keep the feedrate continuity, it looks ahead several paths to detect the sharp corners of paths and overrides the feedrate profile instead of planning the individual path with an acc/dec profile. References [3–7] proposed an approximation method which fit continuous short line blocks into parametric curves before interpolation. Feedrate fluctuations associated with the approximation errors should be limited in this method. Zhang et al. [8] presented a multiperiod turning method to improve the feedrate at the junctions using the linear acceleration and deceleration mode. But this method is only applied to micro line segment. Some velocity planning approaches have been proposed in [9–12]. All these methods used linear acc/dec algorithm, which usually exhibits a jump in acceleration at the beginning and the end of velocity adaptation phase. S-curve acc/dec with better servo instantaneous characteristic is used in look-ahead algorithm [13, 14]. However, it is too complex to adopt the equivalent S-curve profile by approximation algorithm. It is not a whole S-curve profile, which may lead to overshoot for large acceleration.

It should be noted that the path lengths are arbitrary in the usual NC programming. All these look-ahead algorithms mentioned are only used for continuously microline segments. This paper proposed a look-ahead interpolation algorithm with the S-curve acc/dec for continuous linear/circular segments. During the motion, the feedrate profiles are constructed and checked within the machining constraints and the discretization of path with S-curve acc/dec. In addition, the paths of arbitrary length are also considered during interpolation.

This paper is organized as follows. In the next section, feedrate profile formulations with S-curve acc/dec are derived. Section 3 details the look-ahead algorithm. Simulation and experiments with the proposed look-ahead scheme are given in Section 4. Finally, a conclusion is given in Section 5.

#### 2. Feedrate Profile Formulation

##### 2.1. Discretizing the Normal S-Curve acc/dec

S-curve acc/dec can avoid mechanical shock imposed on the servo system and get stable motion along the tool path. Figure 1 shows the kinematics profiles used in the normal S-curve acc/dec. The profiles can be divided into acceleration-speed zone, constant-speed zone, and deceleration-speed zone. For the motion along the tool path, accelerations have trapezoidal profiles with prespecified slopes values. The maximum allowable acceleration and deceleration are and , respectively.

Considering Figure 1, the starting point feedrate is , the end point feedrate is , the desired feedrate is , the starting and end point acceleration is zero, the maximum allowable jerk at acceleration-speed zone is , and the maximum allowable jerk at deceleration-speed zone is . The normal S-curve acc/dec has seven regions with time (), , ; , , , , and are integral, and is the sample period. The travel length is . If the feedrate profile is symmetrically smooth, is equal to . In the traditional CNC system, the times , and are prespecified. If there is acceleration or deceleration, the acceleration time or deceleration time are the prespecified constants, which may reduce efficiency. The accelerations and and the jerks and are prespecified in terms of machine mechanics.

###### 2.1.1. Determination of the Numbers of Interpolation Steps for Each Region

At the acceleration zone, the desired feedrate is obtained as follows:

By imposing the jerk limits values on and maximum allowable acceleration , is obtained as follows: If there is , we can modify to make ; That is, Similarly, at deceleration zone, can be obtained as follows: If , then

and can be obtained by (2) and (5), respectively. If is changed, and are calculated by determined by (7).

Given the numbers of interpolation steps for all regions (except the constant-speed region) specified, the travel length is obtained as follows:

Then the number of interpolation step for constant-speed region is calculated as follows:

The numbers of interpolation steps for different regions are expressed as

is rounding. There are three ways to eliminate rounding error. One is to change the desired feedrate . The other is to alter starting point feedrate . The third is to modify the end point feedrate .

###### 2.1.2. Modifying the Desired Feedrate

If the feedrate is modified to , it can be obtained from (8), as follows:

The jerk at acceleration-speed zone can be recalculated from (1):

Similarly, the jerk at deceleration-speed zone can be recomputed as follows:

The readjusted values of jerks and feedrate should not be greater than the maximum allowable values. Considering (9), (11), (12), and (13), the following in-equations are valid:

For the machining, the feedrate cannot be changed too drastically. Therefore, it is necessary to check the feedrate variation :

Then we can arrived at

For normal block, the value of is much greater than 1, so that the feedrate variation can be neglected.

The S-curve acc/dec sampled-data formulation for each region can be determined by the method stated in [15]. It is where

###### 2.1.3. Altering the Starting Point Feedrate

If the starting point feedrate is changed, is obtained as follows:

The starting point feedrate can be calculated from (8) as follows:

The jerk at acceleration-speed zone can be recomputed from (1):

The sampled-data formulations of S-curve acc/dec for each region are similar to (13). Considering (19), (20), and (21), there is a relationship as follows:

###### 2.1.4. Readjusting the End Point Feedrate

If the end point feedrate is modified, is obtained from (19). The end point feedrate is recalculated from (8) as follows:

The jerk at deceleration-speed zone can be derived from (3):

The sampled-data formulations of S-curve acc/dec for each region are similar to (13). Considering (19), (23), and (24), we can reach

We can adjust , , , , or to discretizing linear/circular path with S-curve acc/dec. This provides a way of calculating the trajectory machining parameters for look-ahead interpolation.

##### 2.2. Feedrate and Travel Length Constraints

In order to generate a feedrate profile, it is necessary to check the path which is a normal or short block. The normal block has acceleration-speed zone, constant-speed zone, and deceleration-speed zone, shown in Figure 1. The short block does not have constant-speed zone. The S-curve acc/dec sampled-data formulations of normal block are (17). The formulations of short block are similar to (17). According to the travel length, the path is divided into seven types. The normal block refers to Type 1. Types 2 to 7 belong to the short block. Type 1 should satisfy

Type 2 which has no constant-speed zone (that means is zero) is shown in Figure 2(a). It has an acceleration-speed zone and a deceleration-speed zone with constant-acceleration regions. It accelerates to a certain speed from starting point feedrate, then changes to deceleration-speed zone and reaches the end point at feedrate . With the travel length shortening, the time of constant-acceleration region is decreasing. In case of Type 2, the following equation should be satisfied:

Type 3 has neither constant-speed zone nor constant-acceleration regions (that means and are zero), as shown in Figure 2(b). Type 3 also has acceleration-speed zone and deceleration-speed zone. The difference between Type 3 and Type 2 is that Type 3 has no constant-acceleration regions. The condition in Type 3 is represented as follows: or

In case end point feedrate is equal to , Type 4 that has constant-speed and acceleration-speed zones is to accelerate to speed and keeps moving at this speed until end point is reached. Or if starting point feedrate is equal to , Type 4 that has constant-speed and deceleration-speed zones keeps moving at speed until the deceleration point is reached; then the speed decelerates to . Equation (29) needs to be satisfied for Type 4, as shown in Figure 2(c):

The difference between Type 5 and Type 4 is that the starting and end point feedrates of Type 5 are not equal to , as shown in Figure 2(d). If end point feedrate is greater than starting point feedrate , Type 5 accelerates to end point feedrate from starting point feedrate . If end point feedrate is less than starting point feedrate , Type 5 decelerates to end point feedrate from . In case of Type 5, (30) should be satisfied:

Without constant-acceleration region, Type 6 has only acceleration-speed or deceleration-speed zone, shown in Figure 2(e). It is checked as

If the travel length is short enough, the type of S-curve acc/dec refers to Type 7, shown in Figure 2(f). Starting with , Type 7 accelerates or decelerates to at the end point. Type 7 is tested as

##### 2.3. Corner Angle Constraints

The feedrate and its direction could be changed at the path turning point, which may cause acceleration. The acceleration that should be less than the maximum allowable acceleration is associated with the turning angle and the feedrate at the corner point. should meet the following [11]:

The corner angle is the angle between the path tangent of forward direction and the next path tangent at the turning point, shown in Figure 3. There are four different types at the turning point: line to line, line to arc, arc to line, and arc to arc. The corner angle between two consecutive path segments is given as

#### 3. Look-Ahead Scheme

The look-ahead algorithm which takes the characteristics of path, machine tool, and feedrate profile into consideration realizes the smooth transfer in interpath. The look-ahead scheme assures the smooth movement and the accessibility of the starting point and end point feedrates of each path.

The interpolation of G01, G02, and G03 codes can be achieved by adjusting starting point feedrate , end point feedrate , and feedrate according to the travel length and the machining parameters. There are three types of algorithm to adjust machining parameters.

*Algorithm A. *The interpolation can be achieved by modifying the starting point feedrate and jerk .

*Algorithm B. *The interpolation can be completed by adjusting the end point feedrate and jerk .

*Algorithm C. *The interpolation can be realized by recalculating the feedrate and jerks , , but the starting point and end point feedrates are not changed.

##### 3.1. Algorithm of Look-Ahead Scheme

In order to guarantee the accessibility of the starting point and end point feedrates of each path, the look-ahead scheme is realized as follows.

*Step 1 (calculating turning point feedrates). *The controller reads paths before interpolation and the look-ahead path number is determined by the controller. The starting point feedrate of the first path and the end point feedrate of last path are and , respectively. The feedrates at turning point are obtained by (35).

*Step 2 (dividing the paths into blocks). *Starting with the first path, the end point feedrates of each path are determined by Algorithm B in order until the last path. The break paths are checked and recorded. The break path whose travel length is so short that the path cannot be interpolated with the S-curve acc/dec is referred to as Type 7. The starting point and end point feedrates of the break path are set according to Type 7.

The paths are divided into blocks by break paths. All the paths lying in every two adjacent break paths are classified into one block. The starting point feedrate of the block is the end point feedrate of the front break path. The end point feedrate of the block is the starting point feedrate of the behind break path.

The longest perfect paths of each block are checked and recorded. The perfect path that can be determined by Algorithm C is referred to as the path in which the interpolation can be completed by adjusting feedrate and jerks , ; the starting and end point feedrates are not changed. Types 1 to 6 belong to the perfect path.

*Step 3 (determine the starting and end point feedrates). *Supposing paths belong to a block, is the longest perfect path, shown in Figure 4. Starting with the path , the end point feedrates of paths are determined by Algorithm B in order until the path . The end point feedrate of path and the starting point feedrate of the path are . Starting with , the starting point feedrate of path is determined by Algorithm A in the reverse order until the path . The starting point feedrate of path and the end point feedrate of path are . The starting point and end point feedrates of the longest perfect path are and , respectively. Since is perfect path, it can be interpolated by recalculating the feedrate and jerks , , the starting point and end point feedrates are not changed. Step 3 is repeated until all the blocks are treated and all the starting and end point feedrates of paths are recorded in the look-ahead buffer queue.

*Step 4 (real-time interpolation). *Take the first path in the look-ahead buffer queue. Calculate the time of every region with the S-curve acc/dec and compute the interpolation point in S-curve acc/dec sampled-data formulations. The movements of mechanics are executed according to the interpolation points. When the interpolation of current line is completed, Step 4 is repeated until all the paths are finished. The look-ahead scheme flowchart is shown in Figure 5.

#### 4. Simulation and Experiment

Several simulations and experiments applying the proposed approach were made on a CNC milling machine, in which m/min, m/s^{2}, m/s^{3}, and ms.

Table 1 shows the coordinates of the starting and end points of 10 small linear/circular segments describing a piece of 2D curve which is deliberately chosen to test the proposed look-ahead scheme. As shown in Figure 6, the first five paths are lines. The sixth path is a circle. There are two sharp corners from the seventh to the tenth path.

The feedrate profiles are shown in Figure 7. Without look-ahead scheme, it has always the acceleration and deceleration phases in each path and the machine tool never reaches the desired feedrate, as shown in Figure 7(a). With the proposed look-ahead scheme, although there are two sharp corners, the feedrate accelerates to desired feedrate and almost keeps moving in this speed until the end point, as shown in Figure 7(b).

The proposed look-ahead scheme can decrease the numbers of the break paths and zero feedrate. As shown in the first row of Table 2, the travel length of path 2 is too short. In [12–14], path 2 is a break path whose starting and end point feedrates are zero.

With this look-ahead scheme, path 2 is not a break path, as shown in Table 2. As shown in Figure 5, there are two sharp corners at the turning points of point 8 and 10. In [12–14], the end point feedrates of seventh and ninth path segment are zero. With this proposed look-ahead scheme, the end point feedrates of seventh and ninth path segment are not zero, as shown in Table 2. As a result, the machining time with the proposed look-ahead scheme was approximately 1 s, while the time without the look-ahead scheme was about 2 s, as shown in Figure 7.

The part shown in Figure 8 was machined on a five-axis machining center controller with an in-house developed CNC running on microC/OS-II real-time operation system. The experimental results showed that the machining time was dramatically shortened when the proposed approach is applied. Moreover, the feedrates are smoother than those without look-ahead approach and the final contour accuracy of the parts is satisfying.

#### 5. Conclusion

Look-ahead scheme is the key issue of high speed and high precision CNC machining for small paths. We propose a feedrate profile generation approach and corresponding look-ahead algorithm with whole S-curve acc/dec. The proposed look-ahead scheme can handle both small line and circle segments. The feedrate profiles generation effectively predetermines the numbers of interpolation steps for different regions and the discretion feedrate of the path with S-curve acceleration and deceleration. As a result, the look-ahead algorithms with S-curve acceleration and deceleration easily meet real-time requirements. The simulations and experiments showed that the proposed approach is feasible and effective.

#### Acknowledgments

The work presented in this paper was supported by the Major National S&T Program of China (Grant no. 2011ZX04002-151) and National 863 Program (Grant no. 2011AA04A104).

#### References

- D. C. H. Yang and T. Kong, “Parametric interpolator versus linear interpolator for precision CNC machining,”
*Computer-Aided Design*, vol. 26, no. 3, pp. 225–234, 1994. View at Scopus - M. Shpitalni, Y. Koren, and C. C. Lo, “Realtime curve interpolators,”
*Computer-Aided Design*, vol. 26, no. 11, pp. 832–838, 1994. View at Scopus - H. Yau and M. Kuo, “NURBS machining and feed rate adjustment for high-speed cutting of complex sculptured surfaces,”
*International Journal of Production Research*, vol. 39, no. 1, pp. 21–41, 2001. View at Publisher · View at Google Scholar · View at Scopus - M. Zhang, W. Yan, C. Yuan, D. Wang, and X. Gao, “Curve fitting and optimal interpolation on CNC machines based on quadratic B-splines,”
*Science China Information Sciences*, vol. 53, no. 1, pp. 1–12, 2010. View at Scopus - H.-T. Yau and J.-B. Wang, “Fast Bezier interpolator with real-time lookahead function for high-accuracy machining,”
*International Journal of Machine Tools and Manufacture*, vol. 47, no. 10, pp. 1518–1529, 2007. View at Publisher · View at Google Scholar · View at Scopus - J. B. Wang and H. T. Yau, “Real-time NURBS interpolator: application to short linear segments,”
*International Journal of Advanced Manufacturing Technology*, vol. 41, no. 11-12, pp. 1169–1185, 2009. View at Publisher · View at Google Scholar · View at Scopus - J. A. Tao, S. L. Gao, Q. N. You, and Q. Shi, “Lookahead and acceleration/deceleration algorithms for micro-line blocks machining,”
*Journal of Computer-Aided Design and Computer Graphics*, vol. 22, no. 9, pp. 1570–1586, 2010. View at Scopus - L. X. Zhang, R. Y. Sun, X. S. Gao, and H. B. Li, “High speed interpolation for micro-line trajectory and adaptive real-time look-ahead scheme in CNC machining,”
*Science China Technological Sciences*, vol. 54, no. 6, pp. 1481–1495, 2011. View at Publisher · View at Google Scholar · View at Scopus - L. B. Zhang, Y. P. You, J. He, and X. F. Yang, “The transition algorithm based on parametric spline curve for high-speed machining of continuous short line segments,”
*International Journal of Advanced Manufacturing Technology*, vol. 52, no. 1–4, pp. 245–254, 2011. View at Publisher · View at Google Scholar · View at Scopus - C. Lee, “Generation of velocity profiles with speed limit of each axis for high-speed machining using look-ahead buffer,”
*International Journal of Precision Engineering and Manufacturing*, vol. 11, no. 2, pp. 201–208, 2010. View at Publisher · View at Google Scholar · View at Scopus - J. Hu, L. Xiao, Y. Wang, and Z. Wu, “An optimal feedrate model and solution algorithm for a high-speed machine of small line blocks with look-ahead,”
*International Journal of Advanced Manufacturing Technology*, vol. 28, no. 9, pp. 930–935, 2006. View at Publisher · View at Google Scholar · View at Scopus - Y. Wang, L. Xiao, S. Zeng, Z. Wu, and S. Zhong, “Optimal feedrate model and solution for high-speed machining of small line blocks with look-ahead,”
*Journal of Shanghai Jiaotong University*, vol. 38, no. 6, pp. 901–904, 2004. View at Scopus - J. He, Y. You, H. Chen, and H. Wang, “A fast nested look-ahead algorithm with S-shape acceleration and deceleration,”
*Acta Aeronautica et Astronautica Sinica*, vol. 31, no. 4, pp. 842–851, 2010. View at Scopus - Y. N. Cao, T. M. Wang, Y. D. Chen, and H. X. Wei, “Application of pre-interpolation S-shape acceleration/deceleration in CNC look-ahead interpolation algorithm,”
*Journal of Beijing University of Aeronautics and Astronautics*, vol. 33, no. 5, pp. 594–599, 2007. View at Scopus - Y. Chen, H. Wei, K. Sun, M. Liu, and T. Wang, “Algorithm for smooth S-curve feedrate profiling generation,”
*Chinese Journal of Mechanical Engineering*, vol. 24, no. 2, pp. 237–247, 2011. View at Publisher · View at Google Scholar · View at Scopus