Analysis and Research on the Construction of Virtual Reality CNC Machine Tool Mode

With the establishment of virtual reality machine tool model as the object, the structure, assembly, movement and simplification of virtual machine tool are analyzed and studied by means of component import method and zero-return method, the calculation of initial position compensation is reduced by retaining the coordinates of the model itself. The model is simplified by using Deep Exploration software and removing part of the model. Finally, driving experiments are repeated, so as to ensure the accuracy of machine tool model and increase the operator’s “3I” (immersion, interaction and imagination) experience, and finally its effect is verified. The results show that this method can achieve the desired goal and is a simple and effective method to ensure the accuracy of machine tool model.


Introduction
With the development of industrial technology, the demand for NC machining and machine is bigger and bigger, the NC machine tool teaching need to rely on a large number of engineering practice, due to the training venue, machine tool number, the limitation of operating factors such as safety, material damage, lead to cultivate outstanding talents of NC machine tool cost high [1] . In view of the above, Virtual Reality (VR) is used to establish a Virtual CNC machine tool structure and its processing and operation process, and a computer-centric human-computer interactive CNC system and operation platform is constructed, which effectively solves the problem of difficult training of CNC talents [2] .

Basic Requirements for Virtual Machine Tool Construction
Virtual machine tool is the foundation of numerical control machining simulation system, and its final structure is reflected in the movement of virtual machine tool and the processing of workpiece, so the construction of machine tool model is particularly important. In the solid modeling of the machine tool, the analysis of each part of the machine tool is needed to find out the relevant dimensions of its overall structure design, and the important dimensions are defined as variables, and the non-major dimensions can be determined by mathematical relations. Omitting the features that have little to do with the overall design to facilitate modeling; Secondly, a complete position constraint is established by combining the assembly datum of each component. In a word, the construction of machine tool model must meet the following points: first, to ensure the accuracy of the movement; Second, the parameters of machine tool structure must have good reproducibility; Third, to ensure the accuracy of the assembly between various parts; Four, closely control the moving direction of moving parts; Fifth, the established model must be convenient to be driven; Sixth, in the guarantee of the model reality, as much as possible to simplify. The organizational relationships are shown in figure 1. In addition to the above principles, the establishment of virtual machine tool model, first, according to the actual machine tool drawings for the construction of three-dimensional model, and there are many commonly used modeling software, such as UG, Solidworks, 3DSMax; Secondly, the model is simplified and the appropriate import method is selected. Finally, a simple driving experiment is carried out.

Method of Machine Tool Model Construction
The establishment of virtual machine tool model needs to be carried out under the virtual platform environment. In this paper, VegaPrime and VC++MFC platforms are used. Since this platform supports the conversion and import of VSB files, and the files in this format can only be read by VegaPrime, the security of this machine tool model is greatly improved. At the same time, the mechanism of this platform is very strict, which can ensure the reproducibility of model parameters of virtual machine tool. Under this platform, the Openflight model can be imported directly through the Lynxprime interface, as shown in figure 2. Because the model established by SolidWorks software can be converted into Openflight format by the model conversion software, this paper chooses SolidWorks as the CNC machine tool model establishment software.

Figure 2. Lynxprime user interface
SolidWorks is the world's first set of 3d mechanical design software developed based on Windows system, because it is simple to use, comprehensive functions, and the system compatibility is good, greatly reducing the design time. See figure 3.  Figure 3. The assembly drawing established by SolidWorks This 3D model is stored in the form of "nodes", each "node" is a complete model element; The whole machine tool model is composed of the network among model elements by the structure of tree graph. When the virtual platform is loaded, it is loaded from low to high in the order of "nodes" of each model element [3] . After the 3D model is built, the files in Sldasm format are converted to Openflight format by DeepExploration software. After successfully converting the machine tool model to Openflight format, the model can be imported into VegaPrim environment in Lynxprime interface to complete the establishment of virtual machine tool model.
DeepExploration format conversion software is a multi-functional software developed by Right Hemisphere, which can import, reedit, transform and animate a large number of model formats [4] . This software can realize the transformation of SolidWorks software model format, during which the required model can be reedited and rendered with its own material library and rendering function. Since VegaPrime default minimum displacement unit is "m", this not only increases the difficulty of machine tool assembly, but also the Openflight model stores a large amount of data, so it is urgent to find a method to ensure the accuracy of machine tool.

Methods to Ensure Model Accuracy
Understanding the design of machine tools is the basis for improving the accuracy of machine tools, while modern machine tools are the product of modular design, which is composed of independently designed and manufactured modules assembled through standardized interfaces and precise coordination. Therefore, according to the principle of "whether there is relative movement" between the machine tool modules, the machine tool can be divided into the following four parts: absolute stationary parts, first-level moving parts, second-level moving parts, and third-level moving parts. Among them, the absolute stationary parts refer to the shell parts of the upright column, base and knife store. It is characterized by the fact that these components remain in the same position at any time during the simulation. The first level moving parts refer to the parts such as slide seat, headstock, cutter head, etc., which are directly connected with the absolute stationary parts and will produce movement. Secondary moving parts refers to the direct connection with the first moving parts, and in its own not moving, its position will be affected by the first moving parts, such as the work table, spindle tool, cutter disc tool. Three-level moving parts refer to vice, blank, etc [5] . In the case of VegaPrime model import, the latter moving parts must be imported as the child nodes of the former moving parts to ensure the relationship between levels.
Due to the large amount of data stored in the Openflight model, the machine tool model was divided according to the above division and assembled in VegaPrime. Meanwhile, the following methods were used to ensure the accuracy of machine tool movement and assembly.

Accuracy of Movement
The motion of the machine tool model is essentially the matrix transformation of the pose coordinate system. In VegaPrim environment, motion control forms can be divided into "object motion" and "freedom setting". There are also two import methods of machine tool model: "whole machine import" and "partial parts import".
When the machine tool model is imported by the machine, the Openflight model file of the machine can be obtained, and the relative position between each model part remains unchanged, so the machine tool assembly accuracy is very high. However, in this way, the machine tool can only adopt "freedom setting motion", which guarantees the assembly precision of the model, but cannot guarantee the motion precision of the model. Therefore, in order to achieve the balance between model motion precision and assembly precision, we can only adopt the method of "partial parts import", which is to decompose the machine tool into small units and then import them one by one in accordance with its assembly sequence. Although this method increases the modeling time, reasonable module division and accurate mold transformation are enough to ensure the model assembly and motion accuracy. Thus, "object motion" is determined as the motion control method. This method relocates in VegaPrim relative to the world coordinate system by receiving the motion instruction, reloads and renders the model in this place to achieve the effect of model movement.

Model Assembly Accuracy
Through the above methods, the motion precision is greatly improved, but the precision of model assembly is reduced. In order to solve the problem of model assembly precision, this paper proposes the model import method of "zeroing method" to make up for the above shortcomings.
The basic idea of "zeroing method" is to place the coordinate origin of all model parts in the same position from the center of the maximum envelop body. Therefore, before the model is imported into VegaPrime, it already has a relative displacement with the origin of its own coordinate system, and it will also appear in the world coordinate system. This displacement is generated automatically in the model transformation without any further calculation and input. See figure 4. Thus, after the model is imported, the calculation of initial position compensation of motion control is reduced, and the required coordinate system pose transformation is also greatly reduced. In this way, the relative position of all parts is ensured and the assembly precision is improved. The specific operation of the "zeroing method" is to import the entire machine tool model into the Deep Exploration software, delete the unnecessary parts, and only keep the parts that need to be converted into format. Meanwhile, the "zeroing" model is obtained by converting the file format in the "no middle" way.

Model Streamline
While ensuring the movement and assembly accuracy, the model should be simplified, which can not only reduce the time and resources spent on model loading, but also reduce The Times of "partial part import". Therefore, the model must be simplified before it is loaded.
However, the simplification of the model is usually destructive, and it is easy for the simplified model to be unable to be read or operated normally. Therefore, the following four steps are selected to simplify the model after multi-party experiments: (1) remove some parts that do not affect the simulation effect, such as: motor coupling, lead screw bearing, etc. Simplify the parts of the model as much as possible.
(2) TextureMapping is used to minimize the number of model faces without affecting the visual effect. The essence of texture mapping technique is to use texture map instead of real model to produce special effect or reality, so as to avoid excessive use of polygon to represent the details of lathe parts. Such as machine parameters nameplate, handwheel, operating handle, thread and other parts. This method reduces the complexity of the field, controls the number of model planes and improves the efficiency of computer graphics processing. (3) the 3D model simplification function of Deep Exploration software was used to simplify the model. See figure 6. The reduction result is precisely defined by percentage control, so that the reduction degree is as close as possible to 40%. However, when the reduction reaches below 40%, the model will be distorted due to excessive reduction. The model repair function in the software can be used to repair the model. See figure 7. (4) the Openflight model converted by Deep Exploration software was converted into a VSB file in VegaPrime with a built-in tool. Since the VSB model can only be read by VegaPrime, this can not only reduce the size of the original model, but also increase the security of the model. See figure 8. The simplified model must be driven repeatedly to verify the feasibility of the model and ensure that there are no read and operation errors. Finally, a virtual machine tool for operation was assembled in VegaPrime to complete the whole process of machine tool modeling.

Conclusion
To sum up, in the construction of virtual machine tools, in order to ensure the accuracy of the machine model, this paper starts from the aspects of motion accuracy, model assembly precision, model simplification, etc., so as to minimize the error, effectively simplify the model, improve the feasibility of the simulation machine, and greatly improve the efficiency of system development. At the same time, the virtual reality machine tool also give the students a more realistic feeling at the same time, improve the teaching effect of NC machining training, ease the pressure on the machine tool equipment storage, save the space training venues, reduce the cost of equipment maintenance upgrade, but also ensure the safety of the students and the equipment for the virtual machine tool NC machining has laid a solid foundation.