1 Introduction

Along with the development of manufacturing industry, the demand for accuracy of CNC machine tools has become increasingly urged. As early as 1960s, the study on machine tools’ accuracy has been carried out. In 1961, Leete et al. [1] first analyzed the alignment errors of three-axis CNC milling machine tools, which aroused the upsurge of accuracy research. In 1978, the US Department of Defense designated the accuracy of machine tools as one of the key investigation tasks. Therefore, it is of great significance to further study the accuracy of machine tools.

At present, the methods evaluating machine tools’ accuracy based on test pieces have been widely used [2,3,4]. Since the effect of geometric error, thermal deformation, mechanical vibration, and other comprehensive factors on machine tools is different, the machining defects reflected in the test pieces are also different. Recently, in the acceptance process of newly developed machine tools, machine tool manufacturers are often beset by some problems. For example, for a five-axis machine tool (FAMT), the positioning accuracy and repetitive positioning accuracy of its each axis can meet the accuracy requirements. And it can also pass the accuracy test of some standard test pieces, such as NASA test piece [5], NCG test piece [6], and quadrangular pyramid test piece [7]. But, it cannot achieve the machining accuracy of some aviation parts and pass the accuracy test of the S-shaped test piece proposed by Chengdu Aircraft Industrial Group [8]. Therefore, it is urgent for machine tool builders to understand the main causes of machining defects in S-shaped test piece, how to eliminate these defects, and how to improve the design of the machine tool in the future to pass the acceptance of machine tools.

The above problems encountered in the production practice can be attributed to the mathematical characterization and causation analysis of test piece surface errors in NC machine tools. Then, this paper will focus on how to describe machining defect of test piece, how to construct the corresponding analysis method based on error spatial morphology of test piece, and then reversely to obtain the main causes leading to these errors.

In the past few decades, as a new standard test piece [9, 10], the S-shaped test piece can overcome the disadvantage that some other standard test pieces cannot adequately evaluate the performance of FAMTs [11, 12]. In addition, the S-shaped test piece has the machining characteristics of the non-developable ruled surface, which can show the machine tool’s ability to machine complex surfaces, and the surface characteristics of thin-walled aeronautical parts, which can not only reflect the static accuracy of the machine tool, but also reflect the dynamic accuracy of the machine tool. At the same time, the curvature of the test piece varies with the change of surface shape, and it has the characteristic of opening and closing angle conversion at the corner. It is not difficult to find that the test piece can be successfully applied in the acceptance and performance testing of high-speed and high-precision machine tools.

Recently, the research on S-shaped test piece has been developed. Mou et al. [13] described an “S” machining test to reflect dynamic machining accuracy of five-axis machine tools. Su et al. [14] introduced a new machining test standard for testing the accuracy of five-axis machine tools using an S-shaped test piece. Jiang et al. [15] exhibited the dynamic performance of the servo system of five-axis machine tools by using S test piece. Wang et al. [16] testified that the S test piece presented more machine abilities than NAS979 based on the servo system of a FAMT. Wang et al. [17] presented a state prediction model for five-axis machine tools based on S surface finish. Zhong et al. [9] presented a new S trajectory kinematic measurement method to evaluate the dynamic accuracy of five-axis machine tools. As can be observed in the above-mentioned literatures, these studies mainly focus on the influence of machine tool dynamic performance on S-shaped test piece machining accuracy. Little research pays attention to quasi-static error, whose basic factor is geometric error. However, as is displayed in Table 1, the macroscopic defects such as tool mark and ripple are mainly caused by the poor dynamic performance of the machine tool, and the contour error of the test piece in microscopic scale is largely affected by the quasi-static error of the machine tool. Obviously, it is of great theoretical and practical significance to study the effect of machine tools’ geometric errors on S-shape test piece in the acceptance and performance testing of machine tools.

Table 1 The classification of machining defects in test pieces

Furthermore, considerable research work has been devoted to the causation analysis of the machining errors for machine tools and great achievements have been made. Chen et al. [23] developed sensitivity analysis of volumetric error regarding 37 error components in a five-axis machine tool and obtained the key influencing error components for the purpose of machine design. Li et al. [24] presented a key geometric errors identification method for machine tools and allowed the degree of influence of the geometric errors on the machining accuracy. Zhao et al. [25] conducted the dynamic sensitivity analysis of machine tools by combining the dynamic error sensitive coefficients and dynamic deformation to recognize the sensitive error components. Liu et al. [26] analyzed the sensitivity of the geometric errors’ effect on the form accuracy in ultra-precision diamond turning. Fan et al. [27] proposed a global sensitivity analysis method to identify key geometric errors for a CNC machine tool. Chen et al. [2] traced the geometric defect of the machined surface by an analysis method of error sensitivity.

The above work mainly focuses on sensitivity analysis, which is to study the sensitivity of uncertainty sources of geometric errors for machine tool parts on machining accuracy and to find out the key factors that affect the machining accuracy of machine tools. However, this analysis method fails to take into account the important fact that geometric error source parameters change with the relative movement of the machine tool. Thus, the analysis results are not enough to truly reflect the influence law of geometric error source parameters on the machining accuracy of machine tools. Therefore, in this paper, how to develop a novel causation analysis method based on error spatial morphology of S-shaped test piece and decouple the key geometric error parameters causing contour errors of test piece is of paramount importance.

2 Characterization of error spatial morphology based on S-shaped test piece

In flank milling, machining error of surface is defined as the normal distance between the ideal cutting surface and the actual cutting surface [28]. As shown in Fig. 1, P1 represents a point on the ideal cutting surface. Then, through point P1, the perpendicular line of the tool axis surface \( \overrightarrow{P_1{P}_3} \),whose perpendicular foot is denoted as P3, is drawn. P2 indicates the intersection point of \( \overrightarrow{P_1{P}_3} \) and actual cutting surface. Therefore, machining error of surface can be represented as Eq. (1).

$$ {e}_{ps}=\frac{\left({P}_3-{P}_1\right)}{\left\Vert {P}_3-{P}_1\right\Vert}\left({P}_2-{P}_1\right)=n\cdot \left({P}_2-{P}_1\right) $$
(1)

where epsdenotes machining error of surface, and n denotes the unit direction vector of \( \overrightarrow{P_1{P}_3} \).

Fig. 1
figure 1

Sketch map of machined surface error in flank milling

As is observed in Eq. (1), machining error of surface can be divided into positive and negative. Positive machining error indicates that the machined surface is undercut, and negative machining error indicates that the machined surface is overcut.

In the machining process of S-shaped test piece, the typically undeveloped ruled surface of test piece introduces theoretical error [12, 29], and geometric errors of the machine tool cause the tool axis to deviate from its ideal position. Therefore, the contour error of S-shaped test piece includes theoretical error and the error of tool axis surface.

It is worth noting that theoretical error caused by the distortion of non-developable ruled surface is related to the geometry of test piece and tool path planning, and it is one of the key reference indexes for evaluating the tool path. Furthermore, since tool axis surface is not affected by theoretical error, the tool axis surface error caused by geometric error of the machine tool will not be affected by theoretical error, and it is an intuitive evaluation index of the comprehensive effect of machine tool’s geometric error on test piece.

2.1 Tool axis surface error modeling

As a modeling method that can describe the motion relationship between the adjacent kinematic parts of machine tools simply and conveniently [3], in this paper, multi-body system (MBS) theory is selected to establish tool axis surface error model. Moreover, a five-axis simultaneous gantry milling machine XKAS2525 × 60 manufactured by BEIJING NO.1 MACHINE TOOL CO., LTD, China, is taken as an example, as shown in Fig. 2. Table 2 displays its main technical parameters. Five kinematic pairs including three translational and two rotational axes are defined as the X-, Y-, Z-, C-, and B-axis, respectively. The geometric error parameters are defined complying with the definition in Ref. [3].

Fig. 2
figure 2

The research FAMT. a Structure b Kinematic chain

Table 2 Main technical parameters of XKAS2525 × 60

In order to describe the 37 geometric errors of the machine tool more conveniently, the coordinate systems (CSs) of the FAMT are first set as follows: (1) Let worktable CS coincide with machine coordinate system (MCS) and CS of X-axis. (2) The CS origin of X-axis is located at the contact point between X-axis and the right guide way. (3) The CS origins of Y-axis and Z-axis are all located at the center point of the lower end surface. (4) The CS origin of C-axis is located at the intersection of C-axis and B-axis. (5) The CS origin of B-axis is located at the center of tool clamping hole. (6) At the home position, X-axis and Z-axis are located at the maximum position of X-direction stroke and Z-direction stroke, respectively, and Y-axis is located at the center position of Y direction stroke. In addition, three directions of X, Y, and Z in the CS of each moving part are all parallel to MCS respectively. (7) Tool coordinate system (TCS) coincides with B-axis CS.

Suppose that the position vector of tool center point and the direction vector of tool axis in TCS can be represented as rt = (0 0  − l 1)T and \( {\mathbf{v}}_t={\left(0\kern0.5em 0\kern0.5em -1\kern0.5em 1\right)}^T \) respectively, while the position vector of the tool center corresponding to the cutting surface of test piece, and the direction vector of tool axis in the workpiece coordinate system (WCS) can be represented as \( {\mathbf{r}}_{\mathrm{w}}={\left({r}_{\mathrm{w}\mathrm{x}}\kern0.5em {r}_{\mathrm{w}\mathrm{y}}\kern0.5em {r}_{\mathrm{w}\mathrm{z}}\kern0.5em 1\right)}^T \) and \( {\mathbf{v}}_{\mathrm{w}}={\left({v}_{\mathrm{w}\mathrm{x}}\kern0.5em {v}_{\mathrm{w}\mathrm{y}}\kern0.5em {v}_{\mathrm{w}\mathrm{z}}\kern0.5em 1\right)}^T \) respectively, where l denotes the length of the cutting tool. Moreover, the position vectors of workpiece coordinate origin in MCS, X-axis CS origin in MCS, Y-axis CS origin in X-axis CS, Z-axis CS origin in Y-axis CS, C-axis CS origin in Z-axis CS, and B-axis CS origin in C-axis CS are expressed as \( {\mathbf{q}}_i={\left({q}_{\mathrm{ix}}\kern0.5em {q}_{i\mathrm{y}}\kern0.5em {q}_{i\mathrm{z}}\kern0.5em 1\right)}^T\left(i=\mathrm{w},2\cdots 6\right) \) respectively.

Therefore, according to the kinematic chain of the research FAMT (as shown in Fig. 2b), in workpiece branch, the position vector of tool center point in MCS pw can be expressed as Eq. (2), while in tool branch, the position vector of tool center point in MCS pt can be expressed as Eq. (3), and tool orientation in MCS Vt can be expressed as Eq. (4):

$$ {\boldsymbol{p}}_{\mathrm{w}}={\left[S1\mathrm{w}\right]}_{\mathrm{p}}{\boldsymbol{r}}_{\mathrm{w}} $$
(2)
$$ {\displaystyle \begin{array}{c}{\boldsymbol{p}}_{\mathrm{t}}=\prod \limits_{t=n,{L}^n(6)=1}^{t=1}\left(\begin{array}{l}{\left[S{L}^1(j){L}^{t-1}(j)\right]}_{\mathrm{p}}{\left[S{L}^t(j){L}^{t-1}(j)\right]}_{\mathrm{p}\mathrm{e}}\\ {}{\left[S{L}^t(j){L}^{t-1}(j)\right]}_{\mathrm{s}}{\left[S{L}^t(j){L}^{t-1}(j)\right]}_{\mathrm{s}\mathrm{e}}\end{array}\right){\boldsymbol{r}}_{\mathrm{t}}\\ {}={\left[S12\right]}_{\mathrm{p}}{\left[S12\right]}_{\mathrm{p}\mathrm{e}}{\left[S12\right]}_{\mathrm{s}}{\left[S12\right]}_{\mathrm{s}\mathrm{e}}{\left[S23\right]}_{\mathrm{p}}{\left[S23\right]}_{\mathrm{p}\mathrm{e}}{\left[S23\right]}_{\mathrm{s}}{\left[S23\right]}_{\mathrm{s}\mathrm{e}}{\left[S34\right]}_{\mathrm{p}}{\left[S34\right]}_{\mathrm{p}\mathrm{e}}\\ {}{\left[S34\right]}_{\mathrm{s}}{\left[S34\right]}_{\mathrm{s}\mathrm{e}}{\left[S45\right]}_{\mathrm{p}}{\left[S45\right]}_{\mathrm{p}\mathrm{e}}{\left[S45\right]}_{\mathrm{s}}{\left[S45\right]}_{\mathrm{s}\mathrm{e}}{\left[S56\right]}_{\mathrm{p}}{\left[S56\right]}_{\mathrm{p}\mathrm{e}}{\left[S56\right]}_{\mathrm{s}}{\left[S56\right]}_{\mathrm{s}\mathrm{e}}{\boldsymbol{r}}_{\mathrm{t}}\end{array}} $$
(3)
$$ {\displaystyle \begin{array}{c}{\boldsymbol{V}}_{\mathrm{t}}=\prod \limits_{t=n,{L}^n(6)=1}^{t=1}\left(\begin{array}{l}{\left[S{L}^t(j){L}^{t-1}(j)(R)\right]}_{\mathrm{p}}{\left[S{L}^t(j){L}^{t-1}(j)\right]}_{\mathrm{p}\mathrm{e}}(R)\\ {}{\left[S{L}^t(j){L}^{t-1}(j)(R)\right]}_{\mathrm{s}}{\left[R{L}^t(j){L}^{t-1}(j)\right]}_{\mathrm{s}\mathrm{e}}(R)\end{array}\right){\boldsymbol{v}}_{\mathrm{t}}\\ {}={\left[S12\right]}_p(R){\left[S12\right]}_{pe}(R){\left[S12\right]}_s(R){\left[S12\right]}_{se}(R){\left[S23\right]}_p(R){\left[S23\right]}_{pe}(R){\left[S23\right]}_s(R)\\ {}{\left[S23\right]}_{se}(R){\left[S34\right]}_p(R){\left[S34\right]}_{pe}(R){\left[S34\right]}_s(R){\left[S34\right]}_{se}(R){\left[S45\right]}_p(R){\left[S45\right]}_{pe}(R)\\ {}{\left[S45\right]}_s(R){\left[S45\right]}_{se}(R){\left[S56\right]}_p(R){\left[S56\right]}_{pe}(R){\left[S56\right]}_s(R){\left[S56\right]}_{se}(R){\boldsymbol{v}}_{\mathrm{t}}\end{array}} $$
(4)

where [SIJ]p([SIJ]p(R)), [SIJ]pe([SIJ]pe(R)), [SIJ]s([SIJ]s(R)), and [SIJ]se([SIJ]se(R)) denotes the relative position (angular position) transformation matrix, the relative position error (angular position error) transformation matrix, the relative motion (angular motion) transformation matrix, the relative motion error (angular motion error) transformation matrix between the rigid body I and the adjacent lower body J respectively, as is displayed in [3].

Suppose that \( {\mathbf{r}}_{\mathrm{w}}^{\mathrm{i}} \) represent the ideal position vector of tool center point in WCS. Then, tool axis surface error model can be denoted as the following equation.

$$ {e}_s={\boldsymbol{r}}_{\mathrm{w}}-{\boldsymbol{r}}_{\mathrm{w}}^{\mathrm{i}} $$
(5)

In order to realize precision machining of machine tools, in two branches, the position of tool center point should be coincided in MCS at any moment, i.e., pw = pt. Thus, rw can be represented as Eq. (6) by using Eqs. (2) and (3):

$$ {\displaystyle \begin{array}{c}{\boldsymbol{r}}_{\mathrm{w}}={\left({r}_{\mathrm{w}\mathrm{x}}\kern0.5em {r}_{\mathrm{w}\mathrm{y}}\kern0.5em {r}_{\mathrm{w}\mathrm{z}}\kern0.5em 1\right)}^T\\ {}={\left({\left[S1\mathrm{w}\right]}_{\mathrm{p}}\right)}^{-1}{\left[S12\right]}_{\mathrm{p}}{\left[S12\right]}_{\mathrm{p}\mathrm{e}}{\left[S12\right]}_{\mathrm{s}}{\left[S12\right]}_{\mathrm{s}\mathrm{e}}{\left[S23\right]}_{\mathrm{p}}{\left[S23\right]}_{\mathrm{p}\mathrm{e}}{\left[S23\right]}_{\mathrm{s}}{\left[S23\right]}_{\mathrm{s}\mathrm{e}}\\ {}{\left[S34\right]}_{\mathrm{p}}{\left[S34\right]}_{\mathrm{p}\mathrm{e}}{\left[S34\right]}_{\mathrm{s}}{\left[S34\right]}_{\mathrm{s}\mathrm{e}}{\left[S45\right]}_{\mathrm{p}}{\left[S45\right]}_{\mathrm{p}\mathrm{e}}{\left[S45\right]}_{\mathrm{s}}{\left[S45\right]}_{\mathrm{s}\mathrm{e}}{\left[S56\right]}_{\mathrm{p}}\\ {}{\left[S56\right]}_{\mathrm{p}\mathrm{e}}{\left[S56\right]}_{\mathrm{s}}{\left[S56\right]}_{\mathrm{s}\mathrm{e}}{\boldsymbol{r}}_{\mathrm{t}}\end{array}} $$
(6)

Ignoring geometric errors in Eq. (6), \( {\mathbf{r}}_{\mathrm{w}}^{\mathrm{i}} \) can be obtained, as show in Eq. (7):

$$ {\displaystyle \begin{array}{c}{\boldsymbol{r}}_{\mathrm{w}}^{\mathrm{i}}={\left({r}_{\mathrm{w}\mathrm{x}}^{\mathrm{i}}\kern0.5em {r}_{\mathrm{w}\mathrm{y}}^{\mathrm{i}}\kern0.5em {r}_{\mathrm{w}\mathrm{z}}^{\mathrm{i}}\kern0.5em 1\right)}^T\\ {}={\left({\left[S1\mathrm{w}\right]}_{\mathrm{p}}\right)}^{-1}{\left[S12\right]}_{\mathrm{p}}{\left[S12\right]}_{\mathrm{s}}{\left[S23\right]}_{\mathrm{p}}{\left[S23\right]}_{\mathrm{s}}{\left[S34\right]}_{\mathrm{p}}{\left[S34\right]}_{\mathrm{s}}\\ {}{\left[S45\right]}_{\mathrm{p}}{\left[S45\right]}_{\mathrm{s}}{\left[S56\right]}_{\mathrm{p}}{\left[S56\right]}_{\mathrm{s}}{\boldsymbol{r}}_{\mathrm{t}}\end{array}} $$
(7)

Therefore, tool axis surface error es can be described as Eq. (8) by substituting Eqs. (6) and (7) into Eq.(5):

$$ {e}_s=\left(\begin{array}{c}{e}_x\\ {}{e}_y\\ {}{e}_z\end{array}\right) $$
(8)

where ex, ey, ez denote the component of es in x, y, z direction, respectively. Their algebraic expressions are displayed in Appendix 1. x, y, z, c, b denote the NC instruction values of X-, Y-, Z-, C-, and B-axis, respectively.

2.2 Tool path planning based on the S-shaped test piece

An S-shaped test piece is formed by equidistant thickening of S-shaped non-developable ruled surface. Its model formation process is as follows. First, given the control points of the top and bottom for the S-shaped ruled surface (as is seen in Table 7 of Appendix 2), the S-shaped curve models for the top and bottom of the test piece called the alignments of ruled surfaces are established. Then, the S-shaped ruled surface model is built by interpolating control points of two alignments. Meanwhile, the control points on the ruled surface are all interpolated and calculated by using three uniform B-spline curves [8, 15]. Finally, an S-shaped equal thickness strip model is obtained by offsetting each point at a certain distance along the normal direction. Figure 3 shows the model diagram of the S-shaped test piece.

Fig. 3
figure 3

The model diagram of the S-shaped test piece. a 2D model. b 3D model

According to Refs. [10, 12, 15, 29], the typical characteristic of un-developable ruled surface is the existence of twist angle, which will inevitably lead to theoretical errors in the machining of the S-shaped test piece. Figure 4 shows the schematic diagram of theoretical error formation during S-shaped test piece processing. Where Q1 and Q2 denote the control point on the upper and lower alignment respectively, n1 and n2 denote the unit normal vector of the upper and lower alignment at Q1 and Q2 respectively, O denotes tool center point, φ denotes twist angle, v denotes tool axis orientation, and R denotes tool radius.

Fig. 4
figure 4

The schematic diagram of theoretical error formation

This paper mainly aims to develop the error causation analysis based on S-shaped test piece and should eliminate theoretical error to avoid being the interference factor of this research. So, this section utilized the new three-point tangential method proposed in [12] to obtain the optimized tool path, as is displayed in Fig. 5.

Fig. 5
figure 5

The optimized tool path

In addition, as shown in Fig. 6, three test lines L1, L2, and L3, whose heights are 8 mm, 17.5 mm, and 35 mm respectively, and the upper and lower alignment, are chosen to calculate theoretical error of the optimized tool path along X-axis positive direction of the CS for S-shaped test piece. The calculated theoretical errors are displayed in Fig. 7. Figure 8 marks the regions with larger theoretical errors on S-shaped ruled surface.

Fig. 6
figure 6

The schematic diagram of theoretical error test positions (unit: mm)

Fig. 7
figure 7

Theoretical error of the optimized tool path

Fig. 8
figure 8

The regions with large theoretical error on S-shaped ruled surface

From Fig. 7, it can be seen that the maximum theoretical error is 0.009 mm. It is obvious that theoretical error of the optimized tool path can be negligible because the standard of the S-shaped test piece requires an allowable range of final error from − 0.05 mm to + 0.05 mm [8]. Therefore, a conclusion is drawn that the theoretical error of the optimized tool path will not interfere with the follow-up research.

2.3 Generation of NC instruction for S-shaped test piece processing

In the cutting process of test piece, NC instruction, which includes that of translational axis and rotary axis, is a precondition for obtaining machining error of surface.

For this researched FAMT in this paper, there are some key position points. Figure 9 shows the vector schematic diagram of these key position points. Where Om and Ow denote the origins of MCS and WCS respectively, P1 and P2 denote the ideal machining position and actual machining position respectively, qc0 and qc denote the vector of tool setting position in WCS and MCS respectively, and qw denote the position vector of WCS origin in MCS.

Fig. 9
figure 9

Vector schematic diagram of the key position points

In Eq. (6), when rw=0, the position equation of the WCS origin in MCS can be obtained, as shown in Eq. (9). Simultaneously, the ideal position equation of the WCS origin in MCS can be described as Eq. (10) by ignoring geometric error in Eq. (9). Where \( {\mathbf{q}}_{\mathrm{w}}^{\mathrm{i}}={\left({q}_{\mathrm{w}\mathrm{x}}^{\mathrm{i}}\kern0.5em {q}_{\mathrm{w}\mathrm{y}}^{\mathrm{i}}\kern0.5em {q}_{\mathrm{w}\mathrm{z}}^{\mathrm{i}}\kern0.5em 1\right)}^{\mathrm{T}} \)denotes the ideal position vector of the WCS origin in MCS.

$$ {\displaystyle \begin{array}{c}{\boldsymbol{q}}_{\mathrm{w}}={\left({q}_{\mathrm{w}\mathrm{x}}\kern0.5em {q}_{\mathrm{w}\mathrm{y}}\kern0.5em {q}_{\mathrm{w}\mathrm{z}}\kern0.5em 1\right)}^{\mathrm{T}}\\ {}={\left[S12\right]}_{\mathrm{p}}{\left[S12\right]}_{\mathrm{p}\mathrm{e}}{\left[S12\right]}_{\mathrm{s}}{\left[S12\right]}_{\mathrm{s}\mathrm{e}}{\left[S23\right]}_{\mathrm{p}}{\left[S23\right]}_{\mathrm{p}\mathrm{e}}{\left[S23\right]}_{\mathrm{s}}\\ {}{\left[S23\right]}_{\mathrm{s}\mathrm{e}}{\left[S34\right]}_{\mathrm{p}}{\left[S34\right]}_{\mathrm{p}\mathrm{e}}{\left[S34\right]}_{\mathrm{s}}{\left[S34\right]}_{\mathrm{s}\mathrm{e}}{\left[S45\right]}_{\mathrm{p}}{\left[S45\right]}_{\mathrm{p}\mathrm{e}}\\ {}{\left[S45\right]}_{\mathrm{s}}{\left[S45\right]}_{\mathrm{s}\mathrm{e}}{\left[S56\right]}_{\mathrm{p}}{\left[S56\right]}_{\mathrm{p}\mathrm{e}}{\left[S56\right]}_{\mathrm{s}}{\left[S56\right]}_{\mathrm{s}\mathrm{e}}{\boldsymbol{r}}_{\mathrm{t}}\end{array}} $$
(9)
$$ {\displaystyle \begin{array}{c}{\boldsymbol{q}}_{\mathrm{w}}^{\mathrm{i}}={\left({q}_{\mathrm{w}\mathrm{x}}^{\mathrm{i}}\kern0.5em {q}_{\mathrm{w}\mathrm{y}}^{\mathrm{i}}\kern0.5em {q}_{\mathrm{w}\mathrm{z}}^{\mathrm{i}}\kern0.5em 1\right)}^{\mathrm{T}}\\ {}={\left[S12\right]}_{\mathrm{p}}{\left[S12\right]}_{\mathrm{s}}{\left[S23\right]}_{\mathrm{p}}{\left[S23\right]}_{\mathrm{s}}{\left[S34\right]}_{\mathrm{p}}\\ {}{\left[S34\right]}_{\mathrm{s}}{\left[S45\right]}_{\mathrm{p}}{\left[S45\right]}_{\mathrm{s}}{\left[S56\right]}_{\mathrm{p}}{\left[S56\right]}_{\mathrm{s}}{\boldsymbol{r}}_{\mathrm{t}}\end{array}} $$
(10)

Suppose that the position vector of tool setting position in WCS is represented as \( {\mathbf{q}}_{\mathrm{c}0}={\left({q}_{\mathrm{c}\mathrm{x}0}\kern0.5em {q}_{\mathrm{c}\mathrm{y}0}\kern0.5em {q}_{\mathrm{c}\mathrm{z}0}\kern0.5em 1\right)}^{\mathrm{T}} \), then the position vector of tool setting position in MCS can be obtained, as shown in Eq. (11).

$$ {\displaystyle \begin{array}{c}{\boldsymbol{q}}_{\mathrm{c}}={\left({q}_{\mathrm{c}\mathrm{x}}\kern0.5em {q}_{\mathrm{c}\mathrm{y}}\kern0.5em {q}_{\mathrm{c}\mathrm{z}}\kern0.5em 1\right)}^{\mathrm{T}}={\boldsymbol{q}}_{\mathrm{w}}+{\boldsymbol{q}}_{\mathrm{c}0}\\ {}={\left[S12\right]}_{\mathrm{p}}{\left[S12\right]}_{\mathrm{p}\mathrm{e}}{\left[S12\right]}_{\mathrm{s}}{\left[S12\right]}_{\mathrm{s}\mathrm{e}}{\left[S23\right]}_{\mathrm{p}}{\left[S23\right]}_{\mathrm{p}\mathrm{e}}{\left[S23\right]}_{\mathrm{s}}\\ {}{\left[S23\right]}_{\mathrm{s}\mathrm{e}}{\left[S34\right]}_{\mathrm{p}}{\left[S34\right]}_{\mathrm{p}\mathrm{e}}{\left[S34\right]}_{\mathrm{s}}{\left[S34\right]}_{\mathrm{s}\mathrm{e}}{\left[S45\right]}_{\mathrm{p}}{\left[S45\right]}_{\mathrm{p}\mathrm{e}}\\ {}{\left[S45\right]}_{\mathrm{s}}{\left[S45\right]}_{\mathrm{s}\mathrm{e}}{\left[S56\right]}_{\mathrm{p}}{\left[S56\right]}_{\mathrm{p}\mathrm{e}}{\left[S56\right]}_{\mathrm{s}}{\left[S56\right]}_{\mathrm{s}\mathrm{e}}{\boldsymbol{r}}_{\mathrm{t}}+{\boldsymbol{q}}_{\mathrm{c}0}\end{array}} $$
(11)

Since tool setting position is regarded as the error-free machining datum point in actual machining, its tool path can be deduced on the basis of the ideal kinematics model. Let geometric error parameters in Eq. (11), and rotation angles of B-axis and C-axes at tool setting position equal to 0, then the ideal position vector of tool setting position in MCS can be represented as Eq. (12). Where \( {\mathbf{q}}_{\mathrm{c}}^{\mathrm{i}}={\left({q}_{\mathrm{c}\mathrm{x}}^{\mathrm{i}}\kern0.5em {q}_{\mathrm{c}\mathrm{y}}^{\mathrm{i}}\kern0.5em {q}_{\mathrm{c}\mathrm{z}}^{\mathrm{i}}\kern0.5em 1\right)}^{\mathrm{T}} \) denotes the ideal position vector of tool setting position in MCS, and \( {\left({x}_0\kern0.5em {y}_0\kern0.5em {z}_0\right)}^{\mathrm{T}} \) denotes the NC instruction at tool setting position.

$$ {\displaystyle \begin{array}{l}{\boldsymbol{q}}_{\mathrm{c}}^{\mathrm{i}}={\left({q}_{\mathrm{c}\mathrm{x}}^{\mathrm{i}}\kern0.5em {q}_{\mathrm{c}\mathrm{y}}^{\mathrm{i}}\kern0.5em {q}_{\mathrm{c}\mathrm{z}}^{\mathrm{i}}\kern0.5em 1\right)}^{\mathrm{T}}\\ {}\begin{array}{c}\end{array}\kern0.8000001em ={\left[S12\right]}_{\mathrm{p}}{\left[S12\right]}_{\mathrm{s}0}{\left[S23\right]}_{\mathrm{p}}{\left[S23\right]}_{\mathrm{s}0}{\left[S34\right]}_{\mathrm{p}}{\left[S34\right]}_{\mathrm{s}0}{\left[S45\right]}_{\mathrm{p}}{\left[S45\right]}_{\mathrm{s}0}{\left[S56\right]}_{\mathrm{p}}{\left[S56\right]}_{\mathrm{s}0}{\boldsymbol{r}}_{\mathrm{t}}+{\boldsymbol{q}}_{\mathrm{c}0}\\ {}\kern1.2em =\left[\begin{array}{cccc}1& 0& 0& {q}_{2\mathrm{x}}\\ {}0& 1& 0& {q}_{2\mathrm{y}}\\ {}0& 0& 1& {q}_{2\mathrm{z}}\\ {}0& 0& 0& 1\end{array}\right]\left[\begin{array}{cccc}1& 0& 0& {x}_0\\ {}0& 1& 0& 0\\ {}0& 0& 1& 0\\ {}0& 0& 0& 1\end{array}\right]\left[\begin{array}{cccc}1& 0& 0& {q}_{3\mathrm{x}}\\ {}0& 1& 0& {q}_{3\mathrm{y}}\\ {}0& 0& 1& {q}_{3\mathrm{z}}\\ {}0& 0& 0& 1\end{array}\right]\left[\begin{array}{cccc}1& 0& 0& 0\\ {}0& 1& 0& {y}_0\\ {}0& 0& 1& 0\\ {}0& 0& 0& 1\end{array}\right]\\ {}\kern1.45em \left[\begin{array}{cccc}1& 0& 0& {q}_{4\mathrm{x}}\\ {}0& 1& 0& {q}_{4\mathrm{y}}\\ {}0& 0& 1& {q}_{4\mathrm{z}}\\ {}0& 0& 0& 1\end{array}\right]\left[\begin{array}{cccc}1& 0& 0& 0\\ {}0& 1& 0& 0\\ {}0& 0& 1& {z}_0\\ {}0& 0& 0& 1\end{array}\right]\left[\begin{array}{cccc}1& 0& 0& {q}_{5\mathrm{x}}\\ {}0& 1& 0& {q}_{5\mathrm{y}}\\ {}0& 0& 1& {q}_{5\mathrm{z}}\\ {}0& 0& 0& 1\end{array}\right]\left[\begin{array}{cccc}1& 0& 0& {q}_{6\mathrm{x}}\\ {}0& 1& 0& {q}_{6\mathrm{y}}\\ {}0& 0& 1& {q}_{6\mathrm{z}}\\ {}0& 0& 0& 1\end{array}\right]\left(\begin{array}{c}0\\ {}0\\ {}-l\\ {}1\end{array}\right)+\left(\begin{array}{c}{q}_{cx0}\\ {}{q}_{cy0}\\ {}{q}_{cz0}\\ {}1\end{array}\right)\\ {}\kern1.25em =\left(\begin{array}{c}{q}_{2\mathrm{x}}+{q}_{3\mathrm{x}}+{q}_{4\mathrm{x}}+{q}_{5\mathrm{x}}+{q}_{6\mathrm{x}}+{q}_{\mathrm{c}\mathrm{x}0}+{x}_0\\ {}{q}_{2\mathrm{y}}+{q}_{3\mathrm{y}}+{q}_{4\mathrm{y}}+{q}_{5\mathrm{y}}+{q}_{6\mathrm{y}}+{q}_{\mathrm{c}\mathrm{y}0}+{y}_0\\ {}{q}_{2\mathrm{z}}+{q}_{3\mathrm{z}}+{q}_{4\mathrm{z}}+{q}_{5\mathrm{z}}+{q}_{6\mathrm{z}}+{q}_{\mathrm{c}\mathrm{z}0}+{z}_0-l\\ {}1\end{array}\right)\end{array}} $$
(12)

And, Eq. (12) can also be simplified to the following equation:

$$ \left(\begin{array}{c}{x}_0\\ {}{y}_0\\ {}{z}_0\end{array}\right)=\left(\begin{array}{c}{q}_{\mathrm{cx}}^{\mathrm{i}}-{q}_{2\mathrm{x}}-{q}_{3\mathrm{x}}-{q}_{4\mathrm{x}}-{q}_{5\mathrm{x}}-{q}_{6\mathrm{x}}-{q}_{\mathrm{cx}0}\\ {}{q}_{\mathrm{cy}}^{\mathrm{i}}-{q}_{2\mathrm{y}}-{q}_{3\mathrm{y}}-{q}_{4\mathrm{y}}-{q}_{5\mathrm{y}}-{q}_{6\mathrm{y}}-{q}_{\mathrm{cy}0}\\ {}{q}_{\mathrm{cz}}^{\mathrm{i}}-{q}_{2\mathrm{z}}-{q}_{3\mathrm{z}}-{q}_{4\mathrm{z}}-{q}_{5\mathrm{z}}-{q}_{6\mathrm{z}}-{q}_{\mathrm{cz}0}+l\end{array}\right) $$
(13)

According to Eq. (7) and Fig. 9, \( {\mathbf{r}}_{\mathrm{w}}^{\mathrm{i}} \) can also be represented as Eq. (14):

$$ {\displaystyle \begin{array}{c}{\boldsymbol{r}}_{\mathrm{w}}^{\mathrm{i}}={\left[S1\mathrm{w}\right]}_{\mathrm{p}}{\boldsymbol{r}}_{\mathrm{w}}^{\mathrm{i}}-{\boldsymbol{q}}_{\mathrm{w}}\\ {}={\left[S12\right]}_{\mathrm{p}}{\left[S12\right]}_{\mathrm{s}}{\left[S23\right]}_{\mathrm{p}}{\left[S23\right]}_{\mathrm{s}}{\left[S34\right]}_{\mathrm{p}}{\left[S34\right]}_{\mathrm{s}}{\left[S45\right]}_{\mathrm{p}}\\ {}{\left[S45\right]}_{\mathrm{s}}{\left[S56\right]}_{\mathrm{p}}{\left[S56\right]}_{\mathrm{s}}{\boldsymbol{r}}_{\mathrm{t}}-{\left({q}_{\mathrm{w}\mathrm{x}}\kern0.5em {q}_{\mathrm{w}\mathrm{y}}\kern0.5em {q}_{\mathrm{w}\mathrm{z}}\kern0.5em 1\right)}^{\mathrm{T}}\end{array}} $$
(14)

Thus, NC instruction of translational axis for the FAMT can be obtained by utilizing Eq. (14), as shown in Eq. (15):

$$ \left(\begin{array}{c}x\\ {}y\\ {}z\end{array}\right)=\left(\begin{array}{c}{r}_{\mathrm{wx}}^{\mathrm{i}}-{q}_{2\mathrm{x}}-{q}_{3\mathrm{x}}-{q}_{4\mathrm{x}}-{q}_{5\mathrm{x}}-{q}_{6\mathrm{x}}\cos (c)+{q}_{6\mathrm{y}}\sin (c)+l\sin (b)\cos (c)+{q}_{\mathrm{wx}}\\ {}{r}_{\mathrm{wy}}^{\mathrm{i}}-{q}_{2\mathrm{y}}-{q}_{3\mathrm{y}}-{q}_{4\mathrm{y}}-{q}_{5\mathrm{y}}-{q}_{6\mathrm{y}}\cos (c)-{q}_{6\mathrm{x}}\sin (c)+l\sin (b)\sin (c)+{q}_{\mathrm{wy}}\\ {}{r}_{\mathrm{wz}}^{\mathrm{i}}-{q}_{2\mathrm{z}}-{q}_{3\mathrm{z}}-{q}_{4\mathrm{z}}-{q}_{5\mathrm{z}}-{q}_{6\mathrm{z}}+l\cos (b)+{q}_{\mathrm{wz}}\end{array}\right) $$
(15)

By using Eqs.(13) and (15), the following equation can be obtained:

$$ \left(\begin{array}{c}x\\ {}y\\ {}z\end{array}\right)=\left(\begin{array}{c}{r}_{\mathrm{wx}}^{\mathrm{i}}+{x}_0+{q}_{\mathrm{wx}}+{q}_{\mathrm{cx}0}-{q}_{\mathrm{cx}}^{\mathrm{i}}+l\sin (b)\cos (c)+{q}_{6\mathrm{x}}-{q}_{6\mathrm{x}}\cos (c)+{q}_{6\mathrm{y}}\sin (c)\\ {}{r}_{\mathrm{wy}}^{\mathrm{i}}+{y}_0+{q}_{\mathrm{wy}}+{q}_{\mathrm{cy}0}-{q}_{\mathrm{cy}}^{\mathrm{i}}+l\sin (b)\sin (c)+{q}_{6\mathrm{y}}-{q}_{6\mathrm{y}}\cos (c)-{q}_{6\mathrm{x}}\sin (c)\\ {}{r}_{\mathrm{wz}}^{\mathrm{i}}+{z}_0+{q}_{\mathrm{wz}}+{q}_{\mathrm{cz}0}-{q}_{\mathrm{cz}}^{\mathrm{i}}+l\cos (b)-l\end{array}\right) $$
(16)

As is seen in Fig. 9, the ideal tool setting position can be represented as the following equation:

$$ {\boldsymbol{q}}_{\mathrm{c}}^{\mathrm{i}}=\left(\begin{array}{c}{q}_{\mathrm{c}\mathrm{x}}^{\mathrm{i}}\\ {}{q}_{\mathrm{c}\mathrm{y}}^{\mathrm{i}}\\ {}{q}_{\mathrm{c}\mathrm{z}}^{\mathrm{i}}\end{array}\right)={q}_w+{q}_{c0}=\left(\begin{array}{c}{q}_{wx}\\ {}{q}_{wy}\\ {}{q}_{wz}\end{array}\right)+\left(\begin{array}{c}{q}_{cx0}\\ {}{q}_{cy0}\\ {}{q}_{cz0}\end{array}\right)=\left(\begin{array}{c}{q}_{wx}+{q}_{cx0}\\ {}{q}_{wy}+{q}_{cy0}\\ {}{q}_{wz}+{q}_{cz0}\end{array}\right) $$
(17)

By utilizing Eqs. (16) and (17), Eq.(18) can be obtained:

$$ \left(\begin{array}{c}x\\ {}y\\ {}z\end{array}\right)=\left(\begin{array}{c}{r}_{\mathrm{wx}}^{\mathrm{i}}+{x}_0+l\sin (b)\cos (c)+{q}_{6\mathrm{x}}-{q}_{6\mathrm{x}}\cos (c)+{q}_{6\mathrm{y}}\sin (c)\\ {}{r}_{\mathrm{wy}}^{\mathrm{i}}+{y}_0+l\sin (b)\sin (c)+{q}_{6\mathrm{y}}-{q}_{6\mathrm{y}}\cos (c)-{q}_{6\mathrm{x}}\sin (c)\\ {}{r}_{\mathrm{wz}}^{\mathrm{i}}+{z}_0+l\cos (b)-l\end{array}\right) $$
(18)

In addition, to obtain the NC instruction of translational axis in Eq. (18), NC instruction of rotary axis should also be solved.

Suppose that geometric errors in Eq. (4) are neglected, and then the mapping relationship between tool axis vector v and NC instruction of rotary axis can be described as the following equation:

$$ v=\left(\begin{array}{c}{v}_x\\ {}{v}_y\\ {}{v}_z\end{array}\right)=\left(\begin{array}{c}\sin (b)\cos (c)\\ {}\sin (b)\sin (c)\\ {}\cos (b)\end{array}\right) $$
(19)

where \( v={\left({v}_x\kern0.5em {v}_y\kern0.5em {v}_z\right)}^T \) denotes tool axis vector and is determined by the generatrix vector (as shown in Fig. 4).

Utilizing Eq. (19), the following equations can be obtained:

$$ b=\Big\{{\displaystyle \begin{array}{c}-\operatorname{arccos}\left({v}_z\right)\kern0.5em -{180}^{\circ }<b\le {0}^{\circ}\\ {}\operatorname{arccos}\left({v}_z\right)\kern1.25em {0}^{\circ }<b<18{0}^{\circ }\ \end{array}} $$
(20)
$$ c=\Big\{{\displaystyle \begin{array}{c}\arctan 2\left({v}_y,{v}_x\right)-{180}^{\circ };-{360}^{\circ }<c\le -{180}^{\circ}\\ {}\arctan 2\left({v}_y,{v}_x\right);\kern3em -{180}^{\circ }<c\le {180}^{\circ}\\ {}\arctan 2\left({v}_y,{v}_x\right)+{180}^{\circ };\kern1.5em {180}^{\circ }<c\le {360}^{\circ}\end{array}} $$
(21)

The generation principle of NC instruction for rotary axes is to make its vector change as uniformly as possible to reduce machining error caused by speed fluctuation. In this research, to ensure the continuity of the change of rotation angle for rotary axes, B-axis swings in the range from − 105° to 0° and change values of C-axis angles do not exceed 270°. Figure 10 shows the flowchart of NC instruction calculation for rotary axes. The NC instruction of rotary axes is generated by substituting \( v={\left({v}_x\kern0.5em {v}_y\kern0.5em {v}_z\right)}^T \) into Eqs. (20) and (21), as shows in Fig. 11. Then, by substituting the NC instruction of rotary axes into Eq. (18), the NC instruction of translational axes can be obtained, as is displayed in Fig. 12.

Fig. 10
figure 10

The flowchart of NC instruction calculation for rotary axes

Fig. 11
figure 11

The NC instruction of rotary axes

Fig. 12
figure 12

The NC instruction of translational axes

2.4 Establishment of error spatial model for S-shaped test piece

According to the above-mentioned analysis, by using the optimized tool path, the machining error of surface for S-shaped test piece can be thought of as being caused only by tool axis surface error due to the elimination of theoretical error. In addition, the unit normal vector of the upper and lower alignment can be considered equal, i.e., n1 = n2 = n (as shown in Fig. 4). Therefore, error spatial model for S-shaped test piece can be established, as shown in Eq. (22), where E denotes spatial error.

$$ E=n\cdotp {e}_s $$
(22)

The physical meaning of Eq. (22) is error spatial morphology of S-shaped test piece. And it can construct a mapping relationship between geometric error of the machine tool and contour error of the S-shaped test piece, and map errors of the machine tool to the test piece surface. So, it is regarded as a theoretical basis of the causation analysis of machining error for test piece surface.

As a matter of fact, Eq. (22) expresses a functional relationship between spatial error and geometric error parameters. So, E can be also represented as Eq. (23):

$$ E=f\left({G}_1,{G}_2,\cdots {G}_i,\cdots {G}_{37}\right)\;\left(i=1,2,\cdots 37\right) $$
(23)

where Gi denotes the ith geometric error parameter.

If the influence of a single geometric error parameter on error spatial morphology is only considered and all other error parameters are ignored, then the following equation can be obtained:

$$ {E}_i=f\left({G}_i\right) $$
(24)

where Ei refers to the spatial error caused only by error parameter Gi on the S-shaped test piece.

Please note that NC instruction value of tool setting position can be directly obtained by tool setting in actual processing, and the NC instruction calculated in this paper is actually relative instruction relative to tool setting position. Therefore, machining error of S-shaped test piece surface is practically affected by the error increment relative to tool setting position, not by the absolute value of machining error. Obviously, it is necessary to consider the factor that geometric error source parameters change with the relative movement of the machine tool, which further confirms the limitations of the traditional error analysis methods [23,24,25,26,27].

3 The causation analysis of contour error for S-shaped test piece

According to Eq. (22), contour error of test piece is mainly determined by the configuration and error parameters of the researched FAMT, and geometric parameters of test piece. In this paper, therefore, the causation analysis of contour error for S-shaped test piece can be developed by analyzing the error spatial morphology of S-shaped test piece. The error causation analysis for S-shaped test piece mainly includes four parts: (1) the acquisition of geometric error parameters, (2) the influence law of all geometric errors on error spatial morphology, (3) the influence law of a single geometric error on error spatial morphology, and (4) the causation analysis of contour error for s-shaped test piece, as is displayed in Fig. 13.

Fig. 13
figure 13

The flow chart of the error causation analysis for S-shaped test piece

3.1 Acquisition of geometric error parameters

To obtain 37 geometric error parameters, a measurement experiment is carried out on the studied FAMT. The dual-frequency laser interferometer, XL-80 by Renishaw, is utilized to identify 21 geometric errors of translational axes with the method introduced in [30], While, 16 geometric errors of rotary axes are obtained with the double-bar ball, QC20-W by Renishaw by using the method presented in [31].

In the experiment, the measuring strokes of X-axis, Y-axis, Z-axis, B-axis, and C-axis are 5000 mm, 1570 mm, 900 mm, 360°, and 105°. The experimental conditions are the same as those in [30, 31], respectively. Figure 14 shows the scenes of geometric error measurements. The position-independent geometric errors (PIGEs) are listed in Table 3. In addition, take X-axis and C-axis as an example, the scatter diagram of discrete data and the fitting curve diagram for position-dependent geometric errors (PDGEs) based on the polynomial optimization method in [30] are shown in Table 4.

Fig. 14
figure 14

The scenes of geometric error measurements. a Linear axis. b Rotary axis

Table 3 The value of PIGEs. (Unit: mm)
Table 4 The scatter diagram of discrete data and the fitting curve diagram for PDGEs

3.2 The influence law of all geometric errors on error spatial morphology

Error spatial morphology of the S-shape test piece can directly represent error spatial distribution of the test piece surface. Because surfaces on both sides of test piece are symmetrically distributed, this paper only aims to a side surface (namely, test surface in Fig. 6).

When considering all error parameters, error spatial morphology of test piece can be obtained, as shown in Fig. 15, where RP denotes the research point (RP), which represents the cutter location point selected to be analyzed in the machining process of test piece. And RP number increases along the increasing direction of X coordinate. Its left side is a spatial view, and the right side is a projection view of the left side. It will not be explained one by one later.

Fig. 15
figure 15

The error spatial morphology of S-shaped test piece

From Fig. 15, it can be seen that the left side of point 141 shows undercut error, the right side shows overcut error, and the error mutation point, namely point 122, appears in the middle of the test piece. This result indicates that the cause of machining error for the test piece can be further analyzed based on error spatial morphology.

In order to analyze the formation law of error morphology, the relative motion law of the machine tool should be described. In Fig. 16, (a), (b), (c), (d), and (e) represent the position coordinate of the tool center point and the speed of coordinate change in WCS when S-shaped test piece is processed. (f) represents the included angles between the surface normal vectors and three coordinate axes at the cutting point corresponding to tool center point.

Fig. 16
figure 16

Motion law of the FAMT. a X-axis. b Y-axis. c Z-axis. d C-axis. e B-axis. f The surface normal vector direction

As is observed in Fig. 16, at points 79 and 167, the surface normal vector is approximately perpendicular to X-axis and has the smallest angle to Y-axis. Along the positive direction of Y-axis, when the included angle between the surface normal vector and the X-axis is less than 90°, these two points are on the right side of the cutting surface, and vice versa. In addition, at these two points, the X-axis coordinates change faster, the Y-axis coordinates are almost unchanged, and Z-axis, C-axis, and B-axis change speeds of coordinates or rotation angles appear extreme values.

At points 24, 36, 208, and 221, the surface normal vector is approximately perpendicular to Y-axis, the X-axis coordinates is almost unchanged, and the Y-axis coordinates change faster.

At point 122, the included angles between the surface normal vectors and the Z-, X-, and Y-axes are approximately 90°, the smallest value, and the maximum value, respectively. At the same time, rotation angle values and directions of B- and C- axes change rapidly. At this point, the open-angle region of the S-shaped surface is cut at the position with the angle less than 90°, and its closed-angle region is cut at the position with the angle greater than 90°.

Based on the above analysis, at point 122, the rotation angles of two rotary axes are all abrupt, so it can be judged that this is caused by two rotary axes. The fact that the included angle between the surface normal vector and X-axis is the smallest shows error parameters in X direction have the most significant influence on the position. In addition, since the rotation angle of C-axis is about − 87° at point 122, run-out error of C-axis in Y direction has the greatest influence on X-direction error of tool axis. Similarly, B-axis is the same as C-axis. Therefore, it can be preliminarily judged that error parameters δy(c) and δy(b) are the main reason for the sudden change of machining error in the middle of the test piece. Then, repairing these two error parameters in error spatial model and observing the variation of error spatial morphology of the test piece, it can be seen that the error at point 122 is greatly reduced, as shown in Fig. 17. This proves that the above analysis method is correct.

Fig. 17
figure 17

The error spatial morphology of test piece after repairing parameters δy(c) and δy(b)

3.3 The influence law of a single geometric error on error spatial morphology

The influence degree of each geometric error on the spatial error of test piece is different, and the influence law is also different. In order to better grasp the influence law of each geometric error on error spatial morphology, spatial error caused only by a single error parameter should be calculated by using Eq. (24):

Taking examples of ten error parametersδx(x), εx(x), εy(x) ,δy(y) ,εx(y), εy(y), δx(z) ,δy(c) ,εz(c), and εx(b), the influence laws of single-error parameter on error spatial morphology are studied. Figures 18, 19, 20, 21, 22, 23, 24, 25, 26, and 27 show the error spatial morphology caused only by these ten error parameters, respectively.

  1. 1.

    Error characteristics caused by error parameter δx(x)

Fig. 18
figure 18

The error spatial morphology caused by δx(x)

Fig. 19
figure 19

The error spatial morphology caused by εx(x)

Fig. 20
figure 20

The error spatial morphology caused by εy(x)

Fig. 21
figure 21

The error spatial morphology caused by δy(y)

Fig. 22
figure 22

The error spatial morphology caused by εx(y)

Fig. 23
figure 23

The error spatial morphology caused by εy(y)

Fig. 24
figure 24

The error spatial morphology caused by δx(z)

Fig. 25
figure 25

The error spatial morphology caused by δy(c)

Fig. 26
figure 26

The error spatial morphology caused by εz(c)

Fig. 27
figure 27

The error spatial morphology caused by εx(b)

As shown in Fig. 18, at points 79 and 167, the effect of δx(x) on spatial error is 0, which indicates the correctness of the analysis that the surface normal vector is approximately perpendicular to X-axis (as shown in Fig. 16f).

On the left side of point 79 and on the right side of point 167, the tool cuts the left side of the test piece. But on the left side of point 79, the error increment of δx(x) relative to tool setting position is positive, so the machining error is negative. While on the right side of point 167, the error increment of δx(x) relative to tool setting position is negative, so the machining error is positive. At points 80–166, the tool cuts the right side of the test piece, and the error increment of δx(x) relative to tool setting position is negative, so the machining error is positive.

At points 24, 56, 192, and 221, X component of the surface normal vector and error spatial morphology all appears extreme. Thus, a conclusion can be drawn that the surface normal vector direction and geometric error increment have a major impact on error spatial morphology of the test piece.

In addition, since the positioning error of X-axis is linear, the projection view of error morphology does not diverge.

Therefore, if the S-shape test piece has larger machining error at points 79 and 167, it can be excluded from δx(x).

  1. 2.

    Error characteristics caused by error parameter εx(x)

As shown in Fig. 19, the biggest characteristic of spatial error caused by εx(x) is that the machining errors near points 79 and 167 vary greatly at different heights, which leads to the divergence of error spatial morphology. It is mainly due to the fact that the surface normal vector is approximately perpendicular to X-axis near these two points, and εx(x)causes the tool to rotate at a prominent angle around the X-axis. In addition, for the test piece, near point 79, the overcut error of the bottom is larger, the overcut error of the top is smaller, while near point 167, the undercut error of the top is larger, and the undercut error of the bottom is smaller. It is mainly because the angle increment of εx(x) relative to tool setting position is positive. At the same time, at points 24, 36, 208, and 221, the surface normal vector is approximately perpendicular to Y-axis, so the rotation angle of tool around X-axis does not make error morphologies of these positions diverge.

Therefore, if near points 79 and 167, the difference of machining error is larger at different heights, it is likely to be caused by εx(x).

  1. 3.

    Error characteristics caused by error parameter εy(x)

From Figs. 18 and 20, it is can be seen that the spatial error trends of εy(x) and δx(x) are similar, but error spatial morphology caused by εy(x) is slightly divergent at different heights in some positions, and its spatial error values are much larger. Moreover, at points 79 and 167, the spatial errors caused by εy(x) are all 0. It is mainly because at these two points, the surface normal vector is approximately perpendicular to X-axis, and εy(x) causes the tool to rotate an angle around the Y-axis.

Therefore, if the S-shape test piece has larger machining error near points 79 and 167, it can be excluded from εy(x).

  1. 4.

    Error characteristics caused by error parameter δy(y)

As shown in Fig. 21, near points 79 and 167, the machining error is the sharpest, because the surface normal vector is approximately perpendicular to X-axis. While, at points 24, 36,208, and 221, the machining error caused is 0, because the surface normal vector is approximately perpendicular to Y-axis. In addition, at points 57,129 and 187, the machining error is also 0, because the error increment of δy(y) relative to tool setting position is 0.

Since the error increment of δy(y) relative to tool setting position is positive at points 57–127 and after point 188, the test piece exhibits an undercut error, and the error increment of δy(y) relative to tool setting position is negative at the other positions; the test piece exhibits an overcut error.

Therefore, the larger machining errors near points 24, 36, 208, and 221 can be excluded from δy(y), while the larger machining errors near points 79 and 167 may be caused by δy(y).

  1. 5.

    Error characteristics caused by error parameter εx(y)

In Fig. 22, the spatial error trend caused by εx(y) is similar to that by δy(y), and its analysis procedure is also similar to δy(y). Therefore, if the test piece has larger machining error at points 79 and 167, it can be considered whether it is caused by εx(y). But, compared to δy(y), spatial error values caused by εx(y) are bigger.

  1. 6.

    Error characteristics caused by error parameter εy(y)

As shown in Fig. 23, the spatial error caused by εy(y) is 0; it is mainly because the surface normal vector is approximately perpendicular to X-axis near points 79 and 167. While at points 57, 129, and 187, the angle error increment of εy(y) relative to tool setting position is 0, so the spatial errors caused by εy(y) in these three positions are 0, and the absolute error caused by εy(y) is larger at the two ends of the test piece.

Therefore, in the vicinity of points 79 and 167, if the S-shaped test piece forms a larger machining error, it can be excluded from the influence of εy(y), and at the two ends of the test piece, the effect of εy(y) is more prominent.

  1. 7.

    Error characteristics caused by error parameter δx(z)

In Fig. 24, in the vicinity of points 79 and 167, the spatial error caused by δx(z) is 0. It is mainly because the surface normal vector is approximately parallel to X-axis. While, because at points 115 and 124, the error increment of δx(z) relative to tool setting position is 0, machining error caused by δx(z) is 0, and at points 44 and 216, error increment of δx(z) shows the maximum value, spatial error caused by δx(z) appears extreme points.

In addition, on the left side of point 79 and on the right side of point 167, the tool cuts the left side of the test piece and error increment of δx(z) is negative, so the test piece is overcut. And at points 115–124, the tool cuts the right side of the test piece and error increment of δx(z) is positive, so the test piece is undercut. At the same time, at points 79–115 and 124–167, the tool cuts the right side of the test piece and error increment of δx(z) is negative, so the test piece is overcut.

Therefore, if the S-shaped test piece forms a larger machining error in the vicinity of points 79 and 167, it can be excluded from δx(z).

  1. 8.

    Error characteristics caused by error parameter δy(c)

As shown in Fig. 25, the most prominent feature of error spatial morphology caused by δy(c) is a sudden change of a larger error value at point 122. According to the previous analysis, the error parameter δy(c) is one of the main factors that cause the error mutation in the middle of the test piece.

In addition, δy(c) can make the tool shift in the Y direction, so it has a significant effect on the spatial error when the surface normal vector is perpendicular to X-axis near the 79 and 167 points, while the machining error of the test piece is smaller when the surface normal vector is perpendicular to Y-axis in the vicinity of points 24, 36, 209, and 221.

Therefore, the larger machining errors near points 79 and 167 may be caused by δy(c).

  1. 9.

    Error characteristics caused by error parameter εz(c)

As shown in Fig. 26, at points 10, 87, 116, 124, 156, and 167, the increment of C-axis angular positioning error relative to tool setting position is 0, so the machining error of the test piece caused by εz(c) is 0. While at points 52, 100, 138, and 197, the increment of C-axis angular positioning error relative to tool setting position is the maximum value, so machining errors caused by εz(c) appear the extreme points.

  1. 10.

    Error characteristics caused by error parameter εx(b)

As shown in Fig. 27, at points 24, 36, 208, and 221, the surface normal vector of the test piece is approximately perpendicular to Y-axis, so the spatial error caused by εx(b) is 0, and at point 122, the angle between the surface normal vector and X-axis is smaller, so the machining error caused by εx(b) is also smaller. In addition, at points 79 and 167, the surface normal vector is nearly perpendicular to X-axis, so machining error value caused by εx(b) is the most prominent.

Therefore, the larger machining errors near points 24, 36, 208, and 221 can be excluded from εx(b), while the larger machining errors near points 79 and 167 may be caused by εx(b).

3.4 The causation analysis of contour error for S-shaped test piece

Based on the analysis in Sects. 3.2 and 3.3, the relationships between geometric error parameters and error spatial morphologies of test piece can be obtained. Thus, the causation analysis of machining error of S-shaped test piece can be developed from two aspects: the causation analysis of local error and the causation analysis of global error.

3.4.1 The causation analysis of local error

The causation analysis method of local error aims to decouple the key geometric error parameters which affect the machining error of local regions for S-shaped test piece. While, as shown in Fig. 8, the geometric characteristic that the S-shaped test piece has five special regions determines that some special points on the test piece can be analyzed. This paper takes examples of points 79,167, 24, 36, 208, and 221 to develop the causation analysis of local error.

According to Sect. 3.2, at points 79 and 167, the motion directions of Y-axis will change (as shown in Fig. 16b) and the surface normal vectors are approximately perpendicular to X-axis (as shown in Fig. 16f). Therefore, for these machining regions, the following conclusions can be drawn:

  1. 1.

    Angular error parameters around Y-axis have little effect on contour error of the test piece. For example, machining errors caused by error parameters εy(x) (as shown in Fig. 20) and εy(y) (as shown in Fig. 23) are approximately 0.

  2. 2.

    Angular error parameters around X-axis have great influence on contour error of the test piece. For example, error spatial morphologies caused by error parameters, such as εx(x) (as shown in Fig. 19), εx(y) (as shown in Fig. 22) and εx(b) (as shown in Fig. 27), appear prominent peaks.

  3. 3.

    Linear error parameters of the translational axes along X direction have a very small effect on contour error of the test piece. For example, machining errors caused by error parameters, such as δx(x) (as shown in Fig. 18) and δx(z) (as shown in Fig. 24) are approximately 0.

  4. 4.

    Linear error parameters of the translational axes along Y direction have a very big impact on contour error of the test piece. For example, error parameter δy(y) (as shown in Fig. 21) leads to a prominent peak in error spatial morphology of the test piece.

  5. 5.

    Since the direction of radial run-out error for rotary axis is easily changed, it should be combined with the rotation angle of rotary axis to judge this direction. Therefore, the analysis of the influence of radial run-out error for the rotary axis on machining error should be based on the specific conditions. For example, at point 79, the rotation angle of C-axis is about 90°, so error parameter δy(c) (as shown in Fig. 25) has a greater impact on machining error.

  6. 6.

    In addition to the above factors, the absolute value of machining error caused by each error parameter should also be taken into account. Although error spatial morphologies caused by some error parameters appear the peak at the analysis points, they have no effect on the whole machining error because these error values are relatively small.

Furthermore, according to Sect. 3.2, at points 24, 36, 208, and 221, the X-axis motion directions will change (as shown in Fig. 16a), and the surface normal vectors are approximately perpendicular to Y-axis (as shown in Fig. 16f). Although the error analysis at these points can refer to the analysis ideas of points 79 and 167, the surface normal vectors have a faster transition and a larger fluctuation in these regions, and error spatial morphologies are not as prominent as that of points 79 and 167. Therefore, for machining regions formed by points 24–36 and 208–221, the following conclusions can be drawn:

  1. 1.

    Angular error parameters around Y-axis have great influence on the contour error of the test piece. For example, machining errors caused by error parameters εy(x) (as shown in Fig. 20) and εy(y) (as shown in Fig. 23) are larger and appear local extreme points.

  2. 2.

    Angular error parameters around X-axis have a very small effect on contour error of the test piece, such as εx(x) (as shown in Fig. 19), εx(y) (as shown in Fig. 22), and εx(b) (as shown in Fig. 27).

  3. 3.

    Linear error parameters of the translational axes along X direction have a very big impact on contour error of the test piece, such as δx(x) (as shown in Fig. 18) and δx(z) (as shown in Fig. 24).

  4. 4.

    Linear error parameters of the translational axes along Y direction have a very small effect on contour error of the test piece, such as δy(y) (as shown in Fig. 21) and δy(c) (as shown in Fig. 25).

Please note that the conclusions of Articles (1) to (4) are applicable to machining process of any S-shaped test piece, while Articles (5) to (6) are affected by the specific machining process. Moreover, points 79 and 221 are just within the range of regions 2 and 5 in Fig. 8 respectively, which verifies the geometric property that the S-shaped test piece has the special point.

According to the above analysis, the key error parameters of regions 2 and 5 can be obtained. Then, machining errors of these two regions are selected to be repaired respectively. Let the key error parameters εx(y), εx(x), δy(z), δy(y), δy(x), δx(c), δx(b), εx(z), εz(x), εy(c), and εz(y) in region 2 be 0 and other error parameters remain unchanged, and the machining error of the test piece between points 70 and 90 is shown in Fig. 28a. In addition, let the key error parameters εy(y), εy(x), δx(y), δx(x), δx(z), εz(x), εy(z), δy(c), δy(b), δx(c), and δx(b) in region 5 be 0 and other error parameters remain unchanged, and the machining error of the test piece between points 220 and 240 is shown in Fig. 28b. Based on Fig. 28a, b, mean values of absolute machining errors are obtained, as shown in Table 5.

Fig. 28
figure 28

Repaired results of key error parameters. a Region 2. b Region 5

Table 5 Mean values of machining errors

From Table 5, it can be seen that mean values of absolute machining errors before and after repair are reduced from 0.090 mm to 0.015 mm and from 0.060 mm to 0.007 mm in regions 2 and 5, respectively, and the reduction ratio is accounted for 83% and 88% in regions 2 and 5, respectively. It is obvious the analysis method of local error spatial morphology can decouple the key error parameters in the local regions of the test piece.

3.4.2 The causation analysis of global error for S-shaped test piece

According to Sect. 3.3, the machining errors caused by different error parameters are different. Compared to the increment of machining error caused by each geometric error parameter, the larger the increment, the greater the influence of error parameter on machining error. Thus, the key parameters of global error can be determined, as shown in Fig. 29.

Fig. 29
figure 29

Increment of machining error caused by single geometric errors

In error spatial model, let the top seven error parameters εx(y), εy(z), δx(b), δx(c), δy(c), δy(b), and εy(c) shown in Fig. 29 be 0 and other error parameters remain unchanged, then the machining errors of three test lines L1, L2, and L3 (as shown in Fig. 5) for S-shaped test piece are shown in Fig. 30. It can be seen in Fig. 30 that global repaired results are not beyond the tolerance. Therefore, the causation analysis of contour error for S-shaped test piece is correct and feasible.

Fig. 30
figure 30

Global repaired results of machining error of S-shaped test piece

4 Experimental verification

To verify the effectiveness of the proposed method, a cutting experiment is carried out. Figure 31 shows the flow chart of the cutting experiment.

Fig. 31
figure 31

The flow chart of the cutting experiment

The rough machining process of the S-shaped test piece made of 2A12 high-strength aluminum alloy is implemented on a three-axis milling machine. Then, subsequent machining processes are developed on a FAMT XKAS2525 × 60 (as shown in Fig. 2), which is suitable for high-speed milling of large and heavy parts in automobile and aviation industries. In addition, the S-shaped strip is milled by using a ϕ20 bar milling cutter, and the cutting parameters and procedures of the test piece are shown in Table 6.

Table 6 Cutting parameters of S-shaped test piece

During the cutting experiment, the room temperature should be controlled at about 20°. The experimental data is measured three times, and the average value is taken to reduce the effect of thermal error and improve the stability of measurement data. To minimize the influence of dynamic error as much as possible, the thickness of the S-shaped strip is increased from 3 mm described in the standard [8] to 8 mm. What is more, to reduce the effect of installation errors, the S-shaped test piece is carefully mounted on the worktable and the installation direction of its CS coincides with that of MCS, as shown in Fig. 32.

Fig. 32
figure 32

Installation mode of the S-shaped test piece

Since tool setting position is considered as the reference position in the cutting process, it is first determined by milling datum surfaces on the base of the test piece, as shown in Fig. 33. Then, the cutting of test piece is carried out by utilizing the NC instruction in Sect. 2.3. In order to improve the surface quality of the test piece, the cutting allowance is gradually decreasing. Cutting experiment of the S-shaped test piece is shown in Fig. 34a. Figure 34b shows the finished S-shaped test piece.

Fig. 33
figure 33

Determination of tool setting position

Fig. 34
figure 34

Cutting test of the S-shaped test piece. a Cutting scene. b The finished test piece

In order to compare with the analysis results in Sect. 3.4, error analysis and detection experiment of S-shaped test piece aim with the same side surface shown in Fig. 6. On three measuring lines L1, L2, and L3, 90 detection points are evenly selected. According to the theoretical value and normal vector of the detection point calculated in Sect. 2, the test piece error is measured by a coordinate measurement machine (CMM): Zeiss PRISMO 125751, Germany, as shown in Fig. 35. Figure 36 shows error detection results. Please note that the outward direction of test piece surface is positive.

Fig. 35
figure 35

Error detection of the S-shaped test piece

Fig. 36
figure 36

Detection errors of the S-shaped test piece

From Fig. 36, it can be seen that the error of the test piece on the smaller side of X coordinate is positive, showing the undercut, and the error on the larger side of X coordinate is negative, showing overcut. And, the error change trends on the three measurement lines are basically the same as that shown in Fig. 15. Detection errors on three different heights of test piece are also analyzed one by one, as shown in Fig. 37. From Fig. 37, the Z-direction error of the test piece is the smallest; the X-direction error is positively correlated with X coordinate, and the change trend of Y-direction error is smaller in both ends and larger in the middle. In addition, the sudden change in the middle of the test piece is caused by X-direction error. In other words, the X-direction error has the greatest influence on the spatial error of the test piece.

Fig. 37
figure 37

Detection errors on different heights

Obviously, the above analysis results are very similar to those of Sect. 3.2, which verifies the correctness of error spatial model for the test piece.

Finally, according to the patent requirement of the S-shaped test piece [8], the machining error is not more than 0.05 mm. While, as is seen in Fig. 36, most of the detection points on the finished surface for test piece are out of tolerance. Therefore, to improve machining accuracy of the test piece, the top 7 global key error parameters εx(y), εy(z), δx(b), δx(c), δy(c), δy(b), and εy(c) displayed in Fig. 29 are directly compensated based on offset function of external CS for the machine tool after the position errors, which are calculated by using the key error parameters and error spatial model, are sent from the thermal offset correction interface of the machine tool to the CNC system, and the S-shaped test piece is machined and detected in the same way. The detection results shown in Fig. 38 indicate the test piece has very few points that are not within the tolerance range after the key error parameters are compensated. In addition, compared with Figs. 30 and 38, the graphs of detection results after compensation and global repaired results are almost similar. Therefore, the causation analysis method presented in this paper based on error spatial morphology of S-shaped test piece is completely feasible and correct.

Fig. 38
figure 38

Detection results of machining error of test piece after compensation

5 Conclusions

In this paper, a novel causation analysis method based on error spatial morphology of S-shaped test piece is developed, and the key geometric error parameters causing contour errors of test piece are decoupled. Firstly, tool axis surface error model is built based on multi-body system (MBS) theory. To eliminate the effect of theoretical errors for S-shaped test piece on tool axis, the optimized tool path is planned based on the three-point tangential method. As a basis, the NC instruction of test piece processing is calculated by considering tool setting position. Thus, the error spatial model of test piece is established and error spatial morphology of test piece is characterized.

Then, considering all geometric error parameters and a single geometric error parameter respectively, spatial morphologies of machining errors for test piece are drawn. As a basis, the relationships between geometric error parameters and error spatial morphologies are analyzed by combining the geometric characteristics of the test piece. In order to decouple the key geometric error parameters affecting contour error of test piece, the causation analysis method of local error and global error are presented. After repairing the local and global key error parameters of the test piece obtained from these two analysis methods respectively, the local machining errors are reduced by more than 80%, and the global machining error is not beyond the tolerance.

Finally, the cutting experiments of S-shaped test piece on the five-axis machine tool (FAMT) XKAS2525 × 60 are carried out. Error detection results of test piece are basically the same as that shown in error spatial morphologies of test piece, which verifies the correctness of error spatial model for the test piece. After compensating the top 7 error parameters εx(y), εy(z), δx(b), δx(c), δy(c), δy(b), and εy(c) obtained from the causation analysis method of global error in CNC system, and re-cutting and detecting test piece under the same conditions, the detection results indicate the test piece has very few points that are not within the tolerance range. And, detection results after compensation and global repaired results are almost similar. Therefore, a reasonable conclusion can be drawn that the causation analysis method presented in this paper based on error spatial morphology of S-shaped test piece is completely feasible and correct. Thus, the work can intuitively reflect the mapping relationship between geometric error of machine tool and error spatial morphology of test piece, directly represent error spatial distribution of the S-shaped test piece surface, grasp the influence law and degree of geometric error on the spatial error of test piece, decouple the key geometric error parameters which affect the machining error of test piece, and provide a comprehensive error analysis method in the acceptance and performance testing of FAMTs by using the S-shaped test piece.

Despite the progress made in this study, only geometric errors are considered. However, some other errors, such as thermal error, cutting-force-induced error, dynamic error etc., also have influence on contour error of test piece. Therefore, further researches should be done for all of the errors, or at least most of them.