1 Introduction

Most product manufacturing and development uses computer-aided design (CAD) and computer-aided manufacturing (CAM) for design and manufacture. Machining is completed by a computer numerically controlled (CNC) machine tool. Five-axis machining is used for the machining of complex components for the high-tech electronics 3C, medical, aviation, and energy industries. However, controlling this equipment to correctly and safely process complex products involves post-processing using CAM software to generate the desired cutter location (CL) points for the tool path and to convert the final numerical control (NC) processing program. This task is often controlled by foreign software companies or is purchased from third-party companies, so there are restrictions on the development of the secondary CAM process.

Shigehiko and Ichiro [1] noted that most five-axis machines are based on traditional three-axis machining machines and are adapted to machine multiple inclined surfaces and complex shapes, so a structure with two rotating axes is added to allow processing using just one clamping operation. Lin et al. [2] proposed a spherical two-circle (STC) method for a five-axis machining machine with any structure. Lee and She [3] used homogeneous coordinate transformation and inverse kinematics to convert orthogonal multi-axis milling machine CL data to NC data. Yoshimi and Takahiro [4] proposed a machining coordinate system (MCS) and a workpiece coordinate system (WCS) for a five-axis machining machine, to allow workpieces with complex shapes to be processed using a five-axis machine. Jung et al. [5] noted that when processing free-form surfaces on a three-axis machine, CL data must be obtained using CAD/CAM software. This data comprises the coordinates that are generated by the definition of the WCS, to allow post-processing. It is converted into the NC machining program for the MCS. However, there is a rotating shaft so errors can occur in the forward and reverse process. This study also showed that the CL data must include the position of the tool relative to the workpiece and the direction of the tool axis and the WCS relative to the MCS is converted into the actual cutting motion for the tool. Two methods were proposed: (1) an interference free algorithm in phase reverse and (2) an algorithm for fewer phase reverse processes. This technique and algorithm is proprietary so it cannot be used by third parties to solve post-processing problems. Vavruska [6] interpolated the tool path using a post-processor to increase the accuracy of multi-axis machining. If the rotation tool center point (RTCP) function is not used, the toolpath tolerances may be violated, so an algorithm in the post-processor dynamically generates new toolpath point coordinates to obey the tolerance and ensure machining accuracy. Some controllers do not support the RTCP function or because of errors in the machine so the post-processing program is modified by the equipment manufacturer. In this case, a technician cannot use the RTCP function. Lai et al. [7] did not interpolate many points using a linearized algorithm. This study recalculated new paths for the NC program to prevent discretization near singularities. When a five-axis machining machine performs linear cutting on a curved surface, the controller does not automatically interpolate data points between two NC blocks in a linearly distributed manner so the path is not a straight line and the tool deviates from the original path. Lin and Lin [8] propose a method to increase the number of CL interpolation points to prevent deviation from the machining path. Yu and Ding [9] determined the relationship between the MCS and the WCS. The tool deviation path is corrected by linearly interpolating points between the two CLs and then outputting to the NC program. Five-axis equal chord-height linear interpolation and the circular interpolation method are similar. If the effect of the five-axis machining on path interpolation is not considered, the final d product may not be cut correctly.

When the RTCP function is not used (non-RTCP), the tool path is interpolated in equal segments or equal fixed lengths to correct deviations so the workpiece can be cut incorrectly. For two-point straight \({P}_{1}\to {P}_{2}\) cutting, the difference between RTCP and non-RTCP is shown in Fig. 1. The tool path trajectory for RTCP cutting is a straight line \({P}_{1}\to {P}_{2}\), because the coordinates are converted by the five-axis machining machine controller on the tool axis. However, non-RTCP has no reference from which to generate toolpaths so only the output results can be used to simulate and adjust the interpolated values. This interpolation method results in equally spaced interpolation of the original deviation path and a greater number of interpolation points at positions that do not require interpolation, so the NC program changes. If this change is too great, the time that is required for calculation and transmission to the controller is increased and more memory is required by the controller, so processing efficiency is compromised. This study uses controllers without RTCP or CAM software that do not output RTCP-specific instructions and uses unequal interval interpolation when path deviation occurs. It also allows optimal segmental interpolation for CL points and outputs these to a correct NC program. The system is then applied to the machining tool path for a five-axis machine tool.

Fig. 1
figure 1

Displacement action of RTCP and non-RTCP

2 Research method

This study concerns non-RTCP, so the operation mode for non-RTCP is defined in terms of a coordinate transformation matrix. For different types of processing machines, the tool axis vectors (\(i, j, k\)) are calculated. The machine tool is rotated using the AC, AB, or BC, and the \(X\), \(Y\), and \(Z\) coordinates for the NC program are calculated using the rotational angle and the \(x\), \(y\), and \(z\) coordinates for the CL point. This study determines the NC interpolation point, so the error between the NC linear interpolation and the CL data points is calculated and then obtained using the calculation of NC to CL, as shown in Fig. 2. The NC program coordinates for the RTCP are derived using the WCS, and the deviation parameters for the rotational axis are set by the controller parameters to generate a NC program to move the machine. However, the NC program for non-RTCP is calculated using the MCS, so if the deviation parameters are not calculated and the coordinates converted, the tool path trajectory produces a workpiece that is incorrect. A table type (TT) five-axis machining machine tool does not swing so it is more rigid. This type of machine is used for heavy cutting and high feed processes. Therefore, this study uses a five-axis machining machine that rotates around the A-axis and C-axis (TATC) for verification, as shown in Fig. 3.

Fig. 2
figure 2

Relationship between CL and NC

Fig. 3
figure 3

Table type

The five-axis NC coordinates include NC point coordinates on the \(X\), \(Y\), and \(Z\) axes and rotation angles A, B, or C. The rotation angle is derived from the tool axis vector, so the rotation angle through the tool axis vector is calculated. To calculate the cutting path for a five-axis machine tool, this study uses the STC method, which generates the cutting path for various types of five-axis machine tools. The STC method uses four vectors and two circles, as shown in Fig. 4. For a general model of a TT five-axis machine tool, the motion of the simulated tool axis vector (workpiece) must terminate at the spindle vector and the tool axis vector is aligned with the spindle vector. Therefore, the dynamic point for a TT five-axis machining machine model starts from point Pt and moves around the secondary rotational axis vector (\(V\)) and then through the conversion point P1 (or P2). The point Ps moves around the main rotation axis vector (\(U\)). The angle between the conversion point P1 (or P2) and the main axis vector and the tool axis vector is calculated using inverse kinematics to determine the rotational angles for the two rotational axes. These two rotation angles are used to calculate the NC point coordinates for TT five-axis machine tools using forward kinematics and by transforming the coordinates for the post-processor using CAM software. The conversion point plays a very important role in generating the cutting path for TT five-axis machine tools.

Fig. 4
figure 4

The general model of the TT five-axis machine tools

Five-axis simultaneous machining uses the NC program that is generated by post-processing, and the controller uses this program to drive the five-axis machine to process complex parts and avoid interference. This study uses the five-axis tool path method for Mastercam software to calculate and generate the tool path and determine the coordinates of the tool cutting location (CL) and the tool axis vector. However, in addition to the CL point for the five-axis path, the tool axis vector is also considered. If the five-axis machining path is directly calculated using linear interpolation, the machining path generates a five-axis error. Using the STC method, the rotational angle and the NC point coordinates are first calculated and the five-axis error (\(\delta\)) between two adjacent CLs is calculated using a midpoint approximate. If the value of \(\delta\) is within the range of the maximum allowable error (δMax), the rotational angle and the NC point coordinates are output and written into the NC program. If \(\delta\) exceeds δMax, the number of sub-points is calculated using the RUIIM and the calculated dividing points are used to divide the points between two adjacent CLs that exceed δMax. The value for \(\delta\) between the two adjacent CLs after division is then calculated. If \(\delta\) is within the range of δMax, the rotational angle and the NC point coordinates are output and written into the NC program. If \(\delta\) exceeds δMax, the RUIIM is used to calculate the sub-points until the value of \(\delta\) is within the range of δMax. Finally, the NC program for the range of δMax is verified using simulation software such as CIMCO and VERICUT and cutting is initiated using a five-axis machining machine to verify the accuracy of the method for this study. The flow chart for the method and the result for the non-RTCP RUIIM that is proposed is shown in Fig. 5.

Fig. 5
figure 5

The research method and result flow chart of the RUIIM research for non-tool following five-axis machining

3 Five-axis error

CNC tool machining uses both hardware and software. The hardware error affects the assembly of mechanical parts. It is determined by adjusting and calibration. There is also an error in the deviation of the rotating shaft due to poor assembly or wear over a period of time. The software error affects the calculation error when the CAM software and the controller execute the NC program. For three-axis machining, the controller executes a linear motion on \(XYZ\) plane using linear interpolation. For five-axis machining, there is an original linear motion in the \(XYZ\) plane and the motion of the two axes of rotation in A, B, and C. If the linear interpolation method is used, the workpiece is cut using an incorrect path. For non-RTCP, the tool cutting path that is generated by the five-axis controller is from NC1 (X50. Y80. Z100. A30. C90.) to NC2 (X100. Y120. Z200. A60. C150.). The tool path results are simulated using simulation software, as shown in Fig. 6. The tool path from NC1 to NC2 is a straight line, but the tool path that is cut by the five-axis machine is a curve. When the controller executes the five-axis program, the CL between the paths is generated by linear interpolation.

Fig. 6
figure 6

Simulation screen of two NC points

CAM software was used to produce an English letter L on a curved surface using a five-axis path method. The tool axis vector Vt for the tool path is normal to the surface, the cutting tolerance is 0.025 mm, and the step (the length of the points) is 2 mm. The resulting tool path is shown in Fig. 7. The NC program is generated using the post-processor in the CAM software, and the tool path is simulated using CIMCO simulation software. Some tool paths feature large deviations and many tool paths that deviate significantly, as shown in Fig. 8.

Fig. 7
figure 7

Letter L for five-axis surface machining

Fig. 8
figure 8

NC program and simulation screen generated by CAM software

The NC program for the CAM software generates deviating tool path so a 0.1 mm step size (dividing point length) is used to generate a new tool path and the NC program is generated using the post-processor in CAM software. CIMCO simulation software is used to simulate the tool path, and the simulation results are shown in Fig. 9. The tool path deviation in Fig. 8 is resolved, but the CAM software performs more equal-spaced interpolation on the original deviation path. This adds CL points where no interpolation is required. A comparison of Figs. 8 and 9 shows that the NC program increases from 28 to 248 blocks and the single block rate for the increase is nearly 8 times that of the original NC program. The CAM software segments and interpolates all of the tool paths and to increase the number of CL points so there are too many interpolation points in the tool path for the NC program and the number of single blocks for the NC program increases. This is a common method for correcting path deviation, but the problem of generating path deviation is not resolved.

Fig. 9
figure 9

NC and simulation screen after equidistant interpolation of CL points by CAM software

In the non-RTCP state, the NC program uses linear interpolation so there is path deviation phenomenon between the designed path and the expected tool path, which is \(\delta\). To resolve a five-axis error between two CL points, isometric interpolation is performed between the CL points of the tool path. If all of the CL points are interpolated using the same condition, then all paths are interpolated equidistantly. If there are insufficient equidistant interpolation points, deviation in the local position point is not corrected. If there are too many interpolation points, the position points that do not undergo equidistant interpolation are also interpolated, which affects the overall processing efficiency. To resolve the problem of redundant equidistant interpolation position points for this study, the calculation of \(\delta\) must be understood. This study uses the approximate solution method to solve \(\delta\). The flow chart for error calculation is shown in Fig. 10. The coordinates of the two CL points CL1 and CL2 are converted to NC1 and NC2, and NC1 and NC2 are used to determine the intermediate value CLNCm. The distance between the intermediate value CLm is calculated for CL1 and CL2 and the path deviation for CLNCm is \(\delta\).

Fig. 10
figure 10

Flow chart of \(\delta\) calculation

4 Unequal interval CL interpolation

If too many interpolation points are generated by equidistant interpolation five-axis errors, this study uses five-axis unequal spacing CL interpolation to accelerate the operation. The value of \(\delta\) is used to determine the equally spaced points. The first division point for CL is calculated using the set expected error. If the value of \(\delta\) for the CL output NC for the interpolation points is greater than the expected error, a second interpolation point is used. If there is a third interpolation point, the five-axis toolpath errors reach the convergence level so the unequal interval interpolation points are obtained. The CL points that are output by CAM software are used to optimize the piecewise interpolation. The five-axis unequal-spaced CL interpolation procedure is described in detail later.

  1. 1.

    The interpolation points in the original equal interval between CLs are added, and if the interpolated \(\delta\) is less than or equal to the set δMax, the next point is calculated using the value for δMax to calculate the required number of points. The points between CL points are then interpolated.

  2. 2.

    If the CLu point is inserted linearly between CL1 and CL2, then using the calculation method of the flow chart in Fig. 10, the difference in the position of the CLu point between CL1 and CL2 also affects the value of \(\delta\). If the distance between CL1 and CLu increases, the corrected five-axis error δu1 also increases, as shown in Fig. 11a. If the distance between CL1 and CLu decreases, the corrected five-axis error δu1 increases. The error δu2 is smaller, as shown in Fig. 11b. The results in Fig. 11 show that the distance between CL1 and CLu is closely related to the corrected value for \(\delta\). The position of the next point CLu that gives a value of \(\delta\) that is within δMax is very important.

Fig. 11
figure 11

\(\delta\) of the next point CLu

\(u\) is the position of the CLu point on CL1 → CL2, so the value of \(u\) is calculated before the coordinate value of the CLu point is calculated. The CLu point is the position for which \(\delta\) is within δMax. Therefore, the distance between CL1 and CL2 is set as a unit length with a value of 1. Its relationship is shown in Eq. (1):

$$\begin{array}{l}CL\left(u\right)\\ CL\left(0\right)={CL}_{1}\\ CL\left(1\right)={CL}_{2}\end{array}$$
(1)

After linear interpolation of point CLu on each axis \((X, Y, Z)\), (CLux, CLuy, CLuz) is calculated using Eq. (2):

$$CL\left(u\right)=\left({CL}_{1x}\left(1-u\right)+{CL}_{2x}\left(u\right),{\;CL}_{1y}\left(1-u\right)+{CL}_{2y}\left(u\right),\;{CL}_{1z}\left(1-u\right)+{CL}_{2z}\left(u\right)\right)$$
(2)

The value that is calculated using Eq. (2) is the scalar value for the five-axis toolpath, so the same linear interpolation is performed on the original tool axis vector \((i, j, k)\) for point CLu. The axial components of point CLu after linear interpolation are (CLuit, CLujt, CLukt), as shown in Eq. (3):

$$\begin{array}{c}{CL}_{uit}={CL}_{1i}\left(1-u\right)+{CL}_{2i}\left(u\right)\\ {CL}_{ujt}={CL}_{1j}\left(1-u\right)+{CL}_{2j}\left(u\right)\\ {CL}_{ukt}={CL}_{1k}\left(1-u\right)+{CL}_{2k}\left(u\right)\end{array}$$
(3)

Each axial component is unitized into (CLui, CLuj, CLuk) after linear interpolation, which is the tool axis vector \((i, j, k)\) of CLu, as shown in Eq. (4):

$$\begin{array}{c}{CL}_{ui}={CL}_{uit}/\sqrt{{CL}_{uit}{}^2+{CL}_{ujt}{}^2+{CL}_{ukt}{}^2{}}\\{CL}_{uj}={CL}_{ujt}/\sqrt{{CL}_{uit}{}^2+{CL}_{ujt}{}^2+{CL}_{ukt}{}^2{}}\\{CL}_{uk}={CL}_{ukt}/\sqrt{{CL}_{uit}{}^2+{CL}_{ujt}{}^2+{CL}_{ukt}{}^2{}}\end{array}$$
(4)

For the two CL points in Table 1, δMax is 0.025 mm. Starting at CL1, according to Fig. 11, the \(u\) value on CL1 → CL2 is calculated to determine the position of point CLu. If the \(\delta\) between CL1 → CLu is within the range of δMax of 0.025 mm and uMax, which is the maximum value, this is the best interpolation point position. The inverse matrix solution method is used, starting from 0, substituting the \(u\) value with micro-steps and repeatedly testing and calculating. If the \(\delta\) between CL1 → CLu is also within the range of δMax, the uMax value is 0.0246 mm. Using Eqs. (2), (3), and (4), the coordinates (CLux, CLuy, CLuz) for the interpolated CLu and the tool axis vectors \((i, j, k)\) are calculated, as shown in Table 2. The double-solution NC program coordinates of the interpolated point CLu are calculated as shown in Table 3.

Table 1 Two CL points and their tool axis vectors
Table 2 CL1, CLu, and tool axis vector
Table 3 Double-solution NC program coordinates of interpolated CLu points

The drawing results for the two negative (Neg.) solutions of CL1 and CLu are used to confirm that δMax is 0.025 mm, which is within the error range for this study, so CLu is the point that is calculated for this study, as shown in Fig. 12. If δMax is known, the CLu1 position of the first interpolation point for CL1 can be obtained. CLu1 is then used to calculate the next CLu2 until the relationship between CLuN and CL2 is also within δMax, as shown in Fig. 13. There are \(N\) interpolation points between two CLs. The value of \(N\) depends on the \(\delta\) between each two CL points so there is no need to perform linear interpolation with the same equal spacing between all CLs. If δMax is used to determine the interpolation method for the next CLu point, \(N\) interpolation points are not required between two CL points to correct the path deviation. For two CL points that are generated by CAM software, for CL1 point (− 20, − 10, 0), the tool axis unit vector is (0.44721, 0, 0.89443), and for CL2 point (10, 20, 30), the tool axis unit vector is (0.03161, 0.03161, 0.999) and doc is (0, 0, 0), and dca is (0, 0, 0), as shown in Table 4.

Fig. 12
figure 12

Interpolate CLu points according to δMax

Fig. 13
figure 13

Calculated interpolated CLu point according to the δMax

Table 4 Two CL points and their tool axis vectors

The approximate solution value for the maximum \(\delta\) for the two negative (Neg.) solutions of the path deviations for CL1 and CL2 is calculated as δ = 11.24403 mm. The number \(N\) of CLu points to be interpolated using different values for δMax is calculated as shown in Table 5. If δMax is smaller, the number of interpolation points \(N\) that is required increases significantly. If δMax is less than 0.01 mm, the required number of interpolation points \(N\) is significantly increased. The data in Table 5 is used to plot the relationship between δMax and the number of interpolation points \(N\), as shown in Fig. 14.

Table 5 δMax and the number of interpolation points \(N\)
Fig. 14
figure 14

Curve of δMax and the number of interpolation points \(N\)

The results in Table 5 show that the relationship between \(\delta\) between two CL points, the number of interpolation points \(N\), and δMax is expressed using Eq. (5), so this study is defined as the RUIIM. The required number of interpolation points Nequ is unconditionally rounded up to the nearest integer.

$${N}_{equ}=\sqrt{\delta /{\delta }_{Max}}$$
(5)

where Nequ is the number of interpolation points, \(\delta\) is the five-axis error between two CL points, and δMax is the maximum error. A comparison of the number of interpolation points Nequ that is calculated using the RUIIM and the number of \(N\) points that are interpolated as calculated using δMax in Table 5 shows that the number of interpolation points Nequ and \(N\) is almost the same, as shown in Table 6. In Table 6, there is an error between Nequ and \(N\), but this is within the range of one interpolation point. The time that is required to calculate the point and processing efficiency are improved by using the RUIIM to divide the CL points that are output by the CAM software into unequal interval interpolation points to achieve optimal segmental interpolation. The RUIIM is used to calculate the required number of interpolation points Nequ between the two CL points to correct the \(\delta\) for the path deviation. The two CL points in Table 4 are interpolated using the RUIIM to achieve unequal interval CL interpolation between the five axes.

Table 6 δMax interpolation point number \(N\) and RUIIM solution interpolation point number Nequ

In Table 4, the two CL points that are generated by the CAM software are CL1 (\(-20, -10, 0\)), for which the tool axis unit vector is (0.44721, 0, 0.89443), and CL2 (10, 20, 30), for which the tool axis unit vector is (0.03161, 0.03161, 0.999). The value of doc is (0, 0, 0) and of dca is (0, 0, 0). If δMax = 0.1 mm, as shown in Table 6, the number of interpolation points that is required to correct the \(\delta\) for the two CL points is N = Nequ = 11. The number of interpolation points between CL1 and CL2 is linearly interpolated by 11 equal divisions. The NC simulation screen with Nequ as the first interpolation point is shown in Fig. 15.

Fig. 15
figure 15

NC simulation screen with Nequ as the first interpolation point

Figure 15 shows that the path offset correction between two CLs (CL1 → CL2) is significantly improved using RUIIM. However, the movement between some interpolation points is not completely corrected to less than δMax. Five-axis machining involves the movement of three linear axes (\(X\), \(Y\), and \(Z\)) and the motion of any two rotational axes (such as AB, AC, or BC) so some motion paths between interpolation points are not within δMax. If the \(\delta\) value between the two CL points is not within δMax, the two adjacent CL points are solved using the RUIIM again until all the calculated values for \(\delta\) for the interpolation point are within the δMax value. In Fig. 15, using the first RUIIM, there are still some motions between interpolation points that are greater than δMax so a second RUIIM is used to produce the interpolation points. The RUIIM continues to interpolate points that have a range that is greater than δMax. The NC program adds the interpolated single-block program here. The NC simulation screen for Nequ for the second interpolation point is shown in Fig. 16.

Fig. 16
figure 16

NC simulation screen with Nequ as the second interpolation point

Figure 16 shows that if only the first points are interpolated for the path deviation between two CL points, some CL interpolation points do not have a range within δMax and a second interpolation point is required. After the second interpolation point is produced for the relevant path deviation interval, there are still some motions between the interpolation points that are greater than δMax. The RUIIM that is proposed by this study is used repeatedly to interpolate the path deviation interval until the path deviation interval is within δMax. The path deviation correction between the two CL points (CL1 → CL2) is complete. The NC simulation screen for Nequ for the third interpolation point is shown in Fig. 17.

Fig. 17
figure 17

NC simulation screen with Nequ as the third interpolation point

The optimal method for interpolation points is to define δMax. The RUIIM is used to move the CL points that are generated by the CAM software, and the deviation paths are processed separately. In Table 4, for δMax = 0.01 mm, the original two CL points are interpolated to interpolate CL with an unequal interval between the five axes, as shown in Fig. 18. To add interpolation points at equal intervals between all CL points under the same conditions, multiple interpolation points are produced using the RUIIM. As shown in Fig. 19, for the path deviation problem in Fig. 9, the optimal result is obtained by interpolating points with unequal spacing CL using the RUIIM.

Fig. 18
figure 18

The NC simulation screen of the unequal interval CL interpolation points among the five axes

Fig. 19
figure 19

NC simulation screen of RUIIM

5 Verification experiment

A five-axis toolpath was created using Mastercam software to generate CL data, and the RUIIM was used to correct the path deviation when the CL point is directly converted into an NC program. CIMCO software was used to simulate the path trajectory for the NC program, and VERICUT was used to confirm the result before processing. CIMCO and VERICUT are currently the most commonly used NC program software for verification before five-axis machining in industry and ensure the safety of five-axis machining. For this study, the tool axis is normal to the surface of the workpiece. Helical pattern milling is used to verify that if the RUIIM is used after the CAM software is corrected to generate the CL point and the NC program is directly output to the CL point, there is deviation from the toolpath and an accurate NC program is obtained for five-axis machining. The NC program that is corrected using the RUIIM is then used for cutting on a TATC five-axis machining machine to verify the method of this study. The cutting tolerance for the Mastercam software is 0.025 mm, as shown in Fig. 20. The inclination angle of the tool axis vector Vt varies with the position of the machined surface.

Fig. 20
figure 20

Five-axis helical milling path and tool axis vector Vt

Using the CL point that is calculated by the CAM software, the output NC program is directly converted and the path trajectory is simulated using CIMCO (Fig. 21a). VERICUT is used to verify solid cutting (Fig. 21b). Figure 21 shows that many toolpaths exhibit deviation, so the cutting paths are different to the required cutting path, which produces partial overcuts. The CL point that is generated by the CAM software is set to δMax which is 0.025 mm. Using the proposed RUIIM, CIMCO simulates the path trajectory (Fig. 22a) and VERICUT verifies the solid cutting (Fig. 22b). The results in Fig. 22 show that the part for which the toolpath deviates is corrected to the correct one by the interpolation using the RUIIM.

Fig. 21
figure 21

Five-axis path helical milling path simulation (pure linear interpolation)

Fig. 22
figure 22

Five-axis path helix path simulation (RUIIM)

For helical pattern milling, the RUIIM that is proposed in this study corrects the NC program that originally generates the toolpath deviation and the range of deviation is less than δMax. CIMCO and VERICUT software show that processing is accurate before the actual five-axis processing. For the NC program for helical milling, the results for the RUIIM are compared with those for the equal-spaced interpolation method. If the path length for one cutting pass is 212.2 mm and the equal spacing is 0.1 mm, there are 2120 blocks for one pass. For a value of δMax = 0.025 mm, there are 296 blocks, so 6.16 times more blocks are used for the equal-spaced interpolation method than for the RUIIM, as shown in Table 7. This result is for one pass. If there are multiple passes used for layered cutting, the number of blocks for the NC program will depend on the number of layers for one pass. If the equidistant interpolation distance is increased to 0.5 mm, the NC program requires 426 blocks but the deviation of the toolpath is not completely corrected, as shown in Fig. 23.

Table 7 Comparison of helical milling NC programs
Fig. 23
figure 23

Helical milling with equal interval interpolation 0.5 mm

In order to verify that the RUIIM corrects the NC program that originally generates the toolpath deviation to within δMax, this study uses a five-axis machining machine that is produced by Baide Machinery for machine cutting verification. The model is a MF400U, the controller uses HEIDENHAIN TNC 640, and the axial strokes are \(X\)-axis 410 mm, \(Y\)-axis 610 mm, \(Z\)-axis 510 mm, \(A\)-axis + 30° ~  − 120°, and \(C\)-axis 360° (continuous). The working turntable is 400 mm in diameter and the maximum spindle speed is 12,000 rpm. Before the verification process, it is necessary to perform a five-axis rotation center correction to confirm the offset values for doc and dca. This is an extremely important parameter for non-RTCP. The outer diameter of the test piece and the datum plane was first turned using a CNC lathe to give a workpiece for verification with dimensions of Ø65 mm and 95 mm in length, which was clamped in a concentric vise. Figure 24 shows the processing machine, schematic diagrams of each axial direction, and specimen clamping.

Fig. 24
figure 24

Appearance, schematic diagram of each axis, and specimen clamping of five-axis machine MF400U

A three-axis surface path was used for dynamic roughing to ensure surface optimization using a Ø10 mm flat cutter. A Ø10 mm ball cutter was then used to perform equidistant wrapping finishing, as shown in Fig. 25. A Ø3 mm ball cutter was used to process the helix on the curved surface. The tool axis is normal to the surface, and the machining depth is 1.5 mm to generate the CL point of the toolpath. The CAM software was then simulated and verified, as shown in Fig. 26.

Fig. 25
figure 25

Pre-machined specimen before helical milling validation

Fig. 26
figure 26

Simulation and verification of helical milling in CAM software

The NC program that is directly output from the CL point (Fig. 27a) and the RUIIM were then used (Fig. 27b). The value for δMax is 0.025 mm. After correcting the path deviation for the CL point, the output NC program is compared with the actual machining. Using a simulation in CIMCO and VERICUT software, the results for pure linear interpolation and RUIIM are consistent, as shown in Fig. 27. Some of the helical cutting positions are incorrect because of the \(\delta\) relationship so the cutting path is incorrect, as shown in Fig. 27a. When the deviation is corrected, the overcut positions that were not correct using the original cutting path are corrected, as shown in Fig. 27b. The machining results for milling a helical pattern milling show that the RUIIM corrects the deviation in the original tool path for the NC program to less than the value of δMax.

Fig. 27
figure 27

Comparison of actual machining of helical milling

6 Conclusion

Many five-axis machines currently use RTCP controllers but some controllers do not feature RTCP commands or post-processing using CAM software, so they do not output NC programs that support RTCP. This study allows controllers that do not support RTCP instructions or have CAM software that does not support post-processing output RTCP to calculate the interpolation points for a toolpath, in order to prevent overcutting of the workpiece due to an error in the cutting path. In the non-RTCP mode, five-axis machining features linear motion in the original \(XYZ\) plane and motion around two rotational axes (such as AB, AC, or BC). If three-axis linear interpolation is also used for processing, five-axis errors result in incorrect or overcut paths. Some current CAM software can only perform equidistant interpolation between CL points to ensure that δu is within tolerance so too many interpolation points are generated. This results in a significant increase in the number of blocks that the NC program uses, which also affects the processing speed and processing efficiency of the entire controller.

This study proposes a RUIIM that uses the C# programming language to quickly calculate the CL point coordinates (CLx, CLy, CLz) and the tool axis vector Vt \((i, j, k)\). This system corrects the value for \(\delta\) to less than the range δMax and corrects the \(\delta\) value for the original toolpath more quickly. If the output CL point coordinates (CLx, CLy, CLz) and the planned tool axis vector Vt \((i, j, k)\) are calculated using CAM software, the CL point can be optimized by segment interpolation and this data is output to a correct NC program to generate the machining toolpath.