3.2.1. Constraints and Optimization Objectives of Manipulator Trajectory
In order to improve the picking efficiency, the B-spline curve is used to interpolate the path of the manipulator to obtain a smooth motion trajectory with time parameters. On this basis, the trajectory is further optimized to enable the trajectory to meet the kinematic and dynamic constraints of the manipulator and meet the requirements of different performance indexes in the picking task. Combined with the kinematic characteristics of the manipulator, the picking efficiency, energy consumption and pulsation are defined as objective functions respectively to establish a multi-objective trajectory optimization model [
21].
To ensure the normal operation of the manipulator, the trajectory of the manipulator must be within the kinematic and dynamic constraints. The specific contents need to meet the following three points.
- (1)
Position constraint: the position constraint is that the trajectory curve must pass through each position point of the given path to ensure that the manipulator will not collide with obstacles during movement;
- (2)
Joint limit constraint: the rotation angle range of each joint of the manipulator is certain, and the position curve of the manipulator generated by interpolation cannot exceed the rotation angle range of each joint;
- (3)
Speed constraint and acceleration constraint: the speed curve and acceleration curve of the manipulator joint shall not only ensure continuity, but also meet the speed constraint and acceleration constraint of the manipulator. The constraint values are shown in
Table 1. Assuming that the maximum speed, maximum acceleration and maximum jerk of joint motion are
vm,
am and
jerm respectively, the trajectory of each joint shall meet the kinematic constraint Equation (2):
where m represents the joint number.
In the light of the characteristics of the convex hull of the B-spline curve, the constraints in Equation (2) can be transformed into the control vertices of the B-spline curve of each joint, only under the following conditions:
where
k represents the
k-th control vertex of joint speed, acceleration and the acceleration curve.
On the premise of meeting the above constraints, the motion time, pulsation and energy consumption of the manipulator are optimized to give full play to the performance of the robot.
- (1)
Time
In order to improve the operation efficiency of the robot, the operation time of the robot is optimized to minimize the time for the robot to move along the specified trajectory under the condition of meeting various constraints. Definition formula (6):
where
S1 is the total operation time of the manipulator. The smaller
S1 is, the higher the working efficiency of the manipulator is;
n is the number of path points;
i is the number of path points.
- (2)
Energy consumption
The working environment of the picking robot is mostly in the field. Reducing energy consumption can effectively improve the continuous working time of the robot when the robot lacks energy supply. The energy consumption expression is:
where
S2 is an index used to measure the energy consumption of the joint. The smaller
S2 is, the less energy will be consumed by the joint;
a(
t) is the acceleration curve of the joint.
- (3)
Pulsation
During the movement of the robot, the sudden change of acceleration will have a great impact on the body of the manipulator, reducing the tracking accuracy and destroy the mechanical structure. Therefore, non-abrupt acceleration is the core requirement of trajectory planning. Optimizing the jerk cure of the robot can reduce the impact, promote the accuracy of the motion trajectory and the target trajectory, and further reduce the contact force among the internal components of the manipulator, thus alleviating the vibration intensity during resonance. The pulsation optimal expression is defined as Equation (8):
where
S3 represents the average joint pulsation. Smaller
S3 equates to a smaller pulsation of the joint trajectory and more stable motion;
M is the number of joints;
Ti is the total time of exercise;
jerk (t) is the pulsation trajectory of the joint.
It can be seen from the above that the trajectory of the manipulator needs to meet multiple constraints and needs to be optimized under multiple objectives. Using the multi-objective optimization method, the above multiple objectives can be optimized synchronously to achieve the best overall effect. Due to the conflict of objectives in multi-objective optimization problems, the method to solve multi-objective optimization problems is usually to coordinate and balance among objectives to make each objective optimal as much as possible [
22]. The optimal solution is not the global optimal one, but the equilibrium solution of all objectives, the set of non-inferior solutions, called the Pareto optimal solution set, is definitely the chosen one. In order to solve the multi-objective optimization problem of manipulator trajectory, the Pareto optimal solution set is obtained and solved by the multi-objective particle swarm optimization algorithm. The algorithm is an optimization algorithm based on swarm intelligence theory. It depends on cooperation and information sharing among all individuals in the group to find the optimal solution. Individuals will adjust the motion state according to their own experience and group experience, and constantly approach the optimal solution through the evolution of the population [
23]. MOPSO uses Pareto optimality and other concepts to evaluate the advantages and disadvantages of particles, and continuously updates the position and speed of particles through individual optimal
Pbest and global optimal
Gbest. The update formula is shown in formulas (9) and (10).
where:
v represents the speed of particles;
x represents the position of the particle;
i represents the number of iterations;
w represents inertia weight;
c1 and c2 are acceleration factors;
rand is a random number with uniform distribution of [0, 1].
With the aim of better obtaining the individual optimal solution and the global optimal solution, and guiding the algorithm to quickly converge to the Pareto front, this paper introduces the individual violation degree and Pareto constraint domination to evaluate the solution set. In order to strengthen the search ability and convergence speed of the traditional MOPSO algorithm, and shielding if from falling into local optimization, this paper optimizes the MOPSO algorithm by adding a mutation operator, a feedback mechanism and an annealing factor.
3.2.2. Constraints and Pareto Constraints
There are many constraints in multi-objective optimization problems. In order to effectively deal with multiple constraints and to better compare different solutions, an individual violation degree is used to deal with constraints. Individual violation degree is defined as the normalized sum of all conflicting constraint values and it can be described as Equation (11) [
24]:
where it is expressed as the distance between solution
x and the feasible region. The greater the distance is, the higher the individual violation degree will be. When
x is the feasible solution, the individual violation degree is 0.
In the multi-objective optimization algorithm, it is necessary to compare not only the individual violation degree between the two solutions, but also the objective function values. However, the objective function is not unique, so the optimal solution cannot be determined directly. In this paper, the Pareto constraint domination is used to compare the solutions and clarify the relationship between advantages and disadvantages. Solution xi dominates solution xj, which must satisfy any of the following conditions:
- (1)
If the solutions xi and xj are all feasible solutions of the optimization problem, and the solution xi is Pareto dominated xj;
- (2)
If the solution xi is feasible and xj is infeasible;
- (3)
If solutions xi and xj are infeasible solutions, but solution xi has less constraint violation degree;
- (4)
If both solutions xi and xj are infeasible solutions and have the same constraint violation degree, then solution xi is Pareto dominated xj.
3.2.3. Mutation Operator
In the MOPSO algorithm, the external file set is devised to store all non-dominated solutions. In each iteration, the global optimal solution needs to be selected from the external file set. In the iterative process of the algorithm, the non-dominated solution will be continuously added to the external file set, resulting in the increasing scale of the external file set, increasing the amount of calculation of the algorithm and reducing the efficiency of the algorithm. Therefore, an upper limit needs to be set on the external file size. When the number of solutions in the external file sets exceeds the upper limit, a certain amount of solutions would be deleted to keep the size of the external file set unchanged. This paper adopts crowding distance sorting to delete the individuals with a small crowding distance and maintain the number of solutions in the external file sets. Crowding distance evaluates the distance between an individual and its adjacent individuals. For an individual in the target space, the distance between the individual and the individuals on both sides is calculated in each target space. The average sum of the distances in each dimension of the target space is the crowding distance. The larger the crowding distance, the sparser the distribution of solution sets, and the better the diversity of solution sets. The crowding distance formula is shown in (12) [
25]:
where
fi(
xi) represents the function value of individual
xi on the
j-th objective function;
fjmax and fjmin represent the maximum and minimum values of the population on the j-th objective function, respectively.
During optimization, all particle updates rely on the searched non-dominated solutions. The greater the number of non-dominated solutions and the more uniform the distributions are, the better the solution set will be [
26,
27]. Maintaining the diversity of non-dominated solution sets can avoid premature convergence of the algorithm. Therefore, when maintaining external file sets, mutation operators are added to improve the diversity of solution sets and avoid premature convergence of the algorithm. A mutation operator is added to the external file set to produce a new solution. For each individual in the external archive set, a mutation solution is generated randomly. The generated mutation solution set is compared with the external file set. If an individual in the external file set is dominated by the mutation solution, the mutation solution will replace the dominated individual in the external file set. Otherwise, the mutation solution is discarded. If the random value rand is less than the set probability
p, the individual of the external file set is taken as the parent to generate a mutation solution. If the random value rand is greater than the set probability
p, no mutation solution is generated. By setting
p, the size of the mutation solution set can be controlled, which not only increases the population diversity, but also does not increase the amount of calculation of the algorithm, so as to avoid reducing the efficiency of the algorithm [
28]. The mutation solution set can guide particles to fly to a wide area and increase the diversity of solutions in the external file set, so it can reduce the probability of the algorithm falling into local minima. The generation process of the variant solution set is shown in Equation (13):
where
parent(
x) represents the position of the parent particle;
parent(
v) represents the speed of the parent particle;
p is the probability of variation.
3.2.5. Annealing Factor
In the iterative process of the algorithm, particles are continuously selected from the external file set as the global optimal solution to guide the convergence of the algorithm. Due to the single evolution direction, when a better solution cannot be generated, the population easily falls into local optimization and the real Pareto frontier cannot be found. To solve this problem, an annealing factor is added in the iterative process to accept the poor solution with a certain probability, enhance the diversity of the population and make it jump out of the local optimal solution. The specific process is as follows: when the new solution
Qnew dominates the current solution, the new solution
Qnew is taken as the individual historical optimal solution. If the new solution does not dominate the current solution, the new solution
Qnew is accepted as the individual historical optimal solution with probability
Pm, and the expression is shown in Equation (14). It can be seen from the formula that, at the initial stage of the algorithm iteration, there are fewer individuals in the external file set and the
Pm value is large. Accepting the poor solution with a large probability can increase the diversity of the population. In the later stage of the algorithm, there are many individuals in the external file set, and a higher
Pm value will slow down the convergence speed of the algorithm. To compensate, in the later stage of the algorithm iteration, a small
Pm value is adopted [
29].
where
pstart is the initial annealing factor;
pend is the final annealing factor;
t is the current number of iterations;
Tmax is the maximum number of iterations.
The pseudo code of the improved multi-objective particle swarm optimization algorithm (represented as GMOPSO) is shown in the following algorithm.
objfun represents the objective function and
constfun represents the constraints of the optimization issue:
GMOPSO Algorithm () |
1: Initialize(popsize, archive size, objfun,constfun, iterative times); |
2: For each particali ∈ [1, popsize] |
3: [xi, vi] ← Initializepositionand speed |
4: Initialize individual best solution Pbest |
5: end |
6: archive ← Determination(pop,objfun,constfun)//sort particals and get non-dominant individuals |
7: for it = 1:(iterative times) |
8: for each partical |
9: Obtain the Gbest |
10 :[xi, vi] ← Position_speed(Pbest, Gbest) |
11: Pbest ← Update(Pm, Pbest) |
12: end |
13: pop ← sort (pop, M)//eliminatethe poorerparticals and supplyparticals |
14: Update external archive |
15: archive ← Mutate(archive, mu) |
16: Until stopping criterion is met |
17: end |
Taking the motion time, energy consumption and pulsation as the optimization objectives, the optimal trajectory optimization model is established. The multi-objective trajectory optimization problem of the manipulator is solved by using the GMOPSO algorithm, so as to obtain the trajectory of the manipulator that meets the constraints and performance requirements. The joint path of the manipulator is interpolated by a quintic B-spline curve to make the manipulator meet kinematic and dynamic constraints. According to the definition of the performance index above, the multi-objective optimization problem with optimal time, energy consumption and pulsation can be defined as Equation (15):
where
f1 is the movement time;
f2 is the average joint pulsation, which measures the smoothness of the trajectory; and
f3 is the average joint acceleration. The simplified analysis of the dynamic model of the manipulator shows that the energy consumption of the manipulator is directly proportional to the square of the absolute value of the acceleration. Therefore, the average joint acceleration is defined as the optimization objective as an index to measure the energy consumption of the robot;
VMj and AMj represent the maximum speed and acceleration of each joint respectively.
The specific algorithm flow is shown in the
Figure 3 below: