Computer Recognition of Machining Codes for NC Machining Simulators

NC machining is one of the most effective production links in the CIMS environment. It can ensure that the product achieves high processing accuracy and stable processing quality, high production efficiency, short preparation cycle, and can greatly save special process equipment and products. Fast update requirements. In the CIMS environment, different simulators are required to simulate related problems for different manufacturing process requirements. For example, for the functional, machinability, assembly, etc., CNC machining process simulation system is one of these simulators. With the development of numerical control technology, computer simulation and modeling technology, the cutting simulation system can be used to verify the tool path and predict the machining shape of the design parts. It has become an important tool for numerical data verification. In recent years, in order to meet the requirements of design, manufacturing integration and overall improvement of processing quality and production efficiency of multi-variety and small-batch products, we urgently need a more powerful cutting simulation system. It is not only a simple tool path verification system. In addition to the functions of geometric simulation, the system should also have the ability to analyze and predict physical process parameters such as cutting forces, cutting errors, and tool fatigue and the resulting product quality problems. , making it an effective tool for analysis and evaluation of cutting performance. Strictly speaking, the existing numerical simulation system still belongs to a geometric simulation verification system, and more often it uses the tool position data as the simulation code to simulate the motion. The use of numerical control processing information carrier - NC program direct drive simulation system, due to taking into account the processing environment and processing conditions and other factors, with the actual production and processing closer, very suitable for accurate, fully functional NC machining simulation. Therefore, the numerical control code is analyzed and processed reasonably and effectively, which makes it an acceptable data for controlling the moving parts of the simulation system. It is a key issue for establishing a manufacturing unit simulation system that integrates processing parameter prediction and product quality analysis in the CIMS environment. First, the numerical control code and its characteristics In the numerical control processing, the parts processing program is composed of the program segment, each program segment consists of a number of data words; the word is the specific instruction of the control system, it is represented by the address of the English letters, Special text and numbers are assembled. The block format refers to the writing rules of words, characters, and data in a block. Usually there are the following three formats: The block format using a delimiter, which is generally used for a numerical control system with a small number of functions. This format program is not intuitive and error prone. The fixed block format, which is long and unintuitive, is rarely used at present. Word-address block format. The format consists of a statement number word, a data word, and a block end marker. There is an address before each word. The order of the words is not strictly required. The number of bits of the data may be more or less. The unnecessary words and the same consecutive words as the previous block may not be written. The advantage is that the program is short, intuitive and easy to verify and modify. Therefore, the format is widely used at present. The word-address block format is as follows: N G X Y Z ... F S T M ; There are many kinds of numerical control systems at present, but some well-performed ones have already formed their own set of numerical control codes before the introduction of international standards. Although most of them are based on ISO and EIA standards, they are generally expanded, making the code of each system vary widely. In order to make the simulation system adapt to a variety of numerical control systems, and can truly reflect the actual processing environment and processing status, high requirements are put forward for computer identification and analysis methods, capabilities, and accuracy of the numerical control code. After comprehensive analysis of the NC code of each system, it is found that although there are functional differences in some codes, they all have the following common features: 1) The NC program segment is a typical context-free grammar, ie the grammar unit can be completely independent of Its possible environment. 2) The NC code syntax rules are simple and the number is small. Based on the above analysis and numerical control simulation purposes, we only need to search for motion and state information related to the moving parts of the simulation system in numerous numerical control codes, and for motion and state information that cannot be reflected in the simulation system. There is no need to analyze them in an astonishing way, as long as computers can recognize them and perform lexical tests. Second, computer processing code identification and analysis to achieve the overall structure

Fig. 1 Flow chart of preprocessing control method This paper takes Windows98 as the platform, Visual C++5 as the development environment, and the requirements of the simulation system on the machining status, simulation accuracy and the real-time continuity of the simulation, and comprehensively considers the huge CNC code of complex surface products. As a result of the buffer capacity requirement, we use the multitasking, multi-threaded programming and CPU time-sharing features of the Win32 API to adopt a pre-processing control flow to solve the problem of computer identification and analysis of numerical control codes. The overall structure is shown in Figure 1. The preprocessing task is responsible for the scanning and lexical and grammatical recognition of the part program, and the result is put into the buffer area; the interpreting task completes the extraction and analysis of the buffer area data, thereby forming a simulation driver file. This method combines the advantages of process interpretation and compilation control methods to ensure the timeliness and efficiency of the simulation. The preprocessing module preprocessing module first applies the one-way linked list structure to the input numerical control program to organize and manage, and utilizes each node of the linked list to correspond to a program segment. The structure of the one-way linked list is as follows: typedef Struct File-text{ char *text; Struct File-text *next;} File-text; Then the program segment stored in each node of the one-way linked list is processed to eliminate unnecessary The comment and carriage return form a standard block containing only function code words. Then according to the address character into the corresponding lexical, grammatical discrimination test processing branch in the lexical analysis, NC program are written according to the standard program segment, first by the identifier type record the expression string behind it, and then by each assignment method for analysis Grammar analysis is the grouping of the representations produced by lexical analysis, the formation of grammar phrases and the completion of grammar synthesis. After the preprocessing of the input program, if there is a lexical and grammatical error, the error code position and the nature of the error are recorded in the error information file to be corrected. The program to be corrected will be saved in the final level. Interpretation module

Figure 2 Explain the block diagram of the module The interpretation module is responsible for extracting relevant command actions and status information, and dividing the motion data into time segments according to the displacement and velocity changes, thereby simulating the movement of the system chess game. The overall structure of the module is shown in Figure 2. Shown: Through the analysis of the data structure that already exists in the buffer area, the simulation-related actions and status information are extracted. The G code is the most important code in the numerical control code. It almost controls all the functions and important settings of the CNC machine tool and must be processed reasonably and effectively. From many G codes, we found that only the following codes are related to the simulation: G00 point control; G01 linear interpolation; G02/G03 arc interpolation; G17/G18/G19 coordinate plane setting; G40/G41/G42 radius Compensation; G90/G91 sets absolute or relative coordinates. For this reason, we will ignore other G codes and only analyze the above G codes in the study of this paper. In order to enable the NC simulation system not only to figure out the actual material geometry removal process, but also to reflect the physical characteristics of the processing process, making it a functional system for optimizing the processing parameters and forecasting the processing quality. Codes such as M code, T code, F code and S code for further analysis. For most CNC systems, the M03/M04 code represents the rotation direction of the spindle. The F code, also called the feed function word, usually specifies the speed in terms of the feed distance per minute. The S code defines the rotation speed of the spindle. Treating these three codes as one branch and integrating them with the G code information can yield the precise position and attitude of the tool at any time. The T code, ie, the tool selection code, can enter the tool library of the simulation system according to the number behind the address code T, and can return the relevant tool geometry and physical information, such as the tool type, model number, geometric expression of the cutting edge and tool material Characteristics and so on. After the above processing, we can obtain the geometric information of the positions, postures and cutting edges of the tools required for the precise physical simulation of the numerical control process. This information is represented by the following data structure: typedef struct Random-data{ float m-code; float f-code; float s-code; float g-code; struct tool-data{ float center-x; float center-y; Float center-z; int *tool-type; }tool-data; struct Random-data*prior; struct Random-data*next; }random-data; Here's something to note: The above code is all modal instructions, ie This field is valid until it encounters the same character instruction again, the original instruction value will be invalid. In the research of this paper, we adopt the search strategy from the back to the front of the data structure. After the initial value is judged, we can get the modal instruction state of each program segment. This method is very easy to implement. III. Conclusion With the continuous development of CIMS and virtual manufacturing, the numerical control machining simulation system as a manufacturing unit has played an increasingly important role. In order to establish a simulation system that can reflect the actual processing process, we must first accurately identify and analyze the NC machining code and convert it into the drive data of the simulation system. On the basis of analyzing the characteristics of numerical control code, this paper proposes a preprocessing control method that is convenient for computer processing and analysis. This method has been successfully applied to the complex surface numerical control machining simulation system based on quality prediction and analysis developed by the author.

1000W Upgraded Electric Chopper Bike

1000W Upgraded Electric Chopper Bike,20Inch Offroad 1000W Electric Bicycle,1000W Chopper Bike For Sports,Bullet Chopper Bike For Adults

Changzhou Smilo Motors Co.,Ltd , https://www.smilomotors.com