1 Introduction

With the advancements in 5G technology, Internet of Things (IoT), cloud computing, and edge computing, various industries are moving towards Industry 4.0. Developing towards smart manufacturing combined with 5G technology has become a trend in the machine tool industry. Using 5G’s low latency combined with cyber physical system (CPS) to achieve real-time simulation and self-correction applications, smart machine tools can ride with the internet cloud waves to create higher added values.

CPS is a system formed by integrating the real physical world and the virtual digital world. Its application fields are also very diverse, including medical digitalization and automobile self-driving systems. In Industry 4.0, CPS is one of the keys to improving machine tools’ performance through IoT and cloud applications. In addition, as a major factor in smart manufacturing, CPS intends to achieve the integration of virtual reality and the real world by performing virtual process simulations and predicting/correcting the system behavior simulated in smart manufacturing. To fully monitor and control the machining conditions, CPS needs to deal with multiple error sources of the machining process such as dynamic servo error, thermal deformation error, and cutting force induced chatter and vibration. Therefore, the target of the modeling and virtual simulation of CPS is to effectively predict and monitor the cutting conditions and workpiece accuracy to achieve the goal of smart adjustment and control in Industry 4.0.

In the past, the machining simulation software of most CAD/CAM systems was mainly based on NC codes to simulate whether the processed 3D geometry is the same as the original CAD model. For a complete CPS or digital twin (DT) that requires simulation of cutting force, temperature rise deformation, spindle tool deflection, and dynamic error generated by the machine during processing, the current NC simulation software cannot satisfy these functions and can only be regarded as pure “geometric simulation.” However, CPS requires a complete system and process simulation. Therefore, in order to achieve the CPS goal in Industry 4.0, the current NC simulation system needs to be upgraded to develop the next-generation machining simulation system that can cover the simulation of the other physical quantities.

Among the many physical quantities simulated by CPS, the cutting force is one of the most important targets. The simulation and prediction of cutting force can prevent tool breakage [1] and excessive tool wear [2] and be used to adjust the cutting feed rate to improve production efficiency [3, 4]. In addition, power consumption, energy consumption, and tool deflection can also be estimated based on the cutting force [5, 6]. This research aims to combine the mechanistic cutting force model and geometric cutting simulation to calculate the instantaneous cutting force in real time. In the scope of this paper, we define “real time” as the computation of cutting force being faster than the machining process itself. The advantage of calculating the cutting force in real time is that the feed rate can be dynamically adjusted through the controller’s “look-ahead” function when the NC code is read during the interpretation stage to prevent tool breakage or improve the cutting efficiency. Currently, the controller can only quickly analyze the dynamic error of the tool path and make timely acceleration/deceleration adjustments through pre-reading the NC code, in order to reduce the dynamic contouring error, especially when the tool is contouring around sharp corners. Although the feed rate can be dynamically adjusted to increase the cutting efficiency through estimating the cutting force, and to protect the tool from excessive wear or breakage, most of the research in the past presented their cutting force estimation offline, due to the large amount of computation involved in the calculation of the instantaneous cutting force. However, under the requirements of CPS and Industry 4.0, real-time/online simulation and feedback are key technologies. Therefore, the goal of this research is to achieve real-time NC simulation and computation of the instantaneous cutting force.

Traditional machining simulation for the cutting force calculation adopts the material removal rate (MRR) model [7] in which cutting force is assumed to have a linear relationship with MRR. In real-world situations, however, MRR and the cutting force may not show a linear relationship through simulation calculation, and MRR cannot calculate the individual component of the cutting force in each axis. More importantly, the MRR method tends to underestimate the instantaneous cutting force, which has been proven in reference [8]. So what we need is to calculate the correct instantaneous cutting force in real time in the machining simulation. It is widely accepted in the literatures that the cutting force evaluation based on the mechanistic model is more accurate than the MRR model [7]. However, it has a large amount of calculation and must be integrated with multi-axis cutting simulation to accurately calculate the cutter workpiece engaging area of ​​complex surfaces. Therefore until now, the two fundamental challenges in achieving a functional, virtual machining process simulation system remain the identification of cutter workpiece intersection along a tool path at discrete feed rate intervals and the development of computationally efficient process simulation algorithms [9].

The calculation of the cutting force in real time must be faster than the actual cutting speed. Aside from the calculation of the cutting force being intensive, the contact area between the tool and the workpiece is also constantly and instantaneously changing due to the complex geometry of the workpiece and the change of the tool path in the actual cutting process. In Merdol and Altintas’ [9] paper, one must first calculate the boundary of the complete cutter workpiece engagement (CWE) area, calculate the intersection of the tool edge and the CWE area (to determine whether the cutting edge falls within the CWE area), and then calculate the cutting force at the cutting edge. They used the Brent algorithm, a bracketing root-finding numerical method, to calculate the intersection point. Cutting forces at the cutter edge tips also need to be sorted and integrated along the cutter axial direction (usually along the z-axis). In their work, it is assumed that CWE was already generated by the Boolean operation of the solid model of the workpiece and the swept volume of the tool during cutting. Although the result of the Boolean operation of the solid modeler is very accurate, the calculation relies on complex surface-and-surface intersections, and the computation cost is very high. Early researchers including Spence [10, 11] and Lazoglu [12, 13] used solid modeling kernels such as ACIS or Parasolid engines to perform the intensive Boolean computations, but this means the NC simulation and cutting force calculation were constrained by the use of expensive solid modelers. Even if, instead of a solid model (CSG or B-Rep), a triangular mesh is used to calculate CWE, the calculation time is still very large [14]. In their 2016 paper, Gong and Feng showed that the computational time for normal performance calculations is in the order of minutes. However, the computational time for high-performance calculations is in the order of hours due to the large number of mesh triangles and the intersection calculations involved. In Altintas’ more recent papers [15,16,17], CWE is still required before calculating the instantaneous cutting force. However, the calculations of CWE and the cutting force require intensive computer calculations, and the multi-axis cutting simulation must be performed simultaneously, which is time-consuming as well. So in previous research reports, almost all instantaneous cutting force computations were based on off-line calculation methods and could not be integrated with the machine tool controller for real-time cutting. Hence, it is difficult to be integrated into the CPS environment.

To obtain accurate CWE calculation, one must first calculate the swept volume of the tool when it travels through the cutting path (hence, it is called cutter swept volume (CSV)). The removal volume (RV) is then calculated from the intersection of the CSV and the in-process workpiece. This process can be obtained through the Boolean operation of a solid modeler but at a very high computation cost. Finally, the tool surface is projected onto the RV along the cutter axial direction to obtain the CWE area. Figure 1 shows the flow chart of the entire calculation of CWE, the intersection of the cutting edge (flute) and the CWE, and the computation of the mechanistic cutting force component in each axis. The amount of computer calculation in the entire process is quite large, so the cutting force calculation is mainly performed in an off-line manner, and cannot be performed in a synchronous and real-time manner on the machine tool during machining.

Fig. 1
figure 1

The flow chart to generate cutter swept volume (CSV) and removal volume (RV)

The existing methods to find CWE are discussed in the following literature. El-Mounayri et al. [18] proposed using B-Rep to model the workpiece and the Bezier curve/surface to model the cutter and Boolean operation to subtract the workpiece and calculate the CWE area in the 3D space. In [19], commercial software ACIS kernel was used for solid modeling and simulation, and the results of solid modeling were enhanced based on B-rep and NURBS. Bailey [20] calculated the surface information of the workpiece based on commercial CAD software; NURBS was used to represent the tool-path contours, and the CWE simulation was performed at each position of the CL points. Fussell [21] proposed the calculation of tool-path swept envelope (SWE) to find the intersection of the tool envelope and the Z-buffer elements of the workpiece. Feng [14] compared the above-mentioned methods of CWE computation and discussed the problem that CSVs may be difficult to generate due to complex cutter envelopes and tool paths. They proposed to use the triangular mesh model to solve the problem, but its calculation is not as efficient either. For high-density triangular mesh models, it takes up to hours to perform CWE calculations.

From the research mentioned above, it is clear that it is necessary to calculate the intersection area between the cutter envelopes and the machined workpiece to assess CWE accurately. The required information includes the CAD model of the workpiece, the tool geometry, and the tool path. It requires a massive amount of computation effort to accurately simulate the intersections of the moving contours of the tool with the RV surface of the machined workpiece at each CL point. This lengthy process hinders the real goal of finding the instantaneous cutting force in real time.

Almost all previous studies have adopted the same point of view: The CWE area must be calculated first to calculate the instantaneous cutting force. However, the large amount of CWE calculation makes the calculation of the instantaneous cutting force challenging to be executed in real time, so a fundamental question is raised: If one wants to achieve real-time calculation of cutting force, is it really necessary to calculate the CWE area? In other words, is it possible to calculate the instantaneous cutting force in real-time without calculating CWE?

In this research, we propose an innovative solution to this problem. Using GPU’s parallel computing on the direct computation of the instantaneous cutting force (without calculating CWE), the cutting force computation, together with NC simulation, can reach up to 48 fps on a local PC, reaching the goal of CPS and digital twin simulation requirements in real time.

2 Cutting force model

Before we proceed to the proposed solution, we first review the mechanistic cutting force model. Cutting force simulation has been an important part of virtual machining in recent years. As described in the “Introduction” section, with the complexity of workpieces and tool paths, it is important to be able to calculate and predict the instantaneous cutting force in order to prevent part damage, tool breakage, or excessive tool wear. The cutting force will also affect the surface accuracy of the workpiece because of excessive tool wear and force-induced chatter or vibrations. Therefore, how to use the machining simulation system to accurately predict the real-time machining status of the machine and the machined part becomes an important research topic. In addition, by combining the machine constraints such as motor torque and spindle speed limits, the machining feed rate can be adaptively scheduled to dynamically adjust the cutting force in a suitable range to prevent part/tool damage and improve machining efficiency.

Traditionally, in setting the cutting parameters of feed rate and spindle speed, users will consult the cutting tool companies to provide the database of suggested parameters relative to different cutters versus workpiece materials. Once the suggested parameters are chosen, they are usually set at fixed values during the machining process. However, when machining complex sculptured surfaces typical in die and mold manufacturing, the fixed cutting parameters usually do not generate optimal machining results. For example, when the tool path contours around sharp corners, large cutter workpiece engagement often takes place and generates large cutting forces. The machine controller often reduces the feed rate at corners based on the evaluation of dynamic contouring error or tracking error but not the cutting force. On the other hand, when machining along a straight tool path, the controller does not know if there is full immersion, hence will not reduce or increase the feed rate. But in the finish milling of dies and molds, there are many occasions that the cutting engagement and the cutting force are relatively small such that their feed rate can be increased to reduce machining time and increase productivity. However, most machine tool controllers today do not take advantage of that. In fact, without cutting force evaluation and prediction, optimal feed rate adjustment cannot be achieved.

Cutting force modeling requires the input variables of cutting rotation angle, chip thickness, and cutting edge position. Taking the most frequently used ball end mill for our study, it is shown [22] that the instantaneous cutting force comes from the integration of the localized cutting force components (in radial, axial, and tangential directions) along the infinitesimal cutting edge segments. Furthermore, cutting force is generated only when there is contact between the cutter and the workpiece. Therefore, typical in 2D and 3D milling, the effective cutting range of the rotation angle is defined in Eq. (1) between the start angle and the exit angle [23]:

$${\theta }_{st}\le \phi \le {\theta }_{ex}$$
(1)

The infinitesimal tangential force (\(\mathrm{d}{F}_{tj}\)), the axial force (\(\mathrm{d}{F}_{rj}\)), and the radial force \((\mathrm{d}{F}_{aj})\) can be written by the cutting force per infinitesimal segment as Eq. (2):

$$\begin{aligned}&\mathrm{d}{F}_{tj}={K}_{te}*dS+{K}_{tc}*h\left(\phi ,\kappa \right)*db\\&\mathrm{d}{F}_{rj}={K}_{re}*dS+{K}_{rc}*h\left(\phi ,\kappa \right)*db\\&\mathrm{d}{F}_{aj}={K}_{ae}*dS+{K}_{ac}*h\left(\phi ,\kappa \right)*db\end{aligned}$$
(2)

\({K}_{rc}, {K}_{tc}, {K}_{ac}\) are the cutting force coefficient generated by the shearing force, and \({K}_{re}, {K}_{te}, {K}_{ae}\) are generated by the cutter side surface rubbing the workpiece in the radial, tangential, and axial directions, respectively.

The chip thickness h of the cutter from the geometric position of the cutter is estimated as shown in Eq. (4). \({s}_{tj}\) is the feed per edge segment of the cutter, \({\phi }_{j}\) is the cutter rotation angle, and \(\kappa\) is the axial immersion angle. \(\kappa\) is deduced according to the geometric position change, which can be expressed as Eq. (3):

$$\kappa ={\mathrm{sin}}^{-1}\left(\sqrt{{{R}_{0}}^{2}-{({R}_{0}-z)}^{2}}/{R}_{0}\right)$$
(3)
$$h\left(z,{\phi }_{j}\right)={s}_{tj}\mathit{sin}{\phi }_{j}\mathit{sin}\kappa$$
(4)

To present the cutting force in the workpiece and the machine coordinate systems, the radial, axial, and tangential force components can be transformed to the X, Y, and Z directions as shown in Eq. (5):

$$\left[\begin{array}{c}d{F}_{x}\\ d{F}_{y}\\ d{F}_{z}\end{array}\right]=\left[\begin{array}{ccc}-\mathrm{sin}\phi \mathrm{sin}\kappa & -\mathrm{cos}\phi & -\mathrm{sin}\phi \mathrm{cos}\kappa \\ -\mathrm{cos}\phi \mathrm{sin}\kappa & \mathrm{sin}\phi & -\mathrm{cos}\phi \mathrm{cos}\kappa \\ -\mathrm{cos}\kappa & 0& -\mathrm{sin}\kappa \end{array}\right]\left[\begin{array}{c}d{F}_{r}\\ d{F}_{t}\\ d{F}_{a}\end{array}\right]$$
(5)

The infinitesimal cutting force components are then integrated along the cutting edge from the bottom to the top of the axial depth of the cut. The resulting cutting forces are represented as a function of the rotation angle in the X, Y, and Z directions as shown in Eq. (6):

$$\begin{aligned}&{F}_{x}\left(\phi \right)={\sum }_{j=1}^{{N}_{f}}{F}_{xj}\left[\phi (z)\right]={\sum }_{j=1}^{{N}_{f}}{\int }_{{z}_{1}}^{{z}_{2}}\\&\quad\quad\quad\quad\left[\begin{array}{ccc}-d{F}_{\mathit{rj}}\mathrm{sin}{\phi }_{j}\mathrm{sin}{\kappa }_{j}& -d{F}_{tj}\mathrm{cos}{\phi }_{j}& -d{F}_{\mathit{aj}}\mathrm{sin}{\phi }_{j}\mathrm{cos}{\kappa }_{j}\end{array}\right] dz\\&{F}_{y}\left(\phi \right)={\sum }_{j=1}^{{N}_{f}}{F}_{yj}\left[\phi (z)\right]={\sum }_{j=1}^{{N}_{f}}{\int }_{{z}_{1}}^{{z}_{2}}\\&\quad\quad\quad\quad\left[\begin{array}{ccc}-d{F}_{rj}\mathrm{cos}{\phi }_{j}\mathrm{sin}{\kappa }_{j}& -d{F}_{tj}\mathrm{cos}{\phi }_{j}& -d{F}_{\mathit{aj}}\mathrm{sin}{\phi }_{j}\mathrm{cos}{\kappa }_{j}\end{array}\right] dz\\&{F}_{z}\left(\phi \right)={\sum }_{j=1}^{{N}_{f}}{F}_{zj}\left[\phi (z)\right]={\sum }_{j=1}^{{N}_{f}}{\int }_{{z}_{1}}^{{z}_{2}}\\&\quad\quad\quad\quad\left[\begin{array}{ccc}-d{F}_{rj}\mathrm{cos}{\phi }_{j}& 0& -d{F}_{\mathit{aj}}\mathrm{sin}{\kappa }_{j}\end{array}\right] dz\end{aligned}$$
(6)

2.1 Identification of cutting force coefficient

In mechanistic models, parameters \({K}_{rc}, {K}_{tc}, {K}_{ac}, {K}_{re}, {K}_{te}, {K}_{ae}\) are known as cutting force coefficients, which are established through cutting tests and regression analysis. When estimating the cutting force, accurate estimations of cutting force coefficients are very important to avoiding tool deflection caused by excessive cutting force and poor machining efficiency caused by too small a cutting force. The cutting force evaluation is related to the cutter geometry, the cutting material, and the estimated cutting coefficients. Inaccurate cutting force coefficients will result in inaccurate assessments of the cutting force. Therefore, a reliable calibration process is needed for the estimation of cutting force coefficients.

In order to obtain the cutting force coefficients, it is necessary to conduct cutting experiments with different processing conditions. The average force method uses the full immersion condition to identify coefficients. In down milling-based full immersion milling, the start angle (\({\theta }_{st}\)) and the exit angle (\({\theta }_{ex}\)) of the tool are \({\theta }_{st}=0\) and \({\theta }_{st}=\pi\), respectively. During machining, the cutters are subjected to the forces in the X, Y, and Z directions under different feed rate settings. According to process characteristics of full immersion milling, different feeds are used to measure the cutting forces in different directions using a dynamometer. The cutting force coefficients are identified through the linear regression of the measured force data. The cutting forces in each axis can be averaged as \(\overline{{F }_{x}}\), \(\overline{{F }_{y}}\), and \(\overline{{F }_{z}}\).

Equation (7) describes the linear relationship between the average cutting force and the feed. Multiple cutting experiments were run to collect multiple sets of data involving different feeds and resulting cutting forces. Linear regression was then used to estimate their slopes and intercepts.

$$\begin{aligned}&\overline{{F }_{x}}=\frac{{N}_{t}b{K}_{rc}}{4}{f}_{t}+\frac{{N}_{t}b{K}_{re}}{\pi }\\&\overline{{F }_{y}}=\frac{{N}_{t}b{K}_{tc}}{4}{f}_{t}+\frac{{N}_{t}b{K}_{te}}{\pi }\\&\overline{{F }_{z}}=\frac{{-N}_{t}b{K}_{ac}}{\pi }{f}_{t}-\frac{{N}_{t}b{K}_{ae}}{2}\end{aligned}$$
(7)

In Eq. (7), \({N}_{t}\) is the spindle speed, \(b\) is the radial depth of cut, and the cutting force coefficients can be derived as shown in Eqs. (8)–(13):

$${K}_{rc}=\frac{4{a}_{1x}}{{N}_{t}b}$$
(8)
$${K}_{re}=\frac{\pi {a}_{0x}}{{N}_{t}b}$$
(9)
$${K}_{tc}=\frac{4{a}_{1y}}{{N}_{t}b}$$
(10)
$${K}_{te}=\frac{\pi {a}_{0y}}{{N}_{t}b}$$
(11)
$${K}_{ac}=-\frac{4{a}_{1z}}{{N}_{t}b}$$
(12)
$${K}_{te}=-\frac{\pi {a}_{0z}}{{N}_{t}b}$$
(13)

The above calibration method for determining cutting force coefficients can be applied to different tool geometry and workpiece material. Once the coefficients are determined, they can be plugged into Eqs. (2) to (6) to estimate the instantaneous cutting force for different cutters, materials, and cutting conditions.

3 Direct calculation of instantaneous cutting force

It is clear from existing literature that the mechanistic model of predicting cutting force is most reliable based on experimental validation. However, most publications presented their results by conducting machining tests with full immersions of cutters in end milling cases. As shown in Fig. 2, in real-world machining of complex workpieces such as dies and molds, the cutter workpiece engagement area is constantly and instantaneously changing, resulting in the difficult assessment of instantaneous cutting force.

Fig. 2
figure 2

Cutter workpiece engagement area changes as the tool moves along the tool path [24]

As pointed out in the “Introduction” section, the traditional way of finding the instantaneous cutting force is to calculate CWE first and then find the intersections of CWE with the cutter disc strips or the cutter edge lines. The entry and exit engagement angles for each cutter disc strip or each cutter edge line are calculated by finding the intersections. The instantaneous cutting forces in each direction (axial, radial, and tangential) are then obtained by integrating the incremental cutting force on each cutter workpiece contact point within the CWE boundaries and along the cutter axial direction based on Eq. (6). The drawback of this traditional method is that CWE must be accurately calculated before the cutting force can be calculated. The cost of CWE calculation is also too high for the calculation of instantaneous cutting forces to be realized in real time during machining.

In this paper, a new approach is proposed to calculate the instantaneous cutting force without CWE calculation. The proposed process flow chart is shown in Fig. 3. Unlike earlier approaches to either represent the cutter and the workpiece by B-Rep or CSG models (and then calculate CWE using expensive Boolean operations) or entirely by triangulated meshes [14], we use analytical models to represent the cutter (to obtain high accuracy) and triangulated mesh to represent the workpiece (which is a common practice as most CAM systems today convert B-Rep or CSG models into triangular meshes for tool-path generation). Dexel method is used to perform multi-axis NC simulation [25, 26] in which updated machining surface (RV) is generated at every instance a cutter location (CL) point is fed from the tool path (the NC code). The CL point can be considered the origin of the cutter and be used to calculate the cutter contact (CC) point based on different cutter types and parameters. The basic idea is to check if the CC point is coincident with the RV surface. If the answer is yes, then there is contact, and the instantaneous cutting force needs to be calculated for this contact point (Figs. 4 and 5).

Fig. 3
figure 3

The process methodology of instantaneous cutting force computation

Fig. 4
figure 4

The calculation of the contact point between the ball end mill and the workpiece

Fig. 5
figure 5

The schematic of calculating the contact point between the cutter and the workpiece using ray casting

Let us use the ball end mill as an example. According to [22], a cutter edge point can be represented as Eq. (14) with respect to the CL point of the cutter:

$$rd(z\phi )={\left[\begin{array}{ccc}r\left(z\right)\mathrm{sin}\phi & r\left(z\right)\mathrm{cos}\phi & z-R\end{array}\right]}^{T}$$
(14)

Since the CL point moves along the tool path relative to the workpiece coordinate system (or the world coordinate system if we assume they coincide with each other), we can represent the cutter edge point as Eq. (15) with respect to the world coorsdinate system.

$$\mathrm{P}={r}_{0}+\mathrm{t}{ r}_{d}$$
(15)

In order to determine if this cutter edge point is a CC point, Eq. (15) can be replaced by a vector or a ray to intersect the RV surface. If the intersection calculation returns with a distance equal to the cutter ball radius, then it is a CC point, and the instantaneous cutting force needs to be calculated based on Eq. (6). To calculate the intersection point on the triangular mesh, given a considered triangle with three vertices\({P}_{1}, {P}_{2}, \mathrm{and} {P}_{3}\), the normal vector of the triangle is

$$n=\frac{\left({P}_{2}-{P}_{1}\right)\times \left({P}_{3}-{P}_{1}\right)}{\Vert \left({P}_{2}-{P}_{1}\right)\times \left({P}_{3}-{P}_{1}\right)\Vert }$$
(16)

The plane equation of the triangle can be represented as in Eq. (17), given \(d=n\bullet P_{1}\):

$$n\bullet P-d=0$$
(17)

Now, we replace Eq. (15) with a ray as in Eq. (18). The distance of projection t can be obtained in Eq. (19):

$$P={r}_{0}+\mathrm{t}\frac{{r}_{d}}{\Vert {r}_{d}\Vert }$$
(18)
$$t=^{\left(d-n\bullet {r}_{0}\right)}/_{\left(n\bullet \frac{{r}_{d}}{\Vert {r}_{d}\Vert }\right)}$$
(19)

t is the distance from the CL point to the RV surface. If this distance satisfies Eq. (20) and the intersection point falls inside the triangle, it is accepted as the CC point between the cutter and the workpiece.

$$\left|\left|t\right|-R\right|<\varepsilon = \delta (tolerance)$$
(20)

Based on Eq. (19), the cutter contact point with the machined surface can be identified and calculated without the calculation of CWE. At each instance of a CL point, we can search through the cutter contact (CC) space as a function of the axial depth of cut (or the z height in the cutter coordinate system) and the cutter rotation angle \(\phi .\) The discretization of the CC space is shown as a two-dimensional grid (see Figs. 6 and 7). The intersection detection process from Eqs. to is carried out for each grid point. If identified as a CC point, the localized instantaneous cutting force will then be calculated based on Eq. (3). Otherwise, it will be set to zero because of no contact. After the localized instantaneous cutting forces of all the grid points are calculated, they are integrated along the cutter axial direction (the z-axis). The result is the instantaneous cutting force as a function of the cutter rotation angle ϕ. This process helps us calculate the instantaneous cutting force directly, without the prerequisite of finding CWE first. The CWE area can also be easily identified if the discretization of the CC space is dense enough, as shown in Figs. 6 and 7, although that is no longer our goal.

Fig. 6
figure 6

Using ray casting to find cutter contact points to calculate instantaneous cutting force

Fig. 7
figure 7

CC space with cutter contact points showing instantaneous cutting force values

To accurately estimate the cutting force, the discretization of the CC space needs to be sufficiently dense, particularly in the cutter axial direction. Numerical integration schemes such as Simpson’s rules or Romberg integration algorithm can be employed to increase the accuracy with finite segmentations. In the rotation angle dimension, the angles should be dense enough to reconstruct the harmonic pattern of the cutting force. The more dense the grid points are, the higher the computation cost of the complex cutting force will be. However, since the computation of the localized cutting force on each grid is independent, they can theoretically be computed simultaneously. This characteristic lends itself to the possibility of using parallel computing to reduce the total computation time. In this work, since we use OpenGL4.3 to speed up the machining simulation by using GPU shaders, it is natural and straightforward for us to adopt Compute Shaders in OpenGL to deploy the parallel computation scheme. Ideally, every localized instantaneous cutting force calculation is considered a single thread in execution using the Compute Shaders. This tremendously speeds up the computation of the total cutting force.

By combining the proposed method with parallel computing using GPU, we can compute the instantaneous cutting force with instantly changing machined surface in real time, such as the cases shown in Figs. 8 and 9. In the next section, we will describe the experiments and the simulations used to verify the effectiveness of the proposed method.

Fig. 8
figure 8

Simulating the instantaneous cutting force of a single-edged tool

Fig. 9
figure 9

Simulating the instantaneous cutting force of double-edge tool

4 Simulation results and experimental validations

Based on the proposed method described in the previous section, instantaneous cutting force at any given cutting instant can be calculated and simulated given a known workpiece, a cutter type, cutter parameters, and a machining CL file, which needs to be verified by experiments. In this section, we describe the experimental validation process and its results. Although the proposed method can be applied to various cutters, including flat end mill, ball end mill, and fillet end mill, and to roughing or finish milling conditions, we use the ball end mill and the finish milling condition in this work because of their general representation characteristics.

First of all, the calibration of the cutting coefficients needs to be established. A 3-mm-diameter ball end mill made of high-speed carbide is used to machine a material raw block made of aluminum Al-6061. For the calibration of cutting coefficients using Eq. (7), full immersion of cutter is adopted to use the mechanistic cutting force model directly. We use a vertical machining center (Tong-Tai VC 608) and a Kistler 9257B force dynamometer to measure the cutting force (see Fig. 10). Four different feed rates are designed to obtain the linear relationship chart between the feed rate and the cutting force, as shown in Table 1. The workpiece dimensions are 50*60*38 mm.

Fig. 10
figure 10

The schematic of the experimental set up

Fig. 11
figure 11

A linear regression graph showing the average X, Y, and Z directional cutting forces

Fig. 12
figure 12

The comparison between the cutting force simulations and experiments

Table 1 The cutting conditions for the experiments
Table 2 The values of the linear regression cutting force coefficients for the workpiece material Al-6061

By running a straight G1 tool path at four different feed rates, we measure the average cutting forces in Eq. (7). Linear regression is applied to the data to find the slope and the intercept for each force component Fx, Fy, and Fz, as shown in Fig. 11. Table 2 shows the calibrated cutting force coefficients using Eqs. to. After the cutting coefficients are found, they can be plugged into the cutting force model of Eq. (6) and used to simulate the cutting force. To verify the cutting force model, the simulated cutting force is plotted against the measured cutting force, as shown in Fig. 12.

To verify the proposed instantaneous cutting force calculation method, a spider-shape die geometry (see Figs. 13 and 14) is used to evaluate the simulated cutting force against the measured cutting force. Due to the geometry variation along the tool paths, the instantaneous cutting force changes from CL point to CL point. Our goal is to evaluate the proposed method’s validity and efficiency since it does not calculate CWE. The material is still Al-6061, and the cutter is still a 3-mm-diameter ball end mill. The maximum axial depth of cut is 1.5 mm.

Fig. 13
figure 13

The simulated tool path of the machining model

Fig. 14
figure 14

An illustration of the real geometry

Our experiment compares the simulated cutting forces with the measured data from the dynamometer in the three axial directions (see Fig. 15). From the comparison, it can be seen that the wave pattern and the cutting force amplitude of the entire tool path and the cutting force are successfully predicted. In processing complex sculptured surfaces, the cutter workpiece engagement (CWE) area changes instantaneously, and the instantaneous cutting force changes are more difficult to predict.

Fig. 15
figure 15

Comparison the complex tool path of cutting force simulations and experiments. (a) The measured force in the X direction. (b) The simulated force in the X direction. (c) The measured force in the Y direction. (d) The simulated force in the Y direction. (e) The measured force in the Z direction. (f) The simulated force in the Z direction

Fig. 16
figure 16

A graphical illustration of the simulation program

Figure 15 shows the comparisons of the cutting simulations and the experiments for a more complicated path segment of the case. From the comparisons in the three axial directions, it is clear that the simulation can capture the complex cutting force variations from the variation of the tool path and the machined surface. The acquisition frequency set by the measuring instrument is 6400 Hz, and the sampling rate is one point per 0.533 degrees of rotation. Since in this study, both the feed rate (50 mm/min) and the rotation speed (2000 rpm) are relatively low to reduce dynamic errors, the much higher acquisition frequency (6400 Hz) is, in fact, an overkill. The sampling rate set in the simulation shown in Fig. 15 is 600 Hz, and the sampling rate is one point per 10 degrees. From the results in the figure, even at a 1/10 sampling rate, the simulation in this study can still simulate the subtle cutting force changes at such sampling rate, reducing the waste of computer memory and saving the computation time (Fig. 16).

The current case study uses an Intel Core i5-6400 CPU and uses C + + combined with OpenGL Compute Shader to perform the calculations on a Windows PC. Its graphics card is an NVIDIA GeForce GTX 950, and its execution efficiency FPS is 12. In order to test the better execution efficiency of Compute Shader, another computer with an Intel Core i7-9700KF CPU and an NVIDIA GeForce RTX 2060 graphics card is also used. Its execution efficiency reaches 48 FPS. This means that if we sample and calculate the cutting force at every interval of 1 mm, we will be able to calculate the instantaneous cutting force up to the feed rate of 2,880 mm/min in real time. This validates the potential to use our proposed method for evaluating the instantaneous cutting force in real time to serve as an important digital twin function in CPS.

5 Conclusion

CPS requires modeling and virtual simulation of machining processes. Among the many physical quantities simulated by CPS, cutting force is perhaps the most important one to be simulated. This research aims to combine the mechanistic cutting force model and geometric cutting simulation to calculate the instantaneous cutting force in real time. Most of the researches in the past presented their cutting force estimation offline due to the large amount of computation involved in the calculation of the instantaneous cutting force. The major bottleneck is the prerequisite requirement to calculate the complex CWE area before calculating the instantaneous cutting force. In this research, we propose an innovative solution to this problem. Using GPU’s parallel computing on the direct computation of the instantaneous cutting force (without calculating CWE), the cutting force computation, together with NC simulation, can reach up to 48 fps on a local PC, reaching the goal of CPS and digital twin simulation requirements in real time.

Unlike earlier approaches to either represent the cutter and the workpiece by B-Rep or CSG models and then calculate CWE using expensive Boolean operations, we use analytical models to represent the cutter and triangulated mesh to represent the workpiece. Dexel method is used to perform multi-axis NC simulation in which the updated machining surface is generated at every CL point along the tool path. Instead of calculating CWE and then finding the intersections of cutting edge with CWE, we use the ray casting method to directly project the cutting edge point to the updated machined surface and then calculate the instantaneous cutting force. At each instance of a CL point, we can search through the CC space as a function of the axial depth of cut and the cutter rotation angle. The discretization of the CC space is a two-dimensional grid that lends itself naturally to using parallel computing to reduce the total computation time. In this work, we adopt Compute Shaders in OpenGL to deploy the parallel computation scheme. This tremendously speeds up the computation of the total cutting force. In our future work, the proposed system will be integrated with a PC-based controller in which the look-ahead function will use the cutting force prediction to dynamically adjust the feed rate to increase production efficiency. Feed rate optimization can also be carried out to balance the dynamic contouring error (usually resulting in the reduction of feed rate) and the milling efficiency.