Abstract
Manufacturing environment is always changing due to unexpected reasons, including urgent job insertion, unavailability of machine tools, and changes of production planning, which has imposed significant challenges for numerical control programming, as numerical control programs are always not available any more for changed manufacturing resources. Traditional numerical control programming mode cannot adapt to the new manufacturing environment, and this problem becomes especially pressing for large manufacturing enterprises with production characteristics of small batches and large varieties. In order to address this issue, a feature-based adaptive numerical control programming method for changing manufacturing environment is proposed. A framework including preprocess module and postprocess module is constructed, and the flexibility of the numerical control program is realized through the function separation of the two modules. A feature-based information model including geometric and process information is established for flexible numerical control program generation when manufacturing resources are changed. About 75% numerical control programming work which is manufacturing resource free is done by preprocess module, and the rest is done by postprocess module for changing manufacturing environment. The implementation of the prototype system for the numerical control programming of a typical aircraft structural part shows the feasibility of the proposed method.
Keywords
Introduction
As the functions of the numerical control (NC) machine tools have become more and more advanced, such as multi-axis control, adaptive control, and error compensation, 1 NC machining has been the most important and popular machining method. Contemporary NC machining is faced with intense global competition; under the demand on high productivity and product quality, large-variety customized production and increasing attention being paid to shorten product lead time.2–4 NC programs are one of the final results of process planning, which is critical in machining process as it is the bridge for information exchange between computer-aided manufacturing (CAM) system and computerized numerical control (CNC) system, and CNC systems acquire accurate machining intention by interpreting NC codes generated by CAM system. NC programs play a critical role for machining efficiency and quality.
At present, NC programs are generated for specific machine tools, and they cannot be transferred to other machine tools at most of the time. Nevertheless, the manufacturing environment is changing in actual manufacturing process. There are many changes during production process, for example, urgent job insertion, job delay, broken tools, unavailability of machines, and changes of production planning,5,6 especially in the large enterprises with many machine tools, it always occurs. In this case, another machine tool has to be chosen to replace the original machine tool so as to continue the manufacturing process.
The problem for the situation mentioned above is that due to different machining performance, machine tools are of different levels and have different requirements for NC programs, and the spindle speed, feedrate, cutting width, and cutting depth of the current NC programs may no longer be suitable to the new machine tool because they are key impact factors for NC program generation. In this regard, the flexibility of NC programs is very important.
Generally, there are two ways to solve the above problems in real-life production. The first one is that the machining parameters are selected very conservatively at NC programming stage so as to keep suitable for most of the machine tools. The shortcoming of this method is that the machining parameters dramatically decrease machining efficiency for high-performance machine tools, so it is a waste of manufacturing resource, especially for the machine tools with high machining performance. The other way is redoing NC programs when the machine tool is changed, and the machining parameters of the machining operations are reset according to the new machine tool and then new NC programs are generated corresponding to new machining parameters. It is obvious that this method is time waste and human resource waste. In addition, the new machine tool maybe needs to wait for replanning of NC programs.
A survey in some aircraft manufacturing enterprises shows that the problem mentioned above has been a bottleneck in production, and about 30%−45% NC programs are suffering from this situation. Therefore, an adaptive NC programming method for changing manufacturing resources with very little additional work is in need. There are two challenges for solving this issue:
How to define the flexibility of the NC program so as to make it more adaptable for different machine tools;
How to establish an information model for adaptive NC program generation when machine tools are changed.
In order to address the issues mentioned above, a feature-based adaptive NC programming method for changing manufacturing environment is proposed. A framework including two modules, namely, preprocess module and postprocess module, is constructed, and the flexibility of the NC program is defined through the function separation of the two modules. A feature-based information model is established for adaptive NC program generation when the machine tool is changed; the feature-based information model can provide geometric and process information for NC program generation. In this article, the NC programming of aircraft structural parts is taken as application objective of the proposed method due to its urgent requirement for adaptive NC programming.
The rest of this article is organized as follows: section “Literature review” reviews some related literature, section “Feature-based framework for adaptive NC programming” presents the proposed framework, section “Feature-based information generation in preprocess module” describes the feature-based information generation in preprocess module, section “Feature-based NC programming in postprocess module” introduces the feature-based NC programming in postprocess module, section “Case study” elaborates a case study and the implementation of the prototype system, and section “Conclusions and future work” concludes this article and discusses our future work.
Literature review
The complexity and precision requirements of NC machining have become increasingly high due to the rapid changes of production capability and functionality. 7 Traditional NC programming method has limited the flexibility of NC programs seriously. Worldwide efforts have been made toward the development of new information models and new approaches to improve the adaptivity of NC programs. The related research can be divided into four categories.
STEP-NC-based information model for NC programming. An interface standard, recognized as STEP-NC, has been developed by ISO TC184 SCI and SC4 and is formalized as ISO 14649 and ISO 10303 AP 238, respectively.8,9 STEP-NC is envisaged to be an independent NC programming language used throughout the design and manufacturing implementation chain.10,11 STEP-NC has been widely researched in the last decades. Xu et al. 12 claimed that the STEP-NC model can represent a common standard for NC programming, making the goal of a generic NC code generation facility a reality. Kramer et al. 13 described an experiment in building and running two STEP-NC interpreters for milling operations: one using ISO 14649 and the other using AP 238 of ISO 10303. Wosnik et al. 14 introduced a generic approach to preprocess and feed process data back from servo drives to CNC and computer-aided process planning (CAPP) systems. Borgia et al. 15 presented a network part program approach for the machining of multiple fixture pallets, which is based on the STEP-NC data structure so as to support nonlinear sequences of operations and process flexibility. Choi et al. 16 presented the development and data management of Turn-STEP to support intelligent manufacturing and autonomous execution of NC machines. It still has some shortcomings of STEP-NC to solve the problem proposed by this article: (1) The process information has been determined at the very beginning of NC programming stage, and it cannot adapt to different machine tools with different performances; and (2) it needs a special interpretation module embedded in the CNC system to implement the model, so it is not versatile at present industry stage.
Distributed process planning method for NC programming. Another focused research is distributed process planning method which is supposed to address the changing production process. Shih and Srihari 17 proposed a distributed artificial intelligence (AI)–based framework for process planning. Fichtner et al. 18 presented the use of agent and networks for acquisition and preparation of distributed NC information to support NC planning. Function blocks (FBs) have been widely applied for distributed process planning. Brennan et al. 19 proposed a FB model to support configuration and reconfiguration of real-time distributed control systems that is built upon recent models for distributed intelligent control. Jeang et al. 20 presented a process planning method by considering the process deterioration for the NC machining of complex parts, where the process is optimized in real time. Wang et al.21–23 have studied intensively on FB-based distributed process planning. They proposed an effective approach for distributed process planning enabled by event-driven FBs for adaptive process planning, process control, and assembly. The focus of FB-based method is distributed process planning; most of NC programming work is done by FBs which are embedded in CNC machine tools, and it is not suitable for complex parts with large dimension.
Intelligent NC program processor-based method for NC programming. In order to enable the NC program to be reused, many research works have been performed on the transition of NC program. Srinivas 24 presented an automatic approach for the generation of NC programs using a specified manufacturing process plan. Schroeder and Hoffmann 25 proposed an algorithm that helps the use of CNC machines to convert NC programs from one manufacturer-specific NC dialect to another in order to be more flexible concerning the use of controls. Liu et al. 26 proposed an intelligent NC program processor for CNC system so as to make the basis of NC program to be reused. Guo et al. 27 proposed a universal NC program processor, which consists of NC dictionary and an interpreting engine. Zhang et al. 28 proposed a meta-model of CNC part programming languages, and the meta-model aims to abstract the characteristics of computer numerical controlled machine activities and interpret or represent process information within computer numerical controlled part programs written in different languages or dialects. NC program generated by the transformation method is only suitable for different CNC systems, rather than different machine tools with different performances.
NC program reuse method for NC programming. Yan et al. 29 studied the recognition of machining features in milling from the NC programs through reverse engineering, for reuse of the know-how in operation planning. Huang et al. 30 proposed a NC machining process reuse approach for similar subparts in which existing NC machining process cases are described in association with machining features. This method can be used for the NC program reuse for similar parts, but it still requires much work when manufacturing resources change.
As reviewed above, a lot of efforts have been made for NC programming so as to address the changing manufacturing environment, but there is still a lack of platform and a corresponding method to adapt the changes of machine tools with different performances, and the platform should be easily implemented without much work. This article tries to address this issue.
Feature-based framework for adaptive NC programming
In order to realize the objective proposed in this article, a feature-based framework for adaptive NC programming is designed. The framework is designed without any additional embedded modules in CNC systems, and it is also designed as flexible as possible. The framework consists of two modules: preprocess module and postprocess module, as shown in Figure 1. A feature information model including geometric information and process information is constructed so as to associate the two modules, as well as to guarantee the flexibility of the NC programming system.

Framework of feature-based adaptive NC programming.
The framework is designed based on a CAM platform by taking advantage of using geometric information. The function of preprocess module and postprocess module is divided by considering the flexibility of the system. Less redoing work is expected when manufacturing resource is changed. In the preprocess module, preprocess program, geometric, and process information are generated based on features, and the generated results are stored for further use. The first-level tool path is generated in the preprocess program, which is machine tool free. The information files generated in the preprocess module are associated by features. In the postprocess module, specified machine tools are selected and then the cutting parameters can be determined to generate complete tool paths on the basis of preprocess program. The flexibility of NC program generation is ensured by the interim information files generated by preprocess module. Basically, the preprocess module is expected to extract as much manufacturing resource free information as possible so that the postprocess module should do as little work as possible. By taking advantage of the function separation, the main workload is assigned in preprocess module.
Feature-based information generation in preprocess module
The main objective of preprocess module is to extract machine tool-free information, which includes preprocess program, geometric, and process information. The NC programming work is developed based on the features which can be used as the carrier of manufacturing knowledge and experience. When programming in preprocess module, geometric information is extracted by feature recognition, and process information is determined based on geometric information according to the process rules.
For aircraft structural parts, pockets, ribs, holes, and profiles are defined as common machining features. In this article, the NC programming of flank milling of pocket sidewalls is focused and that of the other features can be generalized using the same method. The required information for the new tool path generation of flank milling operation is different for three-axis machining features and five-axis machining features. In respect with three-axis machining features, the depth of the features is required for new tool path generation so as to calculate the tool path layers. In respect with five-axis machining features, the drive geometries are also required for new tool path generation in addition to the first-level tool path, as the depth and the axis of each level are different for freeform surface, and it needs drive geometric information. In some situations, the cutting tools or the parameters of cutting tools may change. In this case, the first-level tool path is not usable any more. In order to solve this problem, all of the drive geometries and check geometries of five-axis machining features are saved and can be invoked for tool path generation when required. The drive geometries of typical features are shown in Figure 2.

Drive geometries of typical machining features.
Generally, only the first-level tool path is generated for each feature, and the others are generated in postprocess module. Machining strategies, especially for the junction of different levels of tool path, should be predefined and stored in feature-based library, which will be used in postprocess for tool path generation of other levels. The first-level tool path (F_T) is generated and output into a text file and can be used when specified machine tools are selected. The output tool path file is preprocess program, cutting tool information, and cutting tool positions. The tool path in the preprocess file is marked by feature IDs. The geometric and process information is generated and output into an XML file, and the information is also marked by feature IDs so as to be associated with the cutting tool path. The drive geometries of features are expressed by persistent tag, and the drive geometries can be associated with the persistent tag in CAM environment. The type of machining operation (MO), the height of the machining feature (h), the direction of cutting tool axis (TA), and tolerance (Tol) requirement are also included in the process and geometric information file. In addition to the detailed process and geometric information, general process information (G_I) such as material of workpiece and properties of cutting tools is also included in the process and geometric information file for cutting parameter selection. The preprocess program information (Pre_I) can be represented as follows
Using the information of preprocess program, process, and geometric information, as well as the association between them, cutting parameters can be selected when machine tools are determined, and the complete NC program can be generated in the postprocess module. Basically, the feature information is extracted automatically by a holistic attribute adjacency graph-based feature recognition method proposed by our research team, 31 but there are still many manual operations required due to the complexity of aircraft structural parts, while the postprocess programming is almost completed automatically according to feature-based algorithms. By considering the function of preprocess programming, about 75% work is completed for the NC programming of a part by preprocess module. The percentage is evaluated according to the real NC programming time; the main workload of NC programming is the feature information, especially drive geometric extraction, and this work is done by the preprocess module in this article, while the rest of the NC programming work does not take much time. So, when manufacturing resource is changed, only very little work is required.
Feature-based NC programming in postprocess module
The NC program with appropriate cutting parameters is generated for specified machine tools in postprocess module. The feature information can be obtained first through an XML file generated by preprocess module and then appropriate machining parameters and machining strategies can be determined according to the selected machine tools as well as machining features. The new NC program generation for existing NC program which is expected to be machined in some other machine tools is also presented in this section. Basically, most of the work in postprocess module is completely automatic because the algorithms can be performed according to the corresponding features.
Generation of NC program based on preprocess program
After the selection of cutting parameters and machining strategies for new machine tool, the complete tool paths are generated. The general cutting tool path generation method for three-axis machining features is introduced first and then the tool path generation of five-axis machining features is described separately.
As the tool paths are identified by feature IDs, the first-level tool path points of each feature are extracted and then the tool path of other levels are offset based on the first-level tool path and cutting parameters. The offset tool path can be represented as follows
where
After the tool path points of each level are generated, the connection tool paths between the adjacent levels are added. The approach and retreat tool paths are also added to complete the tool path. The connection, approach, and retreat tool paths are all selected based on the features according to the preprocess program information. The tool path offset of sidewall flank milling is shown in Figure 3.

Tool path offset based on the first-level tool path.
In terms of five-axis features, because five-axis machining features are usually freeform surface whose curvature is not consistent, the first-level tool path cannot be offset directly to generate the tool path of other levels, and therefore, each of the level should be calculated separately. The drive geometries should be used for tool path generation, and the persistent tags for drive geometries of five-axis features have been contained in the preprocess program file. As the proposed postprocess module is designed in a CAM platform, the drive geometries can be obtained by comparing persistent tag with the 3D part model. The tool axis and cutting depth for each level are calculated according to the drive geometries of five-axis feature. Only flank milling of five-axis feature is considered in this article.
Tool axis vector and cutting depth have to adapt to the curvature changes for tool path generation so as to avoid overcut or undercut. The cutting depth or cutter-axis vectors are usually constant by regular tool path generation. Therefore, the machining efficiency is affected heavily due to the constant cutting depth. An adaptive computational method for cutting depth and tool axis vectors complying with the change of surface curvature is required so as to avoid interference and also to improve machining efficiency.
In order to simplify the issue, the method in this article is limited to ruled surfaces machined by flank milling. The original cutting depth is selected according to the cutting parameter database, and it is used as the maximum allowable cutting depth. The machining error of the current five-axis machining feature is obtained from preprocess program, and it is used as the constraint for the calculation of cutting depth and tool axis. The machining tolerance and the maximum allowable cutting depth are represented as

Adaptive computational method for tool path points and tool axis vectors: (a) Schematic diagram of adaptive tool path generation; (b) Generated cutting tool postions of adaptive tool path generation.
Pi
,
j
is the jth contact point of ith level, P0
,
j
is the vertex point of the section curve in the top side, and
The distance between point
Using the same method, the contact point Pi +1,j can be obtained referring to Pi,j. Pi,j+1 is obtained simply according to the machining error, and it is the same as regular method, so it will not be introduced in this article. All the cutting position points and axis vectors can be obtained and then cutting center points can be calculated according to contact points and their normal vectors. The connection tool path between the adjacent levels and approach and retreat tool paths are also added to the tool path according to the tool path strategies. The axial layering using the adaptive computing method of the cutting depth and cutter-axis vector is shown in Figure 4(b). Compared with the regular methods, the number of machining levels has been decreased. In addition, the overcut and undercut are obviated in the premise of efficiency and accuracy.
After the appropriate cutting parameters are determined and the total tool paths are generated, the specific postprocesser is selected according to the CNC system of the selected machine tool. The NC program with specific formats suited for the CNC system is generated by the postprocesser, which can be used directly for machining.
Generation of new NC program for existing NC program
In real-production environment, there are many existing NC programs which have been made for specified machine tools. In case of manufacturing resource changing, new NC programs have to be redone, which is time-consuming. A solution is also presented to translate the existing NC programs to new NC programs for different machine tools. The key for addressing this issue is creating the connection between the input NC program and the related machining features. A feature recognition method of recognizing machining features from NC program proposed by Zhang et al. 32 is adopted. But for the machining features involved in this article, NC programs are associated with related features by analyzing tool changes, spindle speeds, feedrates, raw material, tool geometry, and tool paths to identify the manufacturing process plan.
The workpiece and cutting tool information is defined first and then the part program is separated into several sections according to the tool changes and spindle speed alterations. Each section is an operation associated with a machining feature. The geometry relationship between machining zone (feature boundary) and the raw workpiece boundary (user input) is utilized to recognize the feature. This method can recognize the features from isolated low-level shop floor data, but it is not enough for tool path regeneration. The association between the input NC program and the features of part is constructed as the features are recognized from the NC program. The detailed geometric and process information of machining features can be obtained by preprocess programming module. Similarly, the tool path and feature-based NC program generation methods also require the methods for preprocess program. The workflow of adaptive NC program generation based on existing NC program is shown in Figure 5.

Adaptive NC program generation based on existing NC programs.
Case study
To implement the adaptive NC programming method for changing manufacturing environment proposed in this article, a prototype system has been developed. The preprocess module and the postprocess module are developed based on the CAM platform of CATIA™. The feature-based machining parameters are stored in a relational database and can be invoked by related modules. The user interfaces of the prototype system are shown in Figure 6. In the interface (Figure 6(a)), the recognized features are listed, and the detailed information of each feature is displayed. The feature list and the information can be output into an XML file. In the interface (Figure 6(b)), new NC program can be generated according to the input information.

User interfaces of the prototype system: (a) User interface of pre-process program generation; (b) User interface of NC program generation.
A typical aircraft structural part is used as an example to validate the proposed adaptive NC programming method. The part is composed of many complex five-axis pockets. There are many uncertain factors during the production process of aircraft structural parts, and therefore, the machine tools are changed frequently. Therefore, the adaptive generation method of NC programs can be very useful for this kind of complex parts. A typical pocket feature in the aircraft structural part is selected as a case to show the details of the proposed approach, and the pocket is marked in Figure 7.

Typical aircraft structural part.
Two kinds of machine tools with different CNC systems are selected to show the generation process of the flexible NC program, which are MIKRON machine tool with HEIDENHAIN system and CHANGZHOU machine tool with FANUC system. The machining performance of the machine tools is contrasted, as shown in Table 1. We can find that the maximum spindle speed, the maximum feedrate, and the power of the machine tools are different. Therefore, the machining parameters are different for the two machine tools. Some of the machining parameters for the two kinds of machine tools are shown in Table 2.
Machining performance of the two machine tools.
CNC: computerized numerical control.
Feature-based cutting parameters of the two machine tools.
The following sections will show how the prototype system generates adaptive NC programs for the two different machine tools. The XML file of geometric–process information and preprocess program is generated by the preprocess module. A part of geometric–process information is shown in Figure 8(a), and a part of the preprocess program file including feature identifications is shown in Figure 8(b).

(a) Geometric–process information and (b) preprocess program file.
In the postprocess module, if the input file is a preprocess file created by the preprocess stage, the appropriate cutting parameters are selected from the feature-based cutting parameter database according to the feature information and the selected machine tool, and the cutting parameter database should be dynamic by referring tool condition monitoring data, 33 from which the real machining states of the selected parameters are evaluated and then appropriate cutting parameters can be updated. The generated NC programs for the two different machine tools are shown in Figure 9. Figure 9(a) is the NC program of MIKRON machine tool, and Figure 9(b) is that of CHANGZHOU machine tool. If the input file is NC program, new NC program can be generated for the selected new machine tool. For example, if the postprocess NC program for MIKRON machine tool is input to the system, and CHANGZHOU machine tool is selected as a new machine tool, feature recognition is first executed from the NC program and then the feature information is extracted from the NC program and the computer-aided design (CAD) model of the part and then new NC program can be generated based on the feature information. We can find that the spindle speed and feedrate are different.

NC programs for two machine tools: (a) MIKRON and (b) CHANGZHOU.
In order to prove the advantage of the adaptive computational method for cutting depth and axis vector, the tool path by regular method (Figure 10(a)) and the one generated by our system (Figure 10(b)) is compared. The number of tool path levels without adaptive generation method is 30, and the number of tool path levels with adaptive optimization is 22. Therefore, the machining efficiency and quality of the NC program generated by our system are higher than the original one.

Comparison of tool paths of five-axis feature by flank milling: (a) regular method and (b) our proposed method.
The implementation results show that the feature-based adaptive NC programming method for changing manufacturing environment has the capacity to generate flexible NC programs. Therefore, the production efficiency and machining quality can be improved.
Conclusion and future work
A feature-based adaptive NC programming method is proposed in order to address the NC programming problems under changing manufacturing environment. The contributions of this article include the following aspects:
The flexibility of NC program is realized through the function separation of preprocess module and postprocess module;
A feature-based information model for organizing geometric and process information of part is constructed for flexible NC program generation when manufacturing resources are changed;
About 75% work which is manufacturing resource free is done by preprocess module, and the rest is done by the postprocess module for changing manufacturing resources. The implementation of the prototype system shows the feasibility of the proposed method.
In contrast to the existing methods for NC program generation, the advantages of this article are that only very little additional work is required for new NC program generation when manufacturing resources are changed; besides, the NC programming framework is designed without any additional embedded modules in CNC systems, and it is also designed as flexible as possible.
Our future work includes the following aspects:
Implementation of the proposed method in real-production environment so as to improve the performance of the prototype system and complete its functionality;
Developing an adaptive NC programming method for online changing machining condition of workpiece, where cutting parameter adjustment is required so as to adapt to the actual state of workpiece.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The results presented in this article were outcome of the research project funded by the National Science and Technology Major Project of China (no. 2013ZX04001-021).
