An Optimized and Virtual on-Machine Measurement Planning Model

The specific needs of customers set requirements like flexibility and custom-made products, as well as quick placement of products on the markets. Mass customization responds to these requirements and imposes new demands inside manufacturing systems such as optimization and virtualization of machining and measurement processes. A contribution in that direction is presented in this paper, pertaining to development and verification an on-machine measurement planning model. The aim of the verification is to visualize collision check between the measuring head placed in the tool holder and the workpiece on the machine tool working table. The virtual on-machine measurement was realized on the configured virtual machine tool LOLA HBG80 in the CAD environment. The measurement path is generated by a new planning methodology, then optimized using ants colony, programed and verified by simulations through few examples of standard forms of tolerance. The output of the simulation process is the G-code for real on-machine measurement for prismatic parts of medium and rough dimensional accuracy.


INTRODUCTION
On-machine measurement path planning depends on the geometric and metrological complexity of the parts which are simultaneously machining and measuring. The machining operations precede measurement operations, and both are performed on machine tools with a measuring head placed in the tool holder. A geometric complexity refers to the distribution and size of measuring or machining surfaces, their accessibility to the measuring probe, etc. On the other side, a metrological complexity primarily refers to the form and quality of tolerances, which appear (require) on a mechanical part, as well as their number. In the context of on-machine measurement planning such as measurement on machine tools, these types of complexity cannot be viewed separately, but can be integrated. A common element in this integration is a touch object or a measuring feature (MF). MF's position and orientation are geometric-machining characteristics, and the type of the tolerance zone, values of zone limits, reference element, etc. are tolerance characteristics.
The manufacturers are often reluctant to use measurement probes in machining centers even though they have been available for CNC machines for years [1]. According to [1,2], ''the traditional mindset that is doing anything but cutting on a machine tool wastes precious time and you should never measure a part using the same machine that made it, also pose obstacles''. Also, using the machine tool as an inspection device eliminates the need for expensive inspection equipment, allowing the manufacturer to divert resources to other uses [1].
According to [1] the main advantages of employing on-machine measurement for in-process measurements are summarized as follows: • Cost and time saving, for example, through reducing inspection queue time and inspection time, as well as eliminating rework of nonconforming product. • Changing from ''reactive'' inspection to ''proactive'' control, for example, by integrating quality control into the product realization process (realtime process measurement and machining control). • Agile machining by providing quick responses to product design changes such as mass customization. The tasks of an on-machine and in-process measurement system for surface metrology are addressed in [3]. The developments and integrations of different onmachine measurement strategies are presented in [4,5].
The paper presents a new approach to modeling the path for a virtual on -machine measurement model by defining touch objects (metrological features) from a geometrical -machining -tolerance standpoint. The geometrical information of the touch objects is taken from the IGES file. The basis for them is a 3D CAD model of the measuring part. The integration of geometric and tolerance information takes place with the help of the geometric and metrological features [6]. Based on this integration, the rules of decomposition between the measuring objects and the tolerances of the measuring parts are defined. An approach to ontological integration is presented in [7].
Based on the defined correlation of the tolerances and parts geometry, a model of the path in this paper as an output generates аn optimized and virtual on-machine point-to-point measurement path. In addition to the given measuring points, there are also collision avo-idance points through which the measuring probe passes in order to avoid collision.
Application of the optimization algorithm based on the ants colony, generates an optimal on-machine measuring path. The path simulation aims to visually check the collision between the measuring probe and the measuring part, and generates at the output a DMIS CNC or G-code for a certain machine tool.

ON-MACHINE MEASUREMENT METODOLOGY
The model of measurement system presented in [8,9] was used as the starting base for the on-machine measurement methodology. By modifying of that system, it is coming to the on-machine measurement model shows in Figure 1. The common elements for both models are defining of the initial and optimal path, and everything else is the new on-machine measurement metodology. The model provides a complete flow of information for virtual onmachine measurement process for machine tool LOLA HBG80 and final measuring devices such as measuring head or machine tool probes (MTPs). The designing data inside of CAD system present the input to the model.
The output of the model is the DMIS CNC or Gcode for the real machine tool LOLA HBG80, or the MTP's path program for measurement real prismatic workpiece (PW). The on-machine measurement path is obtained by defining the initial path and then the optimal path that is programming on the virtual machine tool.
The virtual on-machine measurement process consists of four elements: (i) the prismatic measurement workpiece; (ii) the virtual LOLA HBG80 machine tool; (iii) the measuring head or MTP, and (iv) the fixture tool. The connections between these elements of the onmachine measurement model are shown in Figure 1. The connections include the following types: (i) activities (modelling, configure and setup); (ii) standard elements (tolerance, feature, geometry and CS), and (iii) files IGES, STL etc.

Decomposition of tolerance of the prismatic workpiece according to ISO 1101
The purpose of tolerance decomposition of the measuring part is to get the connections (by defining decomposition rules) between the tolerance and geometric features (GFs), as touch objects which indirectly, through tolerance, participate in the onmachine path planning. One, two or more GFs obtained in this way represent tolerance (metrological features) and part of the geometry of the measuring part which is machined (machining features). From the on-machine measurement aspect, for defining the rules of the qualification -decomposition of the tolerance into geometric features and defining the initial measurement path, only the analysis of the metrological features is important.
In the general case, the rule #1 defines the decomposition of PW into forms of the tolerances defined by standard [10]. Figure 2a) shows decomposition of tolerance form (TF) and tolerance orientation (TO). The decomposition of other types of tolerances is derived according to ISO 1101 standard [11].
Rule #2 defines extension of the forms tolerances decomposition into specific form which also defined by mentioned standard. The examples are shown in Figure  2a). Namely, it is TF1 -tolerance of flatness and TO1tolerance of parallelism.
At the end, the rule #3 defines extension of the forms tolerances decomposition on more specific form. As mentioned, these forms can be called MFs and consist of one or more GFs. Figure 2a) shows a specific example of the decomposition of tolerance length TF1 and TO1. TF1 consists of P#1 (plane) feature, while TO1 consists of P#1 and C#1 (truncated cone). As it can be concluded, mentioned rules are shown for two types of tolerance and two types of MF that are directly related to it. However, to fully describe the MFs it is Figure 1 On-machine measurement planning model necessary to define their parameters which define uniquely each of them. Each geometric feature is uniquely determined by the local coordinate system (CS) and a set of corresponding parameters. According to [8,9] parameters of the MFs can be: diameter (D, D 1 ); height (H, H 1 ); width (a); length (b); normal vector of a feature (n), and fullness vector of a feature (n p ). Other essential difference between GFs and MFs (except the plane) is in the n p parameter that defines the fullness of the feature. The fullness parameter is defined by a unit vector of the X-axis [9]. The parameters of features P#1 and C#1 are shown in Figure 2b).

Measuring points distribution model
The model contains the distribution of the measuring and nodal points. Distribution of measuring point for different MFs such as plane, circle, hemisphere, cylinder, etc. is obtained by modifying Hamersley's [8,9,12] sequences. The coordinates of measuring points are presented in Cartesian coordinate system and designated by creator as i i i i P (s , t , w ) . An example of formulas for calculation of measuring points coordinates for a truncated cone, are as follows: According to [8,9] the set of nodal points implies two subsets i1 i1 i1 i1 P (s ,t ,w ) and i2 i2 i2 i2 P (s ,t ,w ) , as it is shown for inside cone slice in Figure 3a). The distance that measuring probe crosses between: points i1 i1 i1 i1 P (x , y ,z ) and i i i i P (x , y , z ) is presented by 1 d -slow feed path, and the distance between points i2 i2 i2 i2 P (x ,y ,z ) and i1 i1 i1 i1 P (x , y ,z ) is 2 d -rapid feed path.
The distribution of measuring and nodal points for truncated cone based on this model is presented in Figure 3b).
After defining measuring and nodal points in this way and since programming is done in CS of machine, it is necessary to express the coordinates of points in CS of machine tool LOLA HBG80. According to mathematical model shown in Figure 3c In this way, the model defines a potential set of the coordinate points in the CS machine towards a point-topoint measurement path.

Initial measuring path
The point-to-point path or initial measuring path is defined by the model of the distribution measurement points and collision avoidance principle. The first two sets of points are already defined in the previous subchapter, while the third set is defined using the collision avoidance principle. Based on STL model for the presentation of PW geometry, the tolerances of PW, the coordinates of the last point ( ) (subsequent feature), the simplified principle of collision-free points generation are presented in [8].  If an intersection between the line and the plane exists, then it is a point j j j j P (x , y , z ) , where j is the overall number of intersection points. If an intersection between the line p and any of the triangles from STL model exists, then using iterative procedure the points procedure are the points for which there is no collision during the measuring probe crossover. This iterative procedure for obtaining the initial path is shown in Figure 4.

OPTIMIZATION PATH BY USING ANTS COLONY
By defining an initial path from multiple sequences of a measuring path in the point-to-point form, the conditions for its optimization based on the application of some of the AI techniques are fulfilled. In this paper, an ant's colony optimization (ACO) technique is used.

TSP and ACO
Application of ACO in an on-machine measurement system is based on the solution of the travelling salesmen problem (TSP), where the set of cities that the salesman should pass through with the shortest possible path corresponds to the set of points of a minimal measuring path length. According to [13,14], TSP can be represented by a complete weighted graph G (N,A) = with N being the set of nodes representing the cities, and A being the set of arcs. Each arc (i, j) A ∈ is assigned a value (length) ij d , which is the distance between cities i and j, with i, j N ∈ . The goal in TSP is to find a minimum length Hamiltonian circuit of the graph where a Hamiltonian circuit is a closed path visiting each of the n N = nodes of G exactly once [14], so that an optimal solution to the TSP is a permutation π of the node indices } { 1, 2,..., n such that the length ( ) f π is minimal where ( ) f π is given by: A detailed explanation of the solution to this problem for the measurement on CMC is considered in [15,16].

Optimal measuring path
The model is based on equation presented in [8,16] for calculation of the measuring probe path during the measurement of N -measuring points: min P P min P P min D K min P P min P P Results of the comparison I n /O p between initial (default) PTC Creo software measuring path I n and optimal O p path for two types of tolerance and corresponding features, are shown in Table 1.

VERIFICATION OF ON-MACHINE MEASUR-EMENT PATH
Verification of the measuring path for inspection planning of PW is important in order to visualize collision check between the measuring head, PW and fixture. In this case, the aim of the verification is to visualize the collision check between the measuring head placed in the tool holder and the PW, which is set up on the working table. The virtual on-machine measurement was implemented on the configured LOLA HBG80 virtual machine tool in the CAD/CAM environment. A proposed concept for verification of the measuring path is realized through path simulation on configured virtual machine in CAD/CAM system. This concept of verification is validated through several examples of generated measuring paths for selected features and tolerance.

Path simulation on virtual machine tool in CAD/CAM system
A path simulation that uses the virtual machine is the safest and the most cost-effective way for program verification. This simulation is important for: (i) program verification before real measuring; (ii) visual detection of collisions between the moving parts of machine and the measuring head with the PW and jigs and fixtures; (iii) check if the machine can execute the specified measuring path within the workspace boundaries. For programming of such measuring path on virtual machine, the tool module of CAD/CAM system PTC Creo 2.0 was used [17]. For programming and generation of measuring path used CMM module from CAD/CAM system PTC Creo, it is necessary to realize next steps: (i) creating new CMM operation; (ii) loading of reference CAD PW for inspection; (ii) configuring a virtual model of machine tool for on machine measurement; (iii) define coordinate systems on virtual machine; (iv) configuring a virtual model of measuring head; (v) define coordinate systems on virtual measuring head; (vi) defining of measuring operations and selecting of the task coordinate frame; (vii) setting of measuring probe as a new configured measuring head; (viii) selection of the step in accordance with of feature that have to be measured (plane, cone, cylinder,..); (ix) setting of the measuring parameters for selected step; (x) selection of measuring points on the features that have to be measured; (xi) generation of the measuring path; (xii) simulation of the measuring path including measuring head and (xiii) measuring path simulation on configured virtual machine tool LOLA HBG80 with measuring head, using Machine Play option.
Based on previous research in configuring virtual machine tools [18,19] and virtual CMM [17], virtual machine in this paper is configured according to the procedure described below. The configured virtual machine tool which used measuring head are used for the verification of the programmed measuring path in a CAD/CAM system PTC Creo 2.0 based on the generated measuring path.
A measuring path simulation is possible by running the program and using a modelled virtual machine tool with all kinematic connections between the components, which allows the motion of virtual machine model as a system of rigid bodies, as well as virtual measuring head which is placed in the tool holder [18]. A detailed virtual machine tool LOLA HBG 80 with defined kinematic chain between moving components is shown in Fig. 5.

Figure 5 CAD model of machine tool (for on-machine measurement) for the simulation of measuring path
Slider connection is used for the entire translatory movement (X',Y,Z). Such assembly enables the motion of the model in the range defined for each connection. This simulation of the measuring path allows motion of movable components of virtual machine tool, with the measuring head at the end.
After defining of the three slider connections, it is necessary to define coordinate systems (Fig.6) on: • working table, marked as MACH_ZERO, • workpiece, marked also as MACH_ZERO, • head of the main spindle, marked as TOOL_POINT, • measuring head, marked as TOOL, and coordinate system on the measuring probe market as a TIP1.
Matching already defined coordinate systems MACH_ZERO enables the setting up of the virtual PW on the configured virtual machine during the measuring path simulation.
The coordinate system defined on the head of the main spindle and marked as a TOOL_POINT is matched with appropriate coordinate system on the measuring head, marked as a TOOL and enables the setting up of the measuring head at the main spindle on the virtual machine during the measuring path simulation.
During the simulation of measuring path, a complete virtual machine can be included into simulation, with a Machine play option, Fig.7. During the measuring path simulation on virtual machine LOLA HBG80, Fig. 7, besides PW and measuring head that moves through measuring path, it is possible to create and load fixture that is of importance in verification of measuring path and detection of the possible collisions during the program execution. The simulation can generate measuring path that is saved in CL file (DMIS program , Fig 7b), and also can convert DMIS to G code for measuring. Measuring path simulation on virtual on-machine measurement planning model LOLA HBG80 in CAD/CAM environment PTC Creo 2.0 is shown on Fig. 7.

CONCLUSION
On-machine measurement planning is a specific problem, and depending on the metrological complexity of the PW (e.g. number of tolerances), efficiency, intuition and experiential knowledge of the operator. On the other hand, the specific needs of customers create new demands on the flexibility and personalization of custom-made products, as well as the rapid placement with the low unit product costs on the market. Mass customization as a manufacturing technique responds to these requirements and at the same time imposes new needs within manufacturing systems such as: (i) the production cost and process time saving; (ii) changing from reactive inspection to real-time process control; (iii) optimization and virtualization of machining and measurement processes. This paper presents a contribution in these directions, pertaining to development and verification of virtual on-machine measurement planning model.
The aim of the verification is to visualize collision check between the measuring head placed in the tool holder and the PW on the machine tool working table. The virtual on-machine measurement was realized on the configured virtual machine tool LOLA HBG80 in the CAD environment. The measurement path is generated by new planning methodology, then optimized using AC, programmed and verified by simulations through few examples of standard forms of tolerance (metrological features) of PW. The results of the comparison of the initial and optimal measuring paths show a significant saving in the length of the optimal measuring path. If it is known that during on-machine measurement, the path length is almost directly proportional to the measurement time, thus reducing the time required to measure and reduces busy of the machine tool.
Simulation of the path is performed in the CAD/CAM system PTC Creo 2.0. For the simulation of the path in the software, the Manufacturing module was used within the CMM submodule as well. The CL file generates the software as an output report that contains data about the motion of a measuring sensor. The output of the simulation is also G-code for real on-machine measurement on LOLA HBG 80 for medium and rough accuracy parts.
A limitation of the developed model is the application only for PW of medium and rough accuracy, not for parts with high accuracy, as well as parts with free-form surfaces for inspection.
A direction of the future research will be the development of virtual on-machine measurement system based on STEP-NC standard, as well as the indirect method of programming a machine tool with a measuring head as a tool. The second direction of the future research will be the pairing of virtual and real onmachine measurement system -towards the digital twin.