3.1. Selective Assembly Optimization Model for Shaft and Hole
A selective assembly optimization model, intended to select the shaft and hole with uniform clearance, is proposed. In the model, the process has been broken down into two steps—evaluation and optimization—as illustrated in
Figure 3.
In the first step, a series of measuring points characterizing geometric errors are measured using a coordinate measuring machine (CMM). The tactile CMM with high measurement accuracy (measurement uncertainty of 0.6 + L/600 μm) is selected in our work, according to the characteristics of small size and high machining accuracy for precision shaft and hole. The mating surface of shaft and hole is cylindrical, thus, on the premise of sampling theorem, several circles are measured along the axial direction, with dozens of points per circle.
After data processing, the radial distribution of geometric errors for shaft and hole is calculated. The radial distribution represents the ratio of the radius at a certain measurement point to the sum, which can be regarded as probability distribution. Relative entropy is an index to judge the difference between two probability distributions. The smaller its value, the smaller the difference, that is, the more uniform the clearance between shaft and hole. Therefore, the relative entropy is used to evaluate the assembly clearance uniformity of each pair of shaft and hole.
In the second step, the dynamic programming has been used as an optimization algorithm. The average uniformity of all clearances is taken as the optimization objective, and the premise is that there is no interference between shaft and hole. Finally, the optimal pairing combinations are output for batch of shafts and holes.
3.2. Clearance Uniformity Evaluation of Shaft and Hole Based on Relative Entropy
Some studies have shown that entropy—which represents the average uncertainty of random events, and has been widely employed in control theory, image reconstruction, biology, and medicine, among others [
18,
19,
20]—is more suitable for describing data uncertainty [
21]. Preliminary research using information entropy to evaluate geometric errors on plane has been conducted [
2,
3,
22,
23]. The plane has been divided into a lattice with an
m ×
n grid,
zi,j represents the height of grid point (
Pij), and the relative height at each point is
hij =
zij − zmin, where
zmin = min{
zij,
i = 1, 2…,
m;
j = 1, 2, …,
n}. The sum of the relative heights is therefore as shown in Equation (1):
The ratio (
) of the height at a certain point to the sum is given as shown in Equation (2):
If hij is regarded as a sample of the random variable X, and is regarded as sample probability, then information entropy can be used to reflect grid point height distribution.
The following is a brief introduction to the principle of information entropy, which applies to the two subsequent levels of entropy evaluation.
Assume that a set of discrete random variables
X = {
x1,
x2, …,
xn}, and its probability distribution
pi =
p[
X =
xi] = {
p1,
p2, …,
pn}; that is:
Information entropy,
H(
X), characterizes the uncertainty of random events.
E( ) indicates the mathematical expectation, and r is the base of the logarithm, which can take 2, e or 10. In our study, we use e as the base—allowing Equation (4) to be rewritten as shown in (5).
For the plane, the ratio of the height at a certain point to the sum is taken as the sample probability, and the information entropy is used to reflect the height distribution of measurement points. Similarly, for the cylindrical surface of shaft and hole, the ratio of the radius at a certain point to the sum can be taken as the sample probability, and the radial distribution of measurement points can be also reflected by entropy. Thus, Equations (1) and (2) can be rewritten as follows:
where
m and
n represent the number of measurement points in the axial and radial directions, respectively.
ri,j represents radius of measurement point, and the relative radius at each point is
Rij =
ri,j − rmin, where
rmin = min{
ri,j,
i = 1, 2…,
m;
j = 1, 2, …,
n}.
represents the ratio of the radius at a certain point to the sum.
Relative entropy is an index to judge the difference between two probability distributions on the basis of information entropy. The smaller its value, the smaller the difference, that is, the more uniform the clearance between shaft and hole.
If the probability distribution of shaft and hole are recorded as
and
, respectively, then the relative entropy of the shaft and hole is given as shown in Equation (8):
Notice, .
3.3. Optimization Algorithm Based on Dynamic Programming
Relative entropy can be used to evaluate the assembly clearance of a pair of shaft and hole. However, there are several assembly options for batch of shafts and holes. Therefore, it is necessary to consider the comprehensive optimization objectives. Suppose a batch of shafts and holes are assembled; the number of shafts is
M; the number of holes is
N; there are
L combinations of shafts and holes;
indicates whether the
i-th shaft and
j-th hole are involved in the
k-th combination, yes is 1, no is 0, where,
i = 1,2,…,
M;
j = 1,2,…,
N;
k = 1,2,…,
L. The constraint condition is that each part can be used for assembly at most once, and the quantity of each part must meet the assembly quantity. The mathematical description of the selective assembly optimization is as follows.
The optimization objective is to minimize the average relative entropy of all shafts and holes. Assuming that relative entropy of
k-th combination is
, the optimization objective is shown in Equation (11):
Based on the above analysis, selective assembly of shaft and hole is essentially a kind of 0–1 programming problem, in which the variable either takes 0 or 1. Dynamic programming is suitable for solving such a problem. Through the optimization principle of dynamic programming, the multi-stage process is transformed into a series of single-stage problems. Based on the decision of the previous stage, the optimal scheme can be selected under the conditions of different stages, which can determine the optimal value [
24]. Based on the idea of dynamic programming, there are many intelligent optimization algorithms, such as genetic algorithm, ant colony algorithm, simulated annealing algorithm, and so on. The cellular bat algorithm (CBA) [
25] is used in our work, which can accelerate optimization speed and improve the ability of global optimization.
The cellular bat algorithm consists of input module, initialization module, evaluation module, iteration module, and output module, as shown in
Figure 4.
The specific steps are as follows:
(1) Construct cellular automata and initialize parameters.
The number of shafts, holes, and products to be assembled are
M,
N, and
L, where
; The number of bat population is
n; the position of the
i-th bat is
, and its dimension is
L.
includes the assembly combination of
L products.
and
, respectively, show the index of holes and shafts. The initialization method of
is as follows:
where,
,
Equation (12) shows that in the zero iteration (the initialization stage), the
j-th product is assembled by id_hole and id_shaft.
(2) Calculate the fitness of each bat in the initial population, and initialize the global optimal solution . The fitness represents the assembly evaluation of L products, which can be calculated by Equations (8) and (11).
(3) Update the position of each bat.
① Calculate the evolution coefficient
s and all neighbors
of current bats by Equations (13) and (14).
where
is the fitness of the
i-th bat;
and
, respectively, show the min and max value of all fitness. In Equation (14), count_dif counts the number of different items in two equal-length vectors. This means that the neighbor bat and the current bat have only one item different from each other, and the other items are the same.
② If , the current bat evolves into the optimal solution in with a certain probability, or is replaced by a solution in randomly. Where s and range in [0, 1].
③ If , the current bat is replaced with new generated bat randomly.
(4) Recalculate the fitness of each bat and update the global optimal solution .
(5) Judge whether the termination condition is met. If so, output the global optimal solution; otherwise, turn to step (4). The termination condition is that the number of iterations is equal to the maximum number.