1 Introduction

The surface topography has an important impact on the performance and fatigue of the workpiece [1]. The prediction of milling surface topography is necessary, which is the theoretical basis of cutting parameter optimization. Arrazola et al. [2] summarized that the prediction model of metal machining processes especially surface topography mainly has two methods: the experimental data and the analytical method from the milling process characteristics.

With the development of intelligent manufacturing, data processing method is used to analyze cutting characteristics, such as cutting force, cutting temperature, and surface topography. Khorasani et al. [3] used artificial neural networks method to analysis the surface roughness, and the data is obtained by designed experiments. Liu et al. [4] used multi-sensor information to reconstruction of 3D surface topography modeling. Ngerntong et al. [5] used Taguchi method and experimental results to analysis and modeling the machined surface roughness. Kong et al. [6] present a new two two-stage feature-fusion method by combining principal component analysis and kernel locality preserving projection to improve the prediction accuracy of milling surface topography. Cao et al. [7] present a generative adversarial network to predict the surface topography which considers cutting parameters, cutting force, and system vibrations. In previous works [3,4,5,6,7], the surface topography and surface roughness prediction model can be obtained by analyzing and processing the experimental data. This method is used in specific material and cutting parameters, which is impossible to analyze the formation process of milling surface topography theoretically.

By analyzing the motion characteristics of milling process, the surface residual height after machining forms surface topography. Zhang et al. [8] developed an improved z-map method to modeling the surface topography in ball end milling. Based on the proposed model, the effect of cutting parameters on the surface topography is discussed. Peng et al. [9] developed the surface topography based on the cutting edge motion trajectory model, and the effect of inclination angle is discussed. Zhang et al. [10] proposed a new surface topography model which considered the cutter deflection in micro-side milling. Arizmendi et al. [11] proposed the model of face milling surface topography based on the cutting edge geometry and trajectory. Wang et al. [12] developed 3D surface topography of ruled surface milling, and the complex workpiece surface is described by point cloud. Xu et al. [13] present a surface topography model for a ball end cutter, and the feed rate is considered in high speed milling. Wang et al. [14] used a novel elliptical model to predict surface topography with five-axis flank milling, based on this model, a surface roughness control method using feed rate optimization. Torta M et al. [15] developed a framework model for estimating the surface texture in complex surface milling process.

The above literature mainly focus on modeling of ball end milling surface topography in milling due to its easy calculation of tool positioning with a simple geometry. Ball nose end mill is a generalization of both ball end and flat end mill. Ball nose end mill provides a smooth surface finish and has excellent cutting capability with large strip width especially in machining large complex surface [16]. Recently, Kasim et al. [17] used experimental results to analysis the surface topography in ball nose end milling process. Also, the analytical method of surface topography in 4-axis milling is few in the previous literature. In order to solve this problem, the analytical prediction model of surface topography in 4/5-axis milling process is proposed. The theoretic modeling of surface topography is introduced in Section 2. The two conditions with flat surface milling and complex surface milling are simulated and experiment to validate the proposed in Section 3. In Section 4, some conclusions of this study are summarized.

2 Theoretic modeling of surface topography

In the milling process, the residual height in the feed direction and intermittent feed direction after milling will have an impact on the machined surface topography. Therefore, it is necessary to establish the point cloud swept by the cutting edge in the milling process of end milling according to the geometric model of milling cutter, milling process kinematics, and tool path file in the milling process. The point cloud formed in the process updates the discrete points of the workpiece surface, and finally obtains the machined surface topography.

2.1 Geometry model of the ball nose end mill

Engin and Altintas [18] introduced the cutting edge for generalized milling cutters. Ball nose end mill is made up of a bottom circular plane, a quarter of torus, and a cylindrical surface, as shown in Fig. 1. D is diameter, r is the bottom radius, r(z) is the filleted radius, and point OT is the tool center; the origin point is OT(x = 0, y = 0, z = 0).

Fig. 1
figure 1

Geometric model of the ball nose end mill [18]

The effective cutting radius of point P can be calculated based on the axial position:

$$ r(z)=D-r+\sqrt{r^2-{\left(r-z\right)}^2}\kern0.5em $$
(1)

For circular inserted cutter, the helix angle of the cutting edge of the arc segment is not a fixed value .The helix angle of element P can be expressed as the following equations:

$$ i(z)=\cot \left(\frac{\left(r(z)-\left(D/2-r\right)\right)\tan {i}_0}{r}\right) $$
(2)

where i0 is maximum helix angle.

The radial lag angle ψ(z) and axial immersion angle κ(z) as follows:

$$ \psi (z)=\frac{z}{r}\tan i(z),\kern0.5em 0\le z<r $$
(3)
$$ \kappa (z)= arc\cos \left(\frac{r-z}{r}\right),0\le z<r $$
(4)

The radial immersion angle of point P at level z can be calculated:

$$ {\phi}_j\left(z,\theta \right)=\theta +\left(j-1\right)\raisebox{1ex}{$2\pi $}\!\left/ \!\raisebox{-1ex}{$N$}\right.-\psi (z) $$
(5)

where θ is tool rotation angle and N is cutter edge number.

Figure 2 is the lead/tilt angle in five-axis machining. In Fig. 2, ap is cutting depth and s is distance between cuts. The vector direction of the cutter is uniquely determined by the lead angle and tilt angle. For five-axis milling, the transformation relation is introduced in Zhou [19].

Fig. 2
figure 2

The lead/tilt angle in five-axis machining [19]

In the cutter location (CL) file, each CL data contains 6 parameters (x, y, z, i, j, k), the first three (X, Y, Z) represent the CL point coordinate and the remaining three (I, J, K) compose a unit vector representing. The lead, tiltcan obtained form follows:

$$ {\displaystyle \begin{array}{l} lead=\arctan \left(I,\sqrt{J^2+{K}^2}\right)\\ {} tilt=\arctan \left(-J,K\right)\end{array}} $$
(6)

2.2 Simulation of surface topography

In the simulation algorithm, Z-map method is mainly used to judge the cutting edge of the milling tool and update the workpiece geometry during the milling process [20]. As shown in Fig. 3, The meshing point (xi, yj) is determined by:

$$ {\displaystyle \begin{array}{l}{X}_i={X}_0+i\Delta X\\ {}{Y}_j={Y}_0+j\Delta Y\end{array}} $$
(7)
Fig. 3
figure 3

Coordinate system in the milling process

The Zij coordinate of each meshing point represents the height of the workpiece :

$$ {Z}_{ij}=f\left({X}_i,{Y}_j\right) $$
(8)

A set of coordinate systems are established, as shown in Fig. 3. Ow − XwYwZw represents a workpiece coordinate system, and OT − XTYTZT represents local tool coordinate system.

In the simulation, the origin point is OT (0,0,0), the point P(x, y, z), the cutter was discretized into k disks, each height is dz (dz = z/k), and the (xc, yc, zc) at k disks at local coordinate system OT − XTYTZT can be expressed by the following:

$$ \left\{\begin{array}{l}{x}_c=r(z)\times \cos \left({\phi}_j\right)\\ {}{y}_c=r(z)\times \sin \left({\phi}_j\right)\\ {}{z}_c=\left(k-1\right) dz\end{array}\right. $$
(9)

Then, the coordinate axis of TCS is described in WCS as follows: Three coordinate axis vectors of TCS at time t are described as [20]:

$$ \left\{\begin{array}{l}{{}^W\mathbf{x}}_{\mathrm{T},t}=\frac{{{}^W\mathbf{y}}_{\mathrm{T},t}\times {\mathbf{v}}_t}{\left\Vert {{}^W\mathbf{y}}_{\mathrm{T},t}\times {\mathbf{v}}_t\right\Vert}\\ {}{{}^W\mathbf{y}}_{\mathrm{T},t}=\frac{{\mathbf{v}}_t\times {\mathbf{a}}_t}{\left\Vert {\mathbf{v}}_t\times {\mathbf{a}}_t\right\Vert}\\ {}{{}^W\mathbf{z}}_{\mathrm{T},t}=\frac{{\mathbf{v}}_t}{\left\Vert {\mathbf{v}}_t\right\Vert}\end{array}\right. $$
(10)

where at is the feed vector at time t in WCS. vT is defined as unit vector in the direction of the tool axis vector.

The rotation matrix from TCS to WCS at time t is follows:

$$ \mathbf{R}=\left({{}^W\mathbf{x}}_{\mathrm{T},t},{{}^W\mathbf{y}}_{\mathrm{T},t},{{}^W\mathbf{z}}_{\mathrm{T},t}\right) $$
(11)

Consequently, the overall transformation matrix M from OT − XTYTZT to Ow − XwYwZw is written as:

$$ \mathbf{M}=\left[\begin{array}{cc}\mathbf{Rt}& \mathbf{Tt}\\ {}\mathbf{0}& 1\end{array}\right] $$
(12)

where Tt = [x, y, z]T, the point of P(x, y, z) coordinate in WCS.

The general form of the trajectory equation of point P in Ow − XwYwZwis:

$$ {P}_W=\mathbf{M}\times {\left[{x}_c,{y}_c,{z}_c,1\right]}^T $$
(13)

Assuming that the height of the point on workpiece surface corresponding to (Xi, Yj) is Zij, the scallop height of z after material removal is following:

$$ \mathrm{If}\;{P}_W(z)<{Z}_{ij},Z={P}_W(z);\mathrm{If}{P}_W(z)>{Z}_{ij},Z={Z}_{ij} $$
(14)

Surface roughness is the arithmetic mean deviation of contour (within the sampling length, the average of the absolute value of the distance from each point of on the actual contour to the contour center line). Through the height z-value of the workpiece surface, the z-value can extract within a sampling length, and the roughness can be calculated.

The z-value height on the machined workpiece surface is ti(i = 1, …, n), and the average value is:

$$ \overline{t}=\frac{1}{n}\sum \limits_1^n{t}_t $$
(15)

The roughness is the arithmetic mean deviation of contour Ra

$$ {R}_a=\frac{1}{n}\sum \limits_1^n\left|\left({t}_t-\overline{t}\right)\right| $$
(16)

2.3 Simulation procedure

As shown in Fig. 4, in the whole milling profile simulation system, tool path file (including tool position and posture), spindle speed, and feed speed, geometric parameters of tool and workpiece are included. In the preparation stage of simulation, the coordinates of discrete points are used to represent the workpiece surface. The next step is to use these input parameters for simulation. In the simulation process, the main task is to check the tool workpiece contact, that is, to determine whether the cutting edge of the tool has cut to the workpiece surface. If the workpiece has been cut to the cutting edge, the Z value of the grid point needs to be updated to the surface height value after cutting. Repeat the above process until the whole workpiece has been cut, and the final calculation will be made. The specific calculation steps are as follows:

  1. 1.

    Input the tool path, cutter location file, the tool geometry parameters, workpiece surface geometry.

  2. 2.

    Divide the workpiece in plane, and discrete point file stored in the initialization matrix.

  3. 3.

    Calculated the discrete points on the cutting edge in the workpiece coordinate system.

  4. 4.

    Calculate and update the cutter scallop height for the next cutting edge.

  5. 5.

    Repeat (3) and (4) steps for each cutting edge.

  6. 6.

    Repeat (3), (4), and (5) steps for each cutting point.

  7. 7.

    Output the surface topography.

Fig. 4
figure 4

Surface topography simulation system flowchart

3 Simulation and experiment results

The workpiece is nickel-aluminum bronze, which is used widely in marine equipment, such as propellers [21]. The recommended machining parameters of these materials are from manufacturing handbook [22]. For the convenience of observation and comparison, the cutting parameters with larger roughness are selected in finished milling stage. The mainly have two types of experiments: flat surface milling and complex surface milling.

3.1 Test 1: Milling flat surface with ball end mill

The ball end mill is Sandvik Coromant 1B230-1200-XA 1630, 2 flutes, 6-mm radius, normal rake angle is 5°, and 30° helical angle. The machine tool is 5-axis vertical machining center. The milling experimental is shown in Fig. 5. It is carried out on a block of 100-mm length, 10-mm width, and 10-mm height, which is divided into seven areas in the length direction and processed with different processing parameters. After all milling is completed, the three-dimensional surface topography is measured by the Keinsys vh-m100 micro-measurement system. The Keinsys ultra-depth of field micro-measurement system can reconstruct, display, and measure the undulation of the surface. Therefore, the images before and after the experimental processing can be easily compared, and the effectiveness of the simulation software can be tested. Surface roughness Ra is measured by surface roughness test device (Mitutoyo SJ-210). UG NX8.5 CAM module is used to generate the toolpath and NC code in milling process.

Fig. 5
figure 5

Milling experiment setup and roughness measuring instrument

Table 1 is the different spindle speed effect on roughness and the Ra in feed direction results. Ra is the roughness of the surface which is measured by instrument. In Table 1, the surface roughness of the workpiece after cutting under different spindle speed parameters is shown. The feed direction roughness is decrease with the spindle speed increase. Since the spindle speed increases, intermittent cutting time between the two cutting edges decreases, the more conducive to the formation of relatively small surface residual height. Compared with the prediction result to experiment results, the error is less than 10%.

Table 1 The spindle speed effect on roughness and the Ra in feed direction results (feed speed is 800mm/min, cutting depth is 1mm, lead angle is 10°, distance between cuts is 1.5mm, tool radius is 6mm)

Table 2 is the different feed speed effect on roughness and the Ra in feed direction results. Compared with the prediction result to experiment results, the error is less than 10%.The roughness value in the milling feed direction is increasing with the increase of milling feed speed. But in the actual processing, the lower the feed rate is not the better, because in the actual production, both the surface roughness and cutting time are need to concerned. Choosing a lower milling feed rate is conducive to improving the surface quality, but it will reduce the cutting efficiency.

Table 2 The spindle speed effect on roughness and the Ra in feed direction results (spindle speed is 800r/min, cutting depth is 1mm, lead angle is 10°, distance between cuts is 1.5mm, tool radius is 6mm)

Table 3 is the different lead angle effect on roughness and the Ra in feed direction results. Compared with the prediction result to experiment results, the error is about 10%. When the tool inclination angle is 0°, the cutter tip velocity is zero, which lead to the poor surface quality. The roughness decreases rapidly with tool inclination angle increase. And when the tool inclination angle increased to 15°, roughness changed slowly. When the inclination angle is increase to 20°, the roughness increases. Lead angle in 10 to 15° is suitable to obtain a good surface roughness under milling conditions which is shown in Table 3.

Table 3 The lead angle effect on roughness and the Ra in feed direction results (spindle speed is 800r/min, feed speed is 800mm/min, cutting depth is 1mm, distance between cuts is 1.5mm, tool radius is 6mm)

Figure 6 shows the simulated surface topographies with different incline angle at 0°, 5°, 15°, and 25°. The roughness decreases and the workpiece surface is more smooth when the incline angle increases. Since lead angle can improve the surface quality, 4/5-axis is used widely in precision milling of complex free surface.

Fig. 6
figure 6

The surface topography simulated results with different lead angle

For comparison, the measured surface topography measured by the optical microscope. Figure 7 is the measurement and simulation results of surface topography with No. 7 in Table 3. From the simulation results in Fig. 7, it can be seen that the simulation program can clearly show the residual height of the workpiece in two directions after milling and the residual height of the workpiece surface after milling.

Fig. 7
figure 7

Measurement and simulation results of surface topography

The distribution characteristics of the three-dimensional surface topography of the surface are analyzed. Because the use of Keith vhx-1000 ultra-depth of field three-dimensional microscope can only observe the surface topography profile, it does not have the measurement function and cannot well explain the degree of agreement between the simulation results and the experimental results. So in order to further verify the correctness of the simulation program, the roughness meter is used to measure the waviness curve of the surface topography in the two-dimensional direction and compare with the simulation results. Figure 8 is the scallop height result of simulated and measured at different cutting parameters: No. 4 in Table 3, No. 8 in Table 3, No. 6 in Table 1. The extracted surface waviness is compared, which can effectively verify the correctness of the simulation program. The results are consistent with the experimental values, although there are some errors between them, and the experimental values will be slightly larger than the simulation values. Therefore, the method of 3D surface milling simulation based on discrete cutting edge proposed in this paper can well simulate the workpiece surface topography formed after milling.

Fig. 8
figure 8

The scallop height in feed direction after milling

3.2 Test 2: Milling complex surface with ball nose end milling

The ball nose end mill type is EMR-C20-4R20-160-2T, with 20-mm diameters, 4-mm bottom radius, 2 cutter numbers, and cutter install pitch angle is 12°. The circular insert cutter type is Mitsubishi RPMT08T2MOE-JS VP15TF. Four numbers of milling tests result with different spindle speeds in Table 4. The workpiece surface is complex surface, which is come from the propeller model. The toolpath is generated by UG NX 8.5 CAM module in 4-axis milling. Figure 9 is the surface topography of the machined complex surface after milling.

Table 4 The spindle speed effect on roughness and the Ra in feed direction results (feed speed is 800mm/min, cutting depth is 1mm, lead angle is 15°, distance between cuts is 2mm, tool nose radius is 4mm)
Fig. 9
figure 9

Surface topography of the machined complex surface

Figure 10 is the simulation results of surface topography with different spindle speeds. The simulation results of workpiece surface topography under the corresponding cutting parameters show that the residual height in the feed direction of the milling surface becomes obvious with the decrease of the spindle speed. When the spindle speed increases, the finer the workpiece surface topography texture is, and the smaller the difference of the residual height in the feed direction is. This is because when the spindle speed increases, the shorter the time difference between the two edges of the tool contacting the workpiece, so the cutting of the workpiece surface is more compact. However, too high spindle speed will lead to obvious vibration of the machine tool, which in turn affects the texture and quality of the machined surface. Therefore, the maximum speed should be determined according to the actual situation of the machine tool.

Fig. 10
figure 10

Simulation results of surface topography with different spindle speeds with ball nose end mill

3.3 Results and discussion

The above results show that the simulation algorithm of milling table topography based on Z-map can accurately represent the residual height in the feed direction and row spacing direction after machining, and the three-dimensional topography of workpiece surface after machining can be simulated by inputting the tool diameter, fillet, tool location, and milling parameters. The influence of different process parameters and processing strategies on the surface morphology of the workpiece is obtained, which provides a reference for the actual processing parameter selection.

In a practical or industrial environment, 4/5-axis machining is generally programmed using a commercial CAM system. The effect of cutting parameters on the surface topography can be analyzed by simulated method, so the optimization cutting parameters can used to control surface topography and roughness in the future.

4 Conclusions

An analytical model is proposed for the prediction surface topography in 4-axis milling with ball nose end mill. The surface topography can obtained by calculate the relative motion relationship and contact area of tool and workpiece using z-map method directly from toolpath data. The tool runout, tool deformation, tool wear, and vibration are not considered in this study. The following conclusions can be summarized:

  1. (1)

    The surface topography of 4-axis milling can be predicted by the proposed analytical model, which is few in previous works. Also, this method can be extended to the prediction of surface topography of five-axis machining.

  2. (2)

    The effect of cutting parameters (spindle speed, feed speed, inclination angle) on surface topography is discussed.

  3. (3)

    The ball end mill and ball nose end mill experiments are used to validate the model, and the results of surface roughness are consistent and have certain errors between measured and simulation.