Virtual Horizontal Machining Center LOLA HBG 80 for Program Verification and Monitoring

This paper describes configuring the virtual horizontal machining center LOLA HBG80 within the programming and verification system and the open architecture control system. The horizontal machining center LOLA HBG 80 is represented by an equivalent virtual machine in a CAD/CAM environment (PTC Creo and Catia), STEP-NC Machine environment, and the control system. Virtual simulation is essential for machining, and the developed virtual machines are used for program verification and monitoring of the machining process. The virtual machine in the programming system allows the verification of the program before sending it to the real machine and includes verification of the tool path (CLF-Cutter Location File) and G-code. The paper also discusses the possibility of applying a new programming method known as STEP-NC and preparing an adequate environment that includes a virtual machine. The virtual machine in the control system represents the last level for the final program verification and the process monitoring system.


INTRODUCTION
Sudden changes in production programs, product short life cycle, as well as further progress in the development of integrated computing environments for the development of new products, provide opportunities to achieve the paradigm of virtual production. Namely, integrated product development and manufacturing technologies imply the application of virtual production technologies, which are a set of activities in product design and manufacturing technologies that are realized in a computer environment, with the aim of modeling, simulating, and optimizing the product and process. In this way, the virtual product and its creation are verified in the virtual, before moving to the real world, where the product is expected to be successful from the first attempt [1].
Existing CAD/CAM system environments used to program CNC machine tools typically allow the following types of simulations: CLF-based tool path simulation (Cutter Location File), G-code tool path simulation, material removal simulation, and operation simulation virtual machine tool that works according to a given program.
The key type of simulation considered in this paper is the simulation of the virtual machine tool that works according to a given program. The paper presents their configuration, as well as the procedures used to verify the tool path and machining programs on the example of the machine LOLA HBG 80, which was the subject of retrofitting.
The term virtual machine tool can be defined in the following ways. A virtual machine tool is a software implementation of a machine tool, in the form of simulation kinematic models that can execute programs in a selected graphical environment, in the same way that real machines do. A virtual machine is a simulation model of a machine tool that can be interpreted, analyzed, perfected, and tested like a real machine. The virtual machine tool can be implemented within the CAD/CAM system, CNC simulator, and control system of the machine tool itself. In addition to the mentioned environments, a new programming method is now available that appears as an alternative to G-code and is known as STEP-NC (Standard for Product Model Data Exchange for Numerical Control) [2].
In this article, we present virtual horizontal machining center LOLA HBG 80 in different environments. The virtual machine in the programming system is described in chapter 3, while chapter 4 describes virtual machine integrated with open architecture LinuxCNC control system. The application of the configured virtual machines is important for program verification and machining process monitoring.

LOLA HBG80 -HORIZONTAL MACHINING CENTER
LOLA HBG 80 OC is a horizontal machining center that appeared in 1980 as the first domestic-made machining center in the former Yugoslavia with a vertical chain tool magazine and Bosch control, Fig. 1a. According to its functional characteristics, it was in the rank of machining centers of the world's leading manufacturers. It was created as a result of the concept of modular design which was practically applied in the Ivo LOLA Ribar factory. To further develop modern CNC machine tools, this machining center was installed at the Faculty of Mechanical Engineering in Belgrade, Department of Production Engineering, where it is still located today [3,4].
Although the machine has served its working life, during 2019, it was retrofitted with the replacement of control and measuring systems. Now the machine is operational again for new research and education at the Faculty of Mechanical Engineering. The machine now houses a modern open architecture control with a LinuxCNC system, Fig. 1b. This machine (LOLA HBG80 OC) was 2 1/2 axis machining system before retrofitting and now it is a 3-axis machining system (LOLA HBG80 V3). This paper discusses its digital twins in the form of virtual machines in both the programming system and the control system to verify the program and monitor the machining process. The usual programming methods based on G-code (ISO 6983) are considered, as well as a new programming method based on the STEP-NC protocol, according to the ISO 10303-238 standard, Fig. 2.
CAD/CAM systems PTC Creo [5] and Dassault Catia [6] are used as resources for configuring virtual machines in the programming system. The Vericut [7] is used as an additional system for program verification. STEP-NC Machine is used for the new programming method, and LinuxCNC is used as a control system in which the virtual machine is integrated.

VIRTUAL MACHINE IN PROGRAMMING SYSTEM
The available CAD/CAM environment can be used as the programming system of the LOLA HBG80 V3 horizontal machining center. As obvious from Fig. 2a, the part programming is very conventional with the use of a postprocessor to convert the CL file into G-code. This means that the programmer starts, in a common way, from the workpiece CAD model in CAD/CAM system PTC Creo or Catia, generating CL file. The generated tool path is tested through the NC check (animated display of tool path and material removal). Using the configured postprocessor for the horizontal machining center with structure (X'OZY), postprocessing of CL file is done to obtain the program in G-code, which is transferred to the LinuxCNC control system.
Postprocessing is performed for a 3-axis horizontal machining center, with the kinematic structure of X'OZY, which is considered in this paper. The program format, which uses control for the machine, is based on the G-code according to the ISO6983 standard, which is, in this case, very similar in format to the programs for Fanuc CNC systems. A virtual machine within the programming system (Creo and Catia), a virtual machine in the VeriCUT environment, and a virtual machine within the new programming method based on the STEP-NC standard within the STEP-NC Machine software, Fig. 2b, were prepared for this machine.

Virtual machine in programming system Creo
PTC Creo software system supports all stages of the modeling and simulation that were needed for the development of our virtual machine model. The stages are [8]: (i) modeling the mechanism with defined kinematic connections, (ii) definition of ranges in kinematic connections, (iii) manual interactive inspection of defined virtual kinematic connections, (iv) creating a video file of tool path simulation on a virtual machine.
A tool path simulation is possible by running the program and using a modeled virtual machine tool with all kinematic connections between the moving components, which allows their motion within the virtual machine model as a system of rigid bodies. A detailed virtual machine tool LOLA HBG 80 V3 with a defined kinematic chain between moving components is shown in Fig. 3 [9].
Horizontal machining center LOLA HBG80 V3 is 3axis CNC machine tool. The machine has slider connections for all translational movements (X', Y, Z), Fig. 3. Such assembly enables the movement of the model in the range defined for each slider connection. This simulation of the tool path allows motion of movable components of virtual machine tool, according to the running program. After defining the three slider connections, it is necessary to define coordinate systems on the working table and workpiece, marked as MACH_ZERO, and on the forehead surface of the main spindle, marked as TOOL_POINT, while on the defined tool this coordinate system already exists, Fig. 4. Matching already defined coordinate systems MACH_ZERO enables the setting up of the virtual workpiece on the configured virtual machine during the tool path simulation. The coordinate system defined on the head of the main spindle and marked as a TOOL_POINT is matched with the appropriate coordinate system on the tool and enables the setting up of the tool at the main spindle on the virtual machine during the tool path simulation.
To connect the virtual machine to the virtual workpiece for the needs of work simulation, it is necessary to load the assembly of the previously prepared virtual machine by selecting the option Assembly and by loading the model of the machine with define kinematic links. In addition, it is necessary to connect the coordinate system for programming on the machine and the workpiece, Fig. 5. In this way, it will be possible to place a virtual workpiece on a virtual machine during the simulation.

Virtual machine in programming system Catia
Another environment selected for programming and configuring the virtual machine tool was selected CATIA. The module used to configure the virtual machine tool is the Machine tool Bilder. The configuration of the considered horizontal machining center LOLA HBG 80 V3, with three translational axes, in the CATIA environment can be done in two ways [10]: • The first way to define a machine is to pre-assemble it in the Assembly module so that the first component is defined by a type connection (Fix), and the other components should be assembled using the offered type connections (Offset, Coincidence, Contact, Angle, ...). The moving parts of the machine should be allowed a degree of freedom of movement, in this case, translation, in the direction they need. After that, go to the DMU kinematic module and select the Assembly constraints conversion option, which automatically recognizes the required kinematic connections. Translational kinematic connections are defined by the Prismatic joint command. • Another way to define the required machine kinematics is to import one component at a time in the Machine tool builder module and assign them mobility degrees, using the Prismatic joint option for translational axes, which means: (i) defining the translation axis, (ii) merging longer or flat translation, (iii) enabling the axis degree of mobility by activating the Length driven option, (iv) defining the reference position and stroke of the translation axis [1]. Fig.6. shows a configured virtual horizontal machining center with corresponding moving axes and coordinate systems. Within the CATIA software environment, i.e., the Machine tool Bilder module, it is not emphasized in principle how and which names should be assigned to coordinate systems on the machine. Since this type of freedom is allowed to the user of the software, in this paper the names are retained as in the software environment Creo Parametric for better visibility and easier tracking. The characteristic of the Catia software environment is that the coordinate systems defined on the main spindle and the random table of the machine is oppositely oriented, which is not the case in the Creo Parametric software environment, which should be taken into account. Activating the Create Mount Point option opens a window in which you need to select the type of coordinate system and give it a name. It is possible to first assign a coordinate system Tool mount point, which is placed on the main spindle and represents the coordinate system of the tool. This coordinate system allows the virtual tool and its position on the virtual machine to be assembled. Another coordinate system that can be selected is the Workpiece mount point, which allows you to define the zero-point relative to which the desired contour is programmed during the machining process. This coordinate system is used to connect a virtual workpiece and a virtual machine. In this way, a virtual horizontal milling machine with three translation axes was configured. After defining the virtual machine tool, the part processing programming can be started.
Programming is done within the Machining module, i.e., Advance manufacturing software package Catia. The procedure used to program the part shown in Fig. 7. is Roughing.

Figure 7. Virtual machine simulation in CATIA environment
Within this procedure, it is necessary to select the appropriate areas to which the processing process will be performed, as well as to define the appropriate regimes of the processing process itself. Once all the necessary regimes have been defined, a check is approached which can be presented in two ways. First, the simulation of the tool path with material removal is checked by activating the Replay Tool Path option of the procedure itself. If the simulation has passed the desired visual check, the virtual machine simulation can be accessed by activating the Start Machine Simulation option. These checks are important because in this way all errors that occur during the programming process of CNC machine tools can be overlooked and avoided. Unlike the Creo Parametric software package, in the Catia software package, it is also possible to simulate the operation of a virtual machine according to a given program by activating the Simulate Machine function using G-code. It is first necessary to select the postprocessor and generate the G-code. The Fanuc11m postprocessor was selected.

Virtual machine for NC check in Vericut
Simulation of virtual machine tool operation in Vericut environment according to the given program, enables simulation of machine operation based on G-code, with the simulation of material removal and with the possibility to obtain virtual processing in STL format [1,7,10,11]. To configure the virtual machine of the considered horizontal machining center LOLA HBG80 in the Vericut environment, it is necessary to define the type and order of connecting the machine axes according to the structural formula (X'OZY). The basic structure of the machine tool in Vericut consists of a BASE, TOOL, and STOCK. The configuration of the virtual machine starts from the base (O), as a fixed component. The transverse X' axis is connected to the base, as part of the kinematics achieved by the workpiece. On this axis, there are also suitable accessories in the form of angles, for set-up workpieces. The fixed base (O), on the other hand, is connected to the remaining two axes Y and Z, with these movements being realized by the tool. The horizontal translational axis Z (Z Linear) was first added to the base in order, and then the vertical translational axis Y (Y Linear) was added to it. On the spindle that moves along the Y-axis, there is the main spindle (Spindle) and a tool (Tool), which completes the kinematic structure of the machine. The hierarchical tree structure of the X'OZY machine is shown in Fig. 8. The machine was saved under the name LOLA_HBG_80 after configuration and added to the Vericut virtual machine database. After defining the kinematic structure of the machine, it is possible to add models of machine components in STL format. For that, a CAD model of a virtual machine from the PTC Creo programming system was used, from where the component models in STL format were saved and loaded into the Vericut environment. In that way, a virtual machine for verification of the machining program was realized, this also includes a simulation of material removal based on the G-code.
For the realization of the machining simulation project, it is necessary to define [1,10,11]: (i) prepa-ration (Stock), (ii) workpiece, coordinate system (Program zero point), (iii) zero-point (position adjustment on the virtual machine code Offsets), (iv) tools used in the processing and (v) NC programs and possibly subroutines.
An example of verification of the program for the considered example of processing the test part according to ISO 10791-7 is shown in Fig. 9. The simulation of material removal based on the loaded Gcode in two windows is shown, the first with the workpiece only and the second with the virtual machine. the obtained G-code was verified for the considered machine LOLA HBG 80 V3.

Virtual machine in STEP-NC Machine
In the field of machine tool programming, an open challenge is the new programming method based on STEP-NC standards, for different machining systems [2,12,13]. The STEP-NC provides new opportunities to support high-level information from design to CNC controller. It allows bi-directional data flow between CAD /CAM and CNC without any information loss, Fig.2b.
To contribute to efficient applications of a new method of programming based on STEP-NC protocol (ISO10303-238), the focus of our current research is related to applying STEP-NC, and for programming this new retrofitted machine with open architecture control system LinuxCNC. STEP-NC Machine can display and simulate the machining or measuring process, including the simulation of a virtual machine tool.
Also, the STEP-NC Machine environment allows configuring its own virtual CNC machine tools, so in that sense, the virtual horizontal machining center LOLA HBG 80 V3 is configured and integrated into STEP-NC Machine. In this way, it is possible to per-form a simulation based on the generated STEP-NC programs to verify them. A detailed procedure for configuring new machine tools in STEP-NC machine is given in [1], and some results also can be seen in [13,14].
For the LOLA HBG80 V3, which is only able to read G-code files, the STEP-NC with a CNC controller is used. Here it is necessary to use the option of export code in STEP-NC Machine or using developed converters STEP-NC to G-code. This level is indirect STEP-NC programming.
At the moment, for most users, this new method of programming based on STEP-NC cannot be completely used with all the benefits provided by STEP-NC, because the resources for its development are not available to everyone [15]. In papers [14,15] proposed two possible scenarios for indirect programming method based on STEP-NC on existing CNC machine tools and robots for machining.
The software STEP-NC Machine was used to generate the STEP-NC program in P21 format where the simulation was performed on the configured virtual machine LOLA HBG 80 V3, Fig. 10. After that, the translation of the STEP-NC program into G-code was performed. The G-code obtained by applying the export code option is verified once again, on a virtual machine integrated with the control system.

Web interface for the virtual machine tools based on STEP-NC
A configured virtual machine in a STEP-NC Machine environment can through a Web interface and local server enable accessibility on a cloud platform for simulation and monitoring [13]. The web interface on the local server [16] can use the STEP Tools Machine commercial software [2] which can display the 3D models for the machining workpiece, tools, measuring probes, as well as material removal simulation, measuring path simulation, etc. Procedures for build and run services can be viewed at [16]. For build and run, the server needs to install Node and NC.js packages. When the server is running, start the web browser to address http://localhost:8080/, and appears machining setup shown in Fig. 11. After virtual machining, it is possible to download the virtual machined part as an STL file, for further qualitative analysis.

VIRTUAL MACHINE IN CONTROL SYSTEM
The retrofitting of the control system for the presented LOLA HBG 80 V3 horizontal machining center is based on an available open architecture control software LinuxCNC [17].
As a real-time control system with an open architecture, it is used to control various types of CNC machine tools and robots. Years of research and development on the LinuxCNC program have produced a solid, time-proven machine control platform. LinuxCNC software system contains the following four base modules [8,17,18]: (i) motion controller EMCMOT; (ii) discrete input/output signals controller EMCIO; (iii) process controller EMCTASK; and (iv) GUI (Graphical User Interface).
The integration of a virtual machine into open architecture control LinuxCNC system allows machining simulation in the OpenGL 3D environment. Configuration of the interactive virtual machine as a digital twin is done via the Python programming language, as well as allows primitive graphics modeling and integration of the developed models directly into the LinuxCNC control system. Such a virtual machine enables G-code program verification and monitoring of the machining process [18]. The basic concept of configuring and integrating a virtual machine in the control system is shown in Fig. 12.
An already existing virtual model from the CAD/CAM system was used to configure the virtual machine in a Python programming environment. The complete machine model is decomposed into functional parts, which are exported as separate files containing ASCII STL data. During the programming of the virtual machine in the Python programming language, the models of basic components are imported, oriented, and placed in the virtual environment, according to machine structure and adopted reference coordinate system.
The virtual machine appears in a separate window and allows the drawing of toolpaths within the limitations of the virtual machine elements movements. During the execution of the machining program written in G-code, the virtual machine elements are moving in real-time, fully synchronized with the moving parts of the real machine, resulting in a fully functional virtual machine, Fig. 13. The virtual machine integrated with the control system as a basic part of the digital twin receives the control signals through the HAL interface from the realtime LinuxCNC control modules. Such a virtual machine allows the observation of the machine from different perspectives with the possibility of rotating, moving, and zooming a scene. The virtual machine can be used to simulate and verify the machining programs directly in the Axis GUI, or it can be used for mo-nitoring machine activity during machining operations since the movements of the real and virtual machine are identical [18]. During the development and configuration of the control system, a virtual machine integrated with the control system is used for the validation of the developed functions of the controller, which is known as "virtual commissioning" [19].

CONCLUSION
In this paper, a system for programming, control, and monitoring of machining processes on numerically controlled machine tools through several different CAD/CAM environments is presented. The constant need for the development of new software packages, as well as the development of industry, have contributed to the development of virtual models of machines (digital twins) and their virtual environments. Working in a virtual environment allows the verification of a program prepared for real machine tools. In this way, it is possible to prevent possible errors that occur during the programming process, which would lead to a collision between the elements of the machining process. Some CAD/CAM Systems are being developed to monitor the machining process in the sense that soon they will have the option of displaying the cutting forces that occur during the machining process. In this way, space will be provided for optimizing the programmed tool path to reduce cutting forces during the machining process, which will contribute to increasing the quality of the machined surface, and thus the accuracy of the produced parts.