Method of automatic CAM programming using machining templates

* Mgr inż. Maciej Kowalski, maciej.kowalski@mk-tech.pl, https://orcid.org/0000-0002-5601-1310 – MK-Tech; Wydział Budowy Maszyn i Zarządzania Politechniki Poznańskiej, Poznań, Polska The paper presents a unique method of automatic programming of CNC machines using special machining templates built into the CAM program. The method, referred to by the author as Automatic CAM Programming Using Machining Templates (i.e. the acronym ACPUT), is used in the preparation of the machining process of parts characterized by geometric and technological similarity, and is aimed at automating the work carried out in the CAM program. In addition, the results of experimental studies were presented, confirming the possibility of using the new method in practice


Introduction
The machining programming process in the CAM program is carried out for a specific CNC machine on which a given part will be machined. In this process, basic types of tasks can be distinguished, related to: • machine parameter settings, • definition of the workpiece shape, • determination of subsequent machining operations, • simulation and verification of the machining program.
Within the scope of preparatory work, machine parameters are determined, such as the number of controlled axes, size of the machining table, and values of axial displacement. At the beginning, the general geometrical features of the workpiece and the blank from which a part will be made are also determined. A coordinate system with zero position is also defined so that the workpiece can be oriented in the working space of the CNC machine.
The proper development of the program, however, involves determining the detailed course of the machining process, depending on the complexity of the workpiece and its size. In individual machining operations, the technological engineer determines: • specific geometric elements of the CAD model for processing (e.g. planes, edges, points), • type and features of the machining tool, • machining strategy determining the path of the machining tool, • operation parameters (e.g. speeds, input/output paths of the machining tool relative to the workpiece).
All settings must undergo initial verification and evaluation in the CAM program (in order to detect possible errors at the operation level). Next, the tool path for the specific operation is generated and saved in the part program structure. This process is repeated for each operation separately, taking into account the geometric changes from previously generated operations. The whole process is then simulated, and if the program requires corrections, the necessary changes are made in the selected operations. After verification with a special translator, the so-called postprocessor creates an NC code that is implemented in a specific machine tool.
Development research in the field of CAM programming, published in the literature, usually concern the issues of integration and improvement of data exchange on the CAD-CAM line [1][2][3][4]. You can also find research that relate to methods supporting recognition of geometric features in CAD models and then assigning them appropriate operations in the CAM program. However, this is not an automation close to the level used in CAD programs. This work presents a method of automatic CAM programming based on specially prepared machining templates.

Context of considerations
Programming of CNC machines in the area of production processes is most often used in the tool department, where production equipment is prepared (e.g. dies, molds, holders). Due to its intended use, universal (general purpose) and special (dedicated to specific machines, processes, products) equipment can be distinguished. Special production equipment is widely used, e.g. in the automotive industry, both during the vehicle assembly process and in the production processes of its individual parts. For example, an average car structure consists of about 12,000 parts, where most of them are produced using special production equipment.
The process of manufacturing special tooling is usually an example of custom-made production, MTO (Make to Order), and more precisely one of its types, ETO (Engineering to Order), i.e. custom-made design, where the design of the instrument is based on that which is delivered by the contracting authority product model (digital or real). The process of production special tooling is carried out in stages and includes ( Fig. 1): • analysis of the 3D CAD model of the product provided by the customer, • developing a tooling model in the 3D CAD program adapted to the shape of the product, • export of designed 3D CAD models of tooling to the CAM program, • developing machining programs at CAM for individual parts of the tooling, • manufacturing of tooling parts on a CNC machine, • tooling assembly and delivery to the customer.

The ACPUT method
The proposed method is described by the acronym ACPUT (Automatic CAM Programming Using Machining Templates), and includes activities implemented in stage 4 ( Fig. 1). Its basis is the development of a special machining template that represents all production operations possible on a given group of technological operations. The place to save data and information for such a template is a specially prepared knowledge base. Knowledge acquired mainly from specialists in a given field is accumulated and written in a formal way in a form understood by a computer program. To ensure proper operation of the machining template, and thus the automation of the preparation process in the CAM environment, 3D models of tooling must first be properly described in the CAD program (i.e. categorization of features and assigning them to the model). Based on this description, the template later automatically selects the appropriate features for the given part.
The automation method is saved in the form of a procedure and includes the following steps (Fig. 2): 1. Analysis of 3D CAD models of products. 2. Preparation of the technological knowledge base. 3. Defining the geometry necessary to build the machining template and publishing them. 4. Preparation of machining template. 5. Simulation program. 6. NC program preparation.
The first step is the analysis of all CAD models of tooling (i.e. variants) included in a given group, checking the technological design of individual parts and determining the types of machining operations. It is necessary to search for the geometric similarities of the parts and determine their variants. For the objects identified, a description of the technological process is prepared in the next step in the form of a knowledge base.
The knowledge base is built in the process of decomposing technological knowledge into basic units (i.e. detailed data), divided into two areas: The third step introduces modifications in the structure of CAD models, adding to them a special description for those geometric elements that are associated with specific machining operations. It can be considered that such a description is a kind of record of metadata in the CAD model, after which geometric elements can be identified and specific actions performed in them in the CAM program (e.g. automatic connection of selected geometric elements of a given model [surface, line, point] with a specific operation machining, saved in the machining template). The advantage of this approach is that regardless of the geometric differences of the described elements in different variants of the parts, they will always be interpreted in the same way. This is one of the conditions for the correct operation of ACPUT.
In the next step, using the data contained in the knowledge base and specially described CAD models, a machining template is created in the CAM program for a given type of part. Data entered into the knowledge base, including basic data such as machine and workpiece data, as well as that describing all possible operations to be performed, along with the definition of machining parameters, tools, etc., are added to the CAM template. The CAM template automates generation of a machining program, and only requires the option of the machined part. The appropriate algorithm in CAM then adapts the machining process to it.
The automatically generated process should be simulated, assessing the compliance of the results with the assumptions for the given process. In case of discrepancies, after recognizing them, the knowledge record in the database should be improved. The end of the method is preparation of programs directly for the selected CNC machine.

Case study -special assembly equipment for plastic pipes
For verification of ACPUT, a family of special tooling parts for plastic pipe assembly, and more specifically retaining dies, was selected. This family consists of dozens of this type of matrix. Examples of matrix variants are presented in Fig. 3. After analyzing the models of parts, despite the similarity in the functions they perform, the variants of the presented tooling differ in a significant range -matrix nest geometry and external shape. This is due to the shape of the pipes for which they are prepared and the characteristics of the assembly process. The dies are produced in the milling process on CNC machines and from the point of view of this process the NC code for each variant must be separately prepared by a specialist. In practice, the machine programming process is implemented in a CAM system. However, the repeatability of the programming process is high; therefore, it is possible to automate these activities by applying ACPUT and creating a machining template for this part family.
In accordance with ACPUT methodology, knowledge was decomposed and a knowledge base regarding basic data as well as all machining operations was built. Special forms were prepared for acquiring knowledge of the technological process for the presented matrices. The forms were prepared based on the attributes presented in the knowledge decomposition method.
Next, modifications were made to the structure of CAD models, adding descriptions to them for those geometric elements that are associated with specific machining operations. The so-called publications in CA-TIA V5 are a description that enables the program to refer to the objects they concern. It can be considered as a kind of metadata (or tags), after which geometric elements can be identified and other actions performed on them. In the described case, publications allow subsequent automatic connection of selected geometrical elements of a given model (e.g. surface, line, point) with a specific machining operation, saved in the machining template (Fig. 4).
The knowledge base and 3D model, with publications prepared earlier, enabled creation of a template for the machining process. The template has rewritten data stored in the knowledge base, including basic, machine and workpiece data, as well as that describing all possible operations to be carried out, along with the definition of machining parameters, tools, etc. This template enabled automatic generation of the machining program by indicating only the right variant of the workpiece. The scope of work carried out automatically is shown in Fig. 5.

Conclusions
ACPUT is a way to automate the CAM programming process. This is achieved thanks to the use of special machining templates, which for a given family of products constitute the knowledge base of possible machining operations. Correct description of geometrical elements in CAD models, in turn, automatically assigns these operations to the appropriate geometrical elements of the workpiece.
The development of an automatic solution in the CAM environment, thanks to the developed method, is easier, and the actions taken are systematized. In addition, the knowledge base developed under ACPUT is a way to verify, standardize and secure the knowledge of specialists from a given company.
The work carried out also indicates the direction of further actions. It seems necessary to compare machining programming methods for entire families of similar production tools, i.e. the traditional and automatic methods. It will be important to determine indicators that allow assessment of when the development of an automatic solution (according to ACPUT) would be justified. The process of preparing an automatic solution is time consuming and it is assumed that in some situations it may be unprofitable. Further work is planned to carry out validation on examples of different tools by considering different numbers of product families and varying degrees of complexity.