Dimensional and geometrical errors of three-axis CNC milling machines in a virtual machining system

• A virtual machining system is presented in order to create machined parts. • Geometrical errors of three-axis milling machine tools were modeled. • The real errors are enforced to the nominal machining G-codes by developed software. • To validate the system, surfaces of virtual and real machined parts are compared.


Introduction
The rapid development, prototyping, testing and deployment of machining strategies are demands of industrial production in order to reduce manufacturing costs and achieve best quality. Due to shorter product life cycles, demand of presenting novel options on the products as well as small series production, the absolute accuracy of machine tools is of increasing importance. Short product life times do not permit an iterative optimization of the product quality. This means that accurate production in the first time is vital issue for part manufacturing. A key tool in achieving the goals is the modeling and simulation of product development and manufacturing process in a digital environment.
Virtual manufacturing is the addition of simulation to control models and actual processes, allowing for seamless simulation for optimization during the actual production cycle. The modeling employs an approach in which the complete machining process can be simulated and optimized before resorting to costly and timeconsuming physical trials on the real production environment. Using computer models and simulation of manufacturing processes in virtual environments have provided key tools for presenting products with high level of efficiency and accuracy.
There are many errors in CNC machine tools which have an effect on the accuracy and repeatability of part manufacturing. Most of these errors are based on specific parameters such as force and stress, geometrical deviations of machine tool structure, thermal variations, cutting force induced errors, servo errors and tool wear. Virtual machining software systems are deployed for modeling and simulation of the effect of errors on the accuracy and precision of components. It presents a useful method for creating real machined parts in the virtual environment which makes the process of designing, manufacturing and analysis more effective.

Review of researches related to dimensional and geometrical errors in virtual environment
A large amount of work is presented either for the purpose of designing machine tools or simulating machine tool's capabilities in virtual reality systems.  [1] presented a comprehensive review of existing virtual systems as Web-based virtual machine tool systems and mathematical modeling or numerical analysis. Authors endeavored to provide a deeper understanding on the developed virtual systems, categorize them based on the research domain and focus, and review the system structure and the capabilities of the systems. W. Lin and J. Fu [2] developed the Virtual Machine tool Structural Modeler (VMSM) system which can provide an interface for modeling machine tools through a virtual reality environment. In order to predict the real behavior of machine tool in virtual reality systems, different studies were carried out by researchers. Finite Element models and experimental calibration techniques of virtual machine tool technology as well as the structural analysis of the machine tool are presented by Y. Altintas et al. [3].
K. Erkorkmaz et al. [4] presented a trajectory planning strategy for maintaining the tool positioning accuracy in high speed cornering applications by a Virtual CNC system. They used the advantage of the Virtual CNC's ability to accurately predict contour errors and applied corrective measures by modifying the tool path and adjusting the feed rate. Y. Cao and Y. Altintas [5] used a model of spindle-bearing and machine tool systems for virtual simulation of milling operations which allows virtual cutting of a work material with the numerical model of the spindle during the design stage. Enhanced virtual machining for sculptured surfaces by integrating machine tool error models into NC machining simulation has been presented by Y. Lin and Y. Shen [6]. It integrates machine tool error models into NC machining simulation so that part errors can be predicted and shown on a graphic output by simulating the cutting process. S. D. Merdol and Y. Altintas presented a virtual cutting and optimization system for three-axis milling operations [7].
Simulation results by virtual milling system are then used in a constraint-based optimization scheme to maximize the material removal rate by calculating acceptable feed rate levels. M. Habibi et al. [8] presented a compensation method for tool deflection and geometric errors of three-axis milling operation by tool path modification. They used machining codes of milling operation in their software in order to find solution and strategy for compensating the errors in terms of precision enhancing. Y. Altintas and S.D. Merdol [9] used a generalized process simulation and optimization strategy for 2 1/2 axis milling operations in order to increase material removal rate and avoiding machining errors. It combines various machining constraints such as cutting forces, chip thickness, spindle torque-power, form errors on the workpiece and chatter stability of the system to determine the most efficient machining parameters. J.H. Ko et al. [10] presented a new method of calculating cutting-condition-independent coefficient by virtual machining system in order to predict the cutting forces over a wide range of cutting conditions. D. Olvera et al. [11] presented stiffness values of turning center machines in order to consider the overall error vector of produced parts. An experimental methodology to measure the static stiffness along kinematic chain of a turning center is proposed in order to calculate stiffness values of the machines. L.N. López De Lacalle et al. [12] considered errors of produced parts in high speed milling machines to increase productivity and surface quality of produced parts. To generate G-Codes free from errors such as collisions between the tool and the workpiece or fixtures, new control and optimization steps are included in machining methodologies of the CAM software.
Research works in the field of virtual machining systems have focused on general topics of milling operations such as technological review and structural analysis.
The present work is concerned with a virtual machining software system for applying the effect of the 21 dimensional and geometrical errors of a 3 axis CNC milling machine on the machined component. As a result an actual part can be machined in virtual environment according to real conditions. Section 3 deals with a short review of simulation and modeling of geometrical errors in 3-axis milling machines. The software and developed algorithm is presented in Section 4. For validation, some experiments are deployed in order to show the comparison of real machined with virtual parts from which the results are presented in Section 5.

Geometric errors measurement and modeling
Geometric errors are mainly concerned with the errors in the structural elements of the machine tools. These errors affect the machine repeatability and kinematic accuracy which are inherent in the machine tool. For a 3-axis milling machine, there are 21 error components namely: 3 linear positioning errors, 6 straightness errors, 9 angular errors and 3 squareness errors.
Angular errors such as pitch, roll and yaw errors are common causes of positioning errors. Also a small angular error of the spindle can cause a significant effect at the tool tip. Straightness errors seriously degrade machine tool performance and have a direct influence on the machine tool path accuracy. These errors can be the result of wear in machine tool guide ways. Also they can be due to accidents which may have damaged the machine tool structure in some way, or poor machine foundations that are causing a bowing effect on the whole machine tool. Straightness errors have a direct effect on the positioning and contouring accuracy of a machine tool. Axes of machine tools should be perpendicular to each other along their length. Out of squareness between axes can seriously degrade machine tool performance by producing dimensional errors in produced parts. The squareness errors between the axes are calculated by the slopes of two sets of straightness error profiles.
Components of geometric error in 3 axis CNC milling are as Fig. 1. These error subcomponents are the result of using the traditional error categories. In case of 3D NC machines the position errors of the P(X , Y , Z ) point can be measured in a grid of the volume of the work area and can be compensated by modern CNC controllers.
where θ x and θ y are produced angles between reference axis and the mean straight line and φ target is the edge angle of target.    The size of the position error may depend on the +/− motion direction and on the actual cutting forces. Six degrees of freedom error motion of a machine tool carriage system is shown in Fig. 4.
A three-axis machine tool can be considered as an open kinematic chain consisting of a series of links connected together by prismatic joints. At one end of this chain is a tool mounted on an air bearing spindle. The spindle is clamped on the Z-slide.

Errors measurement
Measuring the dimensional and geometric errors is carried out using laser interferometry system. In linear measurement, for forming the fixed length reference arm of the interferometer, one retro-reflector is secured to the beam-splitter. By moving the other retro-reflector relatively to the beam-splitter the variable length measurement arm will be formed. Any change in the separation between the measurement arm retro-reflector and beam-splitter is tracked by the laser system. The optical setup for finding linear positioning errors is as Fig. 5 [14].
Geometric errors may be different in case of working conditions because of cutting forces.
Measuring other geometric errors such as angular, straightness and squareness errors is similar to the presented techniques with different optical tools and setup.

Errors model
The efficient model of geometric errors should be able to convert numerous parameters of any point in space into a single volumetric error vector. Therefore a common reference should be imposed on the nominal position so that a clear concept of volumetric errors can be realized in terms of this reference. A.C. Okafor and Y.M. Ertekin [15] presented a general volumetric error model, which synthesizes geometric errors by using homogeneous matrix transformations of the axis slides. Fig. 6 shows the schematics of table and tool of a 3 axis milling machine.
Where R is the base coordinate system of the machine, R2, R1 and R3 are coordinate systems of X , Y and Z directions respectively.
The actual position and orientation of the X -axis carriage in reference coordinate system is given as Eq. (2).
where, ε x2 (x) Roll error of X -axis. ε y2 (x) Pitch error of X -axis. ε z2 (x) Yaw error of X -axis.  where, α xy Squareness error between X and Y axes. α xz Squareness error between X and Z axes.
x Nominal X axis position which amplifies α xy to yield and abbe error in Y direction in Eq. (3).
x Nominal X axis position which amplifies α xz to yield and abbe error in Z direction in Eq. (4).
Similarly, other matrices for the actual position and orientation of the Y -axis and Z -axis carriages between base coordinate system of R and coordinate systems of R1 and R3 in Fig. 6 can be shown as Eqs. (A.1) and (A.2) in Appendix A. The position of work and tool can be shown as Eqs. (5) and (6). where, where W x , W y and W z are the elements of work coordinates on the table and T x , T y and T z are the elements of tool coordinates for X, Y and Z directions respectively, as shown in Fig. 6. M.V. Nojedeh et al. [16] presented an overall geometric vector in their study for showing the effects of all geometrical errors and kinematical deviations of machine tool's moving axes. The remaining effect is only squareness error between moving axes If the tool error and the Work error are also measured from the R base then the same size errors mean precise product because the tool and the workpart are translated with the same error distance in the same direction. The errors have to be defined exactly using the defined transformation matrices.

Software for enforcing the geometric errors
In order to implement the proposed method, a geometric errors enforcement software is developed in the present work. The ideal tool path (tool tip and tool orientation) and NC codes are generated by a CAD/CAM system such as Catia. Having the machine tool errors, NC codes and the position of the workpart on the table, input in the software, every geometric error parameter is calculated at each cutter path. Section 4.4 mentions that the precision of the manufacturing may depend on the selected region of the work area. Because of this the reference location of the workpart on the table is also an important input of this algorithm. Finally the errors are applied to the G-codes and the corresponding modified NC codes according to actual machining path are developed.
The flowchart of the software is shown in Fig. 7.

Software and algorithms verification
The software is written in Visual Basic programming language which can read G-Code of parts with text format. The 21 geometric errors of a three axis CNC milling machine are enforced on the G-Code. The software can then produce the new G-Codes as text format for machining operation in the virtual environment. The algorithms of the software is presented in Appendix B.
The new G-Codes are generated by the software in a text format file according to the errors and conditions of actual machining  environments. The file can be used by any CAM software such as Vericut [17] for producing actual machined part in the virtual environment.

G02 and G03 conversion
The software is capable of dividing circular path such as G02 and G03 into small segments. Each segment is controlled by an specific tolerance which is given by user. The analytical equation of a typical arc is as Eq. (10).
The fragmentation algorithm for circular path is illustrated as Eq. (11).
where θ s is the start angle of arc and dθ is the angular steps of arc segments. Fig. 8 shows details of circular division for G02 arcs.

The largest error of each axis
Due to the time consuming and expensive error compensation methods of all 21 errors of a 3 axis machine tool, it is possible to increase machine tool accuracy by reducing the largest error of each axis. Therefore by eliminating or reducing this error, the accuracy of machine tool will improve easily and cost effectively. A side effect of the present work is to find the largest error of each axis of a machine tool in each target position. The developed software can present a suggestion to the user for increasing the accuracy of the machine tool. This will be by compensating completely or decreasing the largest error of each axis. The software presents all geometric errors to the user starting from largest right down to the lowest. The user can remove or decrease each of the errors and see the effect on the final volumetric error vector. Fig. 9 shows the dialog box of geometric error monitoring.

The most suitable position of the machine tool table
Another side effect of the present work is by analyzing the errors of the machine tool, the software can divide the machining area in different sections where each section is labeled according to its error value. This means the software can present the machinist with the most suitable machining area, where the least error is present in the machine tool. So the highest accuracy achieved by the machine tool without any error compensation will be known to the user.

Validation
In order to experimentally validate the virtual machining software, two parts are considered. In first step, the machining of the free form surface of a part shown in Fig. 10 is simulated only in virtual environment by the software in order to show the discrepancy of the machined and nominal surfaces.
The discrepancies between the part machined in the virtual environment and CAD designed part (nominal) are shown in Fig. 11.
In the second step, a spline surface as a free form profile of a sample workpiece shown in Fig. 12 is considered for machining in real and virtual environment. Two profiles of real and virtual parts are compared using the data obtained from a CMM machine and a surface comparator software. In the present work, geometrical errors of EMCO VMC600 CNC machine tool were measured by Renishaw ML10 interferometer and the 21 geometric error parameters were identified. The milling tool used for the process is a flat HSS end mill with 10 mm diameter, helix angle 30°and flute number 4. The material of the workpiece is AL7075T6. The spline profile  has 0.33 mm radial and 10 mm axial depth of cut. After supplying the measurement data and NC codes into the software, the error enforced NC codes are generated. The machining tests were carried out in real and virtual environments and compared by a CAD surface comparator software using the same setup of machine and cutting tool. Fig. 12 shows the profile of the test workpiece.
The Original machining G-codes of part without errors and the new G-codes are shown in Figs. 13 and 14 respectively.
The workpiece profile is measured by ZEISS CMM machine. The discrepancies between each point of real machined part and nominal profile are shown in Fig. 15.
Discrepancies between each point of the profile of the part machined in virtual environment and nominal profile are shown in Fig. 16.
Profile errors along the curve length of real and virtual parts are shown in Fig. 17.
A good compatibility is shown between the parts machined in actual and virtual environments.

Conclusion
In the present work, the errors of a 3 axis CNC milling machine tool are enforced on G-codes of parts in virtual environment in order to imitate the real machining environment. The virtual machining software is developed with Visual Basic programming language. The input to the software are the 21 error values of a specific 3 axis machine tool and the G-codes for machining a specific part. The output of the system is a newly generated G-code which will produce a part similar to the part machined in the real environment. In order to validate the system, two parts are considered. The first part is only tested in a complete virtual environment. The second part is tested in virtual and actual environments, where an 81.8 compatibility percentage is realized. In both cases a good compatibility in the test results are shown. This shows that the developed system is able to produce near true components in the virtual environment.  The approach used in the present work can also be developed further and applied to 5-axis CNC milling machines. The mathematical model of volumetric error vector due to 39 dimensional and geometrical errors of 5-axis CNC machine can be generated. A virtual machining software can be developed which can receive the measurements of the 39 errors and produce a near real part in the virtual environment. This is the subject of the future research of the authors.
The results also show that the error modeling used in Ref. [15] can suitably be used in error modeling of a 3-axis CNC milling machine in virtual environment. Furthermore, it shows that the laser interferometer techniques used for measuring the errors of the machine tool are reliable.
where, δ ′ x1 (y) X straightness error of Y axis as it moves in Y direction. δ ′ z1 (y) Z straightness error of Y axis as it moves in Y direction. α xy Squareness error between X and Y axes. α zy Squareness error between Z and Y axes. where, δ ′ x3 (z) X straightness error of Z axis as it moves in Z direction. δ ′ y3 (z) Y straightness error of Z axis as it moves in Z direction. α xz Squareness error between X and Z axes. α yz Squareness error between Y and Z axes.