1. Introduction
Miniature circuit breakers (MCBs) are important electrical devices in power distribution networks to provide fault current protection, and have been widely used in industrial applications [
1,
2]. Most MCB parts are in irregular shapes, and it is usually difficult to implement the automatic assembly via machine. The existing MCB assembly techniques are mostly high-rigidity approaches that separately adjust and assemble different MCB parts by a number of specific devices, which are expensive and inflexible. It is eagerly expected that researchers can propose an automatic assembly scheme with industrial robots which are widely applied in manufacturing industries [
3,
4], to improve the flexibility and efficiency of MCB manufacturing. The key technology of flexible MCB assembly is to adjust randomly postured MCB parts to pre-defined postures with a single robot, so that then the parts can be correctly and accurately assembled. Hence, it is of great significance for improving the production efficiency as well as reducing the production cost.
In practice, the working performance is largely dependent on the robot trajectory. The trajectory planning is a fundamental problem discussed for robot applications [
5,
6,
7]. It is a nonlinear, multi-coupling, multi-constraint multi-objective optimization problem that aims to find the optimal trajectory of the robot based on the corresponding algorithm and boundary constraints under the condition of a given task point [
8,
9,
10]. Existing optimal trajectory planning methods can be divided into four categories by the objective function: 1. minimum time; 2. optimal trajectory smoothness and minimum jerk; 3. minimum energy [
11]; 4. hybrid criteria of the conditions above [
12].
In terms of time-based optimal trajectory planning, there is a contradiction between time and motion stability. Motion acceleration is achieved by rapid changes of the velocity and acceleration, which leads to a large shock load. For the realization of robot time optimal trajectory planning, the current research mainly focuses on polynomial trajectory interpolation and trajectory algorithm optimization. Huang et al. [
13] proposed cubic B-spline curve method to construct parametric paths. Kim et al. [
14] proposed a cubic polynomial method that takes the joint position and speed as the constraints, plans the trajectory offline, and then tracks the trajectory online in real-time. The method is easy to be applied, but does not consider the constraints such as the torque and acceleration of the joints, which causes strong shocks and sudden acceleration changes. Ma et al. [
15] proposed a sixth-degree polynomial method that solves the discontinuity of the segmental interpolation by low-degree polynomials in the motion process, and prevents problems such as sudden acceleration changes and operating shocks of the manipulator. However, a high polynomial degree causes high computational complexity as well as the oscillation of the interpolation (called the "Runge" phenomenon) [
16]. Guan et al. [
17,
18] propose a method employing the NURBS curve which is characterized by derivative continuity, effective segmentation and strong local support, but it is also computationally complex when solving complex robot paths. Artificial intelligence algorithms are applied for trajectory optimization. Huang et al. [
19] use the elitist non-dominated sorting genetic algorithm to optimize robot traveling time and mean jerk. Ajayi et al. [
20] seek to obtain the optimal time via the Genetic Algorithm (GA) which is of low computational requirements and high versatility, as well as the reduction of optimization objectives and constraints. PSO has advantages in optimization range, robustness, and scalability. Yan et al. [
21] use the standard Particle Swarm Optimization (PSO) algorithm to study the axis trajectory planning for flank milling with conical tools. Yang et al. [
22] proposed a PSO method enhanced by an improved annealing schedule, to explore for more candidate solutions and increase the probability of finding the global optima. Shen et al. [
23] proposed a UAV path planning method that introduced a Tabu table into particle swarm optimization (PSO) to improve its optimization ability, and obtained the initial detection route of UAVs based on a “minimum ring” method. Shi et al. [
24] applied the golden section method is used to find the maximum of velocity, acceleration, and jerk, and utilized a PSO with variable learning factors for global optima searching. PSO realizes the dynamic trajectory optimization by its high ergodicity and time interval adaptivity. However, with the increase of the optimization space, the algorithm performance and accuracy decline with the increasing of the optimization space.
To resolve the high-rigidity problem of existing MCB assembly, this paper proposes a single-robot-based flexible automatic assembly technique that applies a novel multi-gripper claw and a flexible posture adjust scheme to achieve flexible automatic assembly for arc extinguishers, handles, magnetic components and other parts in random varying postures. A time-optimal trajectory optimization method based on improved PSO with a multi-optimization mechanism is proposed. A quintic interpolation polynomial that improves acceleration stability, joint impact and precision is employed. The multi-optimization mechanism based on the fitness switch function is proposed to reduce the computational complexity. Optimization results are judged, compared and optimized according to the fitness switch function to improve efficiency. Meanwhile, an adaptive compression factor is applied to adjust the PSO weights to ensure the global exploration ability of the algorithm in the first stage and the local search ability in the second stage. Finally, the simulation of the PSO algorithm with the time optimality as the objective function is accomplished, and the performances of different algorithms are compared. Experiments are performed on the ROKAE XB4 robot platform, to verify the proposed method.
4. Particle Swarm Time Optimal Trajectory Planning
4.1. Time-Optimal Trajectory Planning
Trajectory planning is to design the joint motion curve of the robot according to the robot’s operating requirements. In the planning process, it is required to satisfy the constraints of robot kinematic, dynamics, and the surrounding environment of the robot, and comprehensively consider the smoothness of joint motion, running time and energy consumption. The trajectory planning space of industrial robots can be divided into two types, the joint space and the Cartesian space. Since trajectory planning in the joint space can ensure the smoothness of joint motions by reducing the positioning accuracy of the robot arm Cartesian space, and the robot arm motion trajectory in the Cartesian space have problems such as singular points and joint redundancy, this paper chooses the joint space trajectory planning method. The process of joint space trajectory planning is based on two groups of six joint angles obtained by inverse kinematics, inserting multiple points between the starting and ending points within the interpolation curve, to fit the function curve of the joint angle with a time optimal strategy. Hence, each joint of the robot operates through the joint angle function. The first, second, and third derivatives of the joint angle function are the velocity, acceleration, and jerk, respectively. The maximum speed, acceleration and jerk of the robot joints are adjusted and optimized by the joint motion constraint conditions, so that the time optimal motion control can be achieved.
The goal of trajectory planning in this paper is to find the time-optimal trajectory in the joint space with multiple constraints. By analyzing the assembly path of the robot, the starting and ending points of the path are selected. Based on the actual motion constraint conditions (speed, acceleration, jerk), the joint angle function curve is optimized by ensuring the motion smoothness.
4.2. Improved PSO Algorithm
This paper seeks the optimal trajectory by an improved particle swarm optimization (PSO) algorithm with the objective function of time. Suppose that in a
D-dimensional search space, a population
composed of
n particles, where the
i-th particle is represented as a
D-dimensional vector
, which represents the position of the
i-th particle, i.e., a potential solution. The fitness corresponding to each particle position
Xi can be calculated by the objective function. The velocity of the
i-th particle is
, the individual extreme value is
, and the population extreme value of the population is
. In each iteration, the particle updates its speed and position by extreme values of the individual and the group, as shown below:
where
ω is the inertia weight,
,
, and
k are the current iteration times;
Vid is the particle velocity;
c1 and
c2 are acceleration factors (non-negative constants);
r1 and
r2 are random numbers (distributed within [0, 1]). To prevent the blind search of particles, the position
is within [−
Xmax,
Xmax], and the speed
is within [−0.1·
Xmax, 0.1·
Xmax].
The key of PSO with the quintic polynomial interpolation is to obtain the optimal time
by selecting the independent variables for particle optimization. This paper performs optimization in the search space of time
t1,
t2, and
t3 by reducing the number of search dimensions of the particle swarm to three to avoid complex mapping relations in the derivation. Meanwhile, multi-optimization is with the fitness switch function are applied to improve the converge speed. Time-optimal optimization iteration is performed after the kinematic constraints are met. The fitness function is described as follows:
where
Vj1,
Vj2,
Vj3, and
Vmax are the real-time speed and maximum speed limits of the
i-th joint, respectively.
This paper introduces multi-optimization mechanisms into the PSO algorithm. In the multi-optimization process, a conditional judgment optimization mechanism based on the fitness switch function is proposed, and the corresponding fitness switch function is established according to the result of the particle fitness. Therefore, the result is judged, compared and optimized according to the fitness switch function. The improved PSO process in this article is shown in
Figure 9.
Compared with the standard particle swarm optimization process, this paper introduces two optimization processes in the standard PSO algorithm to form a multi-optimization mechanism. A conditional decision mechanism based on a fitness switch function in the multi-optimization process, As shown in
Figure 9. On one hand, after initializing the particle swarm and determining the basic parameters, the interpolation period of the initialized particles is selected according to the constraints to prevent the initial randomness which reduce the optimization efficiency. Therefore, the rationality of each initial particle can be guaranteed; on the other hand, after the particle fitness, the current individual extreme value and the group extreme value are determined, a fitness switch function that quickly finds the optimal is used to select the particles. The function is defined as follows:
where
t1,
t2, and
t3 are the interpolation times of the robot;
e1,
e2, and
e3 are the interpolation times when the constraints are not met during the iteration process;
Vj1,
Vj2, and
Vj3 are the velocities of the
j-th joint, respectively.
As shown in Equation (13), the fitness switch function conditionally selects the particle fitness in segments. If the velocities of the three segments meet the constraints of Equation (12), the fitness calculation of f1(t) in Equation (13) will be performed and followed by iterations; otherwise, the particles will be re-constrained and optimized based on the constraint conditions of equation. To guarantee the stability of the interpolated curve, the velocities are reduced until the requirements of f2(t) in Equation (15). Equation (15) represents the seven calculation situations of f2(t). Aiming at the above-mentioned seven conditions of inconformity, the time variables e1, e2, and e3 are employed. The fitness switch function sifts and categorizes the particles into two types: superior particles which meet all constraints and can be directly optimized for iterations (the “Y” branch); inferior particles which cannot fully meet the constraints and need to be modified before the iterations (the “N” branch).
The optimization parameters are as follows: the particle swarm number
m = 50; the initial particle position is a random number within [0, 5]; the maximum flying speed of the particle is within [−0.5, 0.5]. An adaptive compression factor is added to PSO, to adjust the weight of the PSO algorithm to guarantee the initial global search capability and the later local search capability, The particle swarm velocity update equation is shown in Equation (16):
is the adaptive compression factor,
iterofcur is the current number of iterations,
NGer is the total number of iterations (set to 100),
is a positive integer (set to 8),
e is a positive integer of (set to 10), the weight
is 0.5, and the weight factor
c1 = 2,
c2 = 2,
r1 and
r2 are random numbers within [0, 1].
5. Algorithm Simulation
As shown in
Figure 10, the flexible assembly performed of MCB parts can be divided into four operating sections: section AB represents the robot moving from the initial position to the loading area; section BC represents the robot gripping a part and placing it on the adjustment rack; section CD indicates the robot adjusting the part to a fixed posture for assembly on the adjustment rack; section DE indicates the robot arm placing the adjusted part on the positioning carrier.
This paper takes section AB as an example for optimization verification. The interpolation points and interpolation times of the six joints are shown in
Table 2 and
Table 3, and the joint kinematic constraints are shown in
Table 4. During the process of section AB, joint 4 has no angular deflection, so the angle difference is 0 degrees.
The position, velocity, acceleration, and jerk interpolation curves of the six joints calculated by the first quintic polynomial interpolation are shown in
Figure 11. In
Figure 11, The oscillations of the position, speed, and acceleration curves are expected to be continuous and smooth. Meanwhile, the maximum values of the speed, acceleration, and jerk oscillations are expected to be as close to the constraint values as possible, to achieve a higher performance.
Figure 11a shows that the quintic polynomial interpolation curve passes the given interpolation points
X1,
X2,
X3,
X4 and is continuously smooth during
t1,
t2, and
t3, which proves the effectivity of the fifth-degree polynomial interpolation.
Figure 11b–d show that the unoptimized speed, acceleration, and jerk curves are continuous, and the peaks meet the constraints
Table 4, but the maximum values of the oscillations are much smaller than the constraint values.
To compare and verify the optimization results, the proposed optimization algorithm is compared with the standard PSO, genetic algorithm (GA), and chaotic optimization algorithm (COA). The chaotic optimization algorithm designed two different optimization spaces, and the comparison results are shown in
Figure 12, which shows that the improved PSO converges to the optimal at the 8th iteration, the standard PSO converges to the optimal value at the 33rd iteration, the genetic algorithm converges to the optimal at the 17th iteration, and the COA with optimization space sizes of 100 and 200 converges to the optimal value at the 20th and 56th iteration, respectively. Hence, the improved PSO is about 76% faster than the standard PSO, 53% faster than the genetic algorithm, and 60% and 85.7% faster than the chaos algorithm. According to the fitness, the improved PSO raises the optimization accuracy by 1.1%, 4.4%, 15.7%, and 12.2%, respectively, compared with other algorithms. Since the chaos optimization algorithm decreases significantly as the optimization space increases, the improved PSO has significantly improved convergence speed and convergence accuracy when the optimization space increases compared to the chaotic algorithm.
The running time of each joint in section AB optimized by the improved PSO algorithm is shown in
Table 5.
Since the joints move simultaneously during the operation of the robot, the interpolation time of each section in
Table 4 is the maximum value of the joints. Therefore,
t1 = 2.79 s,
t2 = 3.31 s,
t3 = 1.79 s. Comparing the running time before optimization in
Table 3, the overall time of section AB is decreased from 12 s to 7.89 s, i.e., decreased by 34.25%.
The optimized position, velocity, acceleration, and jerk curves of the six joints are shown in
Figure 13. The optimized joint curve also passes through the interpolation points
X1,
X2,
X3, and
X4, and meets the kinematic constraints in
Table 4. The extreme values of the curves become closer to the constraints, and the acceleration curve is continuous and stable.
Figure 13c shows that the maximum acceleration of the joints is 0.8 rad/s
2 which is within the acceleration constraint range of
Table 3.
Figure 13d shows that the maximum jerk of the joints is 1.51 rad/s³ which is within the jerk constraint range in
Table 3. Hence, it can be concluded that the improved PSO decreases the assembly time and raises the operation efficiency.
After the optimization, the time comparison of the four paths is shown in
Table 6.
It can be seen from
Table 6 that after the improved PSO algorithm is applied, the times of the four sections are decreased by 2.13 s, 1.61 s, 1.95 s, and 1.21 s, respectively, and the overall time is decreased by 6.90 s, compared with those before PSO improvement, i.e., the overall efficiency is increased by 16.7%. In addition, we also implement the standard generic algorithm (GA) and chaotic optimization algorithm (COA) whose parameters are tuned to the optimal for comparison, and obviously our method is superior to the standard GA and COA.
Figure 14 shows the simulation curves of the robot joint trajectory planning, illustrating the interpolation curves of the three-segment times
t1,
t2, and
t3 after the optimization. It can be observed that the interpolation trajectory as well as the operating curves are continuous, smooth, and stable. Meanwhile, the operating time completely corresponds to the final optimized times
t1,
t2, and
t3. Experiments prove the effectiveness of the improved PSO for time-optimal trajectory planning.
7. Conclusions
This paper proposes a flexible automatic assembly technique to solve the high rigidity issue in current MCB manufacturing, and realizes the flexible automatic assembly of multiple MCB parts with a single robot. A time-optimal trajectory PSO method with a multi-optimization mechanism is proposed. A fitness switch function that judges, compares, and optimizes the results is employed to improve the calculation efficiency. Simulation and experimental results show that compared with other methods, the proposed improved PSO significantly raise the accuracy and efficiency of the robot trajectory planning.
However, the proposed trajectory planning method is developed for the purpose of MCB assembly and is proven on our specifically designed experimental platform. The practicability cannot be fully proven by the experimental results since the conditions of manufacturing are more severe and complicated. Therefore, there are several issues to be improved in the future work: Firstly, the proposed method is expected to be applied to other robotic applications, as well as to different types of industrial robots, e.g., parallel robots, SCARA robots, for a validation of generality; Secondly, it is expected that the proposed method works under the condition that the robot operating with its maximum power, i.e., the fastest motion, and so that to inspect the performance of the proposed method; Thirdly, the cooperating system of the robot and a machine vison device is expected to be established in the next step, to automatically identify and adjust randomly postured parts.