#### Abstract

Robot will be used in the grinding industry widely to liberate human beings from harsh environments. In the grinding process, optimal trajectory planning will not only improve the processing quality but also improve the machining efficiency. The aims of this study are to propose a new algorithm and verify its efficiency in achieving the optimal trajectory planning of the grinding robot. An objective function has been defined terms of both time and jerk. Improved whale optimization algorithm (IWOA) is proposed based on whale optimization algorithm (WOA) and differential evolution algorithm (DE). Mutation operation and selection operation of DE are imitated in the part of initialization to process the population initialized by WOA, and then, the search tasks of WOA are performed. Motion with a constant velocity of the end-effector is considered during fine grinding. The continuity of acceleration and velocity will be achieved by minimizing jerk, and at the same time, smooth robot movement can be obtained. Cubic spline interpolation is implemented. A six-axis industrial robot is used for this research. Results show that optimal trajectory planning based on IWOA is more efficient than others. This method presented in this paper may have some indirect significance in robot business.

#### 1. Introduction

The optimal trajectory planning of a robot is based on the optimization of parameters and the improvement of methods. The most significant optimization criteria are the minimum execute time, minimum energy, and minimum jerk. Trajectory planning in Cartesian space is intuitive, and the movement trajectory and attitude of the end-effector are easy to observe. But, this method did not consider problems caused by kinematic singularities [1–4]. Trajectory planning in joint space can avoid those problems. The joint trajectories are obtained by interpolating functions which satisfy kinematic and dynamic constraints. The trajectory based on a system controller is easier to adjust in joint space [5–7].

A time-optimal trajectory planning method with constraints of velocity, acceleration, and jerk is presented in [8]. This optimization method adopts a hybrid optimization strategy and solves the problem from path description, kinematics of the robot, and constraints. The resulting trajectory is optimal relative to time, but not smooth enough. An analytic method is used to obtain the solution of the minimum jerk trajectory of a point-to-point path. A minimum-time/jerk algorithm is presented, and it is verified by experiments in [9]. A direct analytical method is proposed in [10] to achieve the linear transformation of the industrial robot’s characteristic equation, which is useful for industrial robot trajectory planning and control. According to [11], time-optimal trajectory planning can be considered as a nonconvex problem. Previous robot trajectory planning mainly focused on time optimization [12, 13]. In the recent years, multiobjective optimization under kinematic constraint has been under attention so as to improve the efficiency and quality and save energy. Meanwhile, many algorithms used to achieve optimal trajectory planning of robot are emerged. In order to get the global minimum jerk for trajectory planning of a 2-dof planar robot, a new method using GA is proposed in [14]. Aiming at trajectory planning of a free-floating robot, a jerk optimal trajectory planning algorithm based on particle swarm optimization algorithm is proposed in [15]. Joint Angle trajectory is smooth and continuous, and the driving torque of the robot joint angle is minimized while the attitude adjustment of the free-floating space robot is completed. To obtain the optimal solution for the trajectory of the space robot, a multiobjective particle swarm optimization method is used in [16]. Invasive Weed Optimization algorithm is used to research the optimal solution for a robot arm in [17]. We consider general asymmetric bounds on velocity, acceleration, and jerk [18] and present a complete trajectory generation algorithm. A multiobjective differential evolution algorithm proposed in [19] is used in trajectory planning of a mobile robot. A multiobjective teaching learning-based optimization method proposed in [20] is used to achieve optimal trajectory planning of a welding robot. In [21], a combination of the modified potential field and numerical approach-based Jacobian to achieve path planning of a redundant robot is proposed. An improved B-spline curve is proposed, which made the angular velocity and angular acceleration smooth and continuous during trajectory movement, and the path of the robot end-effector in the Cartesian space is improved while guaranteeing the smoothness of joint movement [22]. Cubic spline is used to interpolate trajectories to ensure the continuity of jerk in [14]. Based on improved cuckoo search algorithm, a 3-5-3 polynomial interpolation trajectory planning algorithm is proposed in [23]. Aiming at an autonomous operation of the mobile system, Pirník et al. [24] present a designed algorithm, which is able to integrate inertial sensor data and can improve the trajectory planning efficiency.

The optimization methods proposed by different scholars are applied in specific scenes. In this paper, IWOA is used in grinding robot optimal trajectory planning with certain objective function, and the optimization results are interpolated by cubic spline. The paper is organized as follows: in Section 2, an optimization problem is introduced and objective function is defined. Section 3 describes the details of WOA and IWOA. In Section 4, grinding path and constraints of kinematic are given. Section 5 shows the results of some simulation and comparison of the jerk and work time before and after optimization. In Section 6, the conclusion is given, and the reasons of optimization results are discussed.

#### 2. Define Objective Function

The smoothness of robot motion plays an important role in robot grinding because it will help reduce vibration and improve the grinding quality. In order to grind the workpiece surface effectively and obtain uniform material removal, it is necessary to plan each point on the grinding path. Better continuity of speed and acceleration can prevent the mechanical body from shock, overshoot, and oscillation [25]. By reducing the jerk, the stability of the robot can improve, and the continuity of speed and acceleration can be achieved. But, the execution time will increase significantly and will affect the production beat. Therefore, trajectory planning is needed to meet the requirements of minimum time and minimum jerk in some extent by introducing weight parameters and . Firstly, the grinding path is defined in the Cartesian space, and then, the inverse kinematics is solved for the ABB IRB2600 robot to obtain the angles of each joint. Considering the constraints of speed, acceleration, and jerk, the objective function is defined as follows:withwhere is the number of joints and is the number of points in the grinding path. The more the points extracted on the curve, the closer it is to the contour curve of the workpiece. But, too many path points will affect the grinding efficiency of the robot, so defining an appropriate number of path points is important. and are weight coefficients. is the computational time interval between two continuous points on the joint path. is the whole grinding time. , and are velocity, acceleration, and jerk of the *j*th joint, respectively. , and are the upper bounds of velocity, acceleration, and jerk of the *j*th joint, respectively.

The first part of (1) represents the running time of the robot, and the second part is an expression about jerk. Jerk is vectors, so to introduce it into the objective function, taking its square for operation, cubic spline interpolation is selected.where and . According to the positions in joint space, time interval, and the constraints of the velocity and acceleration, the robot acceleration matrix is obtained and used to solve (3).

#### 3. Improved WOA

##### 3.1. WOA

WOA is an efficiency nature-inspired meta-heuristic optimization algorithm, which mimics the social behavior of humpback whales. The efficiency of the WOA is evaluated by solving 29 mathematical optimization problems and six structural optimization problems, and optimization results demonstrate that WOA is very competitive compared to the state-of-the-art optimization methods [26]. WOA is used to solve many industrial problems and illustrated in the literature [27–29]. Step 1: the population is initialized Step 2: the fitness value of each search agent is calculated, and the current best individual is selected Step 3: the strategy of shrinking circle and up with spiral-shape is selected Step 4: it is checked whether each search agent exceeds the search boundary, the fitness value of each search agent is calculated, and the optimal position is updated Step 5: the maximum iteration is reached, and the final results are obtained

Details about Step 3 are as follows:

###### 3.1.1. Exploitation

Humpback whales move around their prey in a shrinking circle, while following a spiraling path. To model this behavior, we assume that there is a 50% chance of choosing between shrinking encircling mechanism and a spiral model to update the whale’s position. The mathematical model is as follows:where is a random number in [0,1], *t* is the current iteration, and are coefficient vectors, is the position of the best solution so far, and is the position vector. is a better solution that will be updated in each iteration. indicates the distance of the *i*th whale to the prey, is a constant for defining the shape of logarithmic spiral, and is a random number in [−1, 1].

###### 3.1.2. Encircling Prey

WOA assumes that the current solution is the target prey. First, the best search agent is defined, and then, the other search agents will attempt to update their positions towards the best search agent. This behavior is expressed in the following equations:

The vectors and are calculated as follows:where is linearly decreased from 2 to 0 and is a random vector in [0, 1].

###### 3.1.3. Prey Search

Humpback whales search randomly based on each other’s position. Therefore, a random value greater than 1 or less than −1 is used to force the search agent away from a reference individual. The position of the search agent is updated according to the random selected search agent. The mechanism and the > 1 allow WOA achieve global search. The mathematical model is as follows:where is a random position vector chosen from the current population.

##### 3.2. IWOA

DE has been proved to be an effective global search algorithm in solving complex global optimization problems. DE and WOA are combined to propose a new algorithm (IWOA), which has better ability of global optimization and great robust. Figure 1 is P-code of IWOA.

By imitatating the operation of mutation and selection in DE, the initialize program of WOA is improved. This new initialize program makes population more representative and easier to obtain a global optimal solution. Population size is considered as the number of whales, *G*_{m} is the maximum number of iterations, mutation factor *F* is calculated by (11), and *F*_{0} is the initial value of *F*:

###### 3.2.1. Mutation Operation

For the whale position (*h* = 1, 2, …, N), a new position can be generated by the following formula:where *N* is the number of whales and and are different integers randomly selected in [1, *N*] and instead of index *h*. The mutation factor is a real constant on [0, 2], and the amplification of differential vector is controlled.

###### 3.2.2. Selection Operation

In order to determine whether vector can become new positions for whales in the iteration of *G* + 1, it will be compared with , and if the fitness value of the former is better than the latter, will be replaced by in the *G* + 1 iteration; otherwise, will be retained. Then, positions of whales are updated.

#### 4. Implement

In the process of robot fine grinding, keeping the grinding speed as a constant contributes to control the material removal rate, so as to effectively control the grinding quality. Therefore, the grinding speed is introduced as the intermediate variable and optimized by IWOA. Then, the optimal motion parameters of each joint of the robot are obtained. The constraints of speed, acceleration, and jerk are shown in Table 1.

The first grinding path is divided into 50 trajectory points, as shown in Figure 2.

Then, the joint displacements of six axis for the ABB IRB2600 grinding robot are obtained by inverse kinematics solving. The value of and are chosen after trial of varying the values of each from 0 to 1 and set as 0.4 and 0.6, respectively.

The joint positions are used as the input of the IWOA, and MATLAB 2018b software is used to complete the optimization process. ABB RobotStudio software is used for simulation.

#### 5. Results

The jerk values before and after optimization with respect to the intermittent points on the grinding path are illustrated in Figures 3(a)–3(f). In Figure 3(g), every joint’s position and orientation are given. The comparison of whole grinding time before and after optimization with four kinds of algorithm is shown in Table 2.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

From Figure 3, it can be observed that jerk after optimization is significantly reduced compared with jerk before optimization and fluctuated around a constant value. The maximum value of jerk before optimization for every joint is 2.50 deg/s^{3}, 2.50 deg/s^{3}, 2.50 deg/s^{3}, 250 deg/s^{3}, 3.75 deg/s^{3}, and 33.75 deg/s^{3}. The maximum value of jerk after optimization for every joint is 0.144 deg/s^{3}, 0.034 deg/s^{3}, 0.066 deg/s^{3}, 4.136 deg/s^{3}, 0.039 deg/s^{3}, and 0.042 deg/s^{3}. No matter before or after optimization, the fluctuation range of joint 4 is significantly larger than others.

According to Table 2, it can be observed that grinding time after optimization is increased. The growing rate by using GA is 111.95%, using DE is 95.97%, using WOA is 71.26%, and using IWOA is 68.67%. Also, the growing rate is the smallest by using IWOA.

#### 6. Discussion and Conclusions

In this paper, the objective function including an expression of jerk and time of total work for every joint IWOA is proposed by combining DE and WOA, and IWOA is used to get optimal trajectory of the grinding robot. After optimization, the goal of jerk being smaller is achieved and time is not increased significantly.

Jerk is reduced significantly by using IWOA*.* After optimization, jerk of every joint has reduced significantly. By reducing jerk, the movement path is smoother and the speed and acceleration are more continuous, which can improve the grinding quality to some extent. The jerk fluctuation range of joint 4 is significantly larger than that of others because joint 4 has the biggest range of motion so as to ensure the end-effector passes every point on the grinding path.

IWOA is effective in performing an optimal trajectory planning of a robot*.* Compared with other three algorithms, the growing rate of time is the smallest by using IWOA. The reason is IWOA performa mutation and selection operation for the population initialized by WOA. Mutation and selection operation of IWOA mimic the operation of DE. Then, the initial population becomes more representative, and the algorithm is more robust.

This new method of optimal trajectory planning based on IWOA will be useful in the industry of robot grinding, for example, the grinding of welding line for automobile and its accessories and burrs for hardware products.

#### Data Availability

All data are defined according to the needs of research and results are achieved by software.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.

#### Acknowledgments

This work was funded by the Central Government Guided Local Science and Technology Development Projects of China under grant no. YDZX20191400002765 and Key Research and Development Projects of Shanxi Province under grant no. 201903D421006.