# Intelligent Air Cutting Monitoring System for Milling Process
## 2 Monitoring Method  
Understanding the air cutting of NC machining can help users reduce unnecessary time used air cutting during the machining, and improve the machining efficiency and machine utilization rate. In this research, the G code in the NC program is analyzed, and the change of machine spindle load current and the cutting vibration signal are measured to develop an intelligent air cutting monitoring module. The architecture of the air cutting monitoring system is shown in Figure 1. The Fanuc Open CNC (Computer Numeric Control) API was used to establish a two-way real-time information communication system with a CNC controller. The monitoring system was connected to the Fanuc controller via Ethernet and servbox to capture real-time processing information, such as machining status, spindle load, and current execution NC program for auxiliary diagnosis. To measure the cutting vibration, three single-axis vibration accelerometer sensors made by PCB Piezotronics (model 353B15 and data acquisition (DAQ) NI USB-4431) made by National Instruments Corp. were used. The vibration sensors were mounted on the vise with magnetic mount method to measure X-, Y-, and Z-axis vibration. The sampling rate of 10,240 Hz was set for experiment, and the 1024 data were collected every 0.1 s, then we calculated its root mean square (RMS). By using spindle load and vibration signal, the cutting state and no-cutting state are clear and easy to differentiate, so these two signals are used as the judgment basis. The spindle load and vibration of the machine idle condition are measured and used as the diagnosis threshold. Generally, the G code command for the cutting process is G01, G02, and G03. Another G00 code is mainly used for rapid moving position, and the time for this movement is called air cutting time. To better differentiate air cutting under individual cutting commands, the NC code is identified by using the regular expression method. When the machiningcondition is under one of three cutting NC codes, the judgment is performed to determine the entry of the cutting status and the current time of the computer is recorded. The spindle load is displayed on the control panel with the letter \"L 0%\", which represents the spindle load is 0%. For example, the spindle load current when idle is 0%, and this value is used as the initial value of the spindle load. When the spindle load current is greater than 0% during the machining process, it indicates that the cutting state and the current time are recorded. On the other hand, when the spindle load current changes back from the state of greater than 0% to 0%, it indicates the no-cutting state, and the current time is recorded for the subsequent processing time calculation usage. Since the original vibration signal fluctuates between positive and negative, it is difficult to see the characteristics directly. Therefore, the root mean square (rms) of the vibration signal is calculated and used to monitor the cutting vibration signals, so the cutting state can be differentiated clearly. After the rms processing, the machine idle rms vibration value is multiplied by the magnification and becomes greater than the maximum machine idle original vibration value to avoid system misjudgment. For example, if the machine idle original vibration value is in the range of 0.01 g to 0.02 g, the recommended magnification value is 2 or more. The air cutting diagnosis and time recording are as follows:  
1. Identification of G00, G01, G02, and G03. The real-time information acquisition module collects the current execution NC code block from the CNC controller. Then, Regular Expression method is used to identify the NC code and search the matching G code. For example, \"G01. [1,]\" means \"G01\" to identify G01, \".\" to identify a character, and \"[1,]\" to identify the number. Table 1 shows the regular expression characteristics used in this research. 2. Machining time calculation. The machining time of each NC machining section is obtained according to the time length of G code change.