An extensible NC program interpreter for open CNC systems

作者:Wang, Weixin*; Zhou, Kai
来源:International Journal of Advanced Manufacturing Technology, 2018, 94(1-4): 911-923.
DOI:10.1007/s00170-017-0974-x

摘要

The NC program interpreter plays an important role in CNC systems. It checks for errors and translates NC programs into commands that can be executed by the CNC control module. NC program specifications differ a lot among different CNC manufacturers. However, the existing NC program interpreters only support one specific program format, which increases the programming difficulty and enterprise cost. Meanwhile, due to the closed interpreter structure, it is difficult to develop and implement new CNC function instructions, which limits the openness of CNC systems. In order to solve these problems, this paper presented a novel analysis of NC language's grammar, and designed a set of hierarchical and modular Extend Backus-Naur Form (EBNF) expressions to describe NC language. An extensible interpreter based on EBNF was proposed. Through interaction with users to add new instructions, the system can utilize lexical analyzer (Lex) and yet another compiler compiler (Yacc) to generate a new matching interpreter. This method can also help users to produce a matching interpreter for a specific NC program specification. A prototype interpreter was developed successfully, the validity of which was verified by tests.