Summary of the invention
In order to solve the above-mentioned problems in the prior art, the object of this invention is to provide a kind of optimization method of Product Assembly sequence, the index that the method is evaluated using assembly cost as assembly sequence-planning, by setting up Product assembly model, the geological information of product parts and non-geometry information are described, comprise accessory size, matching relationship between part, kinematic constraint relation etc., obtain feasible Product Assembly sequence, then the universal gravitation searching algorithm of revision is introduced, the colony formed by complex product Assembly part is as independently system, on the basis of search volume, according to assembly cost structure fitness function, by new Formula of Universal Gravitation, carry out the search of optimum solution, thus realize fast, reliably obtain optimum Assembly sequences, effectively can avoid the shot array problem occurring complex product Assembly sequences.
The technical solution used in the present invention is as follows:
An optimization method for Product Assembly sequence, it comprises the following steps:
Step S1, according to the geometric relationship between each parts of product to be assembled, matching relationship and kinematic constraint relation, builds three dimensions Assembly Interference matrix, obtains feasible Product Assembly sequence;
Step S2, take assembly cost as the index that Product Assembly Sequence Planning is evaluated, structure is adapted to the fitness function of universal gravitation searching algorithm;
Step S3, redefines and transformation the computing formula of universal gravitation searching algorithm, builds the universal gravitation search computing formula made new advances;
Step S4, the Assembly sequences adopting new universal gravitation search computing formula to treat assembled product carries out iterative, and the result of calculation obtained is optimum Assembly sequences.
Assembly cost in described step S2 comprises being redirected of assembly direction, assembly tool is changed and the change of fitting-type.
Preferred technical scheme, the three dimensions Assembly Interference matrix in described step S1 is as follows:
Wherein, Ma is three dimensions Assembly Interference matrix, and a is Assembly of the parts direction, and a ∈ { ± x, ± y, ± z}; C
1c
2... C
nrepresent each assembly part to be assembled; N is the parts count of part to be installed; C
ij=1 represents in part C
iwhen moving along direction a toward rigging position, will with part C
jcollide; Part does not collide with self, C
ii=0.
Preferred technical scheme further, the fitness function in described step S2 is:
Wherein, Fit (t) is fitness function, f (X
i) represent the assembly cost of part i; Q
i (k, k+1)the assembly cost that a kth part spends to the assembling process of kth+1 part, this Q are represented
i (k, k+1)=dD
i (k, k+1)+ kT
i (k, k+1)+ lL
i (k, k+1); D
i (k, k+1)for the change number of times of assembly direction, T
i (k, k+1)for the replacing number of times of assembly tool, L
i (k, k+1)for the change number of times of fitting-type, k ∈ [1, N-1]; Weight coefficient when d is redirecting of assembly direction in assembly cost, k is that the weight coefficient in assembly cost changed by assembly tool, and l is the weight coefficient of change in general assembly (GA) cost of fitting-type, and meets d+k+l=1.
Further preferred technical scheme, universal gravitation search computing formula new in described step S3 is as follows:
Wherein, part i to be assembled is represented with particle i, then F
i dt universal gravitation that () is particle i is made a concerted effort, and what Rand represented is random number, and this random number span is [0,1],
X
i d(t) for particle i is in the position of t at d dimension space, F
ijrepresent that particle i is subject to the universal gravitation of particle j, G (t) is universal gravitational constant,
α is attenuation coefficient, G
0for initial gravitational constant, T is the time cycle, and ε is a little numerical constant, M
pirepresent passive gravitational mass, M
ajrepresent active gravitational mass, R
ijt () is the Euclidean distance between t particle i and particle j,
i, j=1,2 ..., n, wherein x
i, x
jfor particle i, j position in space.
Further preferred technical scheme again, the Assembly sequences adopting new universal gravitation search computing formula to treat assembled product in described step S4 carries out iterative process and comprises the following steps:
Step S41, the determination of population size and initialization
If product to be assembled has N number of Assembly part, its composition N ties up search volume, and population is designated as X=(x
1, x
2, x
3... x
n), i-th particle position is labeled as: X
i=(x
i 1, x
i 2, x
i 3..., x
i d... x
i n) (i=1,2,3 ... N);
Step S42, arranges maximum iteration time and calculated mass
To arrange primary iteration value t be 0, maximum iteration time T is 100, according to the Fit of above-mentioned fitness function formulae discovery particle in t
i(t) value, it is minimum ordering rule that definition solves this problem, according to the value solving minimum problems Worst (t) and Best (t) in new universal gravitation search computing formula computation process, wherein:
Best (t) is the best fitness value of t population, and Worst (t) is the poorest fitness value of t population, Fit
jt () is the fitness value of the individual i of t, M
it () is particle inertia quality.
Step S43, determines universal gravitational constant and calculates universal gravitation to make a concerted effort
Wherein, getting maximum iteration time T is 100, initial gravitational constant G
0be 100, attenuation coefficient α is 20,
Getting ε is 5,
Step S44, calculates acceleration a
Step S45, upgrades particle rapidity and position
v
i d(t+1)=Rand×v
i d(t)+a
i d(t)
x
i d(t+1)=x
i d(t)+v
i d(t+1)
Wherein, v
i d(t+1) for particle i is engraved in the speed of d dimension space when t+1, Rand represents the random number that span is [0,1], v
i d(t) for particle i is in the speed of t at d dimension space, a
i dt () is for particle i is at the acceleration of t at d dimension space.
X
i d(t+1) for particle i is engraved in the position of d dimension space when t+1, x
i d(t) for particle i is in the position of t at d dimension space, v
i d(t+1) for particle i is engraved in the speed of d dimension space when t+1.Step S46, judges whether to reach iteration termination condition, and exports optimum Assembly sequences
When reaching the maximum iteration time preset, just stop circulation, and export the positional value x of now each particle
i d, simultaneously by the x of each particle
i doutput valve is by sorting from small to large, then this collating sequence drawn is optimum Assembly sequences.
Beneficial effect of the present invention: gravitation search algorithm attract each other between the law of universal gravitation and particle phenomenon basis on be suggested.In this algorithm, according to Newton's law of gravitation and Newton interpolation algorithm, search agent owing to attracting each other each other to assembling together.Experimental result shows, gravitation search algorithm has very high superiority at the various nonlinear function of solution.Constantly update in Individual Quality process in mobile search, the outstanding Individual Quality of fitness value is comparatively large, and the gravitation produced in interaction motion process is comparatively large, and sole mass is large, slowly mobile, and the little individuality of quality moves relatively just comparatively rapid.So just make whole population constantly towards the individual movement that fitness value is more outstanding, reach between individuality and realize information interaction, excellent individual guidance search, make whole population towards the object of outstanding solution direction movement.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly understand, below in conjunction with instantiation also with reference to accompanying drawing, the present invention is described in more detail.Should be appreciated that, these describe just exemplary, and do not really want to limit the scope of the invention.In addition, in the following description, the description to known features and technology is eliminated, to avoid unnecessarily obscuring concept of the present invention.
The invention provides a kind of complex product Assembly sequences intelligent optimization method, comprise step as follows:
The first step: for the part to be installed of complex product, according to matching relationship and kinematic constraint relation etc. between the geometric relationship between assembly parts, part, is structured in Assembly Interference matrix on three dimensions, obtains feasible Product Assembly sequence.
Second step: the index that assembly cost is evaluated as assembly sequence-planning, structure is adapted to the fitness function of universal gravitation searching algorithm, and wherein assembly cost is primarily of the factor composition such as being redirected of assembly direction, assembly tool is changed, the change of fitting-type.
3rd step: redefine and transformation the computing formula of gravitation search algorithm, sets up gravitation search Computational frame, makes it to be suitable for solving complex product assembly sequence optimization problem.
4th step: adopt gravitation search Computational frame to carry out iterative to complex product assembly sequence optimization problem, the result of calculation obtained is optimum Assembly sequences.
Wherein, the three dimensions Assembly Interference matrix M a described in the first step is as follows:
Wherein, a is Assembly of the parts direction, and a ∈ ± x, ± y, ± z}, namely a representative is along x, y, the motion of the positive negative direction of z-axis; Assembly part is with C
1c
2... C
nrepresent, namely assembly number is n; C
ij=1 represents in part C
iwhen moving along direction a toward rigging position, will with part C
jcollide; Because part does not collide with self, therefore C
ii=0.
Wherein, the structure fitness function particular content described in second step is as follows:
Assembly cost is evaluation index important in assembly sequence-planning, and the factor compositions such as assembly cost is changed primarily of redirected, the assembly tool of assembly direction, the change of fitting-type, the present invention is according to these three factors, add weight coefficient respectively and sue for peace, constructing fitness function Fit (t) that Assembly sequences is evaluated.Assembly direction changes the more of number of times, and assembly cost is then larger, and the number of times that assembly direction changes is designated as D
i (k, k+1); The efficiency that number of times directly affects assembling changed by assembly tool, assembly tool changed number of times and is designated as T
i (k, k+1); The assembling cost that different fitting-types spends is different, and the change number of times of fitting-type is designated as L
i (k, k+1).
Part is in the process of assembling in sum, is configured to by fitness function according to above-mentioned three evaluation criterions:
Formula 1
F (X in formula 1
i) represent that the assembling of particle i spends cost, Q
i (k, k+1)represent the cost that a kth part spends to the assembling process of kth+1 part, wherein k ∈ [1, N-1], as shown in Equation 2:
Q
i (k, k+1)=dD
i (k, k+1)+ kT
i (k, k+1)+ lL
i (k, k+1)formula 2
Wherein d is the weight coefficient redirected in general assembly (GA) cost of assembly direction, and k is that the weight coefficient in general assembly (GA) cost changed by assembly tool, and l is the weight coefficient of change in general assembly (GA) cost of fitting-type, and meets d+k+l=1.
When these three factors change, its value is 1, and when not changing, its value is 0.If when a kth part has the feasibility of assembling to kth+1 part, use this formula to carry out polynomial computation, if without assembly feasibility, do not carry out polynomial computation, Q
i (k, k+1)value is 0.
Wherein, redefining the computing formula of gravitation search algorithm described in the 3rd step comprises with transformation:
Universal gravitation expression formula as shown in Equation 3.
Formula 3
In formula, M
1and M
2for the inertial mass of interactional two particles, R is the Euclidean distance between two particles.G (t) is universal gravitational constant, and its value depends on the real age in universe, and its expression formula as shown in Equation 4.
β < 1 formula 4
Wherein G (t) is the value of the gravitational constant G of moment t.G (t0) refers to the t at the first quantum interval, universe
0the value in moment, β be less than 1 rate of decay.
Interparticle interaction force model is as shown in Figure 1: F
12, F
13, F
14particle M respectively
2, M
3, M
4to particle M
1universal gravitation, F
1then act on particle M
1go up gravitational making a concerted effort, i.e. particle M
1the power of generation acceleration a.Second law of motion according to newton: the acceleration of object is directly proportional to the bonding force of applying, is inversely proportional to the quality of object, and direction is identical with bonding force direction, then the relation of inertial mass M, the acceleration a of particle, the size F of power is as shown in Equation 5:
Formula 5
According to above-mentioned theory definition, redefine gravitational expression formula, shown in 6 and formula 7.
Formula 6
Formula 7
In formula 6 and formula 7, M
pirepresenting passive gravitational mass, is the metering of the intensity of a gravitational field power of a measurement particle.M
ajrepresenting active gravitational mass, is the interactional strength meter of a particle.A
irepresent the acceleration of particle i, M
iirepresentative is the inertial mass of particle i, be a particle under the effect of external force, opposing changes the metering of its motion state intensity.The universal gravitation making particle i be subject to particle j is expressed as F
ij, F
ijbe directly proportional to the product of active gravitational mass and passive gravitational mass, and square being inversely proportional to of Euclidean distance between particle i, j.The acceleration a of active gravitational particle
iwith universal gravitation F
ijbe directly proportional, be inversely proportional to the inertial mass of particle i.
According to formula 6, square being inversely proportional to of the universal gravitation size between two particles and Euclidean distance, in order to raise the efficiency and reduce computation complexity, under the prerequisite meeting principle of gravitation, adopts R to replace R
2, Formula of Universal Gravitation is newly defined as:
Formula 8
In formula 8, ε is a little numerical constant, and the object arranging ε prevents when two particles are constantly close until when overlapping, its Euclidean distance is the situation of 0 under gravitational effect.
In formula 8, x
i dt () particle i is in the position of t at d dimension space.
In formula 8, R
ijt () is the Euclidean distance between particle,
I, j=1,2 ..., n, formula 9
Wherein x
i, x
jfor particle i, j position in space
The basis of formula 4 redefines gravitational constant G (t):
Formula 10
Wherein α is attenuation coefficient, G
0for initial gravitational constant, T is maximum iteration time or the time cycle of definition in actual calculation, so just ensures that gravitational constant is the variable along with the time changes.
After redefining Formula of Universal Gravitation, summation operation can be carried out to the universal gravitation of other particles suffered by each particle, obtain the final F that makes a concerted effort of this particle
d i(t).
The universal gravitation of particle i is made a concerted effort F
i dt () is defined as follows:
Formula 11
Wherein Rand representative is random number, and this random number span is [0,1], and the object arranging this random number is to prevent Algorithm for Solving to be absorbed in local optimum, and embody the randomness feature that algorithm has, the result drawn more tallies with the actual situation.
Wherein, the employing gravitation search Computational frame described in the 4th step carries out iterative to complex product assembly sequence optimization problem, and step is as follows:
(1) determination of population size and initialization
If product N number of Assembly part composition N ties up search volume, population is designated as X=(x
1, x
2, x
3... x
n), i-th particle position is labeled as:
X
i=(x
i 1, x
i 2, x
i 3..., x
i d... x
i n) (i=1,2,3 ... N) formula 12
(2) iterations is set and calculated mass
To arrange primary iteration value t be 0, maximum iteration time T is 100, according to the Fit of above-mentioned fitness function formulae discovery particle in t
it () value, it is minimum ordering rule that definition solves this problem, according to solving the value of minimum problems Worst (t) and Best (t) in the detailed computation process of gravitation search algorithm such as formula shown in 13 Yu formula 14.
Formula 13
Formula 14
The quality of particle is calculated according to the most difference function values of current particle and optimal function value
Formula 15
Formula 16
Best (t) is the best fitness value of t population, and Worst (t) is the poorest fitness value of t population, Fit
jt () is the fitness value of the individual i of t, M
it () is particle inertia quality.
(3) determine universal gravitational constant and calculate gravitation with joint efforts
Getting maximum iteration time T is 100, initial gravitational constant G
0be 100, attenuation coefficient α is 20, and therefore universal gravitational constant is just:
Formula 17
Arranging in formula 8 constant ε in denominator is 5, and now the universal gravitation of particle is:
Formula 18
Size of making a concerted effort is:
Formula 19
(4) acceleration a is calculated
Calculate particle inertia mass M
i(t) and the F (t) that makes a concerted effort
d ivalue, calculating particle i acceleration according to formula 7 and formula 19 is:
Formula 20
(5) particle rapidity and position is upgraded
Calculate the acceleration a of particle
i dt (), upgrades speed and the position of subsequent time particle according to acceleration magnitude
V
i d(t+1)=Rand × v
i d(t)+a
i d(t) formula 21
X
i d(t+1)=x
i d(t)+v
i d(t+1) formula 22
Wherein, v
i d(t+1) for particle i is engraved in the speed of d dimension space when t+1, Rand represents the random number that span is [0,1], v
i d(t) for particle i is in the speed of t at d dimension space, a
i dt () is for particle i is at the acceleration of t at d dimension space.
X
i d(t+1) for particle i is engraved in the position of d dimension space when t+1, x
i d(t) for particle i is in the position of t at d dimension space, v
i d(t+1) for particle i is engraved in the speed of d dimension space when t+1.
(6) judge whether to reach iteration termination condition and Output rusults
Iteration termination condition is reach the maximum iteration time preset, and just stops circulation, and export the positional value x of now each particle when reaching maximum iteration time
i daccording to being defined as minimum ordering rule above, by x
i dfinal output valve by sorting from small to large, then the sequence drawn be use gravitation search for the Assembly sequences calculated.
As shown in Figure 2, realizing of its false code is as described below for the flow process of assembly sequence optimization intelligent algorithm:
Fitness function Fit
i=f (X
i), X=(x
1, x
2, x
3... N);
Generate the initial population X of assemble planning
i=(x
i 1, x
i 2, x
i 3..., x
i d... x
i n);
Assemble planning evaluation criterion is that assembly cost is by objective function f (X
i) control;
Definition maximum iteration time T;
Define initial gravitational constant G
0, attenuation coefficient α;
Definition ordering rule is minimum ordering rule;
Initialization v
0(t), x
0(t);
The position x after circulation jumped out in record
i d(t);
According to minimum ordering rule arrangement part sequence;
Export final Assembly sequences.
In order to better the present invention is described, below for certain model rabbling mechanism, the embodiment of assembly sequence optimization intelligent algorithm is described.Because the connector One's name is legions such as required screw add the complexity of logic difficulty and computing in assemble planning, in the assembling process of reality, the connector such as screw mainly adopts the method for concurrent assembly, the parts assemble sequence main on entirety does not affect substantially, therefore simplified by the connectors such as screw and remove, three-dimensional model only comprises main parts size; After simplification, this mechanism mainly comprises 14 parts, the three-dimensional wiring layout of this model rabbling mechanism as shown in Figure 3:
In order to the more clear concrete condition indicating each part, adopt explosive view better can embody each part shape structure, and part to be numbered, explosive view as shown in Figure 4:
The table of comparisons of the part sequence number shown in Fig. 4, corresponding parts title and dash number is as shown in table 1:
The table 1 part name numbering table of comparisons
(1) initialization of colony
Critical piece after this rabbling mechanism simplifies is 14, and search volume is 14 dimensions, and in this colony, the position mark of the i-th particle is:
X
i=(x
i 1, x
i 2, x
i 3..., x
i d... x
i 14) (i=1,2,3 ... 14) formula 23
(2) structure of fitness function
Formula 24
Wherein:
Q
i (k, k+1)=dD
i (k, k+1)+ kT
i (k, k+1)+ lL
i (k, k+1)formula 25
The value of d, k, l is respectively 0.5,0.2,0.3, then
Q
i (k, k+1)=0.5D
i (k, k+1)+ 0.2T
i (k, k+1)+ 0.3L
i (k, k+1)formula 26
(3) iterations is set and calculated mass
Arranging gravitation search algorithm maximum iteration time T is 100, and arranging primary iteration value t is 0, and definition rule is minimum ordering rule.The quality of each search agent is calculated according to formula 13 ~ formula 16, wherein after calculating fitness function
Formula 27
(4) making a concerted effort of gravitation is calculated
Initial gravitational constant G
0be 100, attenuation coefficient α is 20, and constant ε is 5.
Formula 28
(5) accekeration is calculated
By the inertial mass mass M of particle
i(t) and the F (t) that makes a concerted effort
d ivalue, calculate the acceleration a of particle
i dthe size of (t).
Formula 29
(6) renewal speed and position
Speed and the position of subsequent time particle is upgraded according to the size of acceleration.
V
i d(t+1)=Rand × v
i d(t)+a
i d(t) formula 30
X
i d(t+1)=x
i d(t)+v
i d(t+1) formula 31
(7) net result is exported
Experiment porch uses MATLAB 2010, encodes according to performing step in the assembly sequence-planning of gravitation search algorithm, and according to the related conclusions parameters value drawn in Parameter discussion, by x
i dfinal output valve export optimum Assembly sequences by after rule compositor from small to large, as shown in table 2.Because therefore data volume only lists too greatly the operation result of last 20 times, what the first row represented is the numbering of assembling front each part, always have 14 parts and be then numbered 1 ~ 14, the gravitation search algorithm that is through of last column representative calculates the rear final Assembly sequences exported.
Table 2 assembly case Sequence Planning result table
The Assembly sequences exported from the computing of table 2 Program is analyzed, and this sequence assembly stability is better, and it is less that assembly direction changes number of times, meets the requirement of practical set process, and the requirement of the situation meeting geometric feasibility of Assembly Interference does not appear in Assembly of the parts order.Search agent is each other because universal gravitation effect can flock together, therefore solve this nonlinear optimal problem of Sequence Planning by gravitation search algorithm and there is oneself body superiority, meet the demand of assemble planning, can make Assembly sequences more rationally more can the assembling process of closing to reality, substantially increase operation efficiency, effectively can solve because the more multipair all Assembly sequences of number of parts carry out the problem that causes calculated amount larger when enumerating traversal, thus avoid carrying out fully intermeshing to all Assembly sequences.Adopting gravitation search algorithm to carry out assembly sequence-planning is as can be seen here a kind of feasible, efficient method, can be generalized in numerous, the baroque Product Assembly Sequence Planning of parts count.
Should be understood that, above-mentioned embodiment of the present invention only for exemplary illustration or explain principle of the present invention, and is not construed as limiting the invention.Therefore, any amendment made when not departing from thought of the present invention and scope, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.In addition, claims of the present invention be intended to contain fall into claims scope and border or this scope and border equivalents in whole change and amendment.