1 Introduction

Five-axis CNC milling machining technology has the advantages of high precision, high efficiency and low cost, which is the main machining method for complex curved structural parts [1]. Ball-end milling cutters are commonly used for finish milling of parts with complex curved surfaces such as molds, aero-engine impellers, turbine blades and others as discussed in [2]. The milling force is a dynamic variable, which is one of the most significant variable parameters in 5-axis machining, and it provides the theoretical basis for further studies such as tool wear [3], vibration in milling of thin-walled parts [4], and surface morphology and integrity analysis [5].

The earliest cutting force model for three-axis ball-end cutters was proposed by Lee and Altintas [6], and since then researchers have built on this model and extended it to five-axis machining. CWE extraction and cutting force coefficient measurement are the prerequisites for establishing the model of cutting forces in ball-end mills. In five-axis machining centers, the tilt of tool axis caused by the tool posture adjustment makes that present tool proximity partially overlaps with previous tool path, resulting in the extraction of the CWE remains challenging. The calculation methods of CWE can be divided into discrete method [7], solid modeling method [8], and analytical method [9]. Aras et al. [10] obtained the contact region of the tool and workpiece by Boolean operation through solid modeling. Based on the secondary development of VERICUT. Boz et al. [11] used solid modeling method to obtain the contact area of the tool and the workpiece, and conducted cutting force analysis based on this.

In recent years, some excellent scholars have tried new approaches to solve CWE extraction problems. Qin et al. [12] designed a new algorithm of CWE extracting for different tool postures and predicted the milling forces under different working conditions. Utsumi et al. [13] investigated the effect of tool posture on the maximum and average cutting forces, and the CWE was determined by establishing the point cloud simulation model. The change in the direction of tool axis has considerable effect on both the value and the direction of the milling force. Ozturk et al. [14] showed that the contact area between the milling tool and workpiece depends on the tilt and lead angles, the geometry of the tool, and the depth of milling. It is very important to accurately and efficiently obtain CWE in machining as a prerequisite for cutting force prediction and stability analysis. Geng et al. [15] presented a simulation model to recognize the minimum deflected cutting force generated by the tool posture. This simulation algorithm greatly reduced the time for cutting force calculation for different tool attitudes, which was used to predict the milling force of the ball-end cutter. Mao et al. [16] developed an algorithm for milling force prediction from an intrinsic model of thin-walled parts, considering the weak rigidity of thin-walled workpieces.

In addition, for stability in milling, Minis et al. [17] used the Nyquist criterion to find the stability domain solution for the milling process. Subsequently, time domain, finite element and semi-discrete methods have also been proposed for predicting milling machining stability [18, 19]. Altintas et al. [20] proposed an analytical prediction method for plotting stability petal chart to obtain stable machining parameters. Sun et al. [21] computed the characteristic equations of the machining system and obtained chatter-free, tool posture at each tool position point by a search algorithm. Wang et al. [22] presented a method for constructing posture stability diagrams for chatter prediction, and verified the validity of posture stability diagrams experimentally. Zhan et al. [23] determined the optimal pitch angle of a variable pitch ball-end mill based on a solid modeling method and achieved chatter-free machining. Zhao et al. [24] proposed the PASD algorithm to optimize surface roughness while avoiding geometric interference and chattering. Shi et al. [25] established a dynamic model based on spiral milling and constructed a chatter-free stability prediction map for typical machining positions. Du et al. [26] proposed a milling chatter active control method considering the third-order modes of flexible workpieces for the suppression of milling chatter on thin-walled parts, revealed the intrinsic mode vibration mechanism of the milling chatter, suppressed the milling chatter, and established a semi-analytical model of milling process for thin-walled parts. Sun et al. [27] developed a machining dynamics model considering tool and workpiece flexibility, and constructed a prediction system for the chatter stability of the model using a second-order semi-discretization method. Eynian [28] presented an improved diagram for milling Nyquist stability criterion. Bari et al. [29] established the dynamic equations of motion control in the frequency domain for milling and solved the system stability method using Nyquist stability criterion, which reduces the simulation time by 79%–97% with the use of zero-order approximation and multi-frequency methods, respectively, as compared to semi-discretized methods. However, the impact of tool posture with milling stability was not considered.

Research on optimizing the tool axis orientation of multi-axis machines focuses on preventing geometric interference and smoothing the tool axis orientation. Langeron et al. [30] used a two-spline polynomial approach to smooth the tool axis of a five-axis machining tool, but after smoothing the tool axis needs to be checked by interference. Hu et al. [31] developed an algorithm to avoid geometric interference by considering the characteristics of the five-axis kinematics and the algorithm can generate interference-free continuous five-axis paths of arbitrary free-form surfaces automatically. Wang et al. [32] optimized the tool posture to avoid machining interferences and improve the smoothness of rotary axis motion in 5-axis machine tools. Castagnetti et al. [33] limited the orientation of the tool axes based on the minimization of the motions generated by each rotary axis, with the aim of improving the kinematic behavior of the machine tool during the milling process. Lu et al. [34] considered that different tool postures will result in varying effective tool diameters, thereby having different impacts on milling speeds. Lu et al. [35] presented a new path planning strategy improves kinematics of machining process.

Fig. 1
figure 1

Overview of establishing coordinate systems

Fig. 2
figure 2

Feed coordinate system

Although outstanding scholars have done researches on cutting force prediction and stability analysis of ball-end cutters, very few scholars have studied the dynamic relationship between tool posture and milling stability, as well as the track of the tool axis under stability constraints. The motion track of tool posture under stability constraints is considered., and the main contributions of this paper compared with previous literature are as follows:

  1. (1)

    A method is designed to solve the CWE boundaries for different tool postures.

  2. (2)

    The frequency domain control equation for milling with a ball-end milling cutter is established, and the stability of the system at this cutter position point can be quickly discriminated by Nyquist.

  3. (3)

    The ball-end milling path is optimized based on geometric constraints, stability constraints and tool axis smoothness constraints.

The remaining sections are organized as follows. In Sect. 2, the workpiece, feed, and tool coordinate system is established, and the transformation matrix between them is discussed. In Sect. 3, firstly, the ball-end milling cutter geometry is modeled, and then, the boundaries of the tool-work contact region are calculated. Section 4 establishes the frequency domain control equations for the milling dynamics under different operating conditions. In Sect. 5, the tool axis path of the ball-end milling cutter is optimized. In Sect. 6, milling experiments of the ball-end milling cutter are carried out to verify the correctness of the established control equations and the effectiveness of the cutter path optimization. Some conclusions are summarized in Sect. 7.

2 Establishment and transformation of coordinate systems

As shown in Fig. 1, the workpiece coordinate system (\(O_{\textrm{w}}-X_{\textrm{w}}Y_{\textrm{w}}Z_{\textrm{w}}\)), feed coordinate system (\(O_{\textrm{f}}-X_{\textrm{f}}Y_{\textrm{f}}Z_{\textrm{f}}\)), and tool coordinate system (\(O_{\textrm{t}}-X_{\textrm{t}}Y_{\textrm{t}}Z_{\textrm{t}}\)) is established. Usually, when generating the tool path, the tool axis vector generated in the CAM is defined in the workpiece coordinate system. In machining stability analysis, sometimes the workpiece has weak rigidity, and at this time it is necessary to measure the frequency response function of the workpiece, which is usually defined in the workpiece coordinate system.

Fig. 3
figure 3

Lead angle and tilt angle

As shown in Fig. 2, the origin of \(O_{\textrm{f}}-X_{\textrm{f}}Y_{\textrm{f}}Z_{\textrm{f}}\) is the ball center point of the ball-end milling cutter. The instantaneous feed direction of the tool \(\overrightarrow{F}_{\textrm{w}}\) is the vector difference between two consecutive tool positions when the tool moves along the tool path. \(\overrightarrow{CL}_{\textrm{w}}\left( i,k \right) \) is the current cutting point. \(\overrightarrow{CL}_{\textrm{w}}\left( i+1,k \right) \) is the next cutting point of the current cutting point. The tool point is generated in the \(O_{\textrm{w}}-X_{\textrm{w}}Y_{\textrm{w}}Z_{\textrm{w}}\). Point P is the tool contact point. The tool contact point can be derived from the tool point [36]. The instantaneous feed is defined as the \(X_{\textrm{f}}\). The instantaneous feed normal direction is defined as the \(Z_{\textrm{f}}\). The \(Y_{\textrm{f}}\) axis is generated using the right-hand rule. The unit vector of the feed coordinates is described as:

$$\begin{aligned} X_{\textrm{f}}= & {} \frac{\overrightarrow{F}_{\textrm{w}}}{\left| \overrightarrow{F}_{\textrm{w}} \right| }=m_x\textbf{i}_{\textrm{w}}+m_y\textbf{j}_{\textrm{w}}+m_z\textbf{k}_{\textrm{w}}\nonumber \\ Z_{\textrm{f}}= & {} \frac{\overrightarrow{OP}_{\textrm{w}}}{\left| \overrightarrow{OP}_{\textrm{w}} \right| }=n_x\textbf{i}_{\textrm{w}}+n_y\textbf{j}_{\textrm{w}}+n_z\textbf{k}_{\textrm{w}}\nonumber \\ Y_{\textrm{f}}= & {} \frac{\overrightarrow{F}_{\textrm{w}}\times \overrightarrow{OP}_{\textrm{w}}}{\left| \overrightarrow{F}_{\textrm{w}}\times \overrightarrow{OP}_{\textrm{w}} \right| }=q_x\textbf{i}_{\textrm{w}}+q_y\textbf{j}_{\textrm{w}}+q_z\textbf{k}_{\textrm{w}} \end{aligned}$$
(1)

The expression of the conversion matrix from \(O_{\textrm{f}}-X_{\textrm{f}}Y_{\textrm{f}}Z_{\textrm{f}}\) to \(O_{\textrm{w}}-X_{\textrm{w}}Y_{\textrm{w}}Z_{\textrm{w}}\) is

$$\begin{aligned} \textbf{R}_{\textrm{f}}^{\textrm{w}}=\left[ \begin{matrix} m_x&{} q_x&{} n_x\\ m_y&{} q_y&{} n_y\\ m_z&{} q_z&{} n_z\\ \end{matrix} \right] \end{aligned}$$
(2)

As shown in Fig. 3, the \(O_{\textrm{t}}-X_{\textrm{t}}Y_{\textrm{t}}Z_{\textrm{t}}\) is determined by the lead and tilt angle of tool. \(Z_{\textrm{t}}\) is the tool axis vector. \(Z_{\textrm{t}}\prime \) is the projection of \(Z_{\textrm{t}}\) onto the \(X_{\textrm{f}}O_{\textrm{f}}Z_{\textrm{f}}\) plane. The angle between \(Z_{\textrm{t}}\prime \) and \(X_{\textrm{f}}\) directions is called the lead angle (\(\theta _{\textrm{L}}\)). The lead angle is positive when \(Z_{\textrm{t}}\prime \) is offset relative to the positive direction of \(X_{\textrm{f}}\), otherwise it is negative. \(Z''_{\textrm{t}}\) is the projection of \(Z_{\textrm{t}}\) onto the \(\,\,Y_{\textrm{f}}O_{\textrm{f}}Z_{\textrm{f}}\) plane. The angle between \(Z''_{\textrm{t}}\) and \(Y_{\textrm{f}}\) directions is called the tilt angle ( \(\theta _{\textrm{T}}\)). The lead angle is positive when \(Z''_{\textrm{t}}\) is offset relative to the positive direction of the \(Y_{\textrm{f}}\), otherwise it is negative. \(\textrm{R}\left( \theta _{\textrm{L}} \right) \) and \(\textrm{R}\left( \theta _{\textrm{T}} \right) \) can be expressed as:

$$\begin{aligned} \textrm{R}\left( \theta _{\textrm{L}} \right)= & {} \left[ \begin{matrix} \cos \theta _{\textrm{L}}&{} 0&{} \sin \theta _{\textrm{L}}\\ 0&{} 1&{} 0\\ -\sin \theta _{\textrm{L}}&{} 0&{} \cos \theta _{\textrm{L}}\\ \end{matrix} \right] \end{aligned}$$
(3)
$$\begin{aligned} \textrm{R}\left( \theta _{\textrm{T}} \right)= & {} \left[ \begin{matrix} 1&{} 0&{} 0\\ 0&{} \cos \theta _{\textrm{L}}&{} -\sin \theta _{\textrm{L}}\\ 0&{} \sin \theta _{\textrm{L}}&{} \cos \theta _{\textrm{L}}\\ \end{matrix} \right] \end{aligned}$$
(4)

Therefore, the conversion matrix from \(O_{\textrm{t}}-X_{\textrm{t}}Y_{\textrm{t}}Z_{\textrm{t}}\) to \(O_{\textrm{f}}-X_{\textrm{f}}Y_{\textrm{f}}Z_{\textrm{f}}\) can be expressed as:

$$\begin{aligned} \textbf{R}_{\textrm{t}}^{\textrm{f}}= & {} \textrm{R}\left( \theta _{\textrm{T}} \right) \textrm{R}\left( \theta _{\textrm{L}} \right) \\= & {} \left[ \begin{matrix} \cos \theta _{\textrm{L}}&{} 0&{} \sin \theta _{\textrm{L}}\nonumber \\ \sin \theta _{\textrm{L}}\sin \theta _{\textrm{T}}&{} \cos \theta _{\textrm{T}}&{} -\cos \theta _{\textrm{L}}\sin \theta _{\textrm{T}}\\ -\sin \theta _{\textrm{L}}\sin \theta _{\textrm{T}}&{} \sin \theta _{\textrm{T}}&{} \cos \theta _{\textrm{L}}\sin \theta _{\textrm{T}}\\ \end{matrix} \right] \end{aligned}$$
(5)
Fig. 4
figure 4

Geometrical model of ball-end milling cutter

Fig. 5
figure 5

Extracting the key ideas of CWE

3 Acquisition of CWE for ball-end milling cutter

3.1 Geometrical model of ball-end milling cutter

As shown in Fig. 4, the position of any point on the cutting edge at a tool rotation angle can be expressed in spherical coordinates. The expressions are as follows:

$$\begin{aligned} P=\left[ R\left( z \right) \cos \left( \phi \right) ,R\left( z \right) \cos \left( \phi \right) ,z \right] \end{aligned}$$
(6)

where R in the formula is the radius of the tool corresponding to point P, and it is expressed by:

$$\begin{aligned} R\left( z \right) ={\left\{ \begin{array}{ll} \sqrt{{R_0}^2-z^2}\,\,,-R\leqslant z<0\\ ~~~~~~~~R_0\,\,~~~~~~,z>0\\ \end{array}\right. } \end{aligned}$$
(7)

The axial position of point P is represented by the axial immersion angle \(\kappa =\kappa \left( z \right) \) as:

$$\begin{aligned} \kappa \left( z \right) =\textrm{arccos} \left( \frac{R\left( z \right) }{R_0} \right) \end{aligned}$$
(8)

The radial helical lag angle \(\mathrm {\varphi }\left( z \right) \) is the angle between the line between point P and the tangent of the cutting edge of the point \(\left( 0,0,z \right) \). The radial helical lag angle can be calculated by the following formula:

$$\begin{aligned} \mathrm {\varphi }\left( z \right) =\frac{R+z}{R}\tan \beta \end{aligned}$$
(9)

where \(\beta \) is the helix angle at the point where the spherical and cylindrical parts of the milling cutter intersect, \(\phi _j\left( z \right) \) denotes the angle of rotation of a point on the cutting edge measured from the y-axis in the forward direction, the angle of rotation of the j-th cutting edge with the z-axis position of the cutting edge discrete unit at k when the milling cutter angle of turn is \(\phi \). According to the helix characteristics, \(\phi _j\left( z \right) \) can be expressed as.

$$\begin{aligned} \phi _j\left( z \right) =\phi +\left( j-1 \right) \frac{2\pi }{N}-\mathrm {\varphi }\left( z \right) \end{aligned}$$
(10)

where N is the number of cutting edges

3.2 CWE extraction

The CWE information is the most important basic conditions in machining simulation, which can intuitively describe the complex time-varying working conditions of five-axis machining from the geometrical level. The CWE provide important boundary conditions for the solution of cutting mechanics and dynamics models. CWE is the complex geometric boundary formed on the tool envelope, and the hemispherical surface of the workpiece during ball-end cutter milling.

Fig. 6
figure 6

Determination of CWE boundaries

The boundaries of the tool envelope are determined by a projective geometry method. The CWE is then projected onto a plane perpendicular to the \(Z_{\textrm{t}}\). The main approach of the extracted CWE boundaries is expressed in Fig. 5. The tool is cut into a plane perpendicular to the \(Z_{\textrm{t}}\) at each machining position, and the CWE is generated. The start and exist angles are projected along the tool axis and plotted in the tool coordinate planes, the tool envelope is expanded along the tool axis, and the boundaries of the tool envelope are determined at each discrete position.

In multi-axis machining, often through the NC program design to make the spindle relative to the workpiece posture adjustment. And thus, achieving the adjustment of the tool posture not only helps avoid tool interference but also ensures the ball-end cutter milling head operates effectively to meet high-quality and efficient machining requirements. However, adjusting the tool posture caused an overlap in the coupling between the current tool path and the previous tool paths, which making the tool-workpiece cutting contact quite complex and identification more difficult.

The boundaries of CWE are determined in Fig. 6. BC is the intersection curve between the current cutter’s tooth-swept surface and the previous tool’s surface. AB is the intersection curve between the current tool tooth-swept surface and the surface to be machined. AC is the intersection curve between the current tool tooth-swept surface and the machined surface of the last feed completion, and the intersection points of these three boundary curves are A, B, and C. The boundaries of the tool-work contact area are identified by solving for these three boundary curves.

Fig. 7
figure 7

Extracting start and exist angles

Fig. 8
figure 8

Simulation flow chart of CWE

Fig. 9
figure 9

Simulation chart of CWE

Fig. 10
figure 10

Milling regenerative chatter model with key parameters

In order to simplify the calculation, only the rotary motion of the cutter tooth is considered. The continuous feeding motion between two adjacent cutter teeth is ignored, the swept surface of the last cutter tooth is simplified as a sphere. The cutting point of the cutter tooth, which aligns with the current normal direction of the ideal surface being machined, is considered as the radius of the sphere.

The equations for the current and previous tooth-swept spheres in \(O_{\textrm{t}}-X_{\textrm{t}}Y_{\textrm{t}}Z_{\textrm{t}}\) are shown below.

$$\begin{aligned} {\textrm{x}_{\textrm{t}}}^2+{\textrm{y}_{\textrm{t}}}^2+{\textrm{z}_{\textrm{t}}}^2= & {} {\textrm{R}_0}^2 \end{aligned}$$
(11)
$$\begin{aligned} \left( \textrm{x}_{\textrm{t}}+f_{\textrm{p}} \right) ^2+{\textrm{y}_{\textrm{t}}}^2+{\textrm{z}_{\textrm{t}}}^2= & {} {\textrm{R}_0}^2 \end{aligned}$$
(12)

The last feed machined surface is simplified as a cylindrical surface, and its equation in \(O_{\textrm{t}}-X_{\textrm{t}}Y_{\textrm{t}}Z_{\textrm{t}}\) is:

$$\begin{aligned} \left( \textrm{y}_{\textrm{f}}+a_{\textrm{e}} \right) ^2+{\textrm{z}_{\textrm{f}}}^2={\textrm{R}_0}^2 \end{aligned}$$
(13)

According to Eq. (6), the equation expression of Eq. (13) in \(O_{\textrm{t}}-X_{\textrm{t}}Y_{\textrm{t}}Z_{\textrm{t}}\) is:

$$\begin{aligned} \begin{array}{l} \left( \textrm{y}_{\textrm{t}}\cos \theta _{\textrm{T}}+\textrm{z}_{\textrm{t}}\sin \theta _{\textrm{T}}+a_{\textrm{e}} \right) ^2+\\ \left( \textrm{x}_{\textrm{t}}\sin \theta _{\textrm{L}}-\textrm{y}_{\textrm{t}}\cos \theta _{\textrm{L}}\sin \theta _{\textrm{T}}+\textrm{z}_{\textrm{t}}\cos \theta _{\textrm{L}}\sin \theta _{\textrm{T}} \right) ^2={\textrm{R}_0}^2\,\,\\ \end{array} \end{aligned}$$
(14)

The top surface of the workpiece is given by its equation in \(O_{\textrm{t}}-X_{\textrm{t}}Y_{\textrm{t}}Z_{\textrm{t}}\) is:

$$\begin{aligned} \textrm{z}_{\textrm{t}}=-\textrm{R}_0+a_{\textrm{p}} \end{aligned}$$
(15)

The boundary curve AC can be determined by solving for the intersection curve between the surface swept during rotation of the current tooth and the spherical surface. By intersecting the simplified spherical surface of the current tooth-swept surface with the cylindrical surface formed by the last cutter travel. And then finding the intercept curve that is the boundary curve AC.

$$\begin{aligned} {\left\{ \begin{array}{ll} \left( \textrm{y}_{\textrm{t}}\cos \theta _{\textrm{T}}+\textrm{z}_{\textrm{t}}\sin \theta _{\textrm{T}}+a_{\textrm{e}} \right) ^2+\\ \left( \textrm{x}_{\textrm{t}}\sin \theta _{\textrm{L}}-\textrm{y}_{\textrm{t}}\cos \theta _{\textrm{L}}\sin \theta _{\textrm{T}}+\textrm{z}_{\textrm{t}}\cos \theta _{\textrm{L}}\sin \theta _{\textrm{T}} \right) ^2={\textrm{R}_0}^2\\ {\textrm{x}_{\textrm{t}}}^2+{\textrm{y}_{\textrm{t}}}^2+{\textrm{z}_{\textrm{t}}}^2={\textrm{R}_0}^2\,\,\end{array}\right. } \end{aligned}$$
(16)

The boundary curve BC can be found by solving the intersection curve between the rotational swept surface of the current cutter tooth and the swept spherical surface of the previous cutter tooth.

$$\begin{aligned} {\left\{ \begin{array}{ll} {\textrm{x}_{\textrm{t}}}^2+{\textrm{y}_{\textrm{t}}}^2+{\textrm{z}_{\textrm{t}}}^2={\textrm{R}_0}^2\\ \left( \textrm{x}_{\textrm{t}}+f_{\textrm{p}} \right) ^2+{\textrm{y}_{\textrm{t}}}^2+{\textrm{z}_{\textrm{t}}}^2={\textrm{R}_0}^2\\ \end{array}\right. } \end{aligned}$$
(17)

The sweeping sphere of the front tooth intersects the top plane of the workpiece, and the intersection curve, the boundary curve AB, is found

$$\begin{aligned} {\left\{ \begin{array}{ll} {\textrm{x}_{\textrm{t}}}^2+{\textrm{y}_{\textrm{t}}}^2+{\textrm{z}_{\textrm{t}}}^2={\textrm{R}_0}^2\\ \textrm{z}_{\textrm{t}}=-\textrm{R}_0+a_{\textrm{p}}\\ \end{array}\right. } \end{aligned}$$
(18)

The start and exist angles of the tool teeth are determined by employing the circle intersection method. As shown in Fig. 7, sweeping points at the start and exist of each circle can be determined by analysis

$$\begin{aligned} \varvec{N}\left( \textrm{z} \right) \cdot \varvec{F}=0 \end{aligned}$$
(19)

\(\varvec{N}\left( \textrm{z} \right) \) is the normal vector at point P and can be expressed in \(O_{\textrm{t}}-X_{\textrm{t}}Y_{\textrm{t}}Z_{\textrm{t}}\) as:

$$\begin{aligned} \varvec{N}_{\textrm{t}}\left( z \right) =\left[ \begin{matrix} \sin \left( \kappa \right) \sin \left( \phi \right) &{} \sin \left( \kappa \right) \cos \left( \phi \right) &{} -\cos \left( \kappa \right) \\ \end{matrix} \right] ^T \end{aligned}$$
(20)

F denotes the instantaneous feed rate vector, and the instantaneous feed rate vector in \(O_{\textrm{f}}-X_{\textrm{f}}Y_{\textrm{f}}Z_{\textrm{f}}\) can be expressed as:

$$\begin{aligned} \varvec{F}_{\textrm{f}}=\left[ \begin{matrix} 1&{} 0&{} 0\\ \end{matrix} \right] ^T \end{aligned}$$
(21)

According to the theory of spherical head envelope, point P can be expressed in \(O_{\textrm{t}}-X_{\textrm{t}}Y_{\textrm{t}}Z_{\textrm{t}}\) as:

$$\begin{aligned} P_{\textrm{t}}=\left[ \begin{matrix} R\sin \left( \kappa \right) \sin \left( \phi \right) &{} R\sin \left( \kappa \right) \cos \left( \phi \right) &{} -R\cos \left( \kappa \right) \\ \end{matrix} \right] ^T \end{aligned}$$
(22)

According to Eq. (6), point P can be represented in \(O_{\textrm{f}}-X_{\textrm{f}}Y_{\textrm{f}}Z_{\textrm{f}}\) as:

$$\begin{aligned} P_{\textrm{f}}=\textbf{R}_{\textrm{t}}^{\textrm{f}}P_{\textrm{t}} \end{aligned}$$
(23)

The following relationship is obtained by substituting Eqs. (21) and (23) into Eq. (19)

$$\begin{aligned} a\cdot \sin \phi +b\cdot \cos \phi =c \end{aligned}$$
(24)

where a, b, and c can be expressed as:

$$\begin{aligned} {\left\{ \begin{array}{ll} a=\cos \theta _{\textrm{L}}\sin \kappa \\ b=0\\ c=\sin \theta _{\textrm{L}}\cos \kappa \\ \end{array}\right. } \end{aligned}$$
(25)

As shown in Fig. 7(c), when \(c^2<a^2+b^2\), there are two real solutions for \(\phi \) in Eq. (24), which can be expressed as:

$$\begin{aligned} {\left\{ \begin{array}{ll} \phi _{st}=\textrm{arcsin} \frac{\sin \theta _{\textrm{L}}\cos \kappa }{\cos \theta _{\textrm{L}}\sin \kappa }\\ \\ \phi _{ex}=\pi -\textrm{arcsin} \frac{\sin \theta _{\textrm{L}}\cos \kappa }{\cos \theta _{\textrm{L}}\sin \kappa }\,\,\\ \end{array}\right. } \end{aligned}$$
(26)

where \(\phi _{st}\) is start angle and \(\phi _{ex}\) is exist angle.

As shown in Fig. 7(d), when \(c^2=a^2+b^2\), there are two equal solutions for \(\phi \) in Eq. (24), which can be expressed as:

$$\begin{aligned} \phi _{ex}=\phi _{st}=\textrm{arcsin} \frac{\sin \theta _{\textrm{L}}\cos \kappa }{\cos \theta _{\textrm{L}}\sin \kappa } \end{aligned}$$
(27)

As shown in Fig. 7(e), when \(c^2>a^2+b^2\), the equation has no solution.

After modeling the CWE boundary, the algorithm for calculating the CWE was developed. Its simulation flow chart is shown in Fig. 8. The CWE simulation results for different tool postures with \(R_0=5\)mm are shown in Fig. 9. The chart of CWE at different tool postures is shown in Fig. 9(a)–(h), and it is evident that the changes in CWE can be attributed to changes in lead angle and tilt angle. Figure 9(a)–(b) show two sets of CWE with different \(a_e\) under the same tool attitude. The simulation chart of CWE shows that the smaller the \(a_e\), the smaller the CWE area and the corresponding reduction in cutting force.

4 Milling state control equation

The discrete mechanical model is used to evaluate the direction of the instantaneous cutting force and its magnitude as shown in Fig. 10. The tool is cut into a series of cells along its axial layer and the cutting forces of each cell are synthesized into the total cutting force in the contact region between the tool and the workpiece. The equation of the dynamic cutting force at the j-th edge to the dynamic cutting thickness is expressed as [37]:

$$\begin{aligned} \left[ \begin{array}{c} \textrm{F}_x\left( \phi _j \right) \\ \textrm{F}_y\left( \phi _j \right) \\ \textrm{F}_z\left( \phi _j \right) \\ \end{array} \right] =g\left( \phi _j \right) \left[ T \right] \left[ \begin{array}{c} k_r\\ k_t\\ k_a\\ \end{array} \right] h_d\Delta b \end{aligned}$$
(28)

where \(k_r\), \(k_t\) and \(k_a\) are the cutting force coefficients, obtained by orthogonal cutting experiment, and T is the cutting force transformation matrix. The axial, tangential and circumferential forces at a point on the cutting edge are converted to the cutting forces in the X, Y and Z axes in the cartesian coordinate system. The expression for T is:

$$\begin{aligned} T=\left[ \begin{matrix} -\sin \left( \mathrm {\kappa } \right) \sin \left( \phi _j \right) &{} -\cos \left( \phi _j \right) &{} -\cos \left( \mathrm {\kappa } \right) \sin \left( \phi _j \right) \\ -\sin \left( \mathrm {\kappa } \right) \cos \left( \phi _j \right) &{} \sin \left( \phi _j \right) &{} -\cos \left( \mathrm {\kappa } \right) \cos \left( \phi _j \right) \\ \cos \left( \mathrm {\kappa } \right) &{} 0&{} -\sin \left( \mathrm {\kappa } \right) \\ \end{matrix} \right] \end{aligned}$$
(29)

where \(h_d\) is the dynamic cutting thickness, and its \(h_d\) expression is Eq. (30), and the direction is along the normal to the tool surface. The square \(\left[ \textbf{n} \right] \) is the normal vector of the tool surface, \(\mathbf {\Delta }_{\varvec{F}}\) is the dynamic displacement in the feed coordinate system, \(\Delta b\) is the cutting width. The relationship between cutting width \(\Delta b\) and discrete slice height \(\Delta \textrm{z}\) can be calculated by Eq. (31).

$$\begin{aligned} h_d= & {} \left[ \textbf{n} \right] \left[ \mathbf {\Delta }_{\varvec{F}} \right] \nonumber \\= & {} \underset{\left[ \textbf{n} \right] }{\underbrace{\left[ \begin{matrix} \sin \left( \phi _j \right) \sin \left( \mathrm {\kappa } \right) &{} \cos \left( \phi _j \right) \sin \left( \mathrm {\kappa } \right) &{} \!-\!\cos \left( \mathrm {\kappa } \right) \\ \end{matrix} \right] }}\underset{\left[ \varvec{\varDelta }_{\varvec{F}} \right] }{\underbrace{\left[ \begin{array}{c} \Delta x_{Fd}\\ \Delta y_{Fd}\\ \Delta z_{Fd}\\ \end{array} \right] }}\nonumber \\ \end{aligned}$$
(30)
$$\begin{aligned} \Delta b= & {} \frac{\Delta \textrm{z}}{\sin \left( \mathrm {\kappa } \right) } \end{aligned}$$
(31)

where \(g\left( \phi _j\left( z \right) \right) \) is the unit step function, used to determine whether the tool teeth are in the cutting state, expressed as follows:

$$\begin{aligned} g\left( \phi _j\left( z \right) \right) =\left\{ \begin{matrix} 1&{} \phi _{st}\leqslant \phi _j\left( z \right) \leqslant \phi _{ex}\\ 0&{} \textrm{otherwise}\\ \end{matrix} \right. \end{aligned}$$
(32)

Definition:

$$\begin{aligned} \left[ A_j\left( \phi _j \right) \right] =g\left( \phi _j \right) \frac{\Delta \textrm{z}}{\sin \left( \mathrm {\kappa } \right) }\left[ T \right] \left[ \begin{array}{c} k_r\\ k_t\\ k_a\\ \end{array} \right] \left[ \textbf{n} \right] \end{aligned}$$
(33)

substituting Eq. (33) into Eq. (28) and simplify to get Eq. (34).

$$\begin{aligned} \left[ \begin{array}{c} \textrm{F}_x\left( \phi _j \right) \\ \textrm{F}_y\left( \phi _j \right) \\ \textrm{F}_z\left( \phi _j \right) \\ \end{array} \right] =\left[ A_j\left( \phi _j \right) \right] \underset{\left[ \varvec{\varDelta }_{\varvec{F}} \right] }{\underbrace{\left[ \begin{array}{c} \Delta x_{Fd}\\ \Delta y_{Fd}\\ \Delta z_{Fd}\\ \end{array} \right] }} \end{aligned}$$
(34)
Fig. 11
figure 11

Block diagram of chatter

Add up the forces on N cutting edges to get:

$$\begin{aligned} \left[ \begin{array}{c} \textrm{F}_x\left( \phi \right) \\ \textrm{F}_y\left( \phi \right) \\ \textrm{F}_z\left( \phi \right) \\ \end{array} \right]= & {} \Sigma _{j=1}^{N}\left[ A_j\left( \phi _j \right) \right] \underset{\left[ \varvec{\varDelta }_{\varvec{F}} \right] }{\underbrace{\left[ \begin{array}{c} \Delta x_{Fd}\\ \Delta y_{Fd}\\ \Delta z_{Fd}\\ \end{array} \right] }}\nonumber \\ {}= & {} \left[ A\left( \phi \right) \right] \underset{\left[ \varvec{\varDelta }_{\varvec{F}} \right] }{\underbrace{\left[ \begin{array}{c} \Delta x_{Fd}\\ \Delta y_{Fd}\\ \Delta z_{Fd}\\ \end{array} \right] }} \end{aligned}$$
(35)

where \(\phi \) varies with the rotation of the tool and can be transformed to the time domain by the equation: \(N\cdot \phi =\omega \cdot t\), where N represents the number of tool edges, \(\omega _T\) represents the cutting frequency of tool cutting edges. Fourier expansion of formula \(\left[ A\left( \phi \right) \right] \) gives formula (36).

$$\begin{aligned} {\left\{ \begin{array}{ll} A\left( \mathrm {\omega } \right) \!=\!\mathcal {F} A\left( \textrm{t} \right) \!=\!\Sigma _{r=+\infty }^{r=-\infty }\left[ A_r \right] e^{ir\mathrm {\omega }_{\textrm{T}}t}\!=\!\Sigma _{r=+\infty }^{r=-\infty }\left[ A_r \right] e^{irN\phi }\\ \left[ A_r \right] \!=\!\frac{1}{\phi _p}\int _0^{\phi _p}{\left[ A\left( \phi \right) \right] e^{ir\mathrm {\omega }_{\textrm{T}}t}dt}\!=\!\frac{1}{\phi _p}\int _0^{\phi _p}{\left[ A\left( \phi \right) \right] e^{-irN\phi }d\phi }\\ \end{array}\right. } \end{aligned}$$
(36)

Take only the zero-order term of Fourier expansion, where \(\phi _p=2\pi /N\). The relationship between dynamic cutting force and dynamic displacement at feed coordinates can be expressed as:

$$\begin{aligned} \left\{ \begin{array}{c} \left[ \begin{array}{c} \textrm{F}_x\left( \mathrm {\omega } \right) \\ \textrm{F}_y\left( \mathrm {\omega } \right) \\ \textrm{F}_z\left( \mathrm {\omega } \right) \\ \end{array} \right] =\left[ A_0 \right] \underset{\left[ \varvec{\varDelta }_{\varvec{F}} \right] }{\underbrace{\left[ \begin{array}{c} \Delta x_{Fd}\\ \Delta y_{Fd}\\ \Delta z_{Fd}\\ \end{array} \right] }}\\ \left[ A_0 \right] =\frac{1}{\phi _p}\int _0^{\phi _p}{\left[ A\left( \phi \right) \right] d\phi }\\ \end{array} \right. \end{aligned}$$
(37)

The relationship between dynamic cutting force and dynamic displacement can also be established by the principle of structural vibration. As shown in the flow chart of the chattering mechanism in Fig. 11 [38], the dynamic displacement should be equal to the current displacement of the structure due to the dynamic cutting force minus the displacement of the structure due to the dynamic cutting force in the previous cutting cycle.

If the workpiece is weakly rigid in \(O_{\textrm{t}}-X_{\textrm{t}}Y_{\textrm{t}}Z_{\textrm{t}}\), the process can be expressed as:

$$\begin{aligned} \left[ \begin{array}{c} \Delta x_{\textrm{t}d}\\ \Delta y_{\textrm{t}d}\\ \Delta z_{\textrm{t}d}\\ \end{array} \right] =\left( 1-e^{-s\tau } \right) [\Phi _{\textrm{t}}\left( s \right) ]\left[ \begin{array}{c} F_{\textrm{t}x}\left( \omega \right) \\ F_{\textrm{t}y}\left( \omega \right) \\ F_{\textrm{t}z}\left( \omega \right) \\ \end{array} \right] \end{aligned}$$
(38)

The dynamic force and displacement are transformed from \(O_{\textrm{t}}-X_{\textrm{t}}Y_{\textrm{t}}Z_{\textrm{t}}\) to \(O_{\textrm{f}}-X_{\textrm{f}}Y_{\textrm{f}}Z_{\textrm{f}}\), then Eq. (38) can be described as:

$$\begin{aligned} \left[ \textbf{R}_{\textrm{t}}^{\textrm{f}} \right] \left[ \begin{array}{c} \Delta x_{\textrm{t}d}\\ \Delta y_{\textrm{t}d}\\ \Delta z_{\textrm{t}d}\\ \end{array} \right] =(1-e^{-s\tau })\left[ \textbf{R}_{\textrm{t}}^{\textrm{f}} \right] [\Phi _{\textrm{t}}(\omega )]\left[ \textbf{R}_{\textrm{t}}^{\textrm{f}} \right] \left[ \begin{array}{c} F_{\textrm{f}x}\left( \omega \right) \\ F_{\textrm{f}y}\left( \omega \right) \\ F_{\textrm{f}z}\left( \omega \right) \\ \end{array} \right] \end{aligned}$$
(39)

If the workpiece is weakly rigid, in \(O_{\textrm{w}}-X_{\textrm{w}}Y_{\textrm{w}}Z_{\textrm{w}}\), the process can be expressed as:

$$\begin{aligned} \left[ \begin{array}{c} \Delta x_{\textrm{w}d}\\ \Delta y_{\textrm{w}d}\\ \Delta z_{\textrm{w}d}\\ \end{array} \right] =\left( 1-e^{-s\tau } \right) [\Phi _{\textrm{w}}\left( \omega \right) ]\left[ \begin{array}{c} F_{\textrm{w}x}\left( \omega \right) \\ F_{\textrm{w}y}\left( \omega \right) \\ F_{\textrm{w}z}\left( \omega \right) \end{array} \right] \end{aligned}$$
(40)

where \( \Delta x_{\textrm{w}d}\), \(\Delta y_{\textrm{w}d}\), and \(\Delta z_{\textrm{w}d}\) represent the dynamic displacement in \(O_{\textrm{w}}-X_{\textrm{w}}Y_{\textrm{w}}Z_{\textrm{w}}\); \(\Phi _{\textrm{w}}\left( \mathrm {\omega } \right) \) is the workpiece frequency response function measured in \(O_{\textrm{w}}-X_{\textrm{w}}Y_{\textrm{w}}Z_{\textrm{w}}\); and \(F_{\textrm{w}x}\left( \omega \right) \), \(F_{\textrm{w}y}\left( \omega \right) \), and \(F_{\textrm{w}z}\left( \omega \right) \) are the dynamic cutting force in \(O_{\textrm{w}}-X_{\textrm{w}}Y_{\textrm{w}}Z_{\textrm{w}}\).

The dynamic force and displacement are transformed from \(O_{\textrm{w}}\!-X_{\textrm{w}}Y_{\textrm{w}}Z_{\textrm{w}}\) to \(O_{\textrm{f}}\!-X_{\textrm{f}}Y_{\textrm{f}}Z_{\textrm{f}}\), then Eq. 40 can be described as:

$$\begin{aligned} \left[ \textbf{R}_{\textrm{w}}^{\textrm{f}} \right] \left[ \begin{array}{c} \Delta x_{\textrm{w}d}\\ \Delta y_{\textrm{w}d}\\ \Delta z_{\textrm{w}d}\\ \end{array} \right] =(1-e^{-s\tau })\left[ \textbf{R}_{\textrm{w}}^{\textrm{f}} \right] [\Phi _{\textrm{w}}\left( \omega \right) ]\left[ \textbf{R}_{\textrm{w}}^{\textrm{f}} \right] \left[ \begin{array}{c} F_{\textrm{w}x}\left( \omega \right) \\ F_{\textrm{w}y}\left( \omega \right) \\ F_{\textrm{w}z}\left( \omega \right) \end{array} \right] \end{aligned}$$
(41)

If both the workpiece and the tool are weakly rigid, then Eqs. (39) and (41) are brought into Eq. (37) to obtain Eq. (42):

$$\begin{aligned} \left[ \begin{array}{c} \textrm{F}_x\left( \mathrm {\omega } \right) \\ \textrm{F}_y\left( \mathrm {\omega } \right) \\ \textrm{F}_z\left( \mathrm {\omega } \right) \\ \end{array} \right]= & {} \left[ A_0 \right] \left[ \begin{array}{c} \Delta x_{\textrm{f}d}\\ \Delta y_{\textrm{f}d}\\ \Delta z_{\textrm{f}d}\\ \end{array} \right] \\= & {} \left[ A_0 \right] \left\{ \left[ \textbf{R}_{\textrm{t}}^{\textrm{f}} \right] \left[ \begin{array}{c} \Delta x_{\textrm{t}d}\\ \Delta y_{\textrm{t}d}\\ \Delta z_{\textrm{t}d}\\ \end{array} \right] +\left[ \textbf{R}_{\textrm{w}}^{\textrm{f}} \right] \left[ \begin{array}{c} \Delta x_{\textrm{w}d}\\ \Delta y_{\textrm{w}d}\\ \Delta z_{\textrm{w}d} \end{array} \right] \right\} \nonumber \end{aligned}$$
(42)

After simplification, the state Eq. (43) of the system obtained by calculating the determinant of the left-hand side of the equation.

$$\begin{aligned}{} & {} ~~~~~~~\, \varvec{G}_1\left( \varvec{\omega } \right) =det\left\{ I-\left( 1-e^{-s\tau } \right) \right. \\{} & {} \left. \left[ A_0 \right] \left\{ \left[ \textbf{R}_{\textrm{t}}^{\textrm{f}} \right] [\Phi _{\textrm{t}}\left( \omega \right) ]\left[ \textbf{R}_{\textrm{t}}^{\textrm{f}} \right] +\left[ \textbf{R}_{\textrm{w}}^{\textrm{f}} \right] [\Phi _{\textrm{w}}\left( \omega \right) ]\left[ \textbf{R}_{\textrm{w}}^{\textrm{f}} \right] \right\} \right\} \nonumber \end{aligned}$$
(43)

Similarly, when the tool has weak rigidity, the system equation of state is:

$$\begin{aligned} \varvec{G}_2\left( \varvec{\omega } \right) \!=\!det\left\{ I-\!\left( 1-\!e^{-s\tau } \right) \left[ A_0 \right] \left\{ \left[ \textbf{R}_{\textrm{t}}^{\textrm{f}} \right] [\Phi _{\textrm{t}}\left( \omega \right) ]\left[ \textbf{R}_{\textrm{t}}^{\textrm{f}} \right] \right\} \right\} \end{aligned}$$
(44)

When only the workpiece has weak rigidity, the system equation of state is:

$$\begin{aligned} \varvec{G}_3\left( \varvec{\omega } \right) \!=\!det\left\{ I\!-\!\left( 1\!-\!e^{-s\tau } \right) \left[ A_0 \right] \left\{ \left[ \textbf{R}_{\textrm{w}}^{\textrm{f}} \right] [\Phi _{\textrm{w}}\left( \omega \right) ]\left[ \textbf{R}_{\textrm{w}}^{\textrm{f}} \right] \right\} \right\} \end{aligned}$$
(45)

At this point, the equation of state \(\varvec{G}\left( \varvec{\omega } \right) \) of the system is obtained in the frequency domain at a certain cutter site. The stability of the system at the tool position can be determined using the equation of state, that is, whether the chatter will occur.

Nyquist method is a practical and fast method for discriminating linear time-invariant systems [28]. In the process of deriving the state equation of the system, only the zero-order term of Fourier expansion is used for approximation. Therefore, the discrete Nyquist method was used in this paper to quickly identify the machining stability at each cutter position [29].

5 Tool path optimization

During the optimization process of the ball-end cutter, it is necessary to avoid the participation of the tool tip in the cutting and avoid the non-ball-end part from changing the intersection shape of the tool and the workpiece. During ball-end milling, the cutting line speed at the tool tip point is zero. If the tool tip is involved in the cutting, it will lead to a decrease in the surface quality of the workpiece and the tool life. At the same time, when the excessive angle change makes the non-spherical part of the tool participate in the cutting, the above cutting area change method will fail. Therefore, ensuring the stability and avoiding the cutting of the tool tip and the non-spherical part become the three constraints for calculating the feasible tool axis direction.

Figure 12 is the feasible area search range. When searching for feasible areas in the search area, the discrete method is first applied to determine whether the direction of the new tool axis causes non-ball or tool tip points to participate in cutting. If the tool tip point is not involved in cutting, it is judged that the milling process is stable. When the new tool axis direction meets the three constraints mentioned above, the tool axis direction is recorded and becomes one of the feasible solutions.

Fig. 12
figure 12

Searching for feasible tool orientation

Fig. 13
figure 13

Tool axis smooth path

By conducting the above checks and stability checks on the direction of the tool axis in the search space for each tool position, feasible solutions can be obtained for each tool position, Due to sudden changes in the direction of the tool axis, cutting marks will be left on the surface of the workpiece, so the smooth motion of the machine tool’s rotating axis is used as a constraint to select the direction of the tool axis. The fairing problem of the tool axis path can be transformed into a typical shortest path problem. As shown in Fig. 13, After searching for each tool position i, k solutions can be obtained. So the smoothing problem can be expressed as:

$$\begin{aligned} {\left\{ \begin{array}{ll} \Delta \theta _{A}^{i\left( k^i \right) \left( k^{i+1} \right) }=\left| \theta _{A}^{ik^i}-\theta _{A}^{\left( i+1 \right) \left( k^{i+1} \right) } \right| \\ ~\Delta \theta _{B}^{i\left( k^i \right) \left( k^{i+1} \right) }=\left| \theta _{B}^{ik^i}-\theta _{B}^{\left( i+1 \right) \left( k^{i+1} \right) } \right| \\ \textrm{s}.\textrm{t}.\min \left( \sum _{i=1}^{i=n-1}{\left| \theta _{A}^{ik^i}+\theta _{B}^{\left( i+1 \right) \left( k^{i+1} \right) } \right| } \right) \end{array}\right. } \end{aligned}$$
(46)

where \(\Delta \theta _{A}^{i\left( k^i \right) \left( k^{i+1} \right) }\) is the angle change value of the rotation axis A between two consecutive cutting points. \(\Delta \theta _{B}^{i\left( k^i \right) \left( k^{i+1} \right) }\) is the angle change value of the rotation axis B between two consecutive cutting points. n represents the number of tool points in the current tool path. \(\left| \theta _{A}^{ik^i}+\theta _{B}^{\left( i+1 \right) \left( k^{i+1} \right) } \right| \) is the change in rotation axis angle between two consecutive cutting points. Using breadth-depth search strategy [39], find the final tool axis vector that meets \(\min \left( \sum _{i=1}^{i=n-1}{\left| \theta _{A}^{ik^i}+ \right. }\right. \) \(\left. \left. \theta _{B}^{\left( i+1 \right) \left( k^{i+1} \right) } \right| \right) \) at each tool point, and achieve the smoothing of the tool axis vector.

Figure 14 represents the relationship between the new tool position point and the original tool position point. After obtaining the new tool direction, it is necessary to recalculate the tool position point of the new tool axis vector in the feed coordinate, and the new tool position point expression is:

$$\begin{aligned} CL_{i}^{\prime }=CL_i+R_0\cdot \overrightarrow{TA_{\textrm{f}}}-R_0\cdot \overrightarrow{TA_{\textrm{f}}^{\prime }} \end{aligned}$$
(47)

where \(CL_{i}^{\prime }\) denotes the new tool position point, \(CL_i\) represents the tool position point, \(R_0\) is the radius of the ball head, \(\overrightarrow{TA_{\textrm{f}}}\) presents the direction of the initial tool axis, and \(\overrightarrow{TA_{\textrm{f}}^{\prime }}\) indicates the direction of the new tool axis. The above calculations are performed for each tool position point to generate an optimized new tool path.

Fig. 14
figure 14

Calculation of new tool position

Fig. 15
figure 15

Flow chart of tool path optimization

Fig. 16
figure 16

Schematic diagram of machine structure

Fig. 17
figure 17

Cutting force coefficient calibration

The output steps of the optimized tool path were as follows : (1) Input the original tool position file; (2) Confirm the stable machining tool axis vector feasible domain for each tool position point under the given spindle speed and depth of cut; (3) Determine the feasible domain under the geometrical constraints at each tool position point; (4) Intersect the feasible domains to obtain the feasible domains under the multi-constraints; (5) Determine the final tool posture of each tool position point based on the shortest path method; (6) Update the tool position points under the new tool posture and replace them with the original tool position files; (7) According to the new tool position files and the selected machine model, carry out post-processing accordingly to obtain the NC program for machining and output the optimized tool path. The flow chart of tool path optimization is shown in Fig. 15.

6 Simulation and experiment

To verify the effectiveness of the tool axis path optimization in this paper, the finishing process of localized turbine blades was chosen as the research object. The milling experiment was carried out in Shanghai Top horizontal CNC five-axis Machining Center. The machine structure is shown in Fig. 16. The machine model was HMC-C100PL vertical and horizontal conversion machining center with A swinging head and B turntable. The workpiece material used in the experiment is AL7050-T7451. The tool used is the D12R6 carbide ball-end milling cutter, the number of cutting edges is 2, and the spiral angle is \(30^{\circ }\). During processing, the tool runout parameter is \(\rho =0.0017\), and the spindle speed is \(2000 \textrm{r}/\textrm{min}\). The feed rate is \(1250 \textrm{mm}/\textrm{min}\), the depth of cutting is \(0.5 \textrm{mm}\), and the step length is \(0.5 \textrm{mm}\).

Table 1 Cutting force coefficients
Fig. 18
figure 18

Tool system modal experiment

Table 2 The modal parameters
Fig. 19
figure 19

Milling experiment

Fig. 20
figure 20

Milling experiment sound spectra

Fig. 21
figure 21

Measurement of milling experiment error

As described in Fig. 17, the measuring hardware equipment used for the identification of cutting force parameters is Kistler-9272 dynamometer, whose sensitivity in x and y directions is \(-\)7.8 pC/N, sensitivity in z direction is \(-\)3.5 pC/N, and the test sampling frequency is 10 kHz. The data acquisition equipments are HR-CA-411 charge amplifier and HRU-1213MA signal acquisition instrument. Cutting force coefficient calibration adopted the least square method to fit the average value of the measured cutting force [40]. The experimental measurement results of cutting force coefficient are shown in Table 1

As presented in Fig. 18, in the modal parameter experiment of the spindle-tool-handle system, the modal parameters of the tool were obtained by hammer. The hardware devices used for measurement were Kistler 9722 force hammer and PCB353B11S acceleration sensor. The measurement results of the modal parameters of the tool are shown in Table 2.

The tool path before and after optimization is indicated in Fig. 19(a). Figure 19(b) shows the overall result diagram of the workpiece after on-site processing. By comparing the machining effect before and after optimization in the figure, it can be concluded that the original tool path machining result before optimization is poor in surface quality of the workpiece, and there are more obvious vibration lines; the optimized tool path machining result is high in surface quality of the workpiece, and there are no vibration lines on the smooth surface.

The machining results indicate that the optimized tool path chatter disappears. Figure 20(a) is the sound spectrum of the original tool path machining, the largest value is at 3908 HZ, the largest value is much larger than the tool cutting frequency, so the frequency is the cutting chatter frequency. Figure 20(b) is the optimized tool path machining sound spectra, the largest value is at 1000 HZ, the frequency is the tool cutting stability frequency.

Measurement of errors on machined surfaces using the coordinate measuring machine EXPLORER. The surface is measured by coordinate measuring machine. The position and number of sampling points in the two surfaces are the same. Each surface is measured at 45 locations. The measurement site is shown in Fig. 21(a). Figure 21(b) shows the original path machining error cloud, from the cloud, the workpiece deformation is large, the vibration pattern is presented as a stripe. This is because the workpiece is machined in the vertical direction with basically the same curvature and the tool posture is basically the same. Figure 21(c) shows the machining error cloud after path optimization, the machining error after path optimization is significantly reduced, but the machining error is not completely eliminated, which may be due to the failure to take into account the impact of the tool runout and the instantaneous cutting thickness on the accuracy of the cutting force model.

7 Conclusion

In this paper, a tool path optimization method with stability constraints for 5-axis machining was proposed. Firstly, the effect of different tool postures on the extraction of CWE was studied, the control equation of milling dynamics of ball-end milling cutter was established, and Nyquist’s law was utilized to quickly discriminate the stability of each tool position point. Then the tool axis feasible domain was searched based on geometric constraints and stability constraints, and the tool axis path was optimized with the constraint of tool axis smoothness in the feasible domain, and the tool position file was updated in real time. Finally, the effectiveness of the proposed method was verified by milling machining experiments. The following conclusions can be summarized from this study:

  1. (1)

    Ball-end milling cutter tool posture on the CWE has a significant impact on the results from the simulation, the tilt angle of the milling process is more significant. The smaller the milling width (\(a_e\)), the smaller the CWE-mapping, the cutting force should be reduced accordingly. In the finishing process, the milling width can be reduced and the number of passes can be increased to improve the surface quality of the processed workpiece.

  2. (2)

    During the five-axis machining process, the frequency domain response function will change along the cutter axis path. The control equations of milling dynamics under different working conditions of the ball-end milling cutter were established, and its stability could be effectively judged by using Nyquist’s norm.

  3. (3)

    At each original tool path location, the tool axis feasible domain could be searched with geometric and stability constraints. The tool axis path was optimized in the feasible domain with the tool axis smoothness as the constraint, and the tool position file was updated. It is shown through experiments that this method can effectively avoid the chattering problem of five-axis ball-end milling cutter in the milling process.

With the development of artificial intelligence technology, in the future, the impact of tool axis vector changes on more relevant machining parameters (cutting speed, feed rate and surface quality, etc.) can be considered for a more comprehensive and specific optimization analysis.