The digital twin of the machine tool: a solution that improves the efficiency of CNC machining

The digital twin of the machine tool: a solution that improves the efficiency of CNC machining

Category: Metalworking

A digital twin of the CNC machining process can improve process optimization at both the planning and machining stages. The quality of the machined product depends on the precision of the machining process and the surface finish at the end of the machining stage.

What affects the quality of the workpiece?

The quality of the product after machining is the result of defined process planning parameters and variables that occur during machining. In the process planning stage, the process planner defines cutting parameters such as feed rate, cutting depth and width, spindle speed, which affect the quality of the part surface.

Factors such as tool wear and cutting force during the machining process also affect quality. In addition, errors related to machine kinematics, machine vibration and factors such as acceleration or jerk also affect machining accuracy and surface quality.

Predictive models for machining accuracy and surface quality can be built based on data from process planning and machining. One example is Vericut software, which relies on its simulation engine. Once quality is predicted, it can be used as input to optimize machining parameters to achieve the required quality. Data-driven models predict and optimize machining quality, providing feedback to maintain the required quality at the process planning and machining stages by adjusting machining parameters.

In this case, the creation of such a digital twin requires significant resources. The actual machine has to be shut down, followed by a series of tests.

Simulation of the machining process using a digital twin

A complete simulation of the machining process using digital twins, based on real or predictive data, can not only optimise the entire process and provide information that allows users, for example, to reduce machining cycle times, but also to detect errors before they occur.

Purchasing advanced machining centres is a significant investment for companies that need to earn their keep. Achieving full machine efficiency can take a lot of time and experience, especially with machines such as mill-turn and multi-tasking machining centres. An accurate digital twin of the machining environment enables better utilisation of advanced machining platforms while reducing costly errors and downtime.

In the world of machining, a digital twin is a digital representation of the entire machining environment, including the workpiece, semi-finished product, fixtures, clamps, cutting tools, machine tool, controls, auxiliary equipment, continuous and discrete processes. As far as CAM software is concerned, many of them use some aspects of the digital twin.

However, most of them do not cover everything. Therefore, they cannot explain how each element interacts with others during part machining. In today’s reality, machine tools are becoming increasingly complex machines capable of performing multiple operations.

What might the CNC machining process using a digital twin look like in practice?

Let’s start by understanding how we should perceive the digital twin of a CNC machine. First of all, we need to understand that a complete digital twin of a machine is based on a digital model of the machine, upon which the real machine is created. Having such data allows us to make a full system configuration (programming, testing, simulation) for both the CNC, PLC, HMI parts, and the mechanical aspect in a virtual environment.

As CNC machine manufacturers have not previously relied on such models, we can now simulate machining processes based on CAM software that includes aspects of the digital twin, but is not a complete representation as provided by a digital twin. For companies that already operate purchased machines, this is undoubtedly a useful solution that can simulate the machining process by reproducing the machine up to a maximum of 80%, but without an identical representation of the machining sequence.

The machining process considers many aspects described below. CAM systems will not precisely simulate where the tool will be — they lack the required data and an appropriate engine to accurately reproduce it.

So let’s start with the solution the CAM environment gives us.

In practice, CNC machining processes are planned using CAM software during the process planning phase and then executed during the production phase with the generated NC code. The quality assessment in the simulator takes into account the CAD product geometry, the generated toolpath, and the machine kinematics information. However, the effect of factors such as feed rate, spindle speed and the influence of parameters such as machine vibration, PLC programming, continuous and discrete process simulation, feedback control, CNC control and other background processes are not considered in this simulation to evaluate the expected machining quality.

During the execution phase, the operator first sets up the machining job and updates the status of the cutting tools on the CNC machine. If necessary, the operator can update cutting parameters in the NC code, such as feed rate and spindle speed, to achieve a better machining quality after the initial setup of the machine. However, quality visualisation and feedback on the expected machining quality is not available to the operator. During the machining process on the CNC machine, information on the effect of other factors on the machining, such as tool wear or machine vibration, is also not available to the operator.

Modern CNC machines are cyber-physical machining systems equipped with communication protocols such as OPC UA and MTConnect, which provide real-time access to information from CNC machines during machining operations. Real-time machining information collected through standard communication protocols, along with data from external machine sensors, can be used to model machine behaviour. Digital twin models ultimately rely on the data needed to predict machining quality, taking into account factors that influence machining quality based on data from internal and external CNC machine sensors.

Predictive models are data-driven and built on machine learning foundations. When machining data is available for CAM simulation, it optimises parameters that can be controlled to maintain the required quality and provides feedback to control the machining process during both the process planning and execution phases.

Initially, quality optimization and prediction is performed during the process planning stage by combining CAM software and CNC machines with an ‘incomplete’ digital twin, which is a digital version of the machine with prediction and optimization modules.

During the process design phase, CAM software can be connected to the digital twin via an API interface, allowing bi-directional data communication between the CAM software and the digital twin. During machining, the machine is also connected to the digital twin using one of the communication protocols, collecting and transmitting data.

Heidenhain, for example, has a product called virtualTNC, which is a stand-alone programming station based on a real CNC but operated on a PC. This software is essentially identical to the software that powers the TNC control on a multi-axis machine.

The programmer can use the PC-based system to create and test programs for machining parts using the machine’s kinematics, just as he would on the machine’s CNC.

This simulation model is customised by reading performance data from the control on the actual machine.

What does it look like when you have an environment that is based on a digital model from the outset?

One of the latest tools on the market to virtually simulate a machine is the Run MyVirtual Machine programme from Siemens.

It replicates a real machine up to 99%. Five years ago, in conjunction with the development of the SINUMERIK ONE control system, the company carried out pilot implementations with selected machine manufacturers, demonstrating time savings of up to 30% in the implementation of a new machine and a 50% reduction in commissioning time

Today, this machine control is used by more than 350 machine tool manufacturers, many of whom are producing machines with this control on a large scale. Rapid implementation is one of the pillars of modern machining development with the Create platform and Run MyVirtual Machine.

The latest digital twin technology, Run MyVirtual Machine 3D, takes the capabilities of the virtual environment to a higher level. Not only can we see the critical decisions that the CNC brain will make on our computer, but we can also visualise the entire machine space. The 3D option allows the user to import fixtures and clamping devices to fully emulate the configuration that the program will execute in the machining process.

The digital twin of the machine running in this programme faithfully reproduces the working environment on the actual machine. It makes it possible to simulate activities such as workpiece measurement, risk assessment of potential collisions, taking into account the geometry of the body, housing, heads, tools, fixtures, clamps and workpieces, as well as zero offset. It is fully compatible with the real control system, allowing precise determination of the course and times of execution.

For all this to make sense, the digital twin of the CNC machine should first be designed and created in a digital model based on the CAD model of the machine and tested in a virtual environment, rather than being created based on an existing machine. Such an approach allows full configuration of the system (programming, testing, simulation) for both CNC, PLC, HMI and mechanical parts in the virtual environment. These capabilities are made available to manufacturers through the Create MyVirtual Machine tool.


The digital twin in CNC machining is undoubtedly an asset in monitoring and improving part production.

Information from the digital twin enables operators and machining department managers to make informed decisions, often in real time, that would otherwise be out of their reach.

Simulation on digital twins involves not only observing the cut part, but also monitoring and verifying every element of the machine and its movements throughout the entire operation.

When it comes to achieving maximum machine efficiency, a complete digital twin should also provide the user with the ability to quickly identify when there is an opportunity to optimize the program. Considering the volume of parts produced, even a few seconds saved on each part can lead to a significant increase in production volume.

Digital simulations in CAM software can provide the necessary picture to understand the machining environment, ensuring accurate and efficient NC code, allowing faster machining of parts.

However, we must be aware that the difference between CAM simulation with aspects of a digital twin and simulation of a full digital twin of the machine is in the accuracy of the reproduction of the machine and the processes performed on it. A full digital twin can simulate the machine, the machining technology – simulate the machining of the workpiece, detect collisions and take into account physical phenomena in the process, such as the effects of temperature or pressure.

The CAM environment itself cannot do this because it has its own graphics engine, which is based on “assumed” control and does not faithfully reproduce it when simulating G-code, toolpaths generated by NX, for example. It does not take into account data related to PLCs, drives and the NC kernel itself.

However, how closely the digital twin needs to resemble its physical counterpart should be regulated depending on the intended use.

A relatively simple digital twin of the machine may be sufficient to simulate the workflow on the production line. A highly detailed and comprehensive digital twin of the machine may be required for animated simulations of the programmed toolpath to detect potential collisions. In the case of augmented reality applications, a digital twin of the machine may be suitable for operator training or maintenance, with varying requirements for level of detail and realistic visualisation formatting.