1、An intelligent NC program processor for CNC system of machine toolYadong Liua,_, Xingui Guoa, Wei Lia, Kazuo Yamazakia,Keizo Kashiharab, Makoto FujishimabAbstract NC program interpreting is one of the most important tasks of CNC in machine tool system. The existing CNC systems only supportvendor-spe
2、cific NC program input, which restrict the applying of other similar functional NC programs with different program format.Especially for those users owning several machine tools with different CNC from the same provider, the diversity of NC programsdramatically increases their cost and time on opera
3、tor training and machine tool maintenance. In order to deal with the variety of NCprogram, an intelligent NC program processor (NCPP) is proposed in this paper. 1. IntroductionIn the CNC system of modern machine tool, NCprogram interpreting is very important, which is in charge of the accurate resol
4、ving of machining intention generated from CAM system. The major function of NCPP is to decode the input into motion command and programmable logiccontroller (PLC) command, and send them to the motion control processor (MCP) and PLC of CNC separately in order to control the movement of the cutting t
5、ool and auxiliary machine logic. Most CNC systems can handleonly one specific NC program format, while the diversity of NC programs always entangles the machine tool users,especially for those owning several machine tools with different CNC but from the same provider. 2. Interface of NC program proc
6、essorNCPP is one module of the CNC, which requires cooperation between different modules; therefore its quite necessary to clarify the interface before starting design. The purpose of NCPP is to translate the input NC program into machine instruction, such asmotion command, PLC command or simple par
7、ameter settings and error messages. NIST calls these outputs as Canonical Machining Functions.The canonical machining functions were devised with two objectives in mind:_ All the functionality of common 3- to 5-axis machining centers had to be covered by the functions; for any function a machining c
8、enter can perform, there has to be a way to tell it to do that function._ It must be possible to interpret RS274-compatible NC program into canonical machining function calls.3. Conceptual model of proposed NCPPCompared to the traditional design, the major feature of this NCPP is the structure with
9、separation of NCSD and processing engine.Within this NCPP, different NC program could be interpreted in terms of different NCSD, while the processing engine keeps the same. For example, suppose the inputNC program follows Fanuc specification, the engine will refer to the Fanuc NCSD to do interpretat
10、ion. Next time, if a NC program following Mitsubishi specification is given, the same engine will refer to the Mitsubishi NCSD to interpret it. For the two cases, it can be seen that each time only different NCSD is chosen, while the processing engine does not change. Such a solution provides dramat
11、ic flexibility and stability for the NCPP development, only one set of software code of the processing engine needs to be maintained. Even if there is an input NC program following a NC specification which is not available in the existing NCSDs, a new NCSD can be generated and added easily without r
12、ecompiling the source code of the processing engine.4. Design of proposed NCPPBased on the conceptual model of the proposed NCPP If looking inside the NCPP, the key portion is the interpreting (processing) engine mentioned before, from a compilers point of view, the engine can be divided into four s
13、teps in order to check and decode an input NC program.These four steps are:_ Lexical analysis, which checks the character-based error within a NC program._ Syntax analysis, which makes sure the logic relation within each block of NC program is correct._ Semantic analysis, which checks the inter-bloc
14、k logic correctness of a NC program._ Optimization and code generation, which decode block and generate the canonical machining functions.4.1. Lexical analysisThe major functionality of lexical analysis is to merge a sequence of characters from the input NC program intosequence of words, which is a
15、high-level representation unit,Meanwhile, in this step, all blank and comments within the program will be deleted. After lexical analysis, a symbol table with the same information but more systematic compared to the original character-based program will be built. During analysis, allcharacter-based
16、error will be checked, for example whether the unacceptable address letters has been used or not. In this paper, one dictionary has been designed in this step to store all the valid address letters.4.2. Syntax and semantic analysisSyntax analysis is to determine if a sequence of words within a block is syntactically correct, it is also called intra-block check. It includes the range checking of the data por