ACTA IMEKO  ISSN: 2221‐870X  June 2015, Volume 4, Number 2, 10‐17    ACTA IMEKO | www.imeko.org  June 2015 | Volume 4 | Number 2 | 10  Development of a knowledge base for the planning of  prismatic parts inspection on CMM  Vidosav D. Majstorovic 1 , Slavenko M. Stojadinovic 1 , Tatjana V. Sibalija 2   1  University of Belgrade, Faculty of Mechanical Engineering, Department for Production Enginnering, Kraljice Marije 16, 11120 Belgrade    2  Metropolitan University, Belgrade, Faculty of Information Technology, Tadeusa Koscuska 63, 11 000 Belgrade        Section: RESEARCH PAPER  Keywords: Inspection planning; CMM; Knowledge base; Feature – based system  Citation: Vidosav D. Majstorovic, Slavenko M. Stojadinovic, Tatjana V. Sibalija, Development of a knowledge base for the planning of prismatic parts  inspection on CMM, Acta IMEKO, vol. 4, no. 2, article 3, June 2015, identifier: IMEKO‐ACTA‐04 (2015)‐02‐03  Editor: Paolo Carbone, University of Perugia, Italy  Received June 26, 2014; In final form January 28, 2015; Published June  2015  Copyright: © 2015 IMEKO. This is an open‐access article distributed under the terms of the Creative Commons Attribution 3.0 License, which permits  unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited  Corresponding author: Slavenko M. Stojadinovic, e‐mail: slavenkostojadinovic@gmail.com    1. INTRODUCTION  The development of an intelligent system for inspection planning is the imperative and prerequisite for a new generation of metrological systems and their applications within the digital quality concept, based on the global interoperability model [1- 3]. The interoperability model integrates CAD-CAM-CAI data on a digital platform [4, 5] and presents a basis for virtual simulation and knowledge-based inspection planning, especially for prismatic parts. Digital manufacturing is a framework for the development of a new generation of technological systems, based on virtual simulation, digital modelling of a product and cloud computing application [2, 5]. Expert systems (ESs), being an advanced approach for modelling and application of engineering knowledge in technological systems, have been frequently used in the last few decades [6-9]. Since 2000, ESs have passed through the mature stage of development and application [10-14]. Influenced by ESs for the technological processes planning (CAPP/CAM) and STEP standardisation [4,15,16], the metrological primitives modelling is based on the modelling of metrological characteristics (features) [17-19]. Our research is based on this approach [20, 21]. In the CAI model, consideration of metrological features implies the recognition and extraction from the CAD model and their definition and modelling [18]. Our approach has evolved from the definition and modelling [21] and application of ontology for defining a knowledge hierarchy for inspection [20], toward an integrated approach [22] which uses a digital product model in interoperability environment (Autodesk Inventor Professional 2011, Solidworks, PC-DMIS, Protege). Our model of the system for intelligent design of a conceptual inspection plan for CMMs (i.e. Intelligent System for Automatic Planning of Inspection – ISAPI), in the artificial intelligence environment, is presented in this paper. Special attention is dedicated to the knowledge base model that was developed and applied within the proposed approach [22]. 2. DEVELOPMENT OF A KNOWLEDGE BASE MODEL   The conceptual inspection plan presents a basis for CMM programming. Usually, based on experience, knowledge and skills, an engineer (inspection planner) generates a conceptual plan for the inspection on CMMs. However, this approach should be avoided in a modern manufacturing, especially due to the fact that today CMMs work in a digital environment and ABSTRACT  Inspection  on  coordinate  measuring  machines (CMMs)  is  based  on  software  support  for  various  classes  of  metrological  tasks,  i.e.  tolerances. Today, the design of a uniform inspection plan for a measuring part presents a rather complex issue due to the following:  (i) metrological complexity of a measuring part; (ii) skills and knowledge of a designer / inspection planner; and (iii) software for CAI  model, considered as a part of an integrated CAD‐CAPP‐CAM‐CAI system. This issue could be addressed by the usage of expert systems  that generate a conceptual inspection plan for a measuring part, based on which the inspection plan for a selected CMM could be  automatically developed. This paper presents the development of a model of an automatic inspection planning system for CMMs, and,  in particular, the developed knowledge base model.     ACTA IMEKO | www.imeko.org  June 2015 | Volume 4 | Number 2 | 11  with huge numbers of different parts. In contrast to the old approach, a new concept is based on the usage of ESs that generate conceptual inspection plans. The first investigations in this domain have been conducted a long time ago [6], defining a framework for the design of an inspection plan for CMMs using ESs. Since then, owing to the development of artificial intelligence tools, a new generation of ESs has been developed. The basis of each ES model is a knowledge base, its organisation, scope and content in terms of factual and heuristic knowledge. A knowledge base must contain necessary knowledge and information about the measuring part (MP), its tolerances, geometric features (GF) and metrological features (MF), inspection sequences (IS), measuring probe configuration (PC), measuring machine (MM), and fixture tools (FT) and accessories, as presented in Figure 1 [21]. The basic steps for generating a conceptual inspection plan for CMM are: (i) analysis and synthesis of metrological tasks (tolerances) according to the digital product model (the nodes MP, MF and GF presented in Figure 1); (ii) definition and orientation of measuring coordinate systems (MP, MF, GF, IS, PC and MM); (iii) selection of a measuring probe configuration (IS, PC and MM); and (iv) definition of a measuring strategy (decomposition of metrological features, development of geometric features and inspection planning). Therefore, our approach is based on the geometrical (CAD), technological (CAPP/CAM) and metrological (CAI) integration, as presented in the knowledge base model in Figure 1). The proposed model generates a conceptual inspection plan with the following elements: (i) measuring part with metrological / geometric features and inspection sequences; (ii) measuring coordinate systems; (iii) measuring probe configuration; (iv) fixture tools and accessories; and (v) necessary characteristics of CMM. The proposed model supports the CAI system [23, 24] developed as ISAPI [22], and also supports the realisation of the following approaches: (i) measurement (measuring part – CMM – measuring results), (ii) inspection (measuring part – CAD – CMM – inspection results), (iii) reversible engineering (real part model – CMM – CAD), and (iv) inspection planning (CAD – CAI – inspection plan). Therefore, our model is based on the following axiom: geometrical – technological - metrological integration (Figure 2), compatible with the state-of-the-art approaches in digital manufacturing [4]. Previous analyses show that the measuring and inspection on CMM require a wider scope of knowledge: (i) knowledge about the part processing (for the analysis of tolerances and definition of measuring coordinate systems); (ii) general knowledge about tolerances (analysis and synthesis of metrological and geometric features); (iii) specific mathematical knowledge about modelling and relations between geometric and metrological features (e.g. curves modelling); (iv) knowledge about CMM and its working principles; (v) knowledge about software installed on CMM; and (vi) heuristic knowledge about this domain. 2.1. An experimental example  An experiment is performed on a real measuring part [25]. For the observed measuring part a graph of knowledge base model is developed with 4 nodes and their interrelations, as presented in Figure 3. The nodes are non-terminated symbols that present knowledge entities: MP – knowledge about the measuring part and its tolerances, MF – knowledge about metrological features, GF – knowledge about geometric features for the defined metrological feature. Non-terminated symbols as knowledge entities are connected with terminated symbols: a0 = (tolerances, feature), a1 = (metrological feature, feature, tolerances), a2 = (geometric feature, features), b = (tolerance, geometric feature, features), and a = (measuring part, geometric features, features). They are presented as ontological structures with hierarchical relations that define all elements of knowledge in this domain. For example, relations between MP and GF could be as follows: a0 - a1 - a2 (reasoning line for generating a measuring probe path), a0 – b (reasoning line for generating point coordinates at the geometric feature), and a (reasoning line for geometric features at the measuring part). Relevant investigations on the modelling based on tolerance characteristics have already been performed [4,15,16,21]. Our approach integrates metrological – geometrical information from the CAD digital model, where geometrical information are parameters of geometric features taken from the IGES file after modelling of the prismatic measuring part using software Autodesk Inventor Professional 2011. Figure  2.  Elements  for  building  the  knowledge  based  model  for  prismatic parts inspection on CMM.   Figure 1. The knowledge base graph for the  ISAPI model.    ACTA IMEKO | www.imeko.org  June 2015 | Volume 4 | Number 2 | 12  Therefore, the tolerances defined by ISO 1101 standard are presented by the graph that illustrates ontological decomposition into metrological features, and then – into geometric features. This way the reasoning line is specified, and, by extracting parameters, each geometric feature is uniquely defined. This geometric feature presents a basis for the analysis of accessibility of the measuring probe, path planning, and for generating measuring protocols for the input measuring requirements. Terminated symbol a0 defines the decomposition of a prismatic measuring part into the tolerances type defined by the ISO standard: length tolerances (TL), form/shape tolerances (TF), orientation tolerances (TO), and location tolerances (TLC). Terminated symbol a1 defines the continuation of decomposition into specific sub-types of tolerances defined in the ISO standard. For example, the orientation tolerance could be decomposed into the following sub-types: parallelism (TO1), perpendicularity (TO2) and angularity (TO3). Terminated symbol a2 also defines the continuation of tolerances decomposition into the specific forms/shapes. These forms are denoted as metrological characteristics (features). From the metrological aspect, one metrological feature is composed of one or more geometric features. Figure 4 shows a graph of an ontological structure (developed using Protege software), that presents rules for the decomposition in a general case. Figure 3. The graph of a knowledge base and its decomposition.    Figure 4. The rules for decomposition of a knowledge base graph, developed by using Protege software.    ACTA IMEKO | www.imeko.org  June 2015 | Volume 4 | Number 2 | 13  For example, the tolerance TL is composed of seven metrological features: TL1-1, TL1-2, TL1-3, TL1-4, TL1-5, TL1-6 and TL1-7. Further decomposition of each of them could be presented by five geometric features (GF100-points, GF200-lines, GF500-planes, GF600-cylinders and GF700- spheres). Initially, the geometric feature concept has been defined in analytical geometry. Based on this definition, it was later used in engineering modelling. In manufacturing engineering, the geometric features present a basis for the definition of certain aspects of a product design, process design, inspection design, etc. [24]. In our model, the geometric feature presents the lowest level of tolerances definition that refers to the generation of measuring probe points on the measuring part. The systematisation of geometric features is presented in Figure 5. Geometric features shown in Figure 5 present basic features used for the development and explanation of all types of metrological features. Each geometric feature is uniquely defined by the set of parameters with respect to the local coordinate system OXYZ (presented by the red colour in Figure 5) and the coordinate system of a measuring part ОXМYМZМ (presented by the black colour in Figure 5). These parameters could be: coordinates (X, Y, Z), diameter (D, D1), height (H, H1), width (a), length (b), vector of a primitive (n), parameter of the fullness of a feature (np=1 - full, np=-1 - empty). Vector n determines the orientation of primitives in a space. The position of a primitive is defined by the coordinates X0, Y0, Z0. The parameter of fullness is defined by the unit vector of the X-axis of a feature: the value of a parameter np=1 implies a full feature and the value np=-1 implies an empty feature. The parameter of fullness and the vector of a feature define the direction of a measuring probe access during the definition of metrological feature coordinates. The extraction of parameters of a geometric feature cylinder from the IGES file is based on the recognition of its structure. The part of a structure needed for the analysis in our model is presented in Table 1. An IGES file is composed of five sections in the following order: start section, global section, directory entry section, parameter data section, and terminate section, as shown in Figure 6. All geometric entities are given in the directory entry section and parameter data section. The extraction of parameters is performed based on the number of sequences of an entity (geometric feature), as in Table 2. Figure 5. The geometric features and their parameters (geometric primitives).    ACTA IMEKO | www.imeko.org  June 2015 | Volume 4 | Number 2 | 14  The extraction of parameters for the other geometric features could be conducted using the same procedure that was used for a cylinder. The primary objective is decomposition of a prismatic measuring part into metrological features (MF) that indirectly participate in the inspection planning. The secondary objective is decomposition of tolerances into geometric features (GF), and, from a metrological aspect, they give a full set of information to define a conceptual inspection plan. An application of the aforementioned concept of a knowledge base is performed on a real measuring part (a housing of the main spindle of a lathe), presented in Figure 7. According to the knowledge base model, tolerances of a part are reduced to geometric features, including all metrological features that are involved in part tolerances. The measuring part implies the following tolerances: tolerance of length (TL), tolerance of shape / form (TF), tolerance of orientation (TO) and tolerance of location (TLC). The length tolerance is composed of four length tolerances (TL1-61, TL1-62, TL1-63 and TL1-7) and five diameter tolerances (TL2-11, TL2-12 TL2-13 TL2-14 and TL2-15). Table 1. Extraction of IGES parameters of a cylinder.  Entity  1  1   2   3 5   6   7  73‐80 Line  (generatrix)  110  X1, Y1, Z1 (start point)  X2, Y2, Z2  (end point)  4 Seq. number  Line (axis)  110  X3, Y3, Z3 (start point)  X4, Y4, Z4  (end point)  5 Seq. number  Surface of  revolution  120  seq. no. 1,  seq. no. 2  α 1, α2  (start and  end angle)  3 Seq. number  Direction  123  i1, j1, k1  (unit vector)    18 Seq. number  Direction  123  i2, j2, k2  (unit vector)    28 Seq. number  Figure 6. IGES file of a cylinder geometric feature.  Table 2. Calculation of parameters.  Sequence number  Parameter of cylinder  4,5  D= ((X6‐X1) 2 +( Y6‐Y1) 2 +( Z6‐Z1) 2 ) 0.5 5  XO=X1,  YO=Y1,  ZO=Z1  5  H= ((X2‐X1) 2 +( Y2‐Y1) 2 +( Z2‐Z1) 2 ) 0.5 18  n= i1  j1  k1  Figure 7. The real measuring part.    ACTA IMEKO | www.imeko.org  June 2015 | Volume 4 | Number 2 | 15  The form tolerance is TF2-1, while the orientation tolerances are designated as TO2-11, TO2-12, TO2-13 TO2-14, TO2-15 and TO2-16. The location tolerance is marked as TLC1-4. Figure 8 shows the ontological hierarchy (class hierarchy, object property hierarchy and data property hierarchy), i.e. the decomposition of a prismatic measuring part into features. It was based on the general tolerance types as defined by the ISO standard. In this case, the tolerances are TL, TF, TO and TLC. These tolerance types are further decomposed into specific tolerances types that are also defined by the standard. It is necessary to follow this procedure in order to connect specific tolerance types with the real tolerances of real parts. The next step implies further decomposition into specific tolerance types presented in the technical drawing of the part. Metrological features are composed of a few geometric features, and present the relations between tolerance types and geometric features of the part. In other words, if we know that the technical drawing of the part is a real source of metrological information then the metrological features are introduced as a link between tolerances and the part geometry whose carrier is the digital model of the part (CAD model). CAD software allows us to input only one type of tolerance – the TL type. This shows that, in inspection planning, the CAD model of the part could be used only from the geometrical aspect. That is why software for CMM loads geometrical information from the IGES file. Inspection planning of prismatic parts on CMMs is usually performed with respect to three mutually orthogonal directions, depending on the number, position and orientation of measuring stylus in a measuring sensor. Figure 9. The direction of probe accessibility.  Figure 8. Decomposition of the real measuring part into metrological features.    ACTA IMEKO | www.imeko.org  June 2015 | Volume 4 | Number 2 | 16  This assumption serves as a basis for the development of a sequence of metrological features inspection for prismatic parts in our model. From the mentioned three directions, in general it is possible to derive six directions of a measuring probe access (DPA). Since a measuring part must be set up at the machine table, one direction of access is disregarded. Hence, there are five possible directions: DPA 1, DPA 2, DPA 3, DPA 4 and DPA 5, as presented in Figure 9. Each of these directions corresponds to some of the directions of the coordinate system of the CMM: DPA 1 = Z; DPA 2 =  X; DPA 3 = Y; DPA 4 = +X; and DPA 5 = +Y. At the level of a geometric feature, DPA is determined by parameters n and np. For the inspection of a primitive, the possible directions are DPA 1, DPA 2, DPA 3, DPA 4 and DPA 5. A special case is when the direction of a vector n does not match with DPA 1, DPA 2, DPA 3, DPA 4 and/or DPA 5. Then, the movement of a measuring probe should be decomposed into movements in two DPA’s: the first is the closest one from DPA 1, DPA 2, DPA 3, DPA 4 and DPA 5 (according to the minimal angle criteria) for the movement immediately beneath the primitive, and the second is n vector of the primitive. This approach automatically defines an inspection sequence for the measuring part. DPA 1,…, DPA 5 differ from the movement of machine axes. DPA defines the access to a feature, and machine axes accomplish acquisition of measuring points in the desired directions. Verification of this approach has been performed on a CMM, and results were reported in [26]. 3. CONCLUSION  The development and application of the uniform inspection plan for CMMs are important issues that depend on metrological complexity of a part and skills and knowledge of an engineer (inspection planner). The presented research shows a model of the knowledge base for CMM inspection planning that aims to offer a solution for the development of an intelligent system for inspection planning (ISAPI). The presented knowledge base is defined by entities and relationships among them. The result of this approach is a definition of relations between geometric features and certain types of tolerances that could be found by searching through the graph of a knowledge base model. By searching through the graph, the general tolerance types defined by the standard are linked to the geometric features in order to allow the definition of a metrological sequence and planning of a measuring probe path. Analysis of this method could be performed in respect to the STEP NC standard which contains information about tolerances and geometry. However, the existing CAD interfaces do not allow us to specify tolerances on the CAD model of a part. Therefore, it could be said that our model presents an efficient way to provide all necessary data for an automatic inspection, which is its main advantage. ACKNOWLEDGEMENT  The work presented in this paper has been performed within the technological development project TR 35022, supported by the Ministry of Education, Science and Technological Development of the Republic of Serbia. REFERENCES  [1] E. Westkämper, “Digital Manufacturing In The Global Era”, In Pedro F. Cunha and Paul G. Maropoulos (Eds.): Digital Enterprise Technology, Perspectives and Future Challenges, Springer, (2007), p. 3-14. [2] E. Westkämper, (2010): Factories of the Future beyond 2013 - A view from Research: The role of ICT. http://cordis.europa.eu/fp7/ict/micro-nanosystems/docs/fof- beyond-2013-workshop/westkaemper-manufuture_en.pdf (accessed July 2013) [3] http://www.steptools.com/library/stepnc/ (accessed December 2013) [4] R. Laguionie, M. Rauch, J.Y. Hascoet, S. H. Suh, “An eXtended manufacturing Integrated System for feature – based manufacturing with STEP-NC”, International Journal of Computer Integrated Manufacturing, 24 (2011), pp. 785–799. [5] http://ec.europa.eu/research/industrial_technologies/pdf/ppp- factories-of-the-future-strategic-multiannual-roadmap-info- day_en.pdf (accessed August 2013). [6] H.A. ElMaraghy, P.H. Gu, “Expert System for Inspection Planning”, Annals of the CIRP, 36 (1987), pp. 85–89. [7] C.W. Ziemian, D.J. Medeiros, “Automated feature accessibility for inspection on a coordinate measuring machine”, 35 (1997), pp. 2839–2856. [8] A. Limaiem, E.H. E1Maraghy, “A General Method for Analysing the Accessibility of Features Using Concentric Spherical Shells”, Int. J. Adv. Manuf. Technol., 13 (1997), pp. 101-108. [9] K. Takamasu, R. Furutani, S. Ozono, “Basic concept of feature- based metrology”, Measurement, 26 (1999), pp. 151–156. [10] G. Moroni, W. Polini, Q. Semeraro, “Knowledge based method for touch probe configuration in an automated inspection system”, Journal of Materials Processing Technology, 76 (1998), pp. 153–160 [11] F.S.Y. Wong, K.B. Chuah, P.K. Venuvinod, “Automated inspection process planning: Algorithmic inspection feature recognition, and inspection case representation for CBR”, Robotics and Computer-Integrated Manufacturing, 22 (2006), pp. 56–68. [12] Y.S.F. Wong, B.K. Chuah, K.P. Venuvinod, “Automated extraction of dimensional inspection features from part computer-aided design models”, International Journal of Production Research, 43 (2005), pp. 2377–2396. [13] A. Mohib, A. Azab, H. ElMaraghy, “Feature-based hybrid inspection planning: A mathematical programming approach”, Int. J. Computer Integrated Manufacturing, 22 (2009), pp. 13-29. [14] D.P. Stefano, F. Bianconi, D.L. Angelo, “An approach for feature semantics recognition in geometric models”, Computer- Aided Design, 36 (2004), pp. 993–1009. [15] X. Zhao, M.T. Pasupathy Kethara, G.R. Wilhelm, “Modeling and representation of geometric tolerances information in integrated measurement processes”, Computers in Industry, 57 (2006), pp. 319-330. [16] M. W. Cho, T. I. Seo, “Inspection Planning Strategy for the On- Machine Measurement Process Based on CAD/CAM/CAI Integration”, Int. J. Adv. Manuf. Technol., 19 (2002), pp. 607– 617. [17] T.R. Kramer, H. Huang, E. Messina, F.M. Proctor, H. Scott, “A feature-based inspection and machining system”, Computer- Aided Design, 33 (2001), pp. 653-669. [18] S.G. Zhang, A. Ajmal, J. Wootton, A. Chisholm, “A feature- based inspection process planning system for co-ordinate measuring machine (CMM)”, Journal of Materials Processing Technology, 107 (2000), pp. 111-118. [19] W.C. Myeong, L. Honghee, S.Y. Gil, C. Jinhwa, “A feature-based inspection planning system for coordinate measuring machines”, Int. J. Adv. Manuf. Technol., 26 (2005), pp. 1078–1087.   ACTA IMEKO | www.imeko.org  June 2015 | Volume 4 | Number 2 | 17  [20] S.M. Stojadinovic, V.D. Majstorovic, “Towards the development of feature – based ontology for inspection planning system on CMM”, Journal of Machine Engineering, 12 (2012), pp. 89-98. [21] Majstorović, V., “Inspection Planning on CMM Based Expert System”, Proceedings of 36th CIRP International Seminar on Manufacturing Systems, pp. 48 – 56, Saarbrucken, Germany. [22] S. Stojadinović, “Intelligent Concept For The Inspection Planning Of Prismatic Parts On Measuring Machines”, (PhD in progress). Mechanical Engineering Faculty, Belgrade, 2014. [23] V. Majstorović, P. Bojanić, V. Milačić, “Expert System for Inspection Planning on CMM”, The First World Congress on Intelligent Manufacturing Process & Systems, Proceedings, pp. 120-126, San Juan, 1995. [24] V. Majstorović, P. Bojanić, S. Vraneš, “Intelligent Environment for Product and Process Design”, Proceeding of 29th CIRP Conference “Manufacturing Systems”, pp.145-148, Osaka, 1997. [25] V. Majstorovic, T. Sibalija, M. Ercevic, B. Ercevic, “CAI model for prismatic parts in digital manufacturing”, Proceedings of DET 2014, The 8th International Conference on Digital Enterprise Technology, pp. 214-220, Stuttgart. [26] V. Majstorovic, T. Sibalija, B. Ercevic, M. Ercevic, “CAPP model for prismatic parts in digital manufacturing”, Proceedings of Digital Product and Process Development Systems - IFIP TC 5 International Conference, NEW PROLAMAT 2013, pp. 142- 148, Dresden.