A Method to Improve Routng and Determnng the Shortest Travelng Pathway between PADs n the Automatc Drllng of PCBs Based on Genetc Algorthm A.R. MohammadnaOranj 1 A. Khademzadeh 2 A. Jall Iran 3 H. Ebrahman 3 1 Computer Eng. Dept.Islamc Azad Unversty, Ardabl branch, Ardabl, Iran 2 Educaton & Internatonal Affas, Iran Telecom Research Center 3 Electrcal Eng. Dept.Islamc Azad Unversty, Ardabl branch, Ardabl, Iran Abstract Automatc drlls are wdely used n the process of manufacturng prnted crcut boards. After a crcut s desgned usng very advanced softwares, the pns for dfferent components and the nodes through whch the layers are connected are rgorously drlled by an automatc drll. At the present paper, a study s done on the functon of the automatc drlls of prnted crcut boards and the dffcultes brought about by ssues lke the sequence of drllng, the functonng tme of the devce, the devce deprecaton to optmze the total pathway of the head ral, and the response of the head ral along wth tracng the head ral s beng studed analytcally. The effectveness of the proposed method s demonstrated on 100 node test pattern through Absolute Error (AE), Mean Square Error (MSE), Mean Percentage of Absolute Error (MPAE) and Mean Regulaton (MR%) performance ndces. The result evaluaton shows that the proposed algorthm acheves good result performance. Moreover, ths newly developed strategy has a smple structures provde less deprecaton, arsen n the pace of whole system and a reducton n the error of head dsplacement, whch can be useful for the travelng pathway between PADs n the automatc drllng of prnted crcut boards. Keywords: Genetc algorthm, PCB Auto Drll, Routng pathway 1. Introducton At ndustry, for the desgn and manufacturng of the prnted crcut boards, the components are frst desgned and nstalled by a PCB Desgn softwares. These softwares export several output fles to be used by dfferent devces. The fles nclude a Pad_lst (lst of (x,y) coordnates of component pns), Va (place of connecton of layers together), Component_Lst (lst of components for assemblng machnes), solderng masks (mask for solderng gude, etc. Drllng the prnted crcut boards s a part of manufacturng electronc boards that s done by automatc drllng devces [1-2]. Ths devce operates on the x-y axes horzontally and vertcally, on the plane of the prnted crcut board. There s also a depth-orented movement along the z-axs through whch the drlled s lowered to punch the prnted crcut fber. The moton of the head-ral along the three axes s controlled by the stepwse motors. These devces receve the pad-lst from a PCB desgnng software and gude the drll through the specfed coordnates of the pns and the connecton nodes to punch the pad [3]. The head-rals at these devces usually move followng an unsorted lst of the software output whch requres a long pathway. Ths long pathway needs more tme to be completed and effects sooner devce so deprecaton and the systematc errors are aggravated. It s lke as a Travelng Salesman Problem (TSP) [4-5]. Thus t s mportant to mnmze the total pathway. There are several methods to mnmzng the total pathway whch are x-then-y method, Snakelke method, the mnmum dstance method [1-2]. The sortng done wth the x then y method s a smple and sutable procedure to enhance the pathway. However, t s stll necessary that one fnd the correspondng y coordnate of each step on the x axs and cross that. That s why the pathway would be a zgzag and long one. Usng the snakelke method, the extent of vbratons nvolved s reduced dramatcally. Nevertheless, there wll be blnd nodes. Therefore, the methods aforesad can not be relable enough to fulfll a sutable level of effcency at the system. To choose the best pathway, all the possble arrangements of nodes, that s, n! possble choces for the n nodes avalable should be consdered whch leads to a very tedous and tmeconsumng operaton and process specfc. Thus, optmzaton of travelng pathway s an mportant and essental step to word the desgn of prnted crcut boards. For ths reason and to overcome ths draw back a genetc algorthm (GA) s beng used for mnmze the total pathway [6]. To llustrate the effectveness of the proposed method a 100-node component s consdered as a test pattern. The results of proposed genetc algorthms
based travelng pathway (GATP) are compared wth tradtonal methods through some performance ndces. The performance ndces are chosen as Absolute Error (AE), Mean Square Error (MSE), Mean Percentage of Absolute Error (MPAE), and Mean Regulaton (MR%). Ths smulaton results show that proposed method not only acheve good result performance, but also t s superor to other classcal methods. Moreover the pathway s shorter, the devce deprecaton and the total functonal tme wll be mnmzed. Thus, t s recommended to mnmze travelng pathway n the automatc drllng of prnted crcut boards. n to other devces. Therefore, wth the same order of the pads, the same old long pathway wll be followed. 3.1. Sortng through the x-then-y method Usng the x-then-y method, the coordnates of every node s evaluated wth respect to an offset node and the coordnates are sorted wth sortng algorthms such as Selecton, Merge, Quck-sort or any other sortng 2. The Structure of the PCB Automatc drll A scheme of an automatc drll s shown n fg 1. It s seen that the devce operates on the two x and y axes whch are orthogonal and dsplaced by the step-motors along the axes. Wth a computer command sent to the x motor and the steps beng declared, the motor at ths axs rotates to the extent commanded and leads the head-ral to the desred place on the x axs. The same operaton s carred out for the y axs. The head-ral starts the dsplacements exactly on a node frst drlled and calbrated as the orgn (0,0) wth respect to the offset node. When guded to the pad area, the head-ral s lowered by the z motor and havng completed the drllng, the head rses up to be dsplaced on the x-y drecton headng the other pns. The control board of the devce s composed of the step-motor devces and moton censors (lnear moton decoder). Some devces have flm-encoders on the pathway whch alert the command crcut wth sendng feedbacks to check the sound performance of the motor. In such devces, the servo-motors are manly used n leu of the step-motors [2]. The dsplacement of the automatc headral from one node to another requres a movement along the x-y axes. The PCB desgn software gudes the headral through the pathway wth provdng the coordnates. The more exactly the next node s selected, the shorter wll be the pathway, that s, less deprecaton of the devce, less tme requred and regardng a drop n the number of steps or the step motons of the step-motor, the overall system wll be more accurate. 3. The proposed algorthm The PCB desgnng applcaton softwares, offer the nodal coordnates on the pad whch are the pns of the components to be nstalled. The coordnates may be assgned for a va whose order s the same as desgned, that s, how the crcut desgner arranges the components on the PCB accordng to whch the pads are lsted and fed Fg 1: The scheme of the automatc drll. algorthm on the x axs and the y coordnates correspondng to the x ones are dsplaced based on If (x > x j ) then exchange (P,P j ) (1) The relatonshp above P(x,y) and Pj(xj,yj) are two separate nodes of the lst beng dscussed. 3.2. Snakelke sortng Usng ths method, the x axs should be dvded nto n sectons. The axes are sorted y-then-x and x-then-y alternately. The ascendng-descendng strategy s carred out at the other axes as well. As the moton step x s dvded nto n sectons, the zgzag pathway s 1/n and the leaps (jumps) decease lkewse. Great care should be taken n the choce of n whch must not exceed a lmt and f t does, t wll result n a local optmzaton. 3.3. Sortng wth the mnmum dstance method The operaton begns wth drllng a (0,0) offset pont. The dstance between any node n relatve to an exstng node r s calculated usng equaton 2 and compared to the prevous values to fnd the mnmum value - the shortest path to the next node - and lst t. The node assumed s the node r and the nearest node to r s to be found: D 2 2 = ( xr xn) + ( yr yn) (2)
Usng ths method, the system s accelerated consderably and the pathway shrnks. Although the methods dscussed above offer a relatve mprovement, they are not able to mnmze the pathway. To ths end one should consder all the n! stuatons whch wll ncrease dramatcally wth the number of pads nvolved and wll be almost mpossble to be calculated. The genetc algorthm s used here to obvate ths obstacle. and as the genetc algorthm as a maxmzng process, one can choose the ftness functon to be the nverse of the objectve functon. To optmze the system usng the genetc algorthm, regardng the objectve functon selected n equaton 2, one can choose the ftness functon as 1 F = (3) D 3.4. The shortest pathway usng the genetc algorthm The genetc algorthm s a method based on a natural selecton mechansm whch s successfully used n many optmzaton problems. Ths algorthm holds several prortes [7]: - Instead of dealng wth the parameters, the algorthm deals wth a set of coded parameters. - In genetc algorthm a set of nodes are consdered, not a sngle node. - The genetc algorthm makes use of the data generated by the objectve functon tself, not usng ts dervatves or any other auxlary data. - The genetc algorthm avals from the probablstc functons rather than any specfc equaton. GA focuses on the avalable populaton to generate the chldren n the next generaton. The algorthm choce parents wth best characterstc and transfers them to the matng pool for the genetc algorthm. After the genetc operands are appled, based on Eltsm crteron, a number of parents and chldren are selected for the next generaton. Ths cycle of reproducton and natural selecton contnues untl one of the genetc termnaton crtera s satsfed. The flow chart of the genetc algorthm s shown n fg 2. Before proceedng wth the GA approach, there are two prelmnares to be fnshed [8]. Defnton of sutable Codng: To solve optmzaton problems wth the genetc algorthm, codng s of great mportance. Codng projects the parameters from a real doman to a soluton doman, n whch the problem s beng dealt wth usng the genetc algorthm. Each chromosome s consdered as a sample response n the soluton doman and s composed a number of genes. The number of genes depends on the number of varables ntended to be chosen. Fg.3 shows a sample codng to solve an optmzaton problem along the drll pathway. If n output nodes n the pad-lst are consdered, each gene of a chromosome can be taken as an ndex of a specfc node. As a result, the chromosome wll hold n bts of genes. Choce of ftness functon: For each chromosome of the populaton beng studed, a number of ftness s attrbuted Fg. 2: the flow chart of the genetc algorthm. Based on a flowchart on fg. 2 and the tow prelmnares carred out, the sequences of the genetc algorthm are: Generatng the ntal populaton: Several patterns (chromosomes) are selected out of the same set randomly. The number of these patterns or chromosomes whch s the number of populaton can be user defned. Evaluatng the objectve functon: At ths stage, based on the selected ftness functon, t s estmated that how ft (deservng) s every member of the populaton. 1 2 I J N Fg. 3: A sample chromosome n the soluton space.
Reproducton: Ths stage nvolves couplng the patterns randomly to be sent to the matng pool and reproduce the next generaton wth the genetc and reproductve operands. Crossover: Fg4 shows the process through whch chldren are produced usng the crossover operand. Frst each pattern s dvded nto 3 parts whle the edge elements receve (n/4) bts and the elements n between receve (2n/4) bts. Mutaton operaton: At ths stage the [2n/4] bts are * * Parent1 (3 5 7 2 1 6 4 8) Parent2 (2 5 7 6 8 1 3 4) Fg. 8 the moton of the drll s shown usng the Snakelke method. It s seen that the dstance of the nodes at every zgzag jump s reduced and the total pathway shrnks to 5574 unts. Fg. 9 The head-ral moton (pathway) s shown based on the nearest node to the exstng node method. It s observed that ths algorthm holds some errors whch orgnate from an accumulatve dstance from the blnd nodes and consequently the drll needs more tme to reach these nodes compares to the rest of the nodes. The total pathway on the test pattern based on ths method s 4785 unts. Chld1 (5 8 7 2 1 6 3 4) Chld2 (3 5 7 6 8 1 2 4) Fg. 5: the executon method of the mutaton operand. selected to be replaced by [n/8] at the left and rght edges, as shown n fg. 5. * * Before: (5 8 7 2 1 6 3 4) After: (5 8 6 2 1 7 3 4) Fg. 4: The executon method of the crossover operand. Eltsm: Among the populaton of the parents and the chldren, the chromosome of the next generaton s selected based on the ftness functon. Termnaton crteron: At ths stage t s decded whether the genetc algorthm stops or not. The crtera of termnaton at ths algorthm may be actve or passve. In the passve form, the number of stages of reproducton s decded by the user who chooses the number of generatons. In the actve crteron, f n a number of consecutve generatons no change happens (the number of these generatons s defned by the user), that s, the value of the ftness functon does not mprove, the algorthm termnates. 4. Smulaton To see how effectve the proposed algorthm n mnmzng the automatc drll s pathway s, the algorthm s appled on a group of test data whch are the output data of the PCB desgn softwares such as Protel, OrCAD, EasyPC and the lke. In fg. 6 the pattern test s shown wthout a sortng functon whch shows the pathway followed by the automatc head-ral to be 25290 unts. Fg. 7 rearranges (sorts) the test pattern based on the x-then-y method. As can be seen n the fgure the headral moton s zgzag and the total pathway s 17717 unts. Fg. 6: Explorng the pads based on the ntal lst. Fg. 7: exploraton of the pads based on the lst sorted by the x- then-y algorthm. Fg. 10 shows the convergence of the GA. That after 16 t oraton the algorthm reach the optmal value. In practcng the genetc algorthm the genetc parameter nvolved are provded n table 1. The results of pathway are shown n fg. 11. Accordng ths fgure total pathway usng ths method s 4172 unts.
Fg. 8: Exploraton of the pads based on the lst sorted by the Snakelke algorthm. Fg. 9: Exploraton of the pads based on the mnmum dstance algorthm. Fg. 11: Exploraton of pads based on the genetc algorthm. To demonstrate the performance robustness of the proposed method, the Absolute Error (AE), Mean Square Error (MSE), Mean Percentage of Absolute Error (MPAE) based on pathway characterstc are beng used as: ABSE = D G D K (4) ( DG DK ) MSE = n DG DK 100 DG MPAE = n 2 (5) where: : node number ndex n: total number of nodes present G: ndcates the genetc algorthm K: ndcates the other arrangement methods. K belongs to all the arrangement methods. Dg: The dstance of the ' th ' pont usng the genetc algorthm Dk: The dstance of the ' th ' pont usng other arrangement methods (6) The values of AE, MSE and MPAE are calculated for each method and lsted n table 2. Ths table shows that: Fg. 10: The convergence dagram of the genetc algorthm Max Gen P c P m Pop sze Actve condton 100 0.9 0.1 20 15 generaton wth out mprovement Table 1: Genetc algorthm parameter. ABSE MSE MPAE No Sort 21147 59922 677 x then y 14063 33138 420 Snake 2970 1924 98 mn dst. 2906 2159 83 Table2: The errors of dfferent algorthms beng compared to the genetc algorthm.
1. The x-then-y method holds less dstance error compared to the unsorted lst. 2. The snakelke method holds also holds less error compared to the x-then-y method. 3. The mn dstance method holds less error compared to the prevously mentoned methods. 4. usng the genetc algorthm may guarantee that a complete optmzed pathway could be found. As a result the drll wll move on a mnmzed pathway and ths s economc both regardng the devce deprecaton and tme. To evaluate the mprovement, the crteron MR% n equaton 7 s used and the result s provded n table 3. Ths table shows that usng the genetc algorthm mproves the optmzed result by 83.5%. D ( nosort) Dj( metods) j MR % = 100 (7) D ( nosort) MR% x then y 29.9 Snake 77.2 Mn Dst. 81.1 Genetc 83.5 Table. 3: Comparng the extent of mprovement. The above results show that n comparson wth other methods, the system performance s sgnfcantly mproved by GATP. 5. Conclusons In ths paper a new GA based travelng pathway s proposed to mnmze the movement of automatc drllng of prnted crcut boards. Ths strategy was chosen because of ncreasng complexty of optmzng problem for bgger boards. It should be noted that to acheve the desred level of robust performance, mnmzng the total pathway s very mportant. Thus to reduce the classcal method efforts and ncrease cost savng, a GA ha s been used to choose the best pathway. In ths work GA works offlne and s used to fnd the optmal total pathway. Ths proposed method can guarantee the optmum value of the ftness functon. The salent feature of the proposed method s that the desgn process s less demandng that other methods. The proposed GATP was tested on a 100-node pattern to demonstrate ts effectveness. Smulaton results show that the proposed s very effectve and acheve good robust performance. The system performance characterstcs n term of AE, MSE, MPAE and MR% ndces reveal that the GATP s promsng method for soluton of the travelng pathway between PADs n the automatc drllng of prnted crcut boards and superor to tradtonal methods. Ths s lead to the reducton n the dstances, mnmzaton and optmzaton of the reacton perod, the error and deprecaton of the system. Thus t s recommended to optmzaton total pathway travelng problem. References: [1] A.R. MohammadNaOranj, K. Nav, Desgn & Implement Smart Drll for PCB, MSc Tees, IAU Scence and Reaserch Branch, Tehran, IRAN, 2001. [2] A.R. MohammadNaOranj, K. Nav, Step Motors and Industral Automaton, Semnar, IAU Scence and Reaserch Branch, Tehran, IRAN, 2001. [3] R. B. Reese, OrCad Layout Plus PCB Tutoral, ECE, MSU, 2005. [4] E. Carter and C.T. Ragsdale, A new approach to solvng the multple travelng salesperson problem usng genetc algorthms, European Journal of Operatonal Research, 175(1) 16:246-257, 2006. [5] Ch. Fa. Tsa, Ch. W. Tsa and Ch.Ch. Tseng, A new hybrd heurstc approach for solvng large travelng salesman problem, Informaton Scences, 166(1-4):67-81, 2004. [6] K. Katayama, H. Hrabayash, H. Narhsa, Performance analyss for crossover operators of genetc algorthm, Systems and Computers n Japan, 30(2): 20-30, 1999. [7] H. Shayegh, A. Jall and H.A. Shayanfar, Robust modfed GA based mult-stage fuzzy LFC, Energy Converson and Management, 48(5): 1656-1670, 2007. [8] H. Shayegh, H.A. Shayanfar and A. Jall, Mult-stage fuzzy PID power system automatc generaton controller n deregulated envronments, Energy Converson and Management, 47(18-19):2829-2845, 2006.