Eventos Anais de eventos
COBEM 2021
26th International Congress of Mechanical Engineering
TRANSPILATION FROM NC FILES TO CANONICAL MACHINING FUNCTIONS
Submission Author:
Francisco Ricardo Taborda Aguiar , PR
Co-Authors:
Francisco Ricardo Taborda Aguiar, Dalberto Dias da Costa
Presenter: Francisco Ricardo Taborda Aguiar
doi://10.26678/ABCM.COBEM2021.COB2021-0441
Abstract
The NC file provides the commands for the spindle movements and other events during the machining into CNC machines. But extracting information from the NC file requires a standard format. The NC programming is based on a standard called RS274D which was adopted by ISO and named ISO6893. The CNC manufacturers have extended this NC language by including new commands or changing the syntax of some existent commands to adapt them with their customized functions. The differences in the syntax make it difficult to extract data from the NC file. The present paper proposes an algorithm for interpreting the NC file and transpiling it to Canonical Machining Functions, which is a neutral format to represent the NC data. Also, from the Canonical Machining Functions file is possible to calculate the path, the speeds, the feeds, the tool changes, and the timestamp for these events during the NC file processing. The designed algorithm works like a compiler in computer science. A compiler translates a high-level language into another low-level language. The proposed parser, in turn, translates an NC file into Canonical Machining Functions. The algorithm is based on a two steps flow, like a pipeline. The first step consists of lexical analysis. It splits the NC file into tokens using regular expressions. The second step consists of a semantical analysis. It parses the tokens using grammar rules and recognizes the sentences to generate the Canonical Machining Functions. A prototype has been built to parse NC files created for a specific machine. The regular expressions and the grammar were created based on the CNC programming manual provided by the manufacturer. The algorithm was able to successfully recognizes the G-codes and translates them to Canonical Machining Functions. This approach can solve the lack of interoperability between different NC systems. By adjusting the regular expressions and the grammar rules it is possible to transpile from different input formats and generate the same target format, i.e. Canonical Machining Functions. For future work, a parser can be built for interpreting the Canonical Machining Functions file and extracting information from it.
Keywords
RS724D, ISO6893, GCODE, TRANSPILING

