DATA STRUCTURES IMPLEMENTATION OF THE PROTOCOL STEP-NC AT CNC MACHINES PROGRAMMING DATA STRUCTURES IMPLEMENTATION OF THE PROTOCOL STEP-NC AT CNC MACHINES PROGRAMMING

STEP-NC is being developed concurrently under two different subcommittees of ISO Technical Committee 184 (Industrial automation systems and integration), as two different standards - ISO 14649 ( Data model for computerized numerical controllers ) and ISO 10303-238 ( Application interpreted model for computer numeric controllers ). Both of them can be represented in 10303-21 [4]. The concept of STEP-NC use is simple. It enables a product model database to serve as direct input to a CNC machine tool. No separate files of tool paths. No G&M codes. No Standard STEP-NC (ISO 14649) presents a new model for data transmission between CAD/CAM systems and CNC machines. This standard eliminates the shortcomings of the standard G-code and provides new possibilities in their management. At the Department of Automation and Production Systems, Faculty of Mechanical Engineering, University of Zilina in the framework of the research activities was solved a project for the implementation options of STEP-NC format by programming of CNC machines. This paper presents the results of research solutions which focused mainly on the analysis of standard STEP-NC, a methodology on the model data according to the standard STEP-NC using the EXPRESS language as well as the creation of software for the transformation of STEP-NC data - „TERMINAL STEP NC“. The software has been verified in the transmission of STEP-NC data to a particular CNC machine control system. Transfer of STEP-NC data applications gives the possibility of verifying the implementation of the new standard in older types of CNC machines.


Introduction
Automation is now a key element of the production process and puts higher demands on the level of mechanization and control of production machines. Therefore, it has resulted in the continuous development of NC and CNC machines. At present, most of the CNC machines are programmed in a language standard ISO 6983 using G and M codes. This 30 years old standard can hardly today describe the high requirements for production of complex parts. Producers of CNC machines extend this standard using various additions and implementations thereby becoming this standard non-universal. Another disadvantage is the lack of portability of data, which prevents the full utilization of all new possibilities of CNC machines and CAD/CAM systems [1]. Therefore, at present, a new standard for transmitting data between CAD/CAM and CNC machine was developed, which eliminates the shortcomings of G-code and provides a new option in the control of CNC machines known as STEP-NC standard. It is the application of STEP methods (Standard for Exchange of Product model) for numerically controlled machines. Contrary to the G-code format, it provides a two-way flow of data between the CNC machine and the CAD/CAM system [2]. It is a new model for data transfer between CAD/CAM systems and CNC machines. The role of STEP-NC programming of CNC machines is the object-oriented way. STEP (ISO 10303) describes the data about the product for the mechanical parts. Its main advantage is that it allows using the normalized data in all areas of production [3].
Protocol STEP-NC (Standard for the Exchange of Product data compliant Numerical Control) is currently being developed as a revolutionary method of controlling and programming of CNC machines. On the basis of this method of controlling and programming opportunities exist for the removing of low-level control of machine tools and allow an open and adaptable architecture for a new generation of control CNC machines. In spite of the short history of the Protocol STEP-NC significant research activities has already been done at the international level.

STEP-NC structure
The concept of STEP-NC use is simple. It enables a product model database to serve as direct input to a CNC machine tool. No separate files of tool paths. No G&M codes. No Fig. 2 Structure of the STEP-NC data model [6] In the Header section, some general information and comments concerning the part program are included. These are, for example, filename, author, date and organization. The Data section is the main part of the program, containing all the information about manufacturing tasks and geometries. This section also includes a Project entity that is an explicit reference for the starting point of the manufacturing tasks. The Project entity contains a main Workplan that contains sequenced executable manufacturing tasks -Workingsteps [3].
Details of each Workingstep are given in two parts, Technology description and Geometry description. The Technology description contains a detailed and complete definition of all Workingsteps in a Workplan (Fig. 3).
This may include tool data (dimensions, tool type, conditions and usage of the tool), machine functions, machining strategies, other process data and a workpiece definition (surfaces, regions and features of the finished part). The Geometry description, which is of ISO 10303 data format, provides the geometrical information for workpieces, set-ups and manufacturing features. At the lowest level, the operations can also contain an explicit and postprocessors. This is a radically different approach to CNC programming [5]. Standard STEP-NC generates "workingsteps" which contain information about geometry, tool requirement, and feature definition. With this information, CNC machine tools can receive a file with STEP-NC data, know what it means, and proceed manufacturing the work piece without any more instruction. A comparison between programming with the use of G&M codes and STEP-NC using is described in Fig. 1. Effectively, STEP-NC defines a data input standard for CNC systems. As STEP-NC is an extension of STEP to handling NC processes, it strictly follows the STEP standard. Like other STEP applications, a STEP-NC file also conforms to ISO 10303-21. That is, the file contains two sections marked by the keywords Header and Data respectively (Fig. 2). to design and create two methodologies for the creation STEP-NC data model under the standard STEP-NC. The tools used for creating both STEP-NC data models were chosen solely on the platform of open source softwares, because nowadays developed softwares for the creation of the STEP-NC data are protected or unaffordable.

Fig. 4 General STEP-NC data model
The first method of creating the STEP-NC data consisted of modelling the scheme in CASE (Computer Aided Software Engineering) instrument. The first step was to find solution of appropriate software allowing to create in EXPRESS language the STEP NC data model and its graphical design. For the solution of the problem has been selected as the most preferred exact description of the tool-path if this is required by a CAM system or an NC controller.
Paper presents the results of research which was focused mainly on the analysis of standard STEP-NC, a methodology on the model data according to the standard STEP-NC using the EXPRESS language as well as the creation of software for the transformation of STEP-NC data -"TERMINAL STEP NC".

Methodology for the creation of STEP-NC data model
The basic principle of data model is an object-oriented view on programming using the product characteristics instead of the coding of individual sequences of motion axes and functions of tools [7]. Figure 4 shows a general data model which can be specified as a method or philosophy of standard STEP-NC. General data model includes data about geometry, data about production characteristics and data for the manufacturing process. The role of the project solution was to create a data model according to ISO 14649 for turning technology, the selected model was applied for two-axis turning. View of the fact that the Protocol -STEP (area of geometry) is currently already a commercial protocol, in solving of our project was the biggest accent placed on production process and product characteristics. Solving the problem allows  [8] using data was performed by direct programming in EXPRESS in which individual entities are in accordance with ISO 14649. The program was written in text form -code (Fig. 7).
This part describes the creation of simple partial scheme at the level of the first three layers ("Project", "Workplan", "Workpiece").Using a graphical interface EXPRESS-G this code can be presented in a graphical form, in the form of scheme (Fig.  8) [8]. The structure of the complex EXPRESS scheme consisted of partial EXPRESS schemes that were sequentially defined under layers and implemented in a comprehensive EXPRESS scheme.

Creation of "TERMINAL STEP-NC" software
Within research tasks the software program for the transformation of STEP-NC data TERMINAL STEP-NC was created. The software allows processing control STEP-NC program, and based on the proposed communication protocol, sends commands to the motion control lathe controller via the serial interface USB. For creation of software TERMINAL STEP-NC was used programming language Visual Basic 6.0. The proposed principle of processing the input file STEP-NC consists of five basic steps and is displayed in Fig. 9. Part -Decoding of STEP-NC data is formed by filtration of geometric parameters, by parameterization and by graphical verification [9]. Part -Communication is formed by synchronization and by data transmission.
ARGO UML software. The scheme was then transformed into the markup language XML which communicates with the editor of schemes. Editor of schemes added instances of entities (schema objects) with ISO14649. The last stage of this methodology was to generate the scheme to STEP Physical File (ISO 10303-21). The activity diagram includes sequence activities for the process of creation of scheme and its subsequent transformation and modification (Fig. 5).
Sequence of steps was divided into three parts; each part belonged to a separate section, they were in different activities. Flow of data first goes through section-plugin ArgoUML which creates XMI file destined to the XSL transformation or generates the code of language Express. Section of XSL transformations includes process that receives at its input the XMI file along with the file containing details of transformations. The output of this section is file in STEP-XML format, which is also the entrance to the section of Schemes editor, where are performed processes related with editing [8].
The scheme was created by entities "Workpiece, Material, Project" (Fig. 6). Each entity contains the individual attributes that correspond to the entities according to ISO 14649. Data types that is used for drawing of schemes by applied CASE tool -ArgoUML are not included in plugin in sufficient quantity as it is in the language EXPRESS that uses a large number of data types.
The second method of creating STEP-NC data was based on the Java editor which is complemented by a plugin for EXPRESS and EXPRESS-G. The method of creating the STEP-NC data model Fig. 8 Partial scheme in EXPRESS-G [8] Entry for the program is a text file STEP-NC which is processed by the program so that it can be sent by asynchronous transmission over serial line to the controller lathe Emco Unimat PC (Fig. 10). Software allows visual simulation data transfer. Work environment and the procedure for processing of STEP-NC are displayed in Fig. 11 [10].
TERMINAL STEP-NC was tested on STEP-NC program from Standard -ISO 14649. Verification of functionality, data transmission to the control unit Lathe -Emco Unimat PC is displayed in Fig. 12 [10].  [10] The first methodology is not difficult in terms of programming; the disadvantage is that the plugin was additionally installed in ArgoUML and does not support all data types. It is not possible to create a data model according to the STEP-NC in to its fullest extent. Data types, however, can be completed by use of existing or by creation of new plugin. The second method was implemented directly in a programming language EXPRESS. The advantage is that by using APIs interfaces of JSDA and plugins can be modelled the schema in its entirety of STEP-NC (ISO 14649). In solving it is necessary to have experience with EXPRESS language. The complex structure of the EXPRESS schema and also a partial schema cannot be in these solutions generated into the physical file STEP Part 21 because the interface API of JSDA does not contain a plugin that would enable the given generating. To create a plugin that would be able to carry out such an application is, however, practicable. The created software"TERMINAL STEP-NC" verifies the possibility of using ISO 14649 as a new model for data exchange between CAD / CAM systems and CNC machines and also verifies the possibility of implementing a new standard to the older types of CNC machines [13]. Presented software program "TERMINAL STEP-NC" can process components with the geometry composed of cylindrical and conical surfaces. Algorithm of software is open so it can be expanded in the future to process other types of surfaces and new features [11]. Communication protocol must be extended by the control unit. Standard STEP-NC allows building a complete database of machining information around it. The database, then, dictates what capabilities must exist in the machine tool controller to cut the part [12].

Conclusion
The solution of the project allows comparing two different methodologies for data modelling using STEP-NC protocol.