1 Introduction

In the process of manufacturing complex curves, curves are discretized into a series of continuous short lines. There will be high curvature or sharp corner at the junction of short lines. In order to generate a high-speed smooth path along the curve, corners must be planned.

The traditional interpolation algorithm can realize the continuous change of the speed between the short lines, the small amount of calculation is easy to apply. But the discontinuous acceleration at the corner will cause the vibration of the CNC machine tool and affect the quality of the processed parts. Some experts have given some solutions to solve this problem by using high-order spline curve, such as PH, NURBS, and Bezier [1,2,3]. The high-order spline can effectively reduce the vibration of the cutting tool and realize the uninterrupted feeding movement at the corner [4, 5], but the path speed planning of the spline needs to be done after the corner is transferred, and the calculation is complicated. Finite impulse response technology is proposed.

Finite impulse response technology has the characteristics of high efficiency and easy to be applied in hardware [6]. The technique generates a smooth feed profile through a filter. Starting with a simple reference signal, a series of integrators are combined with a suitable linear feedback controller to ensure that the feed motion is tracked in the fastest way. CS Chen et al. [7] proposed the finite impulse response filter can realize the real-time interpolation of feed and the generation of smooth trajectory. DI Kim et al. [8] proposed various digital filters were used to represent the convolution integral of the reference signal along the machining path to obtain the correct acceleration and deceleration algorithm, so that a single moving filter can obtain a constant acceleration, which can make the acceleration and speed transfer smooth. J W Jeon et al. [9] proposed that a single FIR filter was used to smooth the given feed signal by accurately calculating the coefficients of the filter. At the same time, this method was extended to all kinds of acceleration curves. B Sencer et al. [10] proposed that the cornering trajectory of the tool was generated by filtering the discontinuous axis speed command of FIR at the segment connection. P Besset et al. [11] proposed that the second-order trajectory was used to generate smooth jerk-constrained trajectories based on FIR filter. R Béarée et al. [12] proposed the FIR filter time method, and the jerk-limited profile was used to solve vibration problem by constant jerk-time. Y Altintas et al. [13] proposed that FIR filtering can produce unavoidable delay and induce large contouring errors in multi-axis motion; thus, contouring errors must be compensated.

In this paper, an accurate interpolation and contouring control algorithm based on FIR filters for the corner transition is proposed to determine the corner contour error and realize the smooth transition of the path of the corner. The maximum feed velocity constraint is established for a simple short reference path, and the third-order trajectory is generated by FIR filters. Then, the overlap time is determined by combining the speed at the corner and the given contour error. The maximum contour error of the corner is obtained in Sect. 2. The validity of proposed algorithms is tested by experiment in Sect. 3. The analysis is summarized in Sect. 4.

2 Maximum feed velocity constraint of continuous short lines

The schematic diagram of continuous short lines is shown in Fig. 1. The starting point of short line Pi − 1Pi coordinate is Pi − 1 = [Xi − 1, Yi − 1], and short-segment PiPi + 1 ends at Pi + 1 = [Xi + 1, Yi + 1]. The junction point of linear segment Pi − 1Pi and PiPi + 1 is Pi = [Xi, Yi]. Vxm is the maximum feed speed of X-axis. Vym is the maximum feed speed of Y-axis. Maximum feed speed of short-segment Pi − 1Pi is Vi − 1m. Maximum feed speed of short-segment PiPi + 1 is Vim. γ is the angle between short segments Pi − 1Pi and PiPi + 1. α is the angle between short segments PiPi + 1 and X-axis. β is the angle between short segments PiPi + 1 and Y-axis. Parameters of short line segment can be computed as:

$$ {\displaystyle \begin{array}{c}\overrightarrow{{\mathrm{P}}_{\mathrm{i}-1}{\mathrm{P}}_{\mathrm{i}}}=\left({\mathrm{X}}_{\mathrm{i}}-{\mathrm{X}}_{\mathrm{i}-1},{\mathrm{Y}}_{\mathrm{i}}-{\mathrm{Y}}_{\mathrm{i}-1}\right)\\ {}\overrightarrow{{\mathrm{P}}_{\mathrm{i}}{\mathrm{P}}_{\mathrm{i}+1}}=\left({\mathrm{X}}_{\mathrm{i}+1}-{\mathrm{X}}_{\mathrm{i}},{\mathrm{Y}}_{\mathrm{i}+1}-{\mathrm{Y}}_{\mathrm{i}}\right)\\ {}{\mathrm{L}}_{\mathrm{i}-1}=\left|\overrightarrow{{\mathrm{P}}_{\mathrm{i}-1}{\mathrm{P}}_{\mathrm{i}}}\right|=\sqrt{{\left({\mathrm{X}}_{\mathrm{i}}-{\mathrm{X}}_{\mathrm{i}-1}\right)}^2+{\left({\mathrm{Y}}_{\mathrm{i}}-{\mathrm{Y}}_{\mathrm{i}-1}\right)}^2}\\ {}{\mathrm{L}}_{\mathrm{i}}=\left|\overrightarrow{{\mathrm{P}}_{\mathrm{i}}{\mathrm{P}}_{\mathrm{i}+1}}\right|=\sqrt{{\left({\mathrm{X}}_{\mathrm{i}+1}-{\mathrm{X}}_{\mathrm{i}}\right)}^2+{\left({\mathrm{Y}}_{\mathrm{i}+1}-{\mathrm{Y}}_{\mathrm{i}}\right)}^2}\\ {}\upgamma =\operatorname{arccos}\left(\frac{\overrightarrow{{\mathrm{P}}_{\mathrm{i}-1}{\mathrm{P}}_{\mathrm{i}}}\cdot \overrightarrow{{\mathrm{P}}_{\mathrm{i}}{\mathrm{P}}_{\mathrm{i}+1}}}{\left|\overrightarrow{{\mathrm{P}}_{\mathrm{i}-1}{\mathrm{P}}_{\mathrm{i}}}\right|\times \left|\overrightarrow{{\mathrm{P}}_{\mathrm{i}}{\mathrm{P}}_{\mathrm{i}+1}}\right|}\right)\end{array}} $$
(1)
Fig. 1
figure 1

Diagrammatic sketch of short lines

The direction of the feed speed of Pi − 1Pi and PiPi + 1 may be different, which may cause the change of the feed. For the relationship between short-segment PiPi + 1 and each axis, the following conditions can be defined as

$$ \left\{\begin{array}{c}{\mathrm{V}}_{\mathrm{im}}\le \left|{\mathrm{V}}_{\mathrm{xm}}/\cos \left(\upalpha \right)\right|\\ {}{\mathrm{V}}_{\mathrm{im}}\le \left|{\mathrm{V}}_{\mathrm{ym}}/\cos \left(\upbeta \right)\right|\end{array}\right. $$
(2)

In order to achieve continuous feed motion, the short line needs to be completed within the sampling period of the driver. The maximum feed velocity needs to meet the following conditions:

$$ \left\{\begin{array}{c}{\mathrm{V}}_{\mathrm{i}\mathrm{m}}\mathrm{T}\le {\mathrm{L}}_{\mathrm{i}}\\ {}{\mathrm{V}}_{\mathrm{i}\mathrm{m}}\le {\mathrm{L}}_{\mathrm{i}}/\mathrm{T}\end{array}\right. $$
(3)

The maximum feed velocity of short line segment PiPi + 1 can be derived from Eqs. (2) and (3):

$$ {\mathrm{V}}_{\mathrm{i}\mathrm{m}}=\min \left\{\left|{\mathrm{V}}_{\mathrm{xm}}/\cos \left(\upalpha \right)\right|\right.,\left.\left|{\mathrm{V}}_{\mathrm{ym}}/\cos \left(\upbeta \right)\right|,{\mathrm{L}}_{\mathrm{i}}/\mathrm{T}\right\} $$
(4)

2.1 Generation of high-order trajectory

Typically, “trapezoidal acceleration” or “trapezoidal jerk”–based feed profiling is used to generate smooth trajectories for high-speed and precision motion systems [11, 14]. This section mainly introduces the generation of third-order trajectory with FIR filters. As shown in Fig. 2, it is a strategy for generating a third-order trajectory based on FIR. Li − 1 is the length of the short line segment, and Tv is duration time. The high-order trajectory is obtained by filtering the short-segment velocity rectangular pulse signal three times.

Fig. 2
figure 2

A strategy for generating a third-order trajectory based on FIR

A first-order FIR filer is defined in Laplace by transfer function [8]:

$$ {\mathrm{M}}_{\mathrm{i}}\left(\mathrm{s}\right)=\frac{1}{{\mathrm{T}}_{\mathrm{i}}}\frac{1-{\mathrm{e}}^{-\mathrm{s}{\mathrm{T}}_{\mathrm{i}}}}{\mathrm{s}} $$
(5)

where Ti is the time constant, representing the delay of ith FIR filters. Rectangular impulse response is evaluated by taking inverse Laplace transform of Eq. (5) as

$$ \mathrm{m}\kern0.40em \left(\mathrm{t}\right)={\mathrm{L}}^{-1}\left({\mathrm{M}}_{\mathrm{i}}\left(\mathrm{s}\right)\right)=\frac{\mathrm{u}\kern0.30em \left(\mathrm{t}\right)-\mathrm{u}\kern0.40em \left(\mathrm{t}-{\mathrm{T}}_{\mathrm{i}}\right)}{{\mathrm{T}}_{\mathrm{i}}}\kern0.70em \mathrm{where}\kern0.1em \ \mathrm{u}=\left\{\begin{array}{c}1\kern1em \mathrm{t}\ge 0\\ {}0\kern0.8000001em \mathrm{t}<0\end{array}\right. $$
(6)

The filter is realized by convoluting the input signal v(t) with the defined FIR filters transfer function. Convolution is an integral operation, which can be used to describe the relationship between the input and output of linear time invariant system. The output signal can be obtained by convolution of the input signal and a function representing the characteristics of the system. The filtered velocity signal [15] can be expressed as

$$ {\displaystyle \begin{array}{c}\mathrm{v}\kern0.3em \hbox{'}\left(\mathrm{t}\right)=\mathrm{v}\left(\mathrm{t}\right)\ast \mathrm{m}\left(\mathrm{t}\right)\\ {}\kern0.7em =\frac{1}{{\mathrm{T}}_1}\underset{0}{\overset{\mathrm{t}}{\int }}\Big(\kern0.20em \left[\mathrm{v}\kern0.20em \left(\mathrm{t}\right)-\mathrm{v}\kern0.2em \left(\uptau -{\mathrm{T}}_{\mathrm{v}}\right)\right]\kern0.5em \left[\mathrm{u}\kern0.2em \left(\mathrm{t}-\uptau \right)-\mathrm{u}\kern0.2em \left(\mathrm{t}-{\mathrm{T}}_1-\uptau \right)\kern0.1em \right]\kern0.4em \mathrm{d}\uptau \\ {}\kern0.4em =\frac{1}{{\mathrm{T}}_1}\left[\begin{array}{c}\underset{0}{\overset{\mathrm{t}}{\int }}\mathrm{v}\left(\mathrm{t}\right)\kern0.40em \mathrm{u}\kern0.30em \left(\mathrm{t}-\uptau \right)\kern0.30em \mathrm{d}\uptau -\underset{0}{\overset{\mathrm{t}}{\int }}\left(\kern0.30em \right[\mathrm{v}\kern0.20em \left(\mathrm{t}\right)\kern0.30em \mathrm{u}\kern0.30em \left(\mathrm{t}-{\mathrm{T}}_1-\uptau \right)\kern0.30em \mathrm{d}\uptau \\ {}-\underset{0}{\overset{\mathrm{t}}{\int }}\mathrm{v}\kern0.20em \left(\uptau -{\mathrm{T}}_{\mathrm{v}}\right)\kern0.30em \mathrm{u}\kern0.20em \left(\mathrm{t}-\uptau \right)\kern0.30em \mathrm{d}\uptau +\underset{0}{\overset{\mathrm{t}}{\int }}\mathrm{v}\kern0.20em \left(\uptau -{\mathrm{T}}_{\mathrm{v}}\right)\kern0.20em \mathrm{u}\kern0.20em \left(\mathrm{t}-{\mathrm{T}}_1-\uptau \right)\kern0.30em \mathrm{d}\uptau \end{array}\right]\end{array}} $$
(7)

The duration time of a short line segment can be expressed as

$$ {T}_v={L}_{i-1}/{V}_{i-1m} $$
(8)

T1 is the time constant of the 1st FIR filter, t is a time variable, Tall is the time required for overall motion duration. Under the condition of only considering Tv > T1, the velocity expression of rectangular velocity curve after filtering once is written as

$$ \mathrm{v}{\prime}_{\mathrm{i}-1\mathrm{m}}\left(\mathrm{t}\right)=\left\{\begin{array}{c}\left({\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}/{\mathrm{T}}_1\right)\mathrm{t}0\le \mathrm{t}<{\mathrm{T}}_1\\ {}{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}{\mathrm{T}}_1\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}\\ {}{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}/{\mathrm{T}}_1\left(-\mathrm{t}+{\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1\right){\mathrm{T}}_{\mathrm{v}}\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1\\ {}0{\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1<\mathrm{t}\end{array}\right. $$
(9)

The acceleration profile in Fig. 3 can be written as

$$ \mathrm{a}{\prime}_{\mathrm{i}-1\mathrm{m}}\left(\mathrm{t}\right)=\left\{\begin{array}{c}\kern0.1em {\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}/{\mathrm{T}}_1\kern8.799997em 0\le \mathrm{t}<{\mathrm{T}}_1\\ {}0\kern12em {\mathrm{T}}_1\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}\\ {}-{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}/{\mathrm{T}}_1\kern8.099995em {\mathrm{T}}_{\mathrm{v}}\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1\end{array}\right. $$
(10)
Fig. 3
figure 3

Velocity and acceleration profiles of the first-order FIR filter

The process of filtering velocity and acceleration is shown in Fig. 3. The processing time of trapezoid velocity pulse signal and acceleration pulse signal is generated by convolution of rectangular pulse signal; the entire process is Tall = Tv + T1, and delay time is Td = T1.

Under the condition of only considering Tv > T1 > T2, the velocity expression of the second filtering is written as

$$ {\mathrm{v}}_{\mathrm{i}-1}\hbox{'}\hbox{'}\left(\mathrm{t}\right)=\left\{\begin{array}{ll}\frac{1}{2}\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1{\mathrm{T}}_2}{\mathrm{t}}^2& \kern0.1em 0\le \mathrm{t}<{\mathrm{T}}_2\\ {}\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}\kern0.30em \mathrm{t}}{{\mathrm{T}}_1}-\frac{1}{2}\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}\kern0.1em {\mathrm{T}}_2}{{\mathrm{T}}_1}& {\mathrm{T}}_2\le \mathrm{t}<{\mathrm{T}}_1\\ {}{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}-\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}\kern0.1em }{2{\mathrm{T}}_1{\mathrm{T}}_2}{\left({\mathrm{T}}_1+{\mathrm{T}}_2-\mathrm{t}\right)}^2& {\mathrm{T}}_1\le \mathrm{t}<{\mathrm{T}}_1+{\mathrm{T}}_2\\ {}\kern0.1em {\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}& \kern0.20em {\mathrm{T}}_1+{\mathrm{T}}_2\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}\\ {}{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}-\frac{1}{2}\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1{\mathrm{T}}_2}{\left(\mathrm{t}-{\mathrm{T}}_{\mathrm{v}}\right)}^2& \kern0.1em {\mathrm{T}}_{\mathrm{v}}\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_2\\ {}\frac{1}{2}\frac{\kern0.1em {\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1{\mathrm{T}}_2}\left(-2\mathrm{t}{\mathrm{T}}_2+{{\mathrm{T}}_2}^2+2{\mathrm{T}}_{\mathrm{v}}{\mathrm{T}}_2+2{\mathrm{T}}_1{\mathrm{T}}_2\right)& {\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_2\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1\\ {}\frac{1}{2}\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1{\mathrm{T}}_2}{\left({\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1+{\mathrm{T}}_2-\mathrm{t}\right)}^2& {\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1+{\mathrm{T}}_2\\ {}0& {\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1+{\mathrm{T}}_2<\mathrm{t}\end{array}\right. $$
(11)

The acceleration profile in Fig. 4 can be written as

$$ {\mathrm{a}}_{\mathrm{i}-1}^{\prime\prime}\left(\mathrm{t}\right)=\left\{\begin{array}{c}\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1{\mathrm{T}}_2}\mathrm{t}\kern13.1em 0\le \mathrm{t}<{\mathrm{T}}_2\\ {}\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1}\kern12.90001em {\mathrm{T}}_2\le \mathrm{t}<{\mathrm{T}}_1\\ {}\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1}-\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1{\mathrm{T}}_2}\left(\mathrm{t}-{\mathrm{T}}_1\right)\kern5.899997em {\mathrm{T}}_1\le \mathrm{t}<{\mathrm{T}}_1+{\mathrm{T}}_2\\ {}\kern1.2em 0\kern14.72002em {\mathrm{T}}_1+{\mathrm{T}}_2\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}\\ {}-\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1{\mathrm{T}}_2}\left(\mathrm{t}-{\mathrm{T}}_{\mathrm{v}}\right)\kern16em {\mathrm{T}}_{\mathrm{v}}\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_2\\ {}-\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1}\kern14em {\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_2\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1\\ {}-\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1}+\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1{\mathrm{T}}_2}\Big(\mathrm{t}-\left({\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1\right)\kern0.3em {\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1+{\mathrm{T}}_2\\ {}\kern0.2em 0\kern14.90002em {\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1+{\mathrm{T}}_2<\mathrm{t}\kern0.1em \end{array}\right. $$
(12)
Fig. 4
figure 4

Each parameter profiles of the second-order FIR filter

The jerk limit is used to mitigate any residual vibrations [16], and the jerk signal is obtained by differentiation as

$$ {\mathrm{j}}_{\mathrm{i}-1}^{\prime\prime}\left(\mathrm{t}\right)=\left\{\begin{array}{c}\kern0.1em \frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1{\mathrm{T}}_2}\kern12.60001em 0\le \mathrm{t}<{\mathrm{T}}_2\\ {}0\kern14em {\mathrm{T}}_2\le \mathrm{t}<{\mathrm{T}}_1\\ {}-\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1{\mathrm{T}}_2}\kern9.8em {\mathrm{T}}_1\le \mathrm{t}<{\mathrm{T}}_1+{\mathrm{T}}_2\\ {}\kern0.2em 0\kern14.40002em {\mathrm{T}}_1+{\mathrm{T}}_2\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}\\ {}-\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1{\mathrm{T}}_2}\kern11.70001em {\mathrm{T}}_{\mathrm{v}}\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_2\\ {}0\kern14.1em {\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_2\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1\\ {}\frac{{\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}}{{\mathrm{T}}_1{\mathrm{T}}_2}\mathrm{t}\kern12.12001em {\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1\le \mathrm{t}<{\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1+{\mathrm{T}}_2\\ {}\kern0.2em 0\kern14em {\mathrm{T}}_{\mathrm{v}}+{\mathrm{T}}_1+{\mathrm{T}}_2<\mathrm{t}\end{array}\right. $$
(13)

The trapezoid velocity signal is convoluted once to generate a smooth curve, and the velocity is differentiated to obtain acceleration and jerk. The whole processing time is Tall = Tv + T1 + T2, and delay time is Td = T1 + T2.

Under the condition of only considering Tv > T1 + T2 + T3 and T1 > T2 + T3, the velocity expression of triple filtering is written as

(14)

The acceleration profile in Fig. 5 can be written as

(15)

where the jerk signal is obtained by differentiation as:

(16)
Fig. 5
figure 5

Each parameter profile by the third-order FIR filter

The original rectangular pulse is convoluted three times to produce a smooth curve in Fig. 5. The whole processing time is Tall = Tv + T1 + T2 + T3, and delay time is Td = T1 + T2 + T3. The curves of velocity, acceleration, and jerk are smoother than the original curves.

2.2 Accurate interpolation and contouring control algorithm for the corner transition

In high-speed machining, the continuous feed pulse can produce uninterrupted motion, and the interpolation with FIR filter will inevitably produce delay. In this paper, an algorithm is proposed, which need not to wait until the filter delay time is completed. The research adjusts the delay time to precisely control the contour error of the corner.

First, overlap time is defined as

$$ 0\le {T}_n\le {T}_{\mathrm{d}} $$
(17)

If Tn = 0, a P2P trajectory is generated as shown in Fig. 6a. If Tn = Td/2, consecutive interpolation is initiated before feed motion of the first short segment comes to a full stop. Contour errors are shown in Fig. 6b at the corner.

Fig. 6
figure 6

Continuous short line interpolation strategy for the corner

The research methods of X-axis and Y-axis are similar, and X-axis is taken as an example. If Tn > 0, X-axis velocity changes profile in Fig. 7. The processing time of the first section Pi − 1Pi is t = Tv + Td, but the start time of the second paragraph PiPi + 1 is t = Tv + Td − Tn in Fig. 7. The bisector of the maximum deviation node occurs at t = Tv + Td − Tn/2. The research method is used to determine the corner contour error. Vsx is velocity of X-axis entering the corner transfer point; Vsy is velocity of Y-axis entering the corner transfer point. Vex is velocity of X-axis leaving corner transfer point; Vey is velocity of Y-axis leaving corner transfer point. α0 is the angle between Pi − 1Pi and X-axis, γ0 is the angle between PiPi + 1 and X-axis, φ0 is the angle between Pi − 1Pi and PiPi + 1, and εis contour error.

Fig. 7
figure 7

Contour error diagram of corner contour

Relation the velocity of transition point and the maximum feed velocity is written as

$$ {\displaystyle \begin{array}{c}\kern0.2em {\mathrm{V}}_{\mathrm{s}\kern0.20em \mathrm{x}}={\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}\kern0.4em \mathrm{c}\kern0.1em \mathrm{o}\kern0.1em \mathrm{s}\kern0.2em \left(\upalpha \right)\kern2.1em {\mathrm{V}}_{\mathrm{s}\kern0.1em \mathrm{y}}={\mathrm{V}}_{\mathrm{i}-1\mathrm{m}}\kern0.4em \mathrm{s}\kern0.1em \mathrm{i}\kern0.1em \mathrm{n}\kern0.2em \left(\upalpha \right)\kern0.2em \\ {}\kern0.2em {\mathrm{V}}_{\mathrm{e}\kern0.20em \mathrm{x}}={\mathrm{V}}_{\mathrm{i}\mathrm{m}}\kern0.3em \mathrm{c}\kern0.1em \mathrm{o}\kern0.1em \mathrm{s}\kern0.2em \left(\upgamma \right)\kern2.799999em {\mathrm{V}}_{\mathrm{e}\kern0.1em \mathrm{y}}={\mathrm{V}}_{\mathrm{i}\mathrm{m}}\kern0.6em \mathrm{s}\kern0.1em \mathrm{i}\kern0.1em \mathrm{n}\kern0.2em \left(\upgamma \right)\end{array}} $$
(18)

In order to facilitate the study, assuming Vi − 1m = Vim = Vm, according to Eq. (15), the maximum contour error can be written as

$$ \upvarepsilon =\left\{\begin{array}{c}\frac{{\mathrm{V}}_{\mathrm{m}}{\mathrm{T}}_{\mathrm{n}}^4}{192{\mathrm{T}}_1{\mathrm{T}}_2{\mathrm{T}}_3}\sin \left(\upbeta /2\right)\kern10.7em 0\le {\mathrm{T}}_{\mathrm{k}}\le 2{\mathrm{T}}_3\kern0.9000001em \\ {}\frac{{\mathrm{V}}_{\mathrm{m}}\left(-2{{\mathrm{T}}_3}^3+4{{\mathrm{T}}_3}^2{\mathrm{T}}_{\mathrm{n}}-3{\mathrm{T}}_3{\mathrm{T}}_{\mathrm{n}}^2+{\mathrm{T}}_{\mathrm{n}}^3\right)}{24{\mathrm{T}}_1{\mathrm{T}}_2}\kern0.1em \sin \left(\upbeta /2\right)\kern2em 2{\mathrm{T}}_3<{\mathrm{T}}_{\mathrm{k}}\le {\mathrm{T}}_1+{\mathrm{T}}_3\kern0.3em \end{array}\right. $$
(19)

Finally, the overlapping time can be solved from Eq. (19) as

$$ {\displaystyle \begin{array}{c}\mathrm{k}=-\frac{108\upvarepsilon \mathrm{si}\mathrm{n}\left(\upbeta /2\right){\mathrm{T}}_1{\mathrm{T}}_2}{{\mathrm{V}}_{\mathrm{m}}}+\frac{\sqrt{11664\upvarepsilon \mathrm{si}{\mathrm{n}}^2\left(\upbeta /2\right){\mathrm{T}}_1^2{\mathrm{T}}_2^2+3{{\mathrm{V}}_{\mathrm{m}}}^2{\mathrm{T}}_3^6}}{{\mathrm{V}}_{\mathrm{m}}}\\ {}{\mathrm{T}}_{\mathrm{n}}=\left\{\begin{array}{c}\sqrt[4]{\frac{192{\mathrm{T}}_1{\mathrm{T}}_2{\mathrm{T}}_3\kern0.20em \upvarepsilon}{{\mathrm{V}}_{\mathrm{m}}\kern0.20em \sin \kern0.20em \left(\upbeta /2\right)}}\kern4.999998em 0\le {\mathrm{T}}_{\mathrm{k}}\le 2{\mathrm{T}}_3\kern0.1em \\ {}{\mathrm{T}}_3+\frac{{\mathrm{T}}_3^2}{3^{1/3}{\left(\mathrm{k}\right)}^{1/3}}-\frac{{\mathrm{k}}^{1/3}}{3^{2/3}}\kern2.6em 2{\mathrm{T}}_3<{\mathrm{T}}_{\mathrm{k}}\le {\mathrm{T}}_1+{\mathrm{T}}_3\kern0.1em \end{array}\right.\end{array}} $$
(20)

With this algorithm, the contour error of the corner can be accurately controlled. The flow chart is shown in Fig. 8.

Fig. 8
figure 8

Accurate interpolation and contouring control algorithm

3 Simulation and experimental results

In this paper, an accurate interpolation and contouring control algorithm based on FIR filters for the corner transition is proposed. This algorithm can accurately control the contour error of the corner. Next, the point-to-point algorithm and the algorithm proposed in this paper are analyzed in detail to verify the superiority of the algorithm.

3.1 Simulation results

As shown in Fig. 9, tool paths are the obtuse angle of 123 and the right angle; an analysis with zero overlap time and half of the delay time is performed. The total length of the path is 51.64 mm. The feed along the tool path is set to Vm = 100 mm/s, and 3 FIR filters are used with time constants T1 = 20 ms, T2 = 10 ms, and T3 = 5 ms. The maximum interpolation error tolerance is 10 μm. The precise algorithm of high-speed machining corner based on FIR filter is abbreviated to FASA. The path is interpolated based on FASA in Fig. 9a.

Fig. 9
figure 9

a FASA algorithm. b P2P algorithm

The delay time during simulation is 35 ms, the contour error around segment transitions is controlled by calculating the overlapping time Tn based on the change in the feed direction from Eq. (20). The total processing time is 0.7907 s. After the speed at the corner need not to be reduced to zero, the transfer is carried out. There is no additional deceleration time. The velocity at the obtuse angle is 28.96 mm/s, the speed at the acute angle is 21.67 mm/s. The jerk can be processed within the limit range, and the generated acceleration can reach G1 continuous. The path is interpolated based on P2P in Fig. 9b. Total machining time is 0.8296; speed needs to be reduced to zero before transferring. The phenomenon of exceeding the jumping limit occurs in the process of machining, and this will cause tool vibration and reduce the surface quality of machined parts.

By comparing FASA and P2P algorithm, the proposed algorithm can accurately determine contour error of corner, make acceleration at the corner reach G1 continuous, and reduce vibration of tool at corner.

3.2 Experimental results

The kinematic performance of the corner contour algorithm is analyzed by experiments; the equipment is an X-Y CNC machine tool driven by two motors shown in Fig. 10. The resolution of linear encoder is 0.8 μm. The feedback bandwidth of axis position is 50 Hz, which can ensure good position synchronization and path tracking. The feed velocity is set to Vm = 100 mm/s, and 3 FIR filters are used with time constants T1 = 20 ms,T2 = 10 ms, and T3 = 5 ms. The maximum contour error is 20 μm; acceleration and jerk of motor driver are limited to Jm = 1.5 × 105mm/s4, Am = 1000 mm/s2, respectively. This algorithm is compared with NURBS and P2P algorithms. Tool path is shown in Fig. 11; corner enlarged is shown in Fig. 12. The enlarged angles on the three corner profiles are 103, 32 and 156. The experimental velocity, acceleration, and jerk profile is shown in Fig. 13. Machining time and contouring performance comparison are shown in Table 1. As noted from Table 1, the machining time of NURBS algorithm is 5.4989 s, the machining time of P2P algorithm is 5.6701 s, and the machining time of FASA algorithm is 5.1021 s; FASA algorithm takes the shortest time, which can effectively improve the processing efficiency. FASA algorithm has the minimum change range of jerk profiles. The P2P algorithm exceeds the jerk limit in the process of machining, which causes the vibration of cutting tool and affects the quality of machining surface. The maximum contour error of FASA algorithm is 21.09 μm, and FASA algorithm is smaller than the maximum contour error of NURBS algorithm (Fig. 14).

Fig. 10
figure 10

Experimental setup

Fig. 11
figure 11

Tool path

Fig. 12
figure 12

Corner zoom

Fig. 13
figure 13

Velocity, acceleration, and jerk profiles in experiment

Table 1 Comparison of various algorithms
Fig. 14
figure 14

Measured contour errors in experiment

4 Conclusions

The sharp corner of the short line segment will have sudden change in speed, which will cause the violent vibration of the machining tool and affect the surface quality of the machined parts. The pulse response technology can realize the smooth transition of the corner, but the pulse response technology can not accurately control the maximum contour error. In this paper, an accurate interpolation and contouring control algorithm for the corner transition is proposed by using FIR filter, which can effectively control the corner contour error and realize smooth transition. The maximum contour of the corner is determined by overlapping time, and different overlapping time produces different tool trajectories. Through simulation and experimental analysis, FASA algorithm can start transmitting around the corner without reducing velocity to zero. The total processing time is relatively short, the vibration and impact generated by the tool at the corner is small, and the processing quality is improved. Compared with point-to-point (P2P) and NURBS algorithm, the algorithm proposed in this paper can reduce the machining time by 7–10% and effectively reduce the maximum contour error of the vibration corner of the tool.