STEP-NC Architectures for Industrial Robotic Machining: Review, Implementation and Validation

,


I. INTRODUCTION
Industrial robots have been generally applied in tasks such as painting, packaging, welding, and pick-and-place operations. In the last few years they have been increasingly used to perform machining tasks as well. Compared with traditional machine tools, industrial robots provide significant advantages in terms of flexibility, cost-effectiveness, affordability, and larger work-space. Furthermore, robots can allow new machining strategies for highly complex parts since they have more degrees of freedom than conventional machine tools. However, one of the substantial limitations that hinder the widespread adoption of industrial robots is their low stiffness, The associate editor coordinating the review of this manuscript and approving it for publication was Ming Luo . mainly in machining with high material removal rates [1]- [4]. In this context, a significant amount of research on robotic machining has been done over the past decades, and a review of some of those works was presented in [3].
An additional problem related to the use of robots in machining is the difficulty to integrate robotic systems present in the factory's numerical chain, since most robots tend to use closed architecture controllers and proprietary programming languages. This problem has motivated industry leaders to implement more efficient and standardized programming methods towards production approaches such as smart manufacturing [5]. In this context, STEP-NC emerges as a new CNC programming standard that provides means to integrate robotic systems with the upstream systems of the numeric chain.
Ji and Wang [3] and Chen and Dong [2] reviewed many articles with applications in robotic machining. They identified the following research trends in the context of robotic machining: robotic machining dynamics, robotic machining configurations, tool path optimization, machining processes, machining quality, monitoring and compensation, calibration, STEP-NC standard, simulation, and energy efficiency.
First normalized as ISO 14649 [6] and after as ISO 10303-AP238 [7], STEP-NC provides a high-level objectoriented data model that extends the data models of the STEP ISO 10303 standard (STEP) to encompass NC process data. STEP-NC was developed due to the need of a new Computer Numerical Control (CNC) programming standard to replace the old G-code [8] and to enable information feedback from the manufacturing and inspection to upstream stages as product design and process planning [9]. The STEP-NC data models for milling and turning processes have already been developed as Application Reference Models (ARM) in ISO 14649 since 2004. These models were mapped to the ISO 10303 AP238 incorporating some modifications in a single Application Interpreted Model (AIM) to achieve integration with other resources of STEP [7]. Demonstrations of the integration of the CAD-CAM-Simulation-CNC chain provided by STEP-NC according to ISO 10303 AP238 are reported in [10]. Recently, the second edition of ISO 10303-238 has been announced with improvements that include new definitions for automated measurement, and new support for additive manufacturing, composite tape layup, and multi-robot drill and fill [11].
Xiao et al. [19] developed a so-called STEP-compliant Industrial Robot Data Model (IRDM), which is used for data exchange between CAx systems and robot off-line programming systems. Geometric and mathematical aspects of IRs were defined in IRDM, which can be used to represent kinematic and dynamic behaviors of the robots.
In this context, this paper contains additional contributions to the development of STEP-NC architectures applied to robotic machining. Six different STEP-NC architectures are analyzed, implemented and validated. Three of presented architectures are novel contributions, while the other three are extensions of previous works by the authors [14], [17], [18]. These architectures promote the dissemination and application of STEP-NC in robotic machining by using some commonly used commercial CAD/CAM software such as Mastercam, Siemens NX and PTC Creo.
The new software tools developed in this work are available on the web, and they include: 1) a module that generates virtual robot models for simulation in the STEP-NC Machine software; 2) an adapter software that can convert data in APT CL file format to STEP-NC in AP238; and 3) a software that works as a plug-in for LinuxCNC [20] allowing to convert a STEP-NC file to G-code, which can be executed on the industrial ASEA robot. Complying with the requirements of the Industry 4.0 context, related to Cloud Robotics and Data Analytic concepts [21].
The remainder of this paper is organized as follows. Section II contains a literature review on robot machining, including some STEP-NC-based architectures for robot machining. Section III describes the six proposed architectures for STEP-NC-based industrial robot machining. Section IV presents a case study for each architecture. Finally, section V contains the conclusion and suggestions for future research works.

II. PREVIOUS RELATED WORKS
A. STEP-NC-BASED CAD/CAM/CNC SYSTEMS The first prototype of the STEP-NC platform was developed in the European STEP-NC project Esprit [22]. A STEP-NC file was generated by a solution using Catia and Open Mind CAD software [23]. This file was then interpreted by an enhanced Siemens 840D controller.
A STEP-compliant interpreter, named Agent-Based Computer Aided Manufacture system (AB-CAM), was presented by Newman et al. [24]. Their system generated an ISO 14649 file, which was interpreted into G-code for machining. In other works reported by the Professor Newman's team, they proposed STEP-NC-compliant data models and different software tools for turning, wire electrical discharge machining, and inspection [25]- [27].
Other platform using interpreted STEP-NC was proposed by Suh et al. [28], [29]. The platform enables controlling the axes of milling and turning machine tools. However, that platform was not implemented in an industrial machine. Another solution of interpreted STEP-NC was developed by Xu [30], which allows the manufacture of parts without using G-code.
An implementation of STEP-NC on an industrial CNC controller was developed by Laguionie et al. [31] and Rauch et al. [23]. The platform enables indirect STEP-NC and can be implemented on many CNC controllers, using different commercial CAD/CAM systems. The platform was implemented and validated on a high speed machining machine tool, as well as a laser cladding machine [32].
Valilai and Houshmand [33] proposed a platform based on STEP data models for collaborative and interoperable product design and manufacture using different CAD/CAPP/CAM/CNC pieces of software. Their platform is comprised of different layers, which enable different pieces of software to work in an integrated manner using their internal data structures.
A prototype of a CAD/CAM/CNC platform based on ISO 14649 was developed by Xiao et al. [34], and it shows data flow between a STEP-compliant CAD/CAM system and a STEP-CNC system. VOLUME 8, 2020 Seeking to develop an open CNC for a five-axis high-speed milling machine, Bensoussan et al. [35] proposed a method to generate the tool path directly on the surface to be machined in order to avoid approximations, leading to a smoother tool path. Their method considers the kinematic limitations of a high-speed milling machine. The experimental validation of their method requires a machine equipped with an open CNC.
Álvares et al. [36] presented an architecture of a CNC compliant with STEP-NC [6] by means of an adapter that converts a program in the STEP-NC format to G-code. The STEP-NC controller is based on the open source LinuxCNC controller, which is compliant with the ISO 6983 standard (G-code) [8]. In order to validate the architecture, a machine tool was built, being controlled by LinuxCNC. The controller is integrated with the STEP part 21 data model (ISO 10303 standard) using an adapter that reads a STEP-NC file. The LinuxCNC controller runs the STEP-NC file seamlessly, and an example part was machined using the system.
Another CAD/CAM/CNC platform was presented by Zivanovic and Puzovic [37] and Živanović and Vasilić [38]. They used the commercial CAD/CAM software Creo for design, process planning and simulation, as well as the STEP-NC machine software [39] to generate an AP238 program.
Srivastava and Komma [40] pointed out that AIM (Application Interpreted Model) format of STEP-NC is more sustainable than ARM (Application Reference Model) format and can be used throughout the life cycle of product. The AIM format of STEP-NC evolved as being effective for numeric control and intelligent machining of products. Srivastava and Komma [40] also discussed the development for interface for STEP-NC (AIM) for tool path generation to machine the outer contour of a part having linear and circular profiles. The interface is implemented using Java Standard Data Access Interface (JSDAI) [41], and the generated codes are verified on STEP-NC Machine software from STEP Tools [39].
Ferreira et al. [42] presented a CAD/CAPP/CAM system compliant with the ISO 14649 standard for the design, process planning, and manufacture of parts having general shapes, which can be executed by anyone through the Internet, referred to as STEP Modeler. The parts are built with the use of features, which can contain general surfaces, enabling the user to design complex parts. The process planning method considers the possibility of using cutting tools with different diameters for removing different amounts of material. The physical STEP-NC file is generated automatically by the system, and it is used as input to the module that simulates graphically the tool paths for machining the part in a three-axis CNC machine.
A set of tools for manufacturing based on ISO 10303 AP238 was proposed in STEPTools [39]. The main module of the platform is called STEP-NC Machine, which can generate ISO 10303 AP238 files. It also contains modules for simulation, inspection, real-time optimization and product design.
Faraz et al. [43] developed a STEP-compliant design and manufacturing framework for discrete sheet metal bend parts, which uses STEP (ISO 10303), AP203, AP207, and AP219 along with STEP-NC (ISO14649) to provide a basis of vendor neutral data modeling with capability of bidirectional communication between design and manufacturing.
The availability of STEP-NC software plug-ins for CAM software can contribute to the dissemination of STEP-NC. A STEP-NC plug-in converts a STEP-NC file into the data structures of an existing CAM system. Currently, plug-ins are available for GibbsCAM and Mastercam. With these plug-ins a shop can receive a customer's STEP-NC files and manufacture parts on existing CNC equipment.

B. ROBOT PROGRAMMING
According to the ISO 8373-2 standard [44], a robot is an automatically controlled, multipurpose manipulator, programmable in three or more axes, which may be either stationary or mobile for use in industrial automation applications.
The insertion of industrial robots in the global industrial scenario in 2016 was the most important in the robotics history, resulting in the sale of more than 290,000 units during that year, an increase of 14% in comparison with 2015 [45]. The most important sectors regarding industrial robots use is the automotive, electrical/electronics and metal and machinery industry, amounting to 70% [45]. Industrial robots have increased their presence in manufacturing significantly, reaching a record number of about 100,000 units in the automotive industry in 2015 [46].
Xu [47] highlights the key role of industrial robots for manufacturing in the concept of Industry 4.0, due to their ability to contribute to agile, advanced and intelligent manufacturing.
Industrial robots have more flexibility in machining than conventional machine tools, due to the larger amount of degrees of freedom (DOF) in the mechanical structure of manipulators. High percentage of industrial robots are used for handling and welding, since these processes have lower precision when compared with machining. However, several works have been developed in order to analyse and reduce machining error using robots, besides improving robot machining performance [48].
The generated cutter location file (CL-file) [49] needs to be converted into a kinematics machine language, but industrial robots do not have a standard programming language. This contributes significantly to CAD/CAM scenarios not to support post-processing for robots [12], consequently not allowing single-platform machining programming methods.
Ríbeíro textitet al. [50] developed a robot software that can carry out robot programming as well as simulation like a 5-axis machining center or 3D printer. It can convert G-code or CL-file programs to robot programs for different robots. Also, the paths generated by their software avoid singularities, axis limits and collisions [50].
Alvares et al. [51] presented a comparative study of numerical controllers integration using LinuxCNC controller and MatLab/Mach3 in Windows solutions applied to a retrofitting process of an old industrial robot. The authors adopted different robot control platforms, and included robot kinematics. Their study considered performance in terms of computational cost, ease of implementation, integration with CAD/CAM, and usability, analyzing the advantages and disadvantages of each architecture. Finally, the most appropriate CNC was chosen, which was LinuxCNC.
Alvares et al. [20] presented a methodology that can be applied to CNC retrofitting of any industrial robot with serial or parallel kinematics, which guides the developer in steps associated with hardware and software specification for a desired robotic platform implementation as a custom solution based on the LinuxCNC system.
Zivanovic et al. [15] presented a methodology for programming, simulation, and execution of industrial robotic machining based on the STEP-NC ISO 10303-238 standard. The NC program, containing essentially machining tool paths, is generated by using commercial CAD/CAM software like PTC Creo, and then it is imported into the STEP-NC Machine software environment for simulation with the 3D kinematic model of the robot. STEP-NC Machine generates the STEP-NC AP238 robotic machining program in P21 format. They use a software module named RoboSTEP-NC, which converts the STEP-NC AP238 machining program to the robot's own programming language, whose control unit is based on the EMC2 software. In another work, Slavkovic et al. [16] applied a similar approach to generate and simulate STEP-NC AP238 machining programs for industrial robotic machining using a Mitsubishi Movemaster EX robot.

C. STEP-NC-BASED MANUFACTURING USING ROBOTS
According to Toquica et al. [17], the potential of CAD/CAM solutions available for off-line machining programming is not fully exploited because of the popular G-code, which enables the description of only elementary actions and cutting tool moves. This is a drawback in the context of Industry 4.0, which requires the presence of smart equipment at all levels of the production chain, ensuring the availability of high-level information from design to manufacturing.
Given this scenario, the STEP-NC standard provides opportunities for robot controllers to support high-level information, including design content [38]. STEP-NC can also be used to overcome programming limitations, as well as contribute to flexible and advanced manufacturing requirements of Industry 4.0 [47].
With regard to machining operations, machine tools have been used because of their higher stiffness and machining accuracy when compared with industrial robots [52]. However, according to Pan et al. [53], in an environment where product variety is high and life cycle is short, industrial robots can contribute to increase productivity and flexibility to meet these challenges.
In industrial robots applications such as part transfer and assembly, the paths are usually relatively simple [19].
However, machining operations are usually carried out along more complex tool paths [14], and its planning is normally difficult and time-consuming [53]. Thus, the development of robot off-line programming systems becomes necessary [54].
A unified manufacturing resource model was proposed by Vichare et al. [55] to provide the necessary information to specify various elements of a CNC machining system (including robotic arms), as well as support for automating decision making regarding process planning.
An open architecture of an intelligent CNC based on parameter-driven technology for multi-robot manipulation operations was presented by Song et al. [56], in which the CNC system was implemented in a H-beam machine for cutting steel.
Although these research works showed the importance of developing STEP or STEP-NC-based systems for manufacturing integration and execution, they did not provide some solutions for robotic machining.
Solvang et al. [12] implemented a STEP-NC-based CAM system for robot machining. The system reads the STEP-NC file and, then, it is parsed, translated, simulated in a virtual robot, and used by a real industrial robot, which did not perform machining. The system was developed in the DELMIA software environment.
Xiao et al. [19] proposed a STEP-compliant robot data model to exchange data between CAx systems and robot off-line programming systems. Their data model includes geometric and mathematic aspects of industrial robots. A robot off-line programming system with 3D virtual environment was presented in their work, but no real machining was carried out.
A STEP-NC-based method was proposed by Rea Minango and Ferreira [14] that uses forward and inverse kinematics procedures that can be applied to serial and hybrid robots, allowing the generation of robot paths for machining. Those paths were tested on virtual robots with different morphologies, and no real machining was performed.
Toquica et al. [17] and Toquica et al. [18] presented a high-level programming solution based on STEP-NC, using a CAD/CAM software for industrial robots machining. A complete platform has been developed to enable advanced and intelligent manufacturing with the possibility of integrating several modules for simulation, optimization, and visualization, as well as in-process manufacturing adaptation, cloud manufacturing, and machine learning with database analytics.
Given the above scenario, it is proposed to implement six architectures for STEP-NC-compliant industrial robot machining. STEP-NC was used because it has not machine or robot dependency, enabling the development of an intelligent and universal off-line programming solution. The ASEA IRB6 robot with 5 DOF was used in this work to validate STEP-NC-based architectures. This robot had its S2 controller updated, retrofitted and made compatible with the LinuxCNC Controller [20].

III. PROPOSED STEP-NC ARCHITECTURES FOR MACHINING USING INDUSTRIAL ROBOTS
This research is focused on implementing and validating different architectures to export STEP-NC files to be used in industrial robotic machining. These architectures use different software tools including some commercial CAD/CAM systems as well as new tools developed by authors. The functional model shown in Figure 1   Each architecture can generate STEP-NC files that are simulated in a digital scenario using a virtual model of the ASEA IRB6 industrial robot and, then, executed in a real (physical) ASEA IRB6 LinuxCNC robot with controller compatible with STEP-NC and G-code. STEP-NC Machine is used by all architectures, being presented as a simulation module, since it allows simulating STEP-NC files including the virtual model of the robot. Fig. 2 presents the STEP-NC digital thread for industrial robotics machining using the six proposed architectures. The data flow is presented along the digital value chain, starting with CAD/CAPP/CAM systems, CNC compatible with RS-274, ISO 14649, and AP238 standards, and finally the Asea virtual robot and Asea real robot that manufacture the example parts. A description of these architectures is given in the next sections.

A. ASEA VIRTUAL ROBOT MACHINING SIMULATION USING STEP-NC MACHINE
This section describes the ASEA robot configuration and simulation using a virtual model within the STEP-NC Machine environment. Virtual simulation is performed to verify and validate the STEP-NC file obtained from each architecture proposed in this work. The architectures present different alternatives for the implementation of the STEP-NC standard (ISO 14649 and ISO 10303 AP238), and the simulation scenario allows verifying the integrity of each program generated within each architecture. The simulation environment provided by the STEP-NC Machine shows how a virtual ASEA robot configuration behaves during a machining task with information extracted from a STEP-NC file.
Toquica et al. [17] presented a manual method for generating the ASEA robot virtual model. Their method has been automated in this work by means of a software for automatic generation of virtual models of robots and machine tools with serial or parallel kinematics. This tool was developed in order to allow the generation of the virtual model of any compatible machine in the STEP-NC Machine platform. A free version of this software is available on the URL: https://tinyurl.com/y5tmw59v. Figure 3 shows the data flow between the activities related to the configuration of STEP-NC Machine to use the ASEA robot as a machine tool in the simulation of machining parts. The diagram is composed of three functional blocks that describe the three main activities in this section. Block A51 in Figure 3 represents the activities to create an XML representation file for the ASEA IRB6-S2 robot, and this XML file is used to configure the virtual robot for simulation. Block A52 refers to the activities to prepare the machining simulation scenario. Block A53 contains the activities related to executing the simulation. The files used as system inputs include the virtual robot model in AP242 or AP214 formats, part model to be manufactured in AP238 STEP file format, and the cutting tool model. The portions of software used as mechanisms to enable simulation are: the development environment for Eclipse Java, JSDAI Application Programming Interface (API), ST-Viewer, and STEP-NC Machine. Outputs generated by the simulation are AP238 files enriched with alterations and parameter settings suitable for real manufacturing. It can also be exported as CNC compatible code for specific machine tools.
The simulation process begins with the generation of the virtual model: each robot component involved in the kinematic control is stored as an independent part. Each part is positioned individually in an assembly to build a functional kinematic arrangement of the robot, being necessary to define the position relationships and constraints. Finally, when the assembly is built, it is exported in STEP AP242 or AP214 formats. These two application protocols share the units of functionality necessary to describe models based on the definition. The virtual robot model needs the XML file to be used as a machine tool within the simulation scenario. The XML file contains the specific data on the kinematic chain of the robot. The STEP file with the virtual robot model contains the robot assembly information, which can be exported from any CAD software.
The program was developed to simplify the identification of labels associated with each component involved in the kinematic model of the robot. The creation of the XML file starts with processing of STEP file (AP-242 or AP-214) in order to extract useful information to configure the parameters of the kinematic model of the robot within the XML file. The program uses Express schemes provided by the STEP standard to identify the explicit hierarchical structures that represent the assemblies as well as the components and their relationships. JSDAI Application Programming Interface (API) is used to read and manipulate object-oriented data defined in these EXPRESS data models. Figure 4 presents a model with the reference paths followed in interpreting the requirements of the application used to generate the XML file. by means of these reference paths, the different integrated resources are explored and the attributes of the entities extracted, being presented briefly in the interface. Each element used in the ISO 10303 standard (STEP) has a specific reference route, which allows the creation of different applications for different purposes.
In the case at hand, the developed application extracts only the information about the assembly and its components, and presents the necessary attributes to create the XML file.
The reference paths that structure the assembly information are presented at the top of   ASEA robot is presented in the lower right part of Figure 4. It can be noticed that the label that identifies the component in the model file is finally part of the XML file.
An example of the process followed to generate the XML file is shown in Figure 5. In order to configure the different parameters correctly, it is necessary to identify the reference labels of each component in the kinematic chain within the STEP file of the robot model. Alternatively, the ST-Viewer software is used to assist this identification phase. ST-Viewer also presents the view of the virtual robot model, information of the reference paths useful to define precisely the geometry labels in the shape_eid attribute and the surface in the face_eid attribute of the XML file.
The positions of each rotational joint of the ASEA IRB6-S2 robot are also defined. In the file, five axes (a, b, c, d, e) are created and configured, which represent the robot's degrees of freedom. Figure 6 shows the result of the final configuration of the XML file, which enables virtual simulation within STEP-NC Machine.
With the XML file created and configured, it is stored next to the virtual model of the robot in the STEP-NC Machine installation folder together with the files of the available machine tools. The ASEA IRB 6-S2 robot is enabled to be used as a machine tool in the simulation. Figure 7 shows the scenario ready to run the simulation, and the programs generated by means of each architecture are verified.

B. ASEA ROBOT WITH LinuxCNC STEP-NC (ISO 14649) CONTROLLER
This section describes the architecture where two new functions are added into LinuxCNC controller: (a) run the STEP-NC file directly into the LinuxCNC controller, VOLUME 8, 2020 converting it to G-code automatically and transparently to the machine operator by means of the adapter described in the previous section; (b) visualize the STEP-NC file by means of an additional Graphical User Interface (GUI) to LinuxCNC.
In order to run the adapter in LinuxCNC, the startup configuration file ('.INI') between the machine and LinuxCNC should be modified, which corresponds to the GUI of the controller AXIS interface. AXIS is a GUI for LinuxCNC that displays both the G-code and the tool path, each in a different window.
In the INI file of the AXIS interface additional programs can be added by means of the [FILTER] section. These filters enable considering the file opened by the controller according to its needs. The filter can do tasks such as ensuring that the G-code file ends with a M2 or M30 command, or detecting if the input is a depth image, and generate the G-code to mill the shape defined by the image [51].
The method to implement a GUI that allows visualising the STEP-NC file is presented in Álvares et al. [36].
In order to add a new interface in AXIS, the Glade Interface Designer was used. Glade is an open source tool for visual GUI development, being independent of any programming language and does not generate source code, except an XML file. Using the widgets available in Glade, a GUI was created to visualise the STEP-NC file. Python was used, which works with Glade.
The file that belongs to the GUI of LinuxCNC can be recognised as ‚axis.tcl‚, and it is found in the controller‚s folder. Tcl is mainly used for rapid development of software applications and GUIs.
In order to add the GUI to visualise the STEP-NC file in the AXIS GUI, the ‚view‚ menu is chosen in order to add a new function. This function seeks to run the program in Python to visualise the STEP-NC file in that GUI. This is done by modifying the axis.tcl file. Figure 8 presents two windows: the ASEA virtual robot is shown on the right-hand side, whereas this menu is shown on the left-hand side containing the command that runs the program to display the STEP-NC file.
The STEP-NC controller is integrated with the STEP part 21 (ISO 10303 standard) data model using an adapter STEP-NC2GCode that reads a STEP-NC file generated by a software that models a 3D part via the internet using STEP Modeler [36]. The ASEA IRB6 LinuxCNC controller [20] runs the STEP-NC file transparently.
The implementation of the STEP-NC-compliant CNC is carried out in two stages: (a) implementation of the STEP-NC2GCode adapter; (b) adding the adapter to the LinuxCNC controller.
The architecture and the implementation of the adapter are presented in Alvares et al. [20], which shows the extraction of information from the STEP-NC file and the stages to generate the G-code from the extracted information.
The forward and inverse kinematics developed by the authors for the ASEA IRB6 industrial robot in the Linux-CNC controller is available in https://tinyurl.com/rqfmbbu. The STEP-NC2GCode adapter integrated with the ASEA IRB6 robot LinuxCNC controller developed by the authors is available in https://tinyurl.com/y592fk5y. Because LinuxCNC is an open source and highlycustomizable application for CNC, it can be used as a starting point in the development of an open architecture controller fully compatible with STEP-NC. This objective can be achieved by adding the necessary functionalities so that LinuxCNC can directly interpret STEP-NC AP238 machining programs.

C. STEP MODELER: CAD/CAPP/CAM/NC
The STEP Modeler software [42] is an integrated CAD/CAPP/CAM system that is used in this work. It generates the STEP-NC file (ISO 14649 p21 or p28 formats) for machining a part, which is input to the CNC controller. Figure 9 shows the application activities that comprise the STEP Modeler.
By means of the CAD module of the STEP Modeler system, the user can design feature-based parts, which may contain general surfaces (e.g. Bèzièr). The CAPP module generates the process plan, which is available as output in  a STEP-NC file. Finally, the CAM module is responsible for converting the STEP-NC file (ISO 14649) to G-code (ISO 6983), in order to perform the machining operations, which can be carried out with different cutting tools. Further details about the STEP Modeler system are given in [36], [42].

D. PTC CREO OR SIEMENS NX CAD/CAM WITH CLFile AND STEP-NC MACHINE
In this architecture, Siemens NX and PTC Creo CAD/CAM software [57] are used to perform CAM modeling and analysis of the part to be manufactured by means of robotic machining. Both pieces of software allow exporting the manufacturing data in a CL file containing Automatically Programmed Tool (APT) language instructions, which is a high-level computer programming language used sometimes to generate instructions for CNC machine tools [58]. The APT CL file generated by both platforms can be directly imported by the STEP-NC Machine software, which converts the APT data to a STEP-NC program, which can then be exported as AP238 in part 21 file format. The approach to initiate this architecture has been proposed by Toquica et al. [17]. Figure 10 shows the data flow between application activities that comprise this architecture. It starts with activity A11, where modeling of the machining operations to be applied to manufacture a part is carried out using PTC Creo software [57]. CAD 3D part is modeled within PTC Creo by using its solid project module. Once the 3D model is created, it can be directly transferred as a reference model to the manufacturing module included in the PTC Creo suite, where different types of machining operations can be created for producing the geometric features of the part.
Facing and roughing operations were defined for a first example part as shown in Fig. 11. Both operations have been created by choosing the milling mode of the Creo manufacturing module, and then selecting the facing and roughing operations.
For each operation, one or more reference geometries can be defined from 3D part model. In the example part, the two internal geometries are related to a single roughing operation, while the facing operation is applied to the upper rectangular face of the part (Fig. 11). The reference geometries are considered as material to be removed from the workpiece, which is defined as a bounding box that encompasses the overall rectangular geometry of the part. Cutting tool configuration and process parameters such as feed rate, spindle speed and depth of cut are defined for each operation when it is created.
Tool path verification is carried out by means of virtual simulation of the machining operations as a previous step to exporting the NC code as an APT CL file. PTC Creo allows simulating: (a) only tool trajectory, (b) three-dimensional material removal, or (c) virtual machining including the machine tool 3D kinematic model. Thus, it enables incorporating a virtual 3D model of the robot ensuring all the relationships and movement constraints among its kinematic components in order to carry out robot machining simulation within PTC Creo.
Machining data are then exported to an independent APT CL file that will eventually be post-processed into the STEP-NC Machine software.
In activity A12 of Fig. 10, Siemens NX is also proposed for CAM modeling of the part, which provides a set of capabilities to facilitate part modeling, tool design, NC programming, inspection, and simulation, in a single platform. The section corresponding to Siemens NX in Fig. 11 illustrates some of the steps taken to generate machining data for the same example part. Firstly, a 3D model in STEP file format is opened in the manufacturing module of Siemens NX. The STEP 3D model was generated using other CAD software. Then, the workpiece size is defined according to the part dimensions, and a part reference zero is assigned to one of the workpiece corners (Fig. 11).
The operations are defined similarly to PTC Creo, where one operation can be applied to one or more reference geometries. Figure 11 shows the two operations being applied to the example part, listed in the operation panel on the workpiece view. Cutting tool type, feeds and speeds, depth of cut, and cutting strategy are some of the settings associated with each operation. Then, NX generates automatically the tool paths, which can immediately be verified with simulation.
Simulation with the 3D robot model can also be carried out using Siemens NX. For this, a 3D model of the ASEA robot has been built as a machine tool by using the machine tool builder module available in NX. Basically, it consists of assembling the elements that compose the robot, taking into account the logical order in the kinematic joints that connect the elements. The setup conditions for part, blank, tool and fixture can also be configured using the kinematic 3D model. Finally, the built robot kinematic model is stored into NX native format in the machine library directory of Siemens NX to be eventually used in virtual simulation. This is very important to verify the machining program before execution or its post-processing, in addition to analyzing the setup conditions of both the part and the robot.
Siemens NX also allows exporting the machining program in an APT CL file format, which can be understood by the STEP-NC Machine software. Therefore, both APT CL files (generated by either PTC Creo or Siemens NX) are imported into STEP-NC Machine by means of the ''File'' tab, then ''Import'' and, finally, by choosing the option ''ProEngineer (APT)'' or ''UGS NX (APT)'' for Creo APT data and NX APT data, respectively. STEP-NC Machine can interpret the APT data produced by Creo and NX to eventually generate a STEP-NC file in part 21 format according to ISO 10303 AP238. This architecture provides the advantage of using two recognized commercial CAD/CAM pieces of software to generate machine tool independent machining program files in the APT standard that can be directly imported into STEP-NC Machine for robotic machining simulation including the robot kinematic model. For the implementations carried out in this architecture, PTC Creo version 5, Siemens NX version 12 and STEP-NC Machine version 11 were used.

E. MASTERCAM CAD/CAM WITH AP238 PLUG-IN FROM STEP TOOLS
STEP Tools developed and made available a package that contains Visual Studio C++ project files to build a STEP-NC software plug-in for Mastercam [59]. Such a plug-in allows exporting a machining program as STEP-NC directly from Mastercam.
Using this plug-in to generate AP238 STEP-NC data for robot machining with Mastercam is another architecture addressed in this work. Data flow and activities involved in this architecture are outlined in Fig. 12. In activity A31, building the C++ project into the Visual Studio.NET framework creates a DLL (Dynamic Link Library) called ''ap238export.dll'' on Mastercam Chooks directory. Then, the DLL is used as control in activity A33, in which input machining data produced by Mastercam in activity A32 is used to generate the AP238 STEP-NC file in part 21 format.  The architecture for a test part is illustrated in Fig. 13. It starts with modeling in Mastercam the 3D model of the part to be manufactured. The machining operations, the machine, part setup, cutting tool and process parameters are defined using the Mastercam tools. For the test part three machining operations were defined: one facing and two pocketing operations, all of them performed using a flat bottom end mill tool with 6 mm diameter. Then, Mastercam automatically generates optimized tool paths for each of these machining operations.
After the machining operations are modeled, tool path verification can be performed in Mastercam by means of its simulation module. Then, STEP-NC data are exported thanks to the plug-in software. In order to use the plug-in, the user needs to click the ''File'' tab in Mastercam and, then, type Alt + C. This action opens the Windows file explorer located in the Chooks folder, from which the DLL ''ap238export.dll'' must be selected. The plug-in uses the DLL ''stepnc.dll'' of STEP-NC Machine to generate the STEP-NC file.
An excerpt of the STEP-NC file generated for the test part is shown on the right side of Fig. 13. It should be noticed that this file contains only tool path data that can be visualized when opened in the STEP-NC Machine environment, which can be appended with additional information including workpiece and cutting tool shape 3D-model data. Furthermore, simulation of the resulting STEP-NC file is carried out by incorporating the ASEA IRB6-S2 robot kinematic three-dimensional model into STEP-NC Machine. The robot machining simulation is described in more detail in section III-A. This architecture contributes to encouraging the adoption of STEP-NC by means of its implementation on commercial CAD/CAM software such as Mastercam. However, a limitation of this architecture is that the available version of the STEP Tools project that builds the plug-in is compatible only with the Mastercam X8 SDK version, making it difficult to use it with earlier or newer versions. In this work, Mastercam X8 version, STEP-NC Machine 11 DLL, and Visual Studio 2013 were used. This architecture is proposed to generate a STEP-NC program from the manufacturing information modeled in Mastercam. The functional model of the architecture comprises the three sub-activities shown in Fig 14. The architecture translates Mastercam machining data contained in a *.nci file to APT CLF data and, then, from APT to STEP-NC. The workpiece model and machining operations in activity A41 are created using Mastercam. Besides, part setup, cutting tool, and process parameters are defined as per the available CNC machine characteristics. This information is condensed into a *.nci file type, which is primarily a Mastercam tool path file.
This file is input to activity A42, which converts it into APT data in a CL file by using the NCI2APT software from ICAM Technologies corporation. NCI2APT software is used because the current Mastercam versions do not directly generate an APT CL file. Subsequently, in activity A43, the developed adapter is used to parse the APT data to generate a STEP-NC file either in part 21 or Part 28 formats.
The APT2STEP-NC adapter was developed in C , which uses the DLL ''stepnc.dll'' from STEP-NC Machine to generate the STEP-NC data as ISO 10303 AP238. A snapshot of the adapter software is shown in Fig. 15. The APT data can be loaded into the adapter by means of the ''File'' tab, and then ''Import''. Several import options are provided to use APT data from PTC Creo, Siemens NX and Mastercam software.
Selection of the ''Mastercam APT'' option loads the APT CL file previously generated by means of the ICAM software, using the machining data built in Mastercam (NCI2APT converts Mastercam *.nci files into ISO 4343 Standard APT CL files). The APT data lines are displayed immediately in the text panel on the left-hand side of the APT2STEP-NC adapter software (Fig. 15). Then, the STEP-NC file is generated by clicking the button ''To STEP-NC'', and the STEP-NC machining data will be displayed in the text panel on the right-hand side of the adapter interface, as shown in Fig. 15.
In the Mastercam APT CL file, machining information is grouped into sections called ''Machine Group'', in which several Machine Groups can coexist within the same file. The machining data associated with each machining operation belonging to the same Machine Group can be distinguished. The APT2STEP-NC software contains a class library from which instances are generated for each of the APT data entities in the APT CL file. Thus, instances of the Machine-Group class are created and stored in a list keeping the same sequence as in the APT file.
A machine group is composed of a list of instances of the ToolpathGroup class, which represents the machining operations associated with that machine group. Similarly, a tool path group comprises a list of instances of the Machin-ingData class, which is an abstract class that can take the form of APT instructions such as GOTO, RAPID, CIRCLE, FEDRAT, SPINDL, etc. represented by a C# class from the APT2STEP-NC APT library.
The STEP-NC machining program is generated by means of methods provided by the STEPNCLib class library from the STEP-NC Machine DLL. APT data entities are mapped into STEP-NC data entities. For example, machine groups are treated as nested Workplans within the main Workplan of a STEP-NC project, which can be created by using the NestWorkplan function.
Tool path groups are mapped as Workingsteps belonging to the current Workplan, being generated by means of the Workingstep function. On the other hand, machining data of a tool path group representing basic APT instructions such as GOTO, RAPID, CIRCLE, FEDRAT, SPINDL, CUTTER, LOADTOOL, COOLNT and MUL-TAX are directly mapped as its equivalent method from the AptStepMaker class: GoToXYZ, Rapid, ArcXYPlane, Feedrate, SpindleSpeed, DefineTool, LoadTool, Coolant and MultaxOn/Off, respectively. Then, the STEP-NC machining program can be generated either in part 21 or 28 format by using one of the SaveAsP21 or SaveFastAsModules functions. A version of the source code of the APT2STEP-NC adapter software is available in the URL https://github.com/StepNcLadprer/apt2stepnc.
Siemens NX and PTC Creo work with ISO 4343 Standard and APT CL data structure, and can export CL data files directly without the need of complementary software, as in the case of MasterCam, and using the adapter to generate STEP AP238 files. Unlike the architecture presented in the previous section, this architecture has the advantage of using any version of software such as Mastercam.   Although STEP-NC Machine software has support to open some APT programs exported from PCT Creo or Siemens NX, these functionalities have also been added to the APT2STEP-NC adapter software. Unlike STEP-NC Machine, APT2STEP-NC software is an open-source software available for use by anyone. Moreover, older versions of the STEP-NC Machine software do not support some of the APT machining programs generated by newer versions of PTC Creo and Siemens NX, which are supported by APT2STEP-NC.
Finally, the STEP-NC AP238 file generated by the APT2STEP-NC adapter can be used in the STEP-NC Machine simulation scenario, allowing both simulating robotic machining and exporting the machining program in G-code, compatible with the ASEA IRB6 robot LinuxCNC controller for the real robotic machining.

IV. VALIDATION OF THE ARCHITECTURES BY MEANS OF CASE STUDIES
This section presents the validation and implementation results of the introduced architectures by means of case studies, including the simulation of robotic machining using LinuxCNC and ASEA robot as a real manufacturing scenario. The integration of LinuxCNC for robot control includes the Open Architecture Controllers (OAC) concept to the STEP-NC standard [17], [18], [32], contributing with Open STEP-NC solutions for industry and academics developments.
Aiming to highlight the contribution of this work related to the implementation and validation stages of the six presented architectures, the main characteristics of each one were centralized and the comparison between proposed parameters is detailed in the Table 1, summarizing the proposed correlation between the six introduced architectures. Second column (CAD/CAM System) describes the CAx compliant platform used in this work, while third and fourth columns relate to the standard file used for tool path programming in NC machining process.
Procedures for manufacturing four different example parts using the six architectures (Table 1) are presented below, including the validation on a real industrial robot. In this case, the LinuxCNC controller receives the four NC programs  (G-code) independently in order to generate the Asea robot movements.
Each NC program file was exported to the LinuxCNC simulator, ensuring the compatibility of the NC program generated by STEP-NC Machine with the RS274/NGC interpreter. In Fig. 16 the NC programs are simulated in the Lin-uxCNC controller simulator, associated with the four parts. HAL layer is an important middleware application developed in Python into LinuxCNC controller, responsible for simulating and processing input/outputs signals (HAL pins) in the machining process [18], [20].
After verifying the machining simulation, the four parts were effectively machined using the Asea robot. The end-effector was a Makita 3709 trimmer, whereas the material used to machine the parts was paraffin wax blocks, which reduces the effects of cutting forces on the robot structure [60] in comparison with harder materials.   17 shows the machining of the four parts using the ASEA robot and LinuxCNC controller, and the Workingsteps in each machined part are shown in Fig. 18. It should be pointed out that the workpieces used in the experiments had the same dimensions, all of them being larger than the original CAD dimensions.
The the CAD/CAM systems generated circular tool strategies for machining the holes and pockets in the example parts, and this resulted in significant geometrical and dimensional errors in the parts machined with the ASEA robot. However, the objective was to validate the manufacture of parts using a real robot with a STEP-NC-compliant controller, and this validation was achieved.

V. CONCLUSION
In order to contribute to the use of the STEP-NC standard in industrial robotic machining, some STEP-NC-compliant architectures were implemented and validated in this work. Each architecture is capable of generating a STEP-NC file, which is first simulated in a virtual environment and, then, the program is executed in a real physical ASEA IRB6-S2 robot with LinuxCNC controller compatible with STEP-NC and G-code. Different parts were modeled and machined.
The first proposed architecture allows generating virtual models of any robot to be simulated in the STEP-NC Machine software by reading assembly model data from a STEP (AP-203, AP-214, AP-242) file. This tool was used to generate the virtual model of the ASEA robot.
A new plug-in software for LinuxCNC was also developed, which enables reading a ISO 14649 STEP-NC file directly in the LinuxCNC environment and, then, translate it to G-code, which is read by the ASEA robot controller.
The STEP modeler software, presented in the third architecture, enables integrating CAD, CAPP, CAM, and CNC. It exports ISO 14649 STEP-NC files either as P21 or P28 formats.
The fourth architecture uses PTC Creo and Siemens NX software to generate a machine tool-independent machining program in APT CL file that can be directly imported and processed in the STEP-NC Machine software to create the STEP-NC data used for robotic machining. This architecture enables changing rapidly from native manufacturing data produced in the CAD/CAM platform to neutral STEP-NC data generated by STEP-NC Machine having APT data as intermediate.
The number of steps required to generate a STEP-NC file in the fifth architecture is significantly reduced because the manufacturing data modeled in Mastercam are written directly as AP238 STEP-NC in part 21 format. Thus, most Mastercam users are closer to implementing STEP-NC on their machine tools and industrial robots. However, in this architecture the plug-in functionality is compatible only with the Mastercam SDK version 8.
On the other hand, the sixth architecture provides the advantage of being implemented for any Mastercam version, which expands the possibilities for STEP-NC applications in industrial robotic machining with currently available commercial software.
By means of the application protocols of the STEP-NC standard, solutions and implementations can be generated based on a neutral, standardized, and open file that allows new functionalities to be included within the digital manufacturing chain. In the simulation of the architectures using STEP-NC Machine, it was necessary to have access to information about the kinematic chain of the ASEA robot, which was extracted from the STEP file containing the robot model. This article presents the method used to read, write, and modify STEP files, being a useful solution for developing future manufacturing functionalities.
A limitation to all presented architectures is the current lack of industrial robot controllers capable of interpreting a STEP-NC machining program directly. This will require significant effort in the future to develop open architecture controllers capable of processing STEP-NC programs effectively.
Future research will be focused on building an industrial robot controller based on the OAC concept, which could download from the Internet and execute programs in the STEP-NC AP238 format without third-party applications.