Sei sulla pagina 1di 11

Articial Intelligence in Engineering 14 (2000) 319329 www.elsevier.

com/locate/aieng

A genetic algorithm for generating optimal assembly plans


B. Lazzerini, F. Marcelloni*
Dipartimento di Ingegneria della Informazione: Elettronica, Informatica, Telecomunicazioni, University of Pisa, Via Diotisalvi 2, 56126 Pisa, Italy Received 30 July 1999; revised 2 June 2000; accepted 5 June 2000

Abstract In this paper, we propose a genetic algorithm that generates and assesses assembly plans. An appropriately modied version of the wellknown partially matched crossover, and purposely dened mutation operators allow the algorithm to produce near-optimal assembly plans starting from a randomly initialised population of (possibly non-feasible) assembly sequences. The quality of a feasible assembly sequence is evaluated based on the following three optimisation criteria: (i) minimising the orientation changes of the product; (ii) minimising the gripper replacements; and (iii) grouping technologically similar assembly operations. Two examples that endorse the soundness of our approach are also included. 2000 Elsevier Science Ltd. All rights reserved.
Keywords: Assembly planning; Genetic algorithms; Partially matched crossover; Mutation

1. Introduction Planning aims to develop a strategy for achieving some desired goal [1]. It can be used for problem solving in such elds as economics, manufacturing, and robotics, which involve multiple decision-making activities. Actually, a planning system generates a plan, i.e. a sequence of domain-specic actions or operations, that leads from an initial state to the goal state. The planning activity generally involves searching a space of possible solutions; this space grows exponentially in the number of actions. Usually an action can take place only if specic conditions hold; a precondition is therefore associated with each action so as to specify when the action can be performed. The use of preconditions may reduce the solution space signicantly. When an action is executed, some preconditions may change, thus enabling or disabling other actions. One of the most interesting applications of planning is assembly planning, which aims to identify and evaluate the different ways to construct a mechanical object from its component parts. More precisely, an assembly sequence planner is a system which, based on the geometric description of a composite object (also called assembly or subassembly), identies the parts that construct that object and generates assembly sequence plans [2,3]. Each plan species the collection of insertion operations to be carried
* Corresponding author. Tel.: 39-50-568-678; fax: 39-50-568-522. E-mail addresses: beatrice@iet.unipi.it (B. Lazzerini), france@iet.unipi.it (F. Marcelloni). 0954-1810/00/$ - see front matter PII: S0954-181 0(00)00011-X

out and the order in which these operations have to be performed. An insertion operation moves a component or sub-assembly along a specic trajectory, and possibly joins two components or sub-assemblies. Actually, not all the combinations of assembly operations are geometrically feasible. Geometric feasibility (i.e. absence of intersecting parts) crucially depends on the order of assembly operations owing to physical and geometrical constraints of the assembly. Further, some feasible and valid assembly sequences can be better (e.g. less time-consuming, more cost-effective, etc.) than others. Automatic generation of all the feasible assembly sequences for a given product is highly desirable in manufacturing industry. For example, integrating a sequence planner into a CAD tool we can provide immediate feedback to the designer about the ease or difculty of assembling the specic product, maybe highlighting hidden problems or even generating novel solutions to known problems. Of course, to automatically nd good assembly plans is even more important. Typically, application-specic goodness criteria, such as the number of tools and tool changes required, or the degree of parallelism allowed, are considered to select good plans from a set of feasible plans [4]. A common approach to assembly planning is assembly by disassembling, i.e. an assembly sequence results from systematically disassembling the nal product and reversing the disassembly sequence [5,6]. Indeed, classical algorithms for assembly planning make use of an undirected graph, called the liaisons graph, that represents the topology of

2000 Elsevier Science Ltd. All rights reserved.

320

B. Lazzerini, F. Marcelloni / Articial Intelligence in Engineering 14 (2000) 319329

the mechanical object. The nodes and the edges of the liaisons graph represent, respectively, the components and the mechanical liaisons that connect pairs of components. Given a liaisons graph, a decomposition method is used to systematically generate the assembly plans [7]. More precisely, the liaisons graph is decomposed into two distinct connected sub-graphs that represent two sub-assemblies. If this decomposition corresponds to a feasible assembly operation (i.e. there exists a geometric constraint-free trajectory to mate the two parts), the two sub-assemblies undergo a new decomposition attempt and so on, recursively, until the sub-assemblies consist of just one component. This recursive decomposition process may be represented by a non-ordered directed tree, which is called assembly tree. There are two kinds of nodes in the tree: the part nodes, which represent the component parts, and the liaison nodes, which describe the connectivity between part nodes and/or liaison nodes. Each assembly tree represents a feasible assembly plan. More precisely, moving from bottom to top, we assemble, in some order (e.g. from left to right), the parts connected by a liaison node. At each step, we either combine a part with a built sub-assembly or put two built sub-assemblies together. In this way, we establish in which order the component parts are considered and the mechanical operations (like insert, mate, screw, etc.) are performed. The assembly plans generated from all the assembly trees are then evaluated against such indexes as the complexity of the trajectories, the stability of the involved sub-assemblies, and the number of orientation changes of parts. The best plans are then selected. It is clear that exhaustive search methods theoretically guarantee optimal solutions, but are unfeasible for complex mechanical products due to unacceptable computational overhead. They can protably be used only when specic constraints can sensibly reduce the number of possible assembly plans or some heuristics can be used based on the knowledge of an expert of the product [810]. In this paper, we propose a genetic algorithm-based approach to generate and evaluate feasible near-optimal assembly sequences. Genetic algorithms (GAs) have proved to be highly effective in solving NP-hard problems and some successful applications to assembly and process planning have been already presented [1115]. Furthermore, efcient and exible planning can be easily achieved by using chromosomes to represent assembly sequences and considering application-specic goodness criteria as tness criteria. The basic idea is to combine two good assembly plans to produce an assembly plan that is better than both parents. Experimental results conrm that, starting from a randomly initialised population of (possibly non-feasible) assembly sequences, the algorithm converges to a feasible sequence. Further, the best solution found in a considerable percentage of the trials carried out during our experimentation is that typically adopted by the human expert.

2. The genetic algorithm In this work we focus on assembly lines composed of robots that can assemble parts only along the vertical axis. This raises the problem to orient the sub-assembly along the direction that allows the robot to perform the insertion operations. As the orientation procedure may be very expensive, the number of orientation changes should be reduced as much as possible. During the assembling process, the single parts are grasped and placed into the assembly line. A gripper mounted on the arm of a robot carries out the grasping. Several types of grippers are available: ngered, magnetic, expandable, and vacuum grippers. Each gripper is characterised by particular features, which make it more appropriate than others to grasp specic components. The choice of a gripper is based on the surface morphology, the size and position of the grasping area(s), and the geometrical form of the component. Of course, as the replacement of a gripper is a time-consuming operation, a proper trade-off between grasping quality and number of replacements should be found. Finally, after the parts have been correctly positioned, they are inserted. Screwing and pressing are examples of insertion operations. To speed up the assembly process, similar operations should be executed consecutively to reduce the number of tool replacements. According to the previous considerations, the optimisation criteria we use to assess the quality of feasible assembly sequences are the following: (i) to minimise the orientation changes of the assembly; (ii) to minimise the gripper changes; and (iii) to group as much as possible technologically similar assembling operations. GAs are adaptive methods suitable to solve optimisation problems [16]. By mimicking the principles of natural selection, GAs are able to evolve solutions for real world problems, provided that they have been suitably encoded. Each potential solution to a given problem is coded as a binary or real string that is called chromosome. Generally, GAs start with a randomly generated initial population of chromosomes. At each step a new population is generated from the current one using two basic operators: crossover and mutation. While crossover combines parent chromosomes to generate offspring chromosomes, mutation is a local modication of a chromosome. Chromosomes are selected for crossover and/or mutation based on their tness value. 2.1. Codifying chromosomes for assembly planning The rst step in developing a GA for assembly planning is to map the problem solutions (assembly sequences) to chromosomes. In our system, a chromosome codies three variables representing, respectively, the component parts listed in assembling order, the directions and orientations along which the components have to be inserted, and the type of grippers needed to perform the insertions. All the

B. Lazzerini, F. Marcelloni / Articial Intelligence in Engineering 14 (2000) 319329

321

Fig. 1. Percentage of trials with a feasible assembly sequence for the rst product.

chromosomes have the same length. This representation can cover all the solution space produced by the sequence of assembly operations, the selection of grippers, and directions. Component parts may be single components or subassemblies. A generic chromosome C consisting of the three variables v1, v2, and v3, is represented as v1;1 v1;N ; v2;1 v2;N ; v3;1 v3;N : The component parts v1;i ; 1 i N; are codied with the integer numbers 1,,N, the directions/orientations v2;i ; 1 i N; are codied as the pair s; a; where s { ; } and a {x; y; z}; and the types of gripper v3;i ; 1 i N; are codied with the integer numbers 1,,T, where T is the number of usable grippers. Actually, we consider ve different types, namely, two- and three-nger grippers, magnetic, expandable, and vacuum grippers. In the following, the gripper types will be denoted as Gt, 1 t T: Genes in the same positions in v1, v2 and v3 are called corresponding genes. 2.2. Fitness function In general, chromosomes may correspond to unfeasible assembly sequences. Therefore, the tness value associated with a chromosome is a function of both the extent to which the assembly sequence represented by that chromosome meets the above criteria and the feasibility degree of the assembly sequence. The feasibility degree of an assembly sequence is the length of the longest feasible sub-sequence in the chromosome. Note that chromosomes are regarded as loops so that a (feasible) sub-sequence is able to wrap around at the end of the chromosome. If the feasibility degree is equal to the number of components and the

feasible sequence is wrapped around at the end of the chromosome, then the genes of the three variables in the chromosome are simultaneously rotated until the head of the feasible sequence coincides with the rst gene of v1. We recall that a sub-sequence is feasible if its components can be assembled using the specied directions/orientations and grippers. The test for sub-sequence feasibility is carried out by using the method proposed in Ref. [17]. In this method, a product is represented in terms of three square matrices for each major axis a, with a {x; y; z}; namely the interference matrix Ia, the contact matrix Ca and the connection matrix La. The size of these matrices is equal to the number of parts composing the product. A part pi interferes with a part pj along a given direction a if, translating pi along a until pi is completely separated from the sub-assembly, pi collides with pj. A part pi is in contact with pj along a given direction a, if pj forbids pi to move along a. While the elements of matrices Ia and Ca simply specify the presence of interference or contact, an element of the matrix La codies the connection type (e.g. threaded, forced, pressed). Exploiting the matrices Ia, Ca and La, the method is able to assess the feasibility degree of an assembly sequence. The matrix La is also used to determine how many similar assembling operations have been grouped in the assembly sequence. The tness associated with a given chromosome c is calculated as a weighted sum f c w1 l w2 N 1 o w3 N g 1 w4 s 1 where N is the number of components, and l, o, g and s represent, respectively, the length of the longest feasible sub-sequence, the number of orientation changes of the assembly, the number of gripper changes, and the maximum number of similar assembling operations grouped together. The choice of the weights wi, i 1; ; 4; is crucial to the effectiveness of the tness function. A wrong balancing of the weights could bring our GA to prematurely converge to a sub-optimal and/or a non-feasible sequence. To determine a method of selecting weights, we evaluated the stability of the GA to variations of the weights. We performed the following three experiments on two products composed of 8 and 11 components, respectively. (These products will be described in Sections 3.1 and 3.3, respectively.) Let N be the number of components of the product under consideration. In the rst experiment, we wanted to assess how and how much the value of w1, with respect to values of the other weights, affected the probability of achieving a feasible assembly sequence. We xed the value of w2, w3 and w4 to 1, and made the value of w1 vary from 1 to N. For each combination of the weights, we conducted 25 trials of the GA. We used an initial population of 80 chromosomes, crossover and mutation probabilities of 0.9 and 0.8, respectively. We observed that values of w1 larger than the values

Fig. 2. Percentage of trials with a feasible assembly sequence for the second product.

322

B. Lazzerini, F. Marcelloni / Articial Intelligence in Engineering 14 (2000) 319329

Fig. 3. Average of the tness values of feasible assembly sequences for the rst product.

of w2, w3 and w4 benet the probability that the GA converges to a feasible assembly sequence. Figs. 1 and 2 show the percentage p of trials with a feasible assembly sequence against the values of w1 for the rst and the second product, respectively. It can be noticed that the percentage p is very low if w1 w2 w3 w4 1; whereas, it grows rapidly with the increase of w1. In particular, the percentage approaches 100% from w1 4 onwards and w1 6 onwards in the rst and second product, respectively. It can be argued that a reasonable choice for the ratio between w1 and each of the other weights would be approximately N/2, with N the number of product components. Repetitions of the same experiment on products composed of up to 17 components strengthened this hypothesis. It follows that,   xed w2 w3 w4 w 1 and w1 wm; with m 1; the GA converges to feasible assembly sequences with a high probability for N=2 m N: To determine which value of m guarantees the best performance, we analysed the tness values. Figs. 3 and 4 show the average of the tness values associated with the feasible assembly sequences against w1. Here, to make the tness values comparable, we recomputed the nal tness values by considering all the weights equal to 1. It can be observed that the tness value decreases with the increase of w1. Indeed, higher values of m weight too much the rst variable with respect to the other three and lead the GA to converge prematurely to a local (non-feasible) maximum. We can conclude that the optimal value for m is N/2. In the second experiment, we considered only the rst product. We varied w2 w3 w4 from 1 to N, and for  each value of w2 w3 w4 w; we made w1 vary from 1 to N. The aim of the experiment was to assess if the ratio

Fig. 5. Percentage of trials with a feasible sequence against w1 and w: 

between w1 and each of the other weights should be N/2 independent of the actual values of the weights. Fig. 5 shows the trend of the percentage of trials with a feasible  sequence against the values of w1 and w: Fig. 6 shows the average of the tness values associated with the feasible  assembly sequences against the values of w1 and w: Again, one can deduce that the ratio between w1 and each of the other weights should be N/2. In the third experiment, with reference to the rst product, for each value of w1 from 1 to N, we considered all combinations of values for w2, w3 and w4, each ranging from 1 to N. The experiment aimed to assess if, for a xed value of w1, which guarantees the convergence to a feasible assembly sequence with a high probability, different values of w2, w3 and w4 affected the optimality of the nal assembly sequence. We veried that, for a xed value of w1, the probability to achieve a feasible optimal solution does not depend on assuming the same values for w2, w3 and w4.  We concluded that the choice w2 w3 w4 w and  w1 N=2w seems to guarantee the best results. 2.3. Crossover We adopt a modied partially matched crossover for the rst variable (i.e. the sequence of components). The other two variables (i.e. the directions/orientations and the type of grippers) are appropriately rearranged in the offspring to t the modications produced in the rst variable. The

Fig. 4. Average of the tness values of feasible assembly sequences for the second product.

 Fig. 6. Average of the tness values of feasible sequences against w1 and w:

B. Lazzerini, F. Marcelloni / Articial Intelligence in Engineering 14 (2000) 319329

323

partially matched crossover (PMX) is particularly suited to solve order-based problems, such as the classical travelling salesman problem [16]. In these problems, the tness depends on the ordering of the genes. Actually, supposing that each gene in a chromosome species a valid grasping operation (i.e. the gripper is suited to grasp the associated component), the feasibility of an assembly sequence is determined by the order in which the parts composing the assembly are assembled. This assumption is always veried in our GA because the gripper associated with a component is always selected from the set of grippers suited to grasp the component. As an example, suppose N 9 and consider the following two chromosomes: CA : CB : 4 5 3 1 2 8 7 6 9 8 7 6 5 4 3 2 9; vA vA ; vA vA 2;1 2;9 3;1 3;9 1; vB vB ; vB vB 2;1 2;9 3;1 3;9

CB, assume that the sub-sequence 3 1 2 in CA is feasible, but is not correctly placed to generate any feasible assembly sequence. If the three random numbers are l 3; a 3 and b 9; we obtain CA : CB : 4 5 3 1 2 8 7 6 9; vA vA ; vA vA 2;1 2;9 3;1 3;9 9 8 7 6 5 4 3 2 1; vB vB ; vB vB 2;1 2;9 3;1 3;9
s e e s s e

and applying MPMX we have OA : QB : 4 5 1 9 8 2763; vA vA ; vA vA 2;1 2;9 3;1 3;9 1 2 7 6 5 4 9 8 3; vB vB ; vB vB 2;1 2;9 3;1 3;9
e s

In PMX, two inter-gene crossing points are generated uniformly at random along the chromosomes. The substring included s within the two points (represented below e by vertical bars and is called a matching portion. CA : CB : 4 5 3 1 2 8 769; vA vA ; vA vA 2;1 2;9 3;1 3;9 9 8 7 6 5 4 3 2 1; vB vB ; vB vB 2;1 2;9 3;1 3;9
s e s e

The other two variables in the chromosomes are dependent on the modications occurred in the rst variable owing to the application of MPMX. More precisely, the position-wise exchanges executed on the genes of the rst variable are also carried out on the corresponding genes of the other two variables. For instance, if vA is exchanged with vA ; 1;5 1;6 then correspondingly vA and vA are exchanged with vA 2;5 3;5 2;6 and vA ; respectively. In this way, a bad-placed feasible sub3;6 sequence may be moved to the correct position. For the sake of simplicity, let us suppose that each component can be grasped by the three different grippers G1, G2 and G3. As a real example, let CA : 4 5 3 1 2 8 7 6 9; x x y z y y z y

PMX performs position-wise exchanges. First, mapping the chromosome CB to CA, in the chromosome CA, 1, 2 and 8 are exchanged, respectively, with 6, 5 and 4. Then, mapping the chromosome CA to CB, in the chromosome CB, 6, 5 and 4 are exchanged, respectively, with 1, 2 and 8. The two offspring OA and OB generated from CA and CB are OA : OB : 8 2 3 6 5 4 7 1 9; vA vA ; vA vA 2;1 2;9 3;1 3;9 9 4 7 128 3 5 6; vB vB ; vB vB 2;1 2;9 3;1 3;9
s e s e

z; G1 G2 G3 G3 G2 G1 G1 G1 G2 CB : 9 8 7 6 5 4 3 2 1; y x x y z z x y

x; G2 G3 G1 G1 G3 G3 G3 G3 G1 be two chromosomes. Let us assume that l 3; a 3 and b 9: Applying MPMX to the rst variable and modifying the other two variables in the offspring appropriately, we obtain OA : 4 5 1 9 8 2 7 6 3;
s s e s e

We introduced a modied version of the classical PMX that is suitable to the specic application. We called this version MPMX. MPMX allows the matching portion to be located possibly in two different parts of the two mating chromosomes. This is obtained by generating uniformly at random three numbers, representing, respectively, the length l, 0 l N; of the matching portion, and the starting positions a and b, 0 a; b N; of the matching portion in the chromosomes CA and CB, respectively. This modication has been introduced in order to allow an incorrectly placed feasible sub-sequence (i.e. a sub-sequence actually contained in some feasible sequence, but in a different position) to change position in the offspring. The chromosomes are considered circular, i.e. if a l N (or b l N; the matching portion of the chromosome CA (CB) is completed by selecting subsequent genes starting from the head of the chromosome CA (CB). Referring to the chromosomes CA and

x
e

y; G1 G2 G3 G2 G1 G2 G1 G1 G3 OB : 1 2 7 6 5 4 9 8 3;
e e s e s

x
s

x; G1 G3 G1 G1 G3 G3 G2 G3 G3

324

B. Lazzerini, F. Marcelloni / Articial Intelligence in Engineering 14 (2000) 319329

2.4. Mutation To achieve the two-fold objective to generate a feasible and optimal sequence, we adopt three different mutation operators in sequence. The rst mutation operator is applied to each of the three variables. It scans the rst variable from left to right and selects a gene with probability 2/N, where N is the number of components. This value of probability guarantees that at least one gene is always selected and possibly two. Experimental results have proved that this choice allows a good trade-off between computation overhead and performance. Let i, 0 i N; be the position of the selected gene. Then, the mutation operator chooses randomly a position j, 0 j N; i j; and exchanges the corresponding genes in each of the three variables of the chromosome. This operator may improve the tness of chromosomes that are not feasible due to the wrong position of two components. As an example, consider the chromosome OA OA : 4 5 1 9 8 2 7 6 3; x x z z y y z y

gripper is replaced by a gripper randomly chosen within the set of grippers suited to assemble the component in position z of the rst variable. Let z 4 be the selected position. Then, applying the mutation operator we may obtain the following chromosome O HHH A: O HHH : A 4 5 2 9 8 1 7 6 3; x x y x y z x y

z; G1 G2 G2 G3 G1 G3 G1 G1 G3

2.5. Evolution Starting from a randomly set initial population composed of 80 chromosomes, at each generation, chromosomes are selected for reproduction with a probability directly proportional to their tness value. More precisely, an intermediate population is generated by applying the stochastic sampling with replacement method [16]. The probability of crossover is 0.9; the probability of mutation ranges from 0.6 to 0.9 depending on the specic product. This choice is motivated by experimental observations. Further, similar probabilities have been already adopted in other works [15]. When the mutation is selected, all the three mutation operators are applied in sequence. Each chromosome selected for reproduction will produce an offspring. The high value of mutation probability ensues from an accurate analysis carried out testing several different values of this probability. We examined assemblies composed of a number of components up to 17. Experimentally, we veried that for low values of mutation probability, the GA converges in few seconds, but frequently toward a non-feasible sequence. Further, the feasible sequences generated are far from being the optimal ones. High values of mutation probability allow us to overcome these problems despite an increase of computational overhead. Only 60% of the new population is composed of offspring, whereas 40% consists of the best chromosomes of the previous population. This acceptance mechanism reduces the risks of a premature convergence of the algorithm to a local minimum, allowing the acceptance of an offspring worse than its parents. Further, transplanting the best individuals of the previous generation to the new generation, the results achieved so far in the evolution process are not lost. When the average of the tness values of all the individuals in the population is greater than 97% of the tness value of the best individual, the GA is considered to have converged and therefore is stopped. In the experiments carried out using different assemblies with a number of components up to 17, the stopping criterion has been always reached.

y; G1 G2 G3 G2 G1 G2 G1 G1 G3 Let i 3 and j 6 be the selected and the randomly chosen positions, respectively. The application of the mutation operator transforms OA into the following chromosome: O HA : 4 5 2 9 8 1 7 6 3; x x y z y z z y

y; G1 G2 G2 G2 G1 G3 G1 G1 G3 The second mutation operator is applied only to the second variable. The operator randomly selects two numbers x and y, 0 x; y N; which identify the starting position and the length of a portion of the variable, respectively. Each gene in the portion is replaced with a probability of 2/N by a gene chosen within the set of possible assembly directions/orientations. Again, the chromosomes are considered to be circular, i.e. the tail of the chromosome is considered to be connected to the head. This operator allows us to modify sequences whose components are in the right order, but the assembly directions/orientations are wrong. Let x 3 and y 7 be the two numbers randomly selected. Applying the mutation operator to O H A, we may, for instance, obtain the following chromosome O HH A: O HH : A 4 5 2 9 8 1 7 6 3; x x y x y z x y

z; G1 G2 G2 G2 G1 G3 G1 G1 G3 The third mutation operator is applied only to the third variable. The operator randomly selects a position z, 0 z N; in the gripper sequence. Then, the corresponding

B. Lazzerini, F. Marcelloni / Articial Intelligence in Engineering 14 (2000) 319329

325

sequence) was generated: 1 3 2 4 6 5 7 8; z z z z z z z

z; G1 G1 G1 G3 G1 G1 G1 G3 The sequence is feasible and no changes of object orientation are necessary to assemble the product. Further, only three gripper changes are required to grasp all the eight components. The three similar assembly operations (screwing of components 5, 7 and 8) are also correctly grouped together. Analysing the assembly, it can be observed that the generated sequence is effectively the best sequence. Fig. 8 shows the convergence characteristics of the optimisation curve (tness versus number of generations), which was produced by averaging the 100 trials. It can be observed that the GA converges within a low number of generations. The maximum number of generations for convergence was 702. Considering that the initial population is composed of randomly generated (possible non-feasible) sequences, the performance is particularly satisfying.

Fig. 7. Product used in the rst example.

3. Examples To illustrate the behaviour of the proposed GA, we consider two simple products composed of 8 and 11 components, respectively. To take more complex assemblies into account, in the second product, we considered a group of four screws and four washers as separate components, thus obtaining a product with seventeen components. The low number of components easily allows us to generate by hand the optimal sequence with respect to our optimisation criteria and, therefore, to compare the results produced by the system with this optimal solution.

3.2. Improving performance When we introduced the tness function in Section 2, we xed the weight w1 associated with l (i.e. the length of the longest feasible sub-sequence) to be larger than the other weights w2, w3 and w4 associated, respectively, with o (i.e. the number of orientation changes), g (i.e. the number of gripper changes) and s (i.e. the number of similar assembling operations grouped together). The reason for this choice is that feasibility is considered the rst objective to reach. Associating the largest weight with l allows the algorithm to evolve towards feasible sequences possibly despite optimisation criteria. On the other hand, this choice is reasonable until the GA begins to produce feasible sequences. At that moment, in order to converge towards optimal sequences, more attention has to be paid to the o, g and s variables of the tness function. To this aim, the weights of each chromosome corresponding to a feasible sequence have to be balanced in such a way that l, o, g and s contribute to the tness value in the same way. Also, the new weights should not produce an abrupt variation of the tness value. For the sake of simplicity,  assume that w2 w3 w4 w: Then, f c w1 l   wN 1 o N g 1 s w1 l wt; where t N 1 o N g 1 s: The problem can be reduced to compute a new weight w H so that f c w H l t for each chromosome c corresponding to a feasible sequence. To avoid an abrupt variation of the tness func  tion, the new weight w H is chosen so that w1 N wt   w H N t; where t is the value of variable t of the rst chromosome that corresponds to a feasible sequence during    evolution. It follows that w H w1 N wt=N t: Let  w1 N=2 and w 1 be the initial values of the weights.

3.1. First example The product considered in the rst example is shown in Fig. 7. Table 1 contains, for each component, the list of grippers, which can be used to grasp the component. We conducted 100 trials using different, randomly initialised, initial populations of 80 chromosomes. We set the crossover and mutation probabilities to 0.9 and 0.8, respectively. We adopted w1 N=2 and w2 w3 w4 1 in the tness function. The GA has always converged to a feasible sequence. The average tness over 100 trials was 45.61, the minimum tness 44, the maximum tness 46, and the standard deviation 0.52. Table 2 illustrates the distribution of solutions. The average computation time on a Pentium II PC at 266 MHz was 34.7 s. In 63% of the trials, the following optimal solution (corresponding to the best feasible
Table 1 List of grippers usable to grasp the components Component 1 2 3 4 5 6 7 8 Grippers G1 G1 G1 G3 G1 G1 G1 G3 G2 G2 G2 G2 G2 G2 G4 G4 G3 G4 G4 G4

326 Table 2 Distribution of solutions Maximum tness Number of trials 46 63

B. Lazzerini, F. Marcelloni / Articial Intelligence in Engineering 14 (2000) 319329 Table 3 Distribution of solutions with the new tness function 45 35 44 2 Fitness Number of trials 46 80 45 20

Then, the V b b ` H f c b b X

new tness function is


N l N 1 o N 2   w1 N wt N t  N t g 1 s for l N

for l N

Obviously, the maxima of the tness function will be differ ent from execution to execution depending on the value of t: In the following, to compare the results, the tness values of the nal population are recomputed using the tness function proposed in Section 2. We performed the same experiment described in the previous section. We conducted 100 trials using the assembly in Fig. 7 and the new tness function. The average tness over 100 trials was 45.8 and the standard deviation 0.4. The average computation time on a Pentium II PC at 266 MHz was 42.4 s. The results are shown in Table 3. Note that in the 80% of the trials, the GA converges to the optimal solution. Further, in the remaining 20% of the trials, it converges to the solution closest to the optimal one. The maximum number of generations for convergence was 900. It follows that the probability to converge to an optimal solution increases with respect to the tness function adopted in the previous section despite a major computation overhead. Fig. 9 shows the convergence characteristics of the optimisation curve (tness versus number of generations), which was produced by an example trial. The change in the computation of the tness value (from the case l N to the case l N in formula (2)) occurs at generation 87. Observe that the variation of the maximum tness in that point is not abrupt. Further, the average tness is quite smooth. 3.3. Second example The second example concerns the assembling of the pump shown in Fig. 10. Here, the number of components

is 11. In the gure, 8 and 9 denote the four screws and washers that close the body of the pump, respectively. Table 4 shows for each component the list of grippers, which can be used to grasp the component. We conducted 100 trials using different, randomly initialised, initial populations of 80 chromosomes. We used the same parameters as in the rst experiment: the crossover and mutation probabilities equal to 0.9 and 0.8, respectively, w1 N=2 and w2 w3 w4 1 in the tness function. The GA has always converged to a feasible sequence. The average tness over 100 trials was 75.92, the minimum tness 74.5, the maximum tness 78.5, and the standard deviation 1.4. Table 5 illustrates the distribution of solutions. The average computation time on a Pentium II PC at 266 MHz was 111.2 s. The maximum number of generations for convergence was 1451. In 12% of the trials, the following optimal solution (corresponding to the best feasible sequence) was generated: 5 7 2 3 6 10 9 1 8 11 4; y z y y y y y y y y

y; G1 G1 G1 G1 G1 G1 G2 G2 G2 G2 G3

The sequence is feasible. To grasp all the 11 components, only three orientation changes and two gripper changes are required. The three similar assembly operations (screwing) are also correctly grouped together. Analysing the assembly, it can be observed that the generated sequence is effectively the best sequence. Fig. 11 shows the convergence characteristics of the optimisation curve (tness versus number of generations), which was produced by averaging the 100 trials. Using the modied tness function (2) and executing the same experiment we obtained the results shown in Table 6. The GA has always converged to a feasible sequence. The average tness over 100 trials was 77.31, the minimum tness 74.5, the maximum tness 78.5, and the standard deviation 1. The average computation time on a Pentium II PC at 266 MHz was 157.1 s. The maximum number of generations for convergence was 1820. Note that the

Fig. 8. Average and maximum tness versus number of generations.

Fig. 9. Average and maximum tness versus number of generations.

B. Lazzerini, F. Marcelloni / Articial Intelligence in Engineering 14 (2000) 319329 Table 5 Distribution of solutions Fitness Number of trials 78.5 12 77.5 32 76.5 28 75.5 16

327

74.5 11

Table 6 Distribution of solutions Fitness Number of trials 78.5 26 77.5 43 76.5 19 75.5 10 74.5 2

Fig. 10. Product used in the second example.

average tness is clearly improved despite an increase in computational time. Fig. 12 shows the convergence characteristics of the optimisation curve (tness versus number of generations), which was produced by an example trial. The change in the computation of the tness value occurs at generation 295. To show that our GA is able to manage products with a number of components larger than 11, we executed the GA on the pump shown in Fig. 10, but considering the four screws and the four washers (denoted by 8 and 9, respectively) as separate components. Thus, the product is composed of 17 components. Let 8a, 8b, 8c and 8d, and 9a, 9b, 9c and 9d, denote the four screws and the four washers, respectively. We conducted 100 trials using different, randomly initialised, initial populations of 80 chromosomes. We used the same GA parameters as in the previous experiments. The GA has always converged to a feasible sequence. The average tness over 100 trials was 174.1, the minimum tness 170.5, the maximum tness 177.5, and the standard deviation 1.86. Table 7 illustrates the distribution of solutions. The average computation time on a Pentium II PC at 266 MHz was 333.5 s. The maximum number of generations for convergence was 4130. One of the optimal
Table 4 List of grippers usable to grasp the components Component 1 2 3 4 5 6 7 8 9 10 11 Grippers G1 G1 G1 G3 G1 G1 G1 G1 G2 G1 G2 G2 G2 G2 G2 G2 G2 G2 G3 G5 G5 G4 G4 G4 G4 G4 G4 G4 G5

Fig. 11. Average and maximum tness versus number of generations.

solutions was 5 7 2 3 6 10 9d 9a 9c 9b 1 8d 8c 8a 8b 11 4; y y y y y y y y y y y y y z y y

y; G1 G1 G1 G1 G1 G1 G2 G2 G2 G2 G2 G2 G2 G2 G2 G2 G3 The other optimal solutions differed from the solution above only for the ordering of operations 9a9d and/or 8a8d. The sequence is feasible, and to grasp all the seventeen components three orientation changes and two gripper changes are required only. The six similar assembly operations (screwing) are also correctly grouped together. Analysing the assembly, it can be observed that the generated sequence is effectively the best sequence. Using the modied tness function (2) and executing the same experiment, we obtained the results shown in Table 8. The GA has always converged to a feasible sequence. The average tness over 100 trials was 175.3, the minimum tness 171.5, the maximum tness 177.5, and the standard deviation 1.57. The average computation time on a Pentium II PC at 266 MHz was 555.1 s. The maximum number of generations for convergence was 5830. 4. Conclusions and discussion In this paper we have presented a GA for generating optimal assembly sequences. Starting from randomly generated, usually non-feasible, sequences, purposely-dened crossover and mutation operators allow the GA to evolve

328

B. Lazzerini, F. Marcelloni / Articial Intelligence in Engineering 14 (2000) 319329

Fig. 12. Average and maximum tness versus number of generations.

Table 7 Distribution of solutions Fitness Number of trials 177.5 4 176.5 12 175.5 20 174.5 18 173.5 18 172.5 10 171.5 13 170.5 5

to feasible optimal sequences. For the sake of brevity, only two examples were presented. However, several case studies, ranging from very simple to reasonably complex assemblies (consisting of up to 17 components) were considered. A number of trials were conducted for each case with different population sizes (ranging from 60 to 100) and different mutation probabilities (ranging from 0.6 to 0.9). We obtained the best results using the conguration proposed in the experiments, i.e. population size composed of 80 chromosomes, and crossover and mutation probabilities equal to 0.9 and 0.8, respectively. In 96% of the trials the computation time on a Pentium II at 266 MHz was less than 6.5 min using the improved tness function. For products up to 10 components, the best solution found in over 45% of the trials is that typically adopted by the human expert. This percentage falls to 15% for products up to 17 components. To assess the quality of the assembly sequences generated by the GA, a space-state search algorithm has been developed to solve the described examples. It is an A -like algorithm [18] in which each node represents an insertion operation (relative to a specic component) and all its possible combinations of direction, orientation, and type of gripper. Any path from the start node to the goal node, with a specic combination for each operation, represents a single assembly sequence. Search space reduction has been achieved by rst allocating each operation to certain possible positions in the assembly sequence, based on the precedence relationships among them. This means that only feasible sequences can be generated by the algorithm. The search strategy aims to nd the path, corresponding to a feasible sequence, with the lowest total cost. Due to the
Table 8 Distribution of solutions Fitness Number of trials 177.5 15 176.5 24 175.5 23 174.5 17 173.5 13 172.5 5 171.5 3

unfeasibility of an exhaustive approach, the best-rst search was adopted. Starting from the start node, at each iteration, the feasible operation (among those that have not been considered yet) that implies the minimum total cost is chosen. To do this, the algorithm adds the cost associated with the assembly sequence built so far between the start node and the current node, to the estimated cost of completing the sequence. This estimation assumes that each remaining operation is performed by its cheapest combination. In the examples, comparing the assembly sequences found by the space search method to the sequences generated by the GA, we observed that in over 70% of the cases in which the GA converges to a feasible sequence, the tness of this solution is higher than that of the sequence produced by the space search method. Finally, to improve the performance in case of assemblies composed by several components, we are exploring the following approach: we split the assembly into sub-assemblies of a reasonable number of components and apply the GA to each sub-assembly. Then, we execute the GA on the whole assembly starting from an initial population composed of combinations of the best solutions obtained by applying the GA to the sub-assemblies. The encouraging preliminary results obtained so far conrm the validity of this approach. Acknowledgements The authors would like to acknowledge the contribution of Prof. G. Dini and Dr F. Failli in the denition of the mechanical aspects of the application presented. References
[1] Ginsberg M. Essentials of articial intelligence. San Francisco, CA: Morgan Kaufmann, 1993. [2] Homem de Mello L, Lee S, editors. Computer-aided mechanical assembly planning. Boston/Dordrecht/London: Kluwer, 1991.

B. Lazzerini, F. Marcelloni / Articial Intelligence in Engineering 14 (2000) 319329 [3] Homem de Mello L, Sanderson AC, Zhang H. Assembly sequence planning. AI Mag 1990;11(1):6281. [4] Dini G, Failli F, Lazzerini B, Marcelloni F. Generation of optimized assembly sequences using genetic algorithms. Ann CIRP 1999;48(1): 1720. [5] Homem de Mello L, Sanderson AC. AND/OR graph representation of assembly plans. IEEE Trans Robot Automat 1990;6(2):18899. [6] Lee S. Disassembly planning by subassembly extraction. Proceedings of the Third ORSA/TIMS Conference on Flexible Manufacturing Systems, Cambridge, MA, 1989. p. 3838. [7] Lee S. Subassembly identication and evaluation for assembly planning. IEEE Trans Systems, Man, Cybernet 1994;24(3):493503. [8] De Fazio TL, Whitney DE. Simplied generation of all mechanical assembly sequences. IEEE Trans Robot Automat 1987;3(6):64058. [9] Sanderson AC, Homem de Mello L. A correct and complete algorithm for generation of mechanical assembly sequences. IEEE Trans Robot Automat 1991;7:22840. [10] Swaminathan A, Barber KS. An experience-based assembly sequence planner for mechanical assemblies. IEEE Trans Robot Automat 1996;12(2):25267.

329

[11] Awadh B, Sephri N, Hawaleshka O. A computer-aided process planning model based on genetic algorithms. Comput Oper Res 1995;22(8):84156. [12] Bonneville F, Perrard C, Henrioud JM. A genetic algorithm to generate and evaluate assembly plans. Proceedings of IEEE Symposium on Emerging Technologies and Factory Automation, Paris, 1995. p. 2319. [13] Vancza J, Markus A. Genetic algorithms in process planning. Comput Ind 1991;17:18194. [14] Wong H, Leu MC. Adaptive genetic algorithm for optimal printed circuit board assembly planning. Ann CIRP 1993;42(1):1720. [15] Zhang F, Zhang YF, Nee AYC. Using genetic algorithms in process planning for job shop machining. IEEE Trans Evolut Comp 1997;1(4):27889. [16] Goldberg D. Genetic algorithms in search, optimization and machine learning. Reading, MA: Addison-Wesley, 1989. [17] Santochi M, Dini G. Computer aided planning of assembly operations: The selection of assembly sequences. Robot Comput Integr Manuf 1992;9(6):43946. [18] Tanimoto SL. The elements of articial intelligence using Common Lisp. New York: Computer Science Press, 1990.

Potrebbero piacerti anche