Open architecture of CNC system research based on CAD graph-driven technology

Open architecture of CNC system research based on CAD graph-driven technology

Robotics and Computer-Integrated Manufacturing 26 (2010) 720–724 Contents lists available at ScienceDirect Robotics and Computer-Integrated Manufact...

832KB Sizes 0 Downloads 76 Views

Robotics and Computer-Integrated Manufacturing 26 (2010) 720–724

Contents lists available at ScienceDirect

Robotics and Computer-Integrated Manufacturing journal homepage: www.elsevier.com/locate/rcim

Open architecture of CNC system research based on CAD graph-driven technology Pengfei Li n, Tao Gao, Jianping Wang, Hongzhao Liu School of Mechanical and Precision Instrument Engineering, Xi’an University of Technology, Xi’an 710048, China

a r t i c l e in f o

a b s t r a c t

Article history: Received 15 April 2009 Received in revised form 23 March 2010 Accepted 15 April 2010

Based on CAD graph-driven technology, a kind of novel open architecture CNC system is put forward and designed together with the key hardware ‘‘PC + PMAC controller’’. The intelligent CNC system software including several function modules is developed under Visual C++6.0 environment. Graphic feature identification and geometric parameter extraction from CAD-part-drawing saved as DXF format are performed to control the relative motion between cutting tool and part. The ant-colony algorithm is applied to auto-optimize the cutting tool paths in machining process. The experiment results of a plane engraving machining example show that the proposed method is feasible, and the entire machining process no longer needs NC programming. The efficiency of CNC machining is improved greatly, and the true intelligent CNC machining can be realized when the advanced programming technologies are integrated in one system according to the proposed conception. Crown Copyright & 2010 Published by Elsevier Ltd. All rights reserved.

Keywords: Open architecture of CNC system CAD graph-driven Ant-colony algorithm Feature extraction

1. Introduction In modern manufacturing systems, CNC has become the core of advanced manufacturing technology, and is used in almost all industrial fields. Nowadays, the NC-code control technology is applied in the majority equipments used in CNC machining, which demands workers to prepare the responding NC program according to the part’s geometry and machining parameters. It puts forward a higher request for programmers because the programming process is complex, lengthiness and inefficient. In recent years, the automatic programming technology is developed rapidly. The mistake caused by programmer is decreased obviously. The quality and the efficiency of NC programming have been enhanced. Omirou and Barouni [1] proposed a series of machine codes selected for integrating advanced programming capabilities into the control of a modern CNC milling system. Li [2] studied the automatic NC programming technology based on the graphic feature principle to realize the integration of CAD/ CAM system. Liu et al. [3] researched the application of an intelligent NC program processor for CNC system of machine tool. Kovacic and Brenzocnik [4] proposed a concept for programming of CNC machines based on genetic algorithms on the basis of CAD models of manufacturing environment. But there are some shortcomings (such as more requirements for artificial participation and low efficiency) in that NC programming. A kind of novel open architecture CNC systems is put forward and designed based

n

Corresponding author. Tel.: + 86 02982312608. E-mail address: [email protected] (P. Li).

on ‘‘PC +PMAC’’ in this paper. The intelligent CNC system software based on CAD graph-driven technology is developed under Visual C++6.0 environment. The geometric parameters of graphics features are extracted from CAD drawing to control the relative motion between cutting tool and parts. A modified ant-colony algorithm is used to auto-optimize the cutting tool paths in machining process, and the related experimental study has been carried out.

2. Hardware structure Now, CNC technology is changing from special enclosed control model to general open-type real-time dynamic control model gradually. Comparing with the traditional enclosed CNC system, the open architecture CNC system has more merits, such as interoperability, portability, interchangeability, extendibility, etc. Aiming at the characteristic demand for an open CNC system of ‘‘PC+ PMAC’’ open architecture, components (such as DC servo motors, servo drivers, and gratings) are selected to build a threeaxis motion control system with PC and PMAC (programmable multi-axis controller). The diagram of hardware structure is shown in Fig.1. In which, the role of PC is responsible for human–computer interaction, resource management, task scheduling, and instructions issue. The function of PMAC motion controller is in charge of receiving instructions and responding to the closed-loop signal. Through analysis and calculation, digital pulse signals as movement order are sent to the servo motor driver. The motor driver carries on power transformation, and

0736-5845/$ - see front matter Crown Copyright & 2010 Published by Elsevier Ltd. All rights reserved. doi:10.1016/j.rcim.2010.04.004

P. Li et al. / Robotics and Computer-Integrated Manufacturing 26 (2010) 720–724

721

Fig. 2. The principle of CNC machining based on CAD graph driven.

Fig. 1. The hardware structure of the CNC system.

drives motor rotation according to the received instructions. The speed signal and the position signal are detected by the measurement components (encoder and grating), and fed back to the motion controller and PC. The double closed-loop (speed and position loop) control system is constituted.

3. Software design

Fig. 3. Diagram of software function modules.

The machining feature parameter of parts are identified and extracted from CAD drawing to control the parts automatic machining by the intelligent CNC system software. The drawing exchange format (DXF) of AutoCAD software [5] is taken as a research subject. The entire machining process can be divided into five steps included CAD drawing input, machining feature identification and extraction, data storage and organization, parameter computation, as well as trajectory interpolation. The machining flowchart is shown in Fig. 2. In order to achieve the CNC machining based on CAD graph-driven the cooperation of PC software and PMAC movement program is required. The key lies in how to identify and extract the machining feature of part form from CAD drawing, and control motor to achieve trajectory interpolation according to the geometric parameters of the machining feature. 3.1. PC software design The PC software programmed under Visual C++6.0 environment is developed to identify and extract the machining feature, calculate the parameters, manage data, schedule tasks and interact between human–computer on Windows platform. The data are exchanged with PMAC motion controller through the driver function library solidified in PMAC. The modularization conception is adopted in software design process. According to the different functions, the software is integrated and divided into certain cooperation modules. The main task modules of PC software are shown in Fig. 3. In order to operate and monitor the CNC manufacturing procedure, a friendly man–machine interface with the characteristic of strong interaction and easy operation is needed. The software interface of the CNC system shown in Fig. 4 include menu, toolbar, graphical display area, operation panel, and status bar. The graphical display area is used to show the DXF drawing of parts. The operation panel is used to show the coordinate value of X, Y, Z axes and complete the operation function such as the start, the suspension, and return to zero in CNC machining process. The information, which include current model, the display scale, the DXF blueprint scale, machining feature quantity, as well as current machining status, are displayed in the status bar. The identification and extraction of part machining feature from CAD drawing is the most important work for PC software. After the structure of DXF file being analyzed, it is founded that the geometric data of CAD drawing are stored in the ENTITIES

Fig. 4. Interface of the PC software.

section of DXF file. The ENTITIES section is divided into many group units. Each group unit is composed by two elements, which are called group code and group value. Group code is equal to the data type code, whose meaning is defined by AutoCAD system. Group value is the value of data type. The combination of two elements can express a data’s meaning and its value. By reading the contents of ENTITIES section in the programming procedure, the machining feature parameters of parts are identified and extracted from CAD drawing. The software flowchart is shown in Fig. 5. Firstly, the contents of DXF drawing are read and followed by the line until ENTITIES section. Secondly, after the group values of ENTITIES section being read, the different graph features are identified according to the group value. The parameters of graph feature are extracted by the corresponding function software according to the classification. 3.2. PMAC software design Actually the programmable multi-axis controller (PMAC) is a computer with independent CPU and memory, which has the abilities of independent operation and control, and has a set of programming language grammar similar to Basic language [6]. Users can write their own motion program and PLC program to

722

P. Li et al. / Robotics and Computer-Integrated Manufacturing 26 (2010) 720–724

and minor axis, respectively. The PMAC fitting program is as follow: ABS //absolute coordinate mode SPLINE1 //uniform cubic B-spline interpolation TA200 //set acceleration time P100 ¼0 //control variables While (P100o361) P101 ¼P51+ P53  cos(P100) //calculating X coordinates of fitting point P102 ¼-(P52+ P54  sin(P100)) //calculating Y coordinates of fitting point X(P101)Y(P102) //curve fitting P100 ¼P100 + 10 //control variables increased End While //end while

Fig. 5. Flowchart of graph features identification and parameters extraction.

Table 1 Interpolation mode responding to graph features. Graph Features

Interpolation model

Explanation

Point Line Rectangle

Rapid Linear Linear

Circle Arc Spline Ellipse

Circle2 Circle1 Spline1 Spline1

Fast-moving to the designated point Linear interpolation The rectangle is completed by linear interpolation Counterclockwise circular interpolation Clockwise circular interpolation uniform cubic spline interpolation Fitting by spline1 model

The irregular curve in AutoCAD part drawing commonly refers to the spline curve. The fitting points of spline curve can be extracted in the way of PC software programming. And then, the PMAC Spline1 model is also used to achieve curve fitting tasks. Because of extensive application of the open architecture of PMAC in CNC control system, the function expansion becomes very convenient. When some interpolation functions for other special graph features are requested in the CNC system, the only work is to develop the corresponding PMAC motion program, and use it directly in machining process.

4. Machining path optimization

achieve multi-axis servo control. In order to realize the trajectory interpolation according to the geometric parameters of the machining feature, the corresponding PMAC motion program is compiled, and an appropriate PMAC interpolation model is selected for each kind of the graph feature. The given corresponding interpolation model in the PMAC function library can be directly used to realize the trajectory interpolation of simple graph feature, such as point, line, circle, arc, etc. But for the other complex curves, the curve must be truncated and divided into several sections. Each section of the curve is fitted by PMAC spline1 model. The corresponding PMAC interpolation modes for each kind of the graph feature are shown in Table 1. The regular curves in AutoCAD part drawing, like ellipse, elliptic arc, and so on, can be fitted by PMAC spline1 model. Firstly, a general parametrization PMAC fitting program is developed for each kind of regular curves according to their equations or expressions. Secondly, geometric parameters of these regular curves are extracted and sent to PMAC via PC software. Thirdly, the fitting points should be calculated after the received geometric parameters input the PMAC fitting program. Finally, the regular curve is fitted under PMAC spline1 model. The fitting process of an ellipse curve is taken as an example to explain the fitting method of the regular curve. There is a given vector Eq. (1) of ellipse

Tool path optimization in NC machining is a typical combinatorial optimization problem. The optimization goal is to minimize the distance of virtual travel in the part machining process. Many researchers use a variety of heuristic algorithms to solve this problem, such as simulated annealing algorithm [7], genetic algorithm [8], neural network algorithm [9], and ant-colony algorithm [10–11]. It is proved that the ant-colony algorithm has the obvious superiority in solving the combinatorial optimization problems. In order to apply the ant-colony algorithm in NC machining tool path optimization, the ant-colony’s routing and the trail pheromone updating are simulated by programming. The data structure is adopted instead of real ant in program, and the code is shown as follows: typedef struct tagAnt_info { int pass; //the node number int curpos; //current location double len; //current path length int path[Num_Max]; //path information BOOL tabu[Num_Max]; //taboo table[i]if tabu[i] ¼TRUE means have visited } Ant_info;

ð1Þ

Firstly, each machining feature is abstracted to be a node. The initial value of trail pheromone level in all paths is equal. Ant k chooses a point as the start point, and calculates the transition probability pk(r,s) of other nodes by Eq. (2) based on value of pheromone level in paths and the distance between the start point and other nodes 8 b > < P ½tðr,sÞU½Zðr,sÞ if s= 2Mk b pk ðr,sÞ ¼ ð2Þ u= 2Mk ½tðr,uÞU½Zðr,uÞ > : 0 otherwise

where Cx and Cy represent the X and Y coordinate of ellipse center and a and b represent the half of length of the major

where t(r,u) is the value of trail pheromone level on path (r, u); Z(r,u) is the value of visibility, which is equal to the inverse of the

PðuÞ ¼ ½Cxþ a cosðuÞi þ ½Cy þ b sinðuÞ  j

P. Li et al. / Robotics and Computer-Integrated Manufacturing 26 (2010) 720–724

distance between node r and u; and b(b Z0) is a parameter that determines the relative importance of pheromone versus distance. Mk represents a taboo point for ant k in next step. In antcolony algorithm, the ants only go along the legitimate path, and are forbidden to visit the nodes, which have been passed once more. So, taboo table: tatu[k] (k¼1,2,y,m) is used to record the nodes which ant k has already visited. Secondly, the next node s is selected under the rule given by 8 < arg maxf½tðr,uÞU½Zðr,uÞb g if q rq0 u= 2Mk s¼ ð3Þ : S otherwise where q is the stochastic variable distributed uniformly in [0,1] interval, q0(0 rq0 r1) is the parameter in [0,1] interval, and S is the random variable selected according to the probability distribution given in Eq. (2). If qrq0, the best path, where the

723

value of transition probability is highest, is chosen, otherwise a path is chosen randomly according to the probability distribution of nodes. The trail pheromone of each path will be renewed according to the rules given by Eqs. (4) and (5) when the ants have completed the tour of all nodes

tðr,sÞ ¼ ð1aÞ tðr,sÞ þ

m X

Dtk ðr,sÞ

ð4Þ

k¼1

Dtk ðr,sÞ ¼



Q =Lk

if ðr,sÞ A tour done by ant k

0

otherwise

ð5Þ

where a is the pheromone decay parameter, Q is an adjustable parameter and referred as the amount of pheromone released by ant k in one circle, and Lk is the path length of ant k running in this circle. It is called that the ant-colony has been trained one time when the ant-colony has finished the tour of all nodes. The above process is repeated until reaching the specified number of training or the best solution appearing under the specified condition.

5. Experiment A XYZ three-axis movement platform (shown in Fig. 6) is used as the experiment equipment to verify the CNC system proposed in this paper. This movement platform is a typical positioncontrol system, which is composed by work table, gantry, the central slide rail, gearing, linear guide rail, etc. It can simulate a variety of CNC machining equipments after installing different cutting tools in the end of Z-axis such as drilling machine, laser cutting machine, and CNC engraving machine. The detail steps of CNC machining based on CAD graph-driven is as follows:

Fig. 6. The picture of a three-axis movement platform.

(1) Designing the 2D parts drawing by the CAD software and save them as DXF format. (2) Opening the DXF file in this CNC system software, the graph features and parameters of part are identified and extracted automatically by the file reading module. The data are filled in the feature linked list, and restored to geometrical figure for display by interactive display module. (3) In order to minimize the length of virtual travel in the part machining process, the machining features in the linked list are sorted applying the ant-colony algorithm by the optimization module. (4) The data of graph feature are read by mission management module. The interpolation parameters of graph feature are calculated by the parameter calculation module according to

Fig. 7. Comparison of tool path length. (a) part diagram (b) before optimizing and (c) after optimizing.

724

P. Li et al. / Robotics and Computer-Integrated Manufacturing 26 (2010) 720–724

Table 2 Data contrast of machining path length and time. Path optimization

Length (mm)

Machining time

Not optimized Ant-colony algorithm

1965 714

5 min 28 s 4 min 20 s

CNC system only needs few human–computer interactions, and the efficiency of CNC machining is improved greatly. The entire machining process no longer needs NC programming. So, the actual intelligent CNC machining can be realized.

Acknowledgments the interpolation requirements of the different graph feature trajectory. (5) The interpolation parameters and instructions are sent to PMAC controller by the communication module. The relative motion between the cutting tool and part is controlled by PMAC motion program to form the graph feature. In order to verify the actual effect of the proposed CNC system, an engraving machining process of sheet metal part is taken as an example. The part drawing is shown in Fig. 7(a). The cutting tool path according to the priority of DXF file is shown in Fig. 7(b). In this case, it can be seen that the cutting tool path is in a state of disorder and the virtual travel is oversize. The overall optimization result of ant-colony algorithm is shown in Fig. 7(c). In Table 2, it is obvious that the length of virtual travel is reduced from 1965 to 714 mm and the machining time is reduced by 20%. The efficiency of parts machining has been greatly improved.

6. Conclusion A novel open architecture CNC system is put forward and built with the key hardware ‘‘PC+ PMAC controller’’ based on the CAD graph-driven technology. The data of graphic features identifying and geometric parameters extracting from the CAD part drawing are adapted to control the relative motion between cutting tool and part. The ant-colony algorithm is applied to optimize the cutting tool paths in machining process. The experiment results of a plane engraving machining example show that the proposed

The authors appreciate the support of their work by China Nation Science Technology Key Plan Program (Grant number: 2009ZX04014-015), China Nation Natural Science Fund (Grant number: 50575180) and Key Subject building fund of Shaanxi Provence. References [1] Omirou Sotiris L, Barouni Antigoni K. Integration of new programming capabilities into a CNC milling system. Robotics and Computer-Integrated Manufacturing 2005;21(6):518–27. [2] Li Gang. Study on automatic graphic feature oriented NC programming. Dalian University of Technology, 2004. [3] Yadong Liu, Xingui Guo, et al. An intelligent NC program processor for CNC system of machine tool. Robotics and Computer-Integrated Manufacturing 2007;23(2):160–9. [4] Kovacic M, Brezocnik M. Evolutionary programming of CNC machines. Journal of Materials Processing Technology 2005;165:1379–87. [5] Autodesk Inc. AutoCAD DXF Reference Guide (version u19.1.01). Autodesk Inc., 2006. [6] DELTA TAU. Data Systems Inc. PMAC2A-PC/104 product guide. USA: DELTA TAU Data Systems Inc., 2004. [7] Klaus Meer. Simulated annealing versus metropolis for a TSP instance. Information Processing Letters 2007;104(6):216–9. [8] Arthur Carter, Cliff Ragsdale. A new approach to solving the multiple traveling salesperson problem using genetic algorithms. European Journal of Operational Research 2006;175(16):246–57. [9] Hassan Ghaziri, Ibrahim Osman. A neural network algorithm for the traveling salesman problem with backhauls. Computers & Industrial Engineering 2003;44(2):267–81. [10] Marco Dorigo, Luca Maria, Gambardella. Ant colony system: a cooperative learning approach to the traveling salesman problem. The IEEE Transactions on Evolutionary Computation 1997;1(1):53–66. [11] Marco Dorigo. Ant algorithms and stigmergy. Future Generation Computer Systems 2000;16:851–71.