1 Introduction

CNC machine tool is one of the most important machining devices, and many kinds of high-grade CNC machine tools have become the pivotal investments in manufacturing enterprises. To give a full role to the potential production of CNC machine tools, to optimize the processing technologies, and to improve the quality of products, there is an urgent request for the cooperation of the processing object itself and related supporting software/hardware factors. With the rapid achievement of information and programming technology, virtual simulation and parameter optimization in the manufacturing process on a computer before practical production have become an effectual way for CNC machining verification [1]. Generally speaking, the whole manufacturing process includes 3 levels: macro production and related management process, workshop-level manufacturing process, and micro material processing process such as physical or chemical reaction, deformation, and material removal or increment. The first two stages are usually realized by ERP (Enterprise Resource Planning)/MES (Manufacturing Execution System)/RPC (Realtime Production and Supervision Control System) or similar enterprise-level platforms to analyze, predict, and control production activities, and the latter conducts monitoring and optimization for details in micro machining process. The analysis of the machine tool cutting process is mainly realized by cutting virtual simulation, which can be divided into two stages: geometric modeling and physical simulation. At present, there are lots of researches in related fields, especially for cutting geometry simulation [2]. There are several commercial or open-source modules currently, which have carried out basic geometric simulation for the machining process or provide the secondary development interfaces. Nevertheless, the research on physical simulation for details in micro cutting, such as forces and heat, is slightly inferior [3].

Physical simulation of the machining process is based on cutting mechanisms and precise geometric calculations with trajectory analysis. Through a comprehensive analysis of cutting mechanism model, CNC code, process planning and optimization, or other related information, the micro cutting process can be simulated in advance, detected and monitored in the process, and analyzed afterwards, therefore to achieve the purpose of “Verification IS Production.” Currently, several CAD/CAM software, such as NX or CATIA, have built-in CNC code analysis and tool path simulation modules. Special software for CNC machining simulation and optimization, such as VERICUT, PowerMILL, and CIMCOEdit, provide more powerful solutions on geometric simulation, verification, analysis, and optimization of cutting process and have powerful ability of simulating material removal in a more realistic way. In addition, many scholars also carried out deep research on cutting simulation from the above aspects, trying to analyze and optimize the cutting in a more detailed and micro perspective.

The difficulties in physical simulation lie in the comprehensive consideration and integration of various factors in cutting process, fast calculation, and transmission to geometric simulation module, so as to reflect the micro varieties of material deformation and removal as truthfully as possible. Most simulation algorithms are mainly to reproduce, plan, and optimize the cutting path and cutting speed with cutting efficiency and to optimize the cutting parameters in CNC code. However, the physical mechanism of cutting itself and influences on mechanics, thermology, and machining quality are rarely or hardly included in the scope of simulation, which is generally obtained through online measurement for take-in-process monitoring or post analysis. With the rise and upgrading of “Industry 4.0,” many upmarket products have increasingly been put into manufacture, which cannot be smoothly implemented in specific cases by means of detection or trial-and-error for many times; therefore, it is an urgent task to realize the pre-verification to meet the actual processing conditions.

For constructing a more effectual platform to realize the accurate geometry-physical modeling and simulation in machine tool cutting process, we have developed a targeted application platform that integrates physical simulation on the geometry modeling module. This paper proposes a framework of multi-element twin micro geometry modeling and physical simulation of machine tool cutting. The research is carried out to establish the roles of multiple cutting elements and mapping between the real situations and simulation modules. Through cutting physical models, we have finished the simulation calculation and revision to multi-factor which affects the cutting performance indexes and finally achieved verification, analysis, and optimization through actual measurement. The rest of this paper is organized as follows. In the next section, we will review the latest advancements in this field. And the framework and methodology will be presented in Section 3. The detailed technologies and modules embedded in implementation will be deeply investigated in Section 4 and Section 5 respectively on geometry and physical areas. The prototype system including geometry-physical modeling and simulation, together with cutting case study, will be presented in Section 6. Finally, the conclusion and further plan will be given in Section 7.

2 Related work

By simulating and verifying the material removal, virtual simulation has the ability of predicting and optimizing the physical characteristics in cutting process, thus to reduce or even avoid physical tests on real machine tools. The field of virtual cutting simulation includes 3D geometric modeling, physical simulation, and parameter optimization, on which scholars have carried out extensive and in-depth research based on physical mechanism of parts cutting. In recent years, geometric modeling and simulation has made remarkable achievements. Several prototype or practical systems have been developed and put into actual applications [4,5,6,7]. Nevertheless, there are not mature results and platforms for the integration of cutting mechanism and geometric-physical calculation to carry out multi-element twin simulation and optimized feedback.

2.1 Geometric modeling of cutting simulation

Because of changeable cutting tool 3D modeling and complex tool-workpiece motion together with Boolean operation in multi axis machining, virtual system puts forward higher requirements for the efficiency, accuracy, and robustness of geometric technologies. At present, there are three kinds of geometrical modeling for cutting simulation, which are respectively based on solid, vector, and space segmentation.

Solid-based methods share the ability of achieving a high accuracy in geometric simulation for using continuous parameters to express surfaces and boundaries, but real-time Boolean operation costs too much computing resources, which limits the simulating speed. Spence and Altintas [8] developed an integrated simulation system for 2.5-Axis CNC machining based on constructive voxel. Mounayri et al. [9] adopted the boundary representation to express 3D workpiece models, the Bezier curve to fit tool profile curve, and Boolean operation between workpiece model and tool scanning body to simulate the removal process of workpiece material. Miao [10] established a numerical control (NC) machining simulation system based on the STL model in triangular patches on the Unity3D platform. Based on rapid and accurate modeling of tool scanning body, the precise Boolean operation of the STL model was realized, and the simulation speed was improved by entity segmentation and spatial grids.

The methods based on vector and space segmentation are approximate way, which sacrifice the accuracy on the premise of improving simulating speed. The Z-map way [11] adopts a series of vectors parallel to the Z axis to represent the workpiece, the height of which are updated according to the cutting path, and the Tri-dexel method is proposed to enhance its accuracy.

To improve the accuracy of the traditional voxel method, Joy and Feng [12] proposed a frame-sliced voxel model, which adopts multi-level voxels to reduce the storage and improves the accuracy of geometric simulation by storing the intersection of cutting tool and voxel. Yau and Tsou [13] realized five-axis simulation by employing volume modeling by octree and parametric tool expression. The mesh model derived from octree is used for error analysis and over-cutting inspection. Sullivan et al. [14] developed a 5-axis machining simulation system, in which adaptive distance field of octree space division is used to represent the 3D workpiece, and reverse trajectory is also adopted to update the material removal process of workpiece, avoiding the calculation of the tool scanning body. The system achieved an accuracy of micrometer or even nanometer level under the low memory consumption.

2.2 Physical simulation of cutting simulation

The main aim of machining process simulation in the virtual environment is to predict the macro status of cutting process, including the maximum cutting force, torque, power, vibration, and surface accuracy, among which cutting force is the most important performance index to represent the cutting status. Many scholars have done outstanding researches on models of cutting force. At present, cutting force evolution includes empirical model, mechanical model, analytical model, finite element model, and hybrid model [15], and mechanical model is more mature and widely used in virtual environment [4]. The mechanical model belongs essentially to one kind of micro element calculation, which divides the cutting edges into micro elements along the axis of the tool. The cutting process of each micro element can be regarded as an oblique cutting, and its circumferential, radial, and axial cutting forces can be calculated based on shear force coefficient, edge force coefficient, and chip shapes. The instantaneous cutting forces can be obtained by integrating the micro cutting force in cutter workpiece engagement (CWE). The coefficients in cutting force model are achieved by fitting the test data or based on the cutting database [16].

As CWE expresses the contacting status of tool-workpiece, it is an important basis to determine whether the micro elements of cutting edge participate in the cutting process. Therefore, obtaining CWE accurately and efficiently in multi-axis machining is the key issue to realize physical simulation and optimization. Many researches have been studied, among which CWE calculation based on simulation can be applied to any shape of tool and workpiece type by their geometric data. According to different techniques used in geometric simulation, CWE calculation can be achieved on entity, vector, and space segmentation [17]. For example, in the process of entity-based CWE calculation, high Boolean operation time is the key problem to be solved [18]. The methods based on vector and space partition calculate CWE in a more quick way with some spatial errors, however. Several enhanced algorithms have been proposed to overcome this shortcoming in a certain degree.

2.3 Parameter optimization in cutting simulation

The theory of cutting parameters optimization has been deeply investigated in various subareas, including end milling [19], turning [20], grinding [21], and drilling [22]. Among these researches, end milling is most widely used to obtain profiles, grooves, and cavities. In end milling, the machining parameters needed to be optimized include cutting speed, feed speed, radial cutting depth, and axial cutting depth. These parameters can be divided into two types according to their influence on tool path: position parameters (radial and axial cutting depth) and kinematic parameters (cutting speed and feed speed). The former affects the tool path position in material removal process, while the latter is the status parameter of machine tool in material removal process.

For the optimization of kinematic parameters, feed speed based on virtual machining is widely concerned and investigated. Virtual geometric and physical simulation help forecast material removal rate, cutting forces, torque, power, tool amplitude, and workpiece surface size error in the process of machining, to realize the adjustment and optimization of feed speed. Different control parameters, such as chip thickness, material removal rate, chord height error, and cutting force, are used in the existing feed rate optimization methods [23]. Several intelligent algorithms are also widely employed in the solution of parameter optimization [24], such as genetic algorithm [25], particle swarm algorithm [26], bee swarm algorithm [27], and artificial neural network [28]. However, it should be reminded that when the theoretical models are used to optimize the machining parameters, the workpieces are usually modeled as a prismatic part, and the same cutting parameters are employed for each milling pass. This premise in geometric simplification makes the method unable to deal with the instantaneous machining state; therefore, it is not suitable to optimize the machining process of more complex parts (casting blank, with corner). To solve the shortcomings of optimization based on the above theoretical models, many researchers try to integrate CAD/CAM application into virtual simulation and optimization strategy.

2.4 Achievements and limitations

From the detailed review and analysis of the above research, it can be concluded that at present, the geometric-physical simulation and parameter optimization of cutting process in machine tools have been deeply investigated from many aspects, and many positive results have been achieved. However, the investigations in these three modules are in a separate status, which have not been tightly integrated. Particularly, there are still some blind spots and difficulties in the real-time calculation, information communication, and feedback mechanism of physical quantity in cutting geometry space. Moreover, the achievements are based on scattered cutting cases. It is an urgent issue to organize and manage the heterogeneous data of machining knowledge efficiently and to form a reusable software framework, which effectual integrates geometric modeling, physical simulation, and parameter optimization. In view of this situation, we built a physical simulation on the geometry modeling module to reproduce the roles of multiple cutting elements and mapping between the real situations and virtual environment, in which cutting simulation and parameter optimization have been well achieved.

3 Architecture and methodology

As an important pattern to simulate the product cutting process and predict potential problems in virtual space, cutting geometric-physical simulation for machine tool is of great significance to detect and evaluate the quality of CNC code, analyze the influence of processing parameters on the product quality, and optimize the manufacturing plan. The virtual scheme helps shorten product development cycle, reduce the production cost, and improve the product competitiveness of enterprises. However, due to the complexity of cutting physical mechanisms and various numerical calculations (including mechanics, thermology, wear, error analysis, and surface quality), a uniform analysis mode cannot be obtained for different processing scenarios; therefore, it is necessary to carry out specific investigation for different machining types, cutting types, cutting materials, workpiece types, etc., then implant them into the calculation software, and thus, the mechanisms for different machining become the theoretical foundation for cutting geometric-physical simulation and optimization. Various physical calculations in CNC cutting simulation have been investigated, and the verified results can be adopted as the input of simulation module. The combination of tool cutting mechanism and geometric technology is the key to the effectiveness of simulation. To achieve this goal, it is necessary to first transform the obtained diversified cutting data into a suitable knowledge representation form and then jointly calculate and represent with geometric simulation to achieve higher accuracy through more targeted description, simulation, and optimization of machining details. For the diversity of cutting factors, the generality of cutting physical simulation cannot be realized at one stroke. In addition, as the final inspection method before manufacturing, cutting simulation is coupled with process planning under current intelligent manufacturing mode to realize overall optimization and to fully play the potential of virtual simulation.

The purpose of this paper is to explore a feasible approach for geometric-physical simulation through multi-element modeling of several machining cases with detailed micro geometry and physics research. Geometric modeling tried to reflect the cutting process as accurately as possible, based on which physical simulation employed cutting parameters obtained from geometric space as the basis for its calculation, and the results of physical calculation can be backward presented and visualized through the geometric module. According to pre-set characteristic value of cutting targets, appropriate cutting parameters will be obtained by multi-disciplinary and multi-objective optimization, and the corresponding value of the original CNC code is fed back to the control and iterator. The research framework of the whole simulation system is shown in Fig. 1.

Fig. 1
figure 1

The research framework

Cutting geometric-physical simulation belongs to the typical multi-input and multi-output system, involving many intertwined factors. Therefore, to make the simulating models reflect cutting reality as truly as possible, and the calculation more accurate and effective, it is necessary to consider all aspects of factors and interference factors comprehensively in physical modeling. In addition, due to the synthesis of multiple factors, the calculation complexity and costing time will be further extended. To complete the calculation and reflect the results back to the geometric simulation in real time is also an urgent problem to be handled. The cutting processing mainly includes the following elements, as listed in Table 1.

Table 1 Machining factors

At present, the existing geometric simulation still holds the bottleneck of efficiency and accuracy, especially visualization of dynamic cutting and accurate calculation in cutter-workpiece engagement body in multi-axis machining. Physical simulation needs a reliable cutting mechanism model and plenty of experimental data, to improve the calculation accuracy and to seamlessly integrate the data into the simulation system, and the two-way linkage with geometry module is still the key issue that will be emphatically analyzed in this paper. We have developed a cutting geometric-physical modeling and simulation system for machine tool, which is cooperatively based on OpenCascade and SDL (Simple DirectMedia Layer). OpenCascade is an open-source 3D geometry modeling library with C +  + /Python API interface, and it is known as one of the three general CAD/CAM engines together with Parasolid and ACIS. SDL is a set of open-source and cross-platform multimedia library written in C language, providing several functions for the usage in the 3D games, simulators, media players, and other related multimedia applications.

4 Key technologies in geometric modeling

To construct an effectual cutting geometric-physical simulation platform, it is a great challenge in which several key technologies need to be deeply investigated, including numerous constituent modules and embedded algorithms.

Geometric and physical simulation put forward high requirements for the accuracy and speed of calculation, and real-time performance under tiny step is a most critical stumble in the implementation. The fidelity of geometric processing in cutting simulation mainly depends on the representation of geometry and the implementation of rapid and accurate Boolean operations among CWE, especially on the latter. For the above issues, we have proposed a complete geometric-physical solution including four fields that need special mention as follows. It is worth mentioning that CWE is the kernel of computation, and this implementation meets the requirements of both geometric modeling and physical simulation, which is a new approach beyond the state of the arts.

4.1 Geometric representation of tools and workpieces

In this paper, we adopted a solid modeling method based on sampling distance field (SDF). SDF belongs to the scalar field, which defines the minimum distance from any spatial point \(p=\left(x,y,z\right)\) to the boundary surface of the 3D solid. The positive and negative distances are used to distinguish the internal and external situations of the spatial points. One advantage of SDF is that it is convenient to use constructive solid geometry (CSG) to treat the surfaces. Because SDF is defined in the whole 3D space, the boundary of an object can be regarded as an iso-surface composed of all zero points in the distance field. Let \(\mathrm{Dist}\left({\varvec{p}},{\varvec{O}}\right)\) be the distance field function of entity \({\varvec{O}}\), and its boundary surface \({\varvec{S}}\) can be expressed in the form of point set \({\varvec{S}}=\left\{{\varvec{p}}\left|\mathrm{Dist}\left({\varvec{p}},{\varvec{O}}\right)=\mathbf{O},{\varvec{p}}\boldsymbol{ }\in \boldsymbol{ }{R}^{3}\right.\right\}\). In such a mathematical definition and description, the gradient \(\nabla \mathrm{Dist}\left({\varvec{p}},{\varvec{O}}\right)\) of a point represents the direction to the boundary surface, and when this point belongs to the boundary, the gradient represents its normal. The Boolean operation between two entities can be easily calculated by the operator of finding the extreme value to obtain the compound distance field. For example, the distance field of tools belonging to the ball-end is expressed as a Boolean sum of a ball and a cylinder as \(\mathrm{max}\left(\mathrm{Dist}\left({\varvec{p}},\boldsymbol{ }\mathbf{S}\mathbf{p}\mathbf{h}\mathbf{e}\mathbf{r}\mathbf{e}\right),\mathrm{Dist}\left({\varvec{p}},\boldsymbol{ }\mathbf{C}\mathbf{y}\mathbf{l}\mathbf{i}\mathbf{n}\mathbf{d}\mathbf{e}\mathbf{r}\right)\right)\); Boolean operation is the essential geometric representation of material removal in tool cutting.

SDF is suitable enough for the description of 3D entities. For complex industrial parts, especially the intermediates in the process of machining simulation, it is difficult or even impossible to express their surface analytically. In this case, to effectually exploit SDF and its targeted characteristics, the sampling points in certain regular distribution are adopted to replace the unified distance field function. In each sampling point, the directed minimum distance from the point to the surface of the object is stored. For any other point, its distance value can be obtained by interpolation from its surrounding sampling points.

There are two sampling implementation means: uniform grid and non-uniform octree. Compared with a uniform grid, octree has higher sampling efficiency as it has the ability of adaptively partitioning space in lower storage. The vertex of each tree node (octant) stores the value of distance, and the solid surface contained in the cube node is obtained by trilinear interpolation of neighboring eight vertices. The types of nodes in octree are divided into real leaf nodes (inside the model), non-leaf nodes (model boundary), and empty leaf nodes (outside the model), and the non-leaf nodes will be further divided to a certain precision range, as shown in Fig. 2, in which the left one is the removal by voxel in cutting and the right one is the analytical tool path from CNC code.

Fig. 2
figure 2

Material removal by voxel in octree along the tool path

4.2 Parametric expression of tool scanning body (TSB)

The process of cutting geometric simulation is the visualization that material in the workpiece is continuously removed by the tool, as shown in Fig. 3, and the tool moves along the cutting path. There are two methods to represent the moving process. One is to replace the sweeping process by sampling on the tool path in a limited set, the disadvantage of which is that too many sampling instances on tool will lead to a large number of Boolean operations, while too few will lead to cutting errors.

Fig. 3
figure 3

The Boolean operation in cutting geometric simulation

The paper adopts the concept of a tool scanning body (TSB). The surface of a TSB is the envelope surface formed by the tool moving along the given cutting path. Therefore, the distance field function of TSB can be expressed as

$$\mathrm{Dist}\left({\varvec{p}},\mathbf{S}\mathbf{V}\left({\varvec{C}},{\varvec{T}}\right)\right)=\underset{\left\{q\left|\mathrm{Dist}\left(q,\mathrm{SV}\right)=0\right.\right\}}{\mathrm{min}}\Vert p-q\Vert$$
(1)

In Formula (1), \({\varvec{C}}\) is the tool body, \({\varvec{T}}\) is the tool path, \(\mathbf{S}\mathbf{V}\left({\varvec{C}},{\varvec{T}}\right)\) is the TSB entity, and \({\varvec{q}}\) is any point on TSB, and thus, the key to determine the distance field function of TSB is to obtain its envelope surface.

Analytical method of representing swept surface which is commonly used holds two disadvantages. One is that the swept surfaces are often obtained by interpolation with a limited number of boundary curves, which often occurs certain errors. On the other hand, complex calculation is needed for swept bodies, and different algorithms are also required for various tool paths, which inevitably brings great inconvenience to spatial calculation. To realize the unified TSB modeling method and combine the requirements of the Boolean operation in distance field, this paper adopts the reverse path algorithm proposed by Sullivan, that is, the tool is regarded as a static object, while the workpiece runs in the reverse direction along the NC path. As in Formula (2), the minimum distance between the tool body and curve \(\mathbf{C}\mathbf{u}\mathbf{r}\mathbf{v}\mathbf{e}\left({\varvec{p}},\widehat{{\varvec{T}}}\right)\) calculated is adopted to replace the minimum distance between point \({\varvec{p}}\) and the enveloping surface, where \(\mathbf{C}\mathbf{u}\mathbf{r}\mathbf{v}\mathbf{e}\left({\varvec{p}},\widehat{{\varvec{T}}}\right)\) is the curve generated by the point \({\varvec{p}}\) along the opposite path.

$$\mathrm{Dist}\left({\varvec{p}},\boldsymbol{ }\mathbf{S}\mathbf{V}\left({\varvec{C}},{\varvec{T}}\right)\right)=\mathrm{Dist}\left(\mathbf{C}\mathbf{u}\mathbf{r}\mathbf{v}\mathbf{e}\left({\varvec{p}},\widehat{{\varvec{T}}}\right),{\varvec{C}}\right)=\underset{a\in \mathbf{Curve}\left({\varvec{p}},\widehat{{\varvec{T}}}\right),\boldsymbol{ }\left\{b\left|\mathrm{Dist}\left(b,{\varvec{C}}\right)=0\right.\right\}}{\mathrm{min}}\Vert a-b\Vert$$
(2)

Compared with the calculation of swept envelopes, it is easier to calculate the minimum distance between the static tool and the curve by using analytical or numerical means. For 3-axis milling tool types, for example, \(\mathrm{Dist}\) of ball-end milling cutter in linear motion can be reduced to a minimum distance between two line-segments. As for 5-axis cases, the iterative numerical method can be used to normalize the reverse tool path to parameter function \(\widehat{{\varvec{T}}}\left(t\right)\), \(t\in \left[\mathrm{0,1}\right]\), and find the optimal target \({\varvec{t}}\) with the minimum distance from the tool.

4.3 Boolean operation between cutting tool and workpiece

Material removal in the cutting process is represented in geometry as Boolean subtraction between workpiece and TSB. Efficient 3D Boolean operation is the key to real-time performance in simulation. TSB is sampled at the node vertices on the octree and combined with the values of original workpiece sampling distances. For continuous relative motions, it is also a time-consuming process to recalculate and update the distance value of each vertex. The current states of octree nodes and the hierarchy of octree are employed to avoid the extra calculation so as to quicken the update. The recursive processes in Boolean subtraction based on octree are based on the following considerations.

Boolean subtraction will be merely performed on the specific internal and boundary of workpiece and tool, and the external octree nodes will be ignored to perform intersection test between the current octree nodes. If the octree nodes of the workpiece are completely outside TSB, they will be ignored; or else, if they are completely inside TSB, the node types will be changed to “external,” and all their children nodes will be deleted, representing that the material is removed.

For the nodes intersecting TSB, their types will change to (or remain) undetermined. The distance fields of TSB are sampled at the vertex of the octree node, and \(\mathrm{min}()\) operator is used to combine it with the value of the original workpiece to realize Boolean subtraction. This node will be subdivided, and Boolean difference operation is carried out on its sub nodes recursively until the predefined maximum octree depth is met. That is to say, certain cutting geometric accuracy has been achieved.

4.4 Geometric rendering and presentation of cutting process

To view and verify the cutting results, the simulation process should be presented dynamically. Rendering can be categorized into raster and real-time ray casting/tracing in computer graphics. Raster rendering has been widely used in various fields, and many GPUs support its acceleration. However, in volume rendering, a triangular patch model needs to be generated as an intermediate carrier. When the number and quantity of triangular patches are very large, they maybe frequently exceed the processing range of GPU, so it is a need to simplify and optimize the triangular patches and additional operations. When octree is adopted as a data structure to store entity information, the size of the smallest nodes is often very small. Thus, the marching cube algorithm used to generate the STL model from octree will be very huge. The simplification and optimization of triangular patches will affect the accuracy of the final display and simulation results. Therefore, this paper used real-time ray casting to render the discrete distance field on octree. Ray-casting method selects a point of view and a range of view and judges the intersection and reflection between the ray and the entity from the point of view to get all the pixel information on the fixed view screen. The generation process of instantaneous simulation image is shown in Fig. 4. The multi-threaded rendering process is divided into several steps, including ray generation, ray and solid intersection calculation, light color determination, and instantaneous image generation. For the detailed implementation, wxWidgets and SDL are employed, in which wxWidgets is responsible for the UI interface, while SDL provides the processing interface of calculation and display. A case is shown in Fig. 5.

Fig. 4
figure 4

Workflow of geometric simulation rendering

Fig. 5
figure 5

A case of geometric simulation

5 Key technologies in physical simulation

5.1 CWE calculation

CWE is the connecting linkage to bridge the gap between 3D geometric modeling and physical simulation, defining instantaneous space conditions of the intersection of tools and workpiece. It determines information of cutting angles on tool edge at different heights; meanwhile, it is also the important input data to predict the cutting force, vibration, and other physical states. Cutting physical simulation depends heavily on an accurate and effective CWE calculation in 3D space. Physical simulation first calculates the feasible contacting arcs (FCA) of the tool in the process of movement as a superset including CWE, according to envelope theory, then carries out an approaching method based on subsection evaluation to realize fast calculation of the intersecting points on contacting arcs and workpiece surface, finally assembles the calculated engagement arcs to obtain the final CWE diagram, and adopts the micro element model as the microscopic solution for physical simulation.

In this paper, micro element model has been widely used to achieve various geometric data used in instantaneous physical quantity calculation. The cutting edge is discretized into a series of micro elements with the same thickness \(dz\) along the tool axis. In each micro element, the cut-in and cut-out angles are constant; thus, CWE-oriented micro element model can be simplified to accurately calculate the cut-in and cut-out angles only on the discrete section circle (axial depth), instead of generating the boundary of the complete CWE. According to the envelope theory, at any time in the process of tool sweeping and cutting, only a part of the tool surface may contact with the workpieces. This part of tool surface is the feasible contacting surface, and the segmented boundaries of the feasible contacting surface and other surfaces are the envelope points. At the same time, the tool section arcs in the feasible contacting surface can be simplified to be viewed as the feasible contacting arcs. For example, in the milling process, the relationship among cutter section lines, envelope points, feasible contacting surface, and FCA is illustrated in Fig. 6.

Fig. 6
figure 6

The swept volume and FCAs

CWE essentially is a feasible subset of contacting surface, and the generation of FCAs can effectively accelerate the calculation process of CWE. FCAs are directly calculated from cutter location (CL) information, and the whole calculation will be carried out in the tool coordinate system, which moves with the tool. As the surface is implicitly expressed in SDF based on octree, it is difficult to obtain the intersection of these FCAs and solid surface directly in the distance field. A new subsection evaluation algorithm is proposed to convert the calculation of surface intersection into the analysis of whether the points have been analyzed in the body, to efficiently calculate the intersection of FCAs and surface and obtain the engagement arcs, that is, the part contacting FCA and the workpiece. Owing to the complexity of CWE itself, each FCA may have one or more engagement arcs.

The engagement arcs of FCAs and the workpiece at all heights for a given tool position have been obtained, taking cut-in angles as x-axis and cutting depths as y-axis, as shown in Fig. 7. The accuracy of CWE is determined by the number of FCAs, and meanwhile, reducing the interval between adjacent FCAs in altitude direction will improve the accuracy of CWE. The commonly used micro element instantaneous model converts the continuous cutting edge into discrete states. If the interval of FCAs is consistent with that of micro instantaneous model, the consistency of their calculation accuracy and improved efficiency then can be guaranteed.

Fig. 7
figure 7

Stretch-out view of CWE

After obtaining CWE, micro element model will predict the instantaneous cutting amount on the screw blade. The tool edge is first discretized axially with a spacing of \(dz\), and the cutting unit on each axial segment on the edge is regarded as a micro element. Only the cutting elements in the CWE region will produce elements such as cutting force, and the cutting physical factors can be obtained by integrating micro elements. For example, in the milling process, the relationship between cutting micro element, CWE, and chip shape is shown in Fig. 8.

Fig. 8
figure 8

CWE and chip shape during cutting

For the calculation of cutting forces, micro element model exhibits a good fit with the machining measurement data, which also provides a good opportunity for the research in this field. On the basis of micro elements, more physical factors in the cutting process are modeled and simulated to realize the effective twin monitoring and analysis.

5.2 Physical quantity calculation based on CWE

The ultimate pursuit of physical simulation is accurate and real time for the calculation of various physical quantities, in which cutting force is the most important and mature one. CWE is computed, and geometrical parameters including chip volume, axial depth of cut, radial depth of cut, and cutter entry angle and exit angle are also achieved and stored for calculating the physical states according to the cutting mechanism. Therefore, mature physical rules in tool cutting are the foundation of this issue. In this subsection, cutting force is selected as an example.

The instantaneous force model is employed to predict cutting force by computing micro element force on incremental sections of the helical cutting edge [29]. The tool edge is segmented into a number of small axial elements with a height \(dz\), as illustrated in Fig. 6 and the flute on each axial element can be termed as a segment cutting edge (SCE). The differential rotating force on each SCE is derived using the linear edge force model, as the following equations:

$$\left\{\begin{array}{c}{dF}_{t,j}\left(\phi ,z\right)=\left({K}_{tc}{h}_{j}\left(\phi ,z\right)+{K}_{te}\right)ds\\ {dF}_{r,j}\left(\phi ,z\right)=\left({K}_{rc}{h}_{j}\left(\phi ,z\right)+{K}_{re}\right)ds\\ {dF}_{a,j}\left(\phi ,z\right)=\left({K}_{ac}{h}_{j}\left(\phi ,z\right)+{K}_{ae}\right)ds\end{array}\right.$$
(3)

In Formula (3), \({h}_{j}\left(\phi ,z\right)={f}_{z}\mathrm{sin}{\phi }_{j}\left(z\right)\mathrm{sin }\kappa \left(z\right)\) is the uncut chip thickness on the flute \(j\) at an axial height \(z\), the radial immersion angle and the axial immersion angle are \({\phi }_{j}\left(z\right)\) and \(\kappa \left(z\right)\) respectively, \({f}_{z}\) is the feed per tooth, and \(ds=dz/\mathrm{sin}\kappa\) is the contact length of this CWE. The tangential, radial, and axial shear force coefficients \({K}_{tc},{K}_{rc},{K}_{ac}\) and edge cutting force coefficients \({K}_{te},{K}_{re},{K}_{ae}\) are both determined by the material properties of the cutter and the workpiece. They can be identified mechanistically from preliminary milling tests conducted at a range of feed rates, and these coefficients will be stored in a database.

By this means, the instantaneous force is obtained. If the values are continuously calculated and recorded at regular time intervals, the force curve is thus generated. The other physical quantities can be also monitored with their own rules that are relevant to CWE.

5.3 Optimization of cutting parameters

According to the simulation results, the performance of machining is analyzed and evaluated, and various parameters affecting machining performance and their optimization strategies are investigated. The multi-objective optimization algorithm is combined with CWE calculation and the representations of cutting mechanism to reversely adjust the setting of processing parameters in NC code, and to achieve the closed-loop feedback and to provide useful guidance for practical machining, which will help to preliminarily realize online and offline modeling and processing scene analysis.

Continuous real-time monitoring and visualization of various physical quantities in machining simulation and calculation are carried out to analyze the trends and laws of how their values change. Meanwhile, monitoring and highlighting the results beyond the thresholds become an important object in the optimization. At the same time, it is also necessary to study and set the ideal calculation values and reversely optimize the input parameter settings. This paper mainly optimized the parameters such as spindle speed, feed speed, cutting depth, and cutting width in NC code and employed related knowledge of cutting rule constraints, theoretical-empirical formulas, machine tool lobes, reference tables, etc., which are built in the simulation platform, to reversely achieve the reasonable optimized parameter values, forming a closed-loop optimization.

Multi-disciplinary optimization platform DAKOTA is employed and externally connected as the solver, combining with predetermined optimization objectives. The schemes carried out a closed-loop analysis and iterative calculation for the quantifiable performances in NC code and cutting process, to realize the beforehand online verification and support the smooth progress of the real production. A research has been carried out on the smoothness optimization of force according to the feed amount in the NC code, as shown in Fig. 9, in which instantaneous force and the feed rate are recorded left, and the contrast of original and optimized G-code are presented in the right with the due pursuit of a stable force workload. The optimizing scheme will not be descripted here in detail due to space limitations.

Fig. 9
figure 9

Optimization of feed rate for smoothness of cutting force

6 Case study

Geometric modeling and physical simulation for the cutting process are effectual methods for the virtual machining verification. In the above sections, detailed technologies have been deeply investigated. Based on the above research, we have developed a tool cutting geometric-physical simulation system. The workflow of the system is illustrated in Fig. 10.

Fig. 10
figure 10

The workflow of the system

In this case, the staircase workpiece previously machined by a flat-end tool is illustrated in Fig. 11a. The size of its cubic blank is set as 60 mm × 40 mm × 30 mm. During the semi-finishing process, a ball-end tool with 6 mm diameter and 20 mm height was adopted, and the tool path contains upward and downward motions. The intermediate simulation results of the semi-finishing generated by the simulator are also given in Fig. 11a. The diagram and top views of the extracted CWEs at CL:35 and CL:180 are shown in Fig. 11d, e, in which the top view is the projection of the CWE on the XY plane of the tool coordinate system, and it is easy to observe the distribution of the CWE on the hemisphere surface of the tool from the top view. Meanwhile, the CWE surfaces derived from the solid modeler are illustrated in Fig. 11b for intuitive understanding.

Fig. 11
figure 11

The staircase workpiece previously machined by a flat-end cutter

From the CWE diagrams, it can be observed that at CL:35 which is on the upward motion, only the front surface of the tool will engage with the workpiece; in other words, the immersion angle is within [0, π], while at CL:180 which is on the downward motion, the back surface of the tool ball tip can also in contact with the workpiece, which means that the engagement angle range is [0, 2π]. Actually, they are in accordance with the feasible contacting surfaces for different motion types, as illustrated in Fig. 11c. From Fig. 11d, e, the boundaries of the CWE diagrams between the proposed method and the B-rep-based approach agree very well.

According to the computed CWE, the cutting physical quantities are calculated per time interval to form a curve or surface. For example, several typical geometric and physical parameters are calculated, monitored, and recorded in Fig. 12.

Fig. 12
figure 12

Cutting force monitoring and recording

The most successful optimization scheme in current implementation is cutting forces according to certain predefined conditions, such as machining time and maximum force limitation. To protect the tools or achieve a high accuracy, it is a frequent request. A preliminary optimized result of this case reduces nearly 17% time compared with before, and meanwhile, the cutting force remains more stable. Other physical quantities such as cutting heat and deformation have been taken into analysis and are still under investigation.

7 Conclusion and further work

In this paper, a framework of geometric modeling and physical simulation for cutting process is proposed, and several key technologies have been investigated in detail. A simulation and optimization system have been developed based on the solutions, which seamlessly integrated cutting mechanism, 3D modeling and efficient Boolean operation, physical calculation, and optimization technology. The experiments verified the feasibility of the scheme, and expected results are achieved on some physical quantity calculation, monitoring, and analysis, bringing an encouraging prospect of its applications and further research. The cutting processes have been well simulated, in which the changes in geometric quantities and the effects of physical quantities are visually demonstrated. In addition, according to multi-disciplinary optimization criteria, cutting parameters are also set more reasonably.

The further work will mainly emphasize on two aspects: one is to bring more cutting mechanism and physical methods into the framework and another is to further improve the accuracy and speed of calculation and simulation. The ultimate vision of this research is to achieve practical usage in more machining scenes with various materials and cutting tools, thus to enhance the product quality and improve the manufacturing efficiency.