*Article*

## **Trajectory Optimization of Pickup Manipulator in Obstacle Environment Based on Improved Artificial Potential Field Method**

#### **Haibo Zhou 1,2, Shun Zhou 1,2, Jia Yu 3, Zhongdang Zhang 1 and Zhenzhong Liu 1,2,4,\***


Received: 18 December 2019; Accepted: 24 January 2020; Published: 31 January 2020

**Abstract:** In order to realize the technique of quick picking and obstacle avoidance, this work proposes a trajectory optimization method for the pickup manipulator under the obstacle condition. The proposed method is based on the improved artificial potential field method and the cosine adaptive genetic algorithm. Firstly, the Denavit–Hartenberg (D-H) method is used to carry out the kinematics modeling of the pickup manipulator. Taking into account the motion constraints, the cosine adaptive genetic algorithm is utilized to complete the time-optimal trajectory planning. Then, for the collision problem in the obstacle environment, the artificial potential field method is used to establish the attraction, repulsion, and resultant potential field functions. By improving the repulsion potential field function and increasing the sub-target point, obstacle avoidance planning of the improved artificial potential field method is completed. Finally, combined with the improved artificial potential field method and cosine adaptive genetic algorithm, the movement simulation analysis of the five-Degree-of-Freedom pickup manipulator is carried out. The trajectory optimization under the obstacle environment is realized, and the picking efficiency is improved.

**Keywords:** pickup manipulator; adaptive genetic algorithm; trajectory optimization; improved artificial potential field method; obstacle avoidance planning

## **1. Introduction**

In the unstructured training fields such as golf, tennis, and table tennis, there are some disadvantages in picking balls such as high labor intensity, high risk, boring work, and low efficiency. Although the use of automated pickup devices such as dedicated discs [1] can improve picking efficiency, it is impossible to pick up objects between obstacles. How to realize the task of picking objects quickly in the obstacle environment, the pickup manipulator as the core part of the service robot is one of the effective picking up tools. However, at present, the pickup manipulator still has low work efficiency in the process of picking up objects, and it is difficult to avoid a collision in the obstacle environment [2]. Therefore, the trajectory optimization of the pickup manipulator in the obstacle environment needs to be solved urgently [3,4].

The operation of the traditional manipulator is usually limited to the specified path or angular displacement range [5]. In 2018, Alexander Reiter et al. proposed a time-optimal path design method

based on a predetermined end-effector path and discussed the time-optimal path following predefined end-effector paths for kinematically redundant robots [6]. Giulio Trigatti et al. proposed a new method for trajectory planning of spraying for industrial robots in 2018. According to the contour trajectory of spraying, the proposed algorithm was used to define the motion law and limit the speed of the end-effector [7]. In 2018, Junsen Huang et al. proposed a robotic time-pulse comprehensive optimal trajectory planning method. The fifth-order B-spline interpolation method is used to interpolate the motion trajectory in the joint space, and then the trajectory is optimized by the elite non-dominated sorting genetic algorithm (NSGA-II) for trajectory planning of the surgical robot [8]. In 2019, Yi Fang et al. proposed a smooth and time-optimal S-curve trajectory planning method to meet the requirements of the high-speed and ultra-precise operation of robotic manipulators in modern industrial applications [9]. However, these methods do not consider the influence of the unstructured obstacle environment. When the pickup manipulator is in an unstructured environment, the presence of obstacles may affect the pickup manipulator. These obstacles will collide with the pickup manipulator, leading to a decrease in the working stability of the pickup manipulator and even damage to the motor and other parts. O. Khatib proposed a unique real-time obstacle avoidance approach for manipulators and mobile robots based on the "artificial potential field" concept and implemented in the COSMOS system for a PUMA 560 robot in 1985 [10]. Steven M. LaValle introduced the concept of a Rapidly-exploring Random Tree (RRT) as a randomized data structure that was designed for a broad lass of path planning problems in 1998 [11]. Jiankun Wang et al. proposed an improved RRT algorithm incorporating obstacle boundary information to deal with an optimal path in 2016 [12]. Wei, k et al. proposed a dynamic path planning method for robotic autonomous obstacle avoidance based on an improved RRT algorithm in 2018 [13]. This method is used for obstacle avoidance of robots in smart factories. In 2018, Li, A et al. proposed a dynamic trajectory planning method based on ACT-R (ideal rational adaptive control) cognitive model [14] and is used for active obstacle avoidance in electric vehicles. In 2019, Wang, X et al. proposed a method for obstacle avoidance with pure azimuth measurement in the absence of a model of obstacle motion [15]. Zhang, W et al. proposed a dynamic collision avoidance method based on collision risk assessment and improved speed barrier method [16] for uncertain dynamic obstacle environments in 2017. Jiankun Wang et al. described a socially compliant path planning scheme for robotic autonomous luggage trolley collection at airports in 2019 [17]. However, these methods do not consider the time-optimal trajectory optimization, and the work efficiency needs to be improved.

In order to improve the picking e fficiency and avoid collision with obstacles, this work takes a five-Degree-of-Freedom pickup manipulator as the research object. The improved artificial potential field method and the cosine adaptive genetic algorithm are combined to finish the trajectory optimization and obstacle avoidance planning.

## **2. Methodology**

To solve the collision problem of the pickup manipulators in complex environments featuring obstacles, an improved artificial potential field method is proposed for the obstacle avoidance planning. In order to solve the problem of the unreachable target, the distance term *dn*(*<sup>X</sup>*, *Xg*) between the pickup manipulator and the target point is added based on the traditional artificial potential field. The influence of the obstacle boundary is also considered on the obstacle avoidance planning of the pickup manipulator. So, the radius *r* of the obstacle is introduced to the repulsion potential field function to adjusting the repulsion potential field. For the defect of local minimum value, this work establishes the virtual sub-target point to solve it. The improved artificial potential field method is used for obstacle avoidance planning and gets the path points.

Then this work uses the cosine adaptive genetic algorithm to optimize the trajectory between the path points. By setting the genetic parameters, constructing the objective function, constructing the motion constraints, designing the fitness function, analyzing the three genetic operators, and the adaptive dynamic adjustment, the time-optimal trajectory planning of the cosine adaptive genetic algorithm is completed. The time-optimal trajectory of the pickup manipulator in the obstacle

environment shortens the working time of the pickup manipulator and improves the picking efficiency, the overall process is shown in Figure 1.

**Figure 1.** Trajectory optimization of the pickup manipulator in the obstacle environment.

#### **3. Trajectory Optimization Design**

#### *3.1. Kinematics Modeling*

Figure 2 shows the overall structure of the selected pickup manipulator with five-Degree-of-Freedom. The selected pickup manipulator is mainly composed of a base, links, joints, and an end gripper. The coordinate system of the selected pickup manipulator linkage, which is established by the D-H method [18–20], is shown in Figure 3. The kinematics modeling analysis is performed as follows.

**Figure 2.** A five-Degree-of-Freedom articulated pickup manipulator.

**Figure 3.** Linkage coordinate system of the pickup manipulator.

According to the homogeneous transformation matrix in the formula (1) and the pose matrix in the formula (2), the expression of the pose matrix of the end-effector (3) is completed. With the above

parameters, the inverse kinematics modeling can be completed by the analytical method. The results are shown in the formulas (4) to (12).

$$\begin{aligned} \stackrel{i-1}{\dot{i}}^T &= \operatorname{Rot}(\mathbf{x}\_{i-1}, a\_{i-1}) \operatorname{Trans}(\mathbf{x}\_{i-1}, a\_{i-1}) \operatorname{Rot}(z\_i, \theta\_i) \operatorname{Trans}(z\_i, d\_i) \\ &= \begin{bmatrix} \cos \theta\_i & -\sin \theta\_i & 0 & a\_{i-1} \\ \sin \theta\_i \cos a\_{i-1} & \cos \theta\_i \cos a\_{i-1} & -\sin \alpha\_{i-1} & -d\_i \sin \alpha\_{i-1} \\ \sin \theta\_i \sin \alpha\_{i-1} & \cos \theta\_i \sin \alpha\_{i-1} & \cos \alpha\_{i-1} & d\_i \cos \alpha\_{i-1} \\ 0 & 0 & 0 & 1 \end{bmatrix} \end{aligned} \tag{1}$$

$$\begin{aligned} \, \_5^0T = \begin{bmatrix} n\_x & o\_x & a\_x & p\_x \\ n\_y & o\_y & a\_y & p\_y \\ n\_z & o\_z & a\_z & p\_z \\ 0 & 0 & 0 & 1 \end{bmatrix} \end{aligned} \tag{2}$$

$$\, \_{5}^{0}T = \, \_{1}^{0}T(\theta\_{1})\_{2}^{1}T(\theta\_{2})\_{3}^{2}T(\theta\_{3})\_{4}^{3}T(\theta\_{4})\_{5}^{4}T(\theta\_{5})\tag{3}$$

Both sides of formula (3) left multiply the inverse matrix 01*<sup>T</sup>*−1, then:

$$
\begin{bmatrix} c\_1 & s\_1 & 0 & 0 \\ -s\_1 & c\_1 & 0 & 0 \\ 0 & 0 & 1 & -d\_1 \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} n\_x & o\_x & a\_x & p\_x \\ n\_y & o\_y & a\_y & p\_y \\ n\_z & o\_z & a\_z & p\_z \\ 0 & 0 & 0 & 1 \end{bmatrix} = {}\_1^0 T^{-10} T \tag{4}
$$

$$\begin{aligned} \;^0\_1T - \;^0\_1T = \begin{bmatrix} c\_{234}c\_5 & -c\_{234}s\_5 & -s\_{234} & a\_3c\_{23} + a\_2c\_2 + a\_4c\_{234} - d\_5s\_{234} \\ -s\_5 & -c\_5 & 0 & 0 \\ -s\_{234}c\_5 & s\_{234}s\_5 & -c\_{234} & -a\_3s\_{23} - a\_2s\_2 - d\_5c\_{234} - a\_4s\_{234} \\ 0 & 0 & 0 & 1 \end{bmatrix} \end{aligned} \tag{5}$$

The matrix of formula (4) is represented as L, and the matrix of formula (5) is represented as R. Take L (2, 4) = R (2, 4), that is, the elements in the second row and the fourth column of the left and right sides of the equation are equal, then:

$$-s\_1p\_x + c\_1p\_y = 0,\tag{6}$$

Taking into account the formula (6), an analytical expression for the joint angle θ1 is obtained:

$$\theta\_1 = a \tan 2(p\_{y\prime} p\_x),\tag{7}$$

According to formula (4) and formula (5), take L (3,3) = R (3,3), L (3,4) = R (3,4), then:

$$\theta\_2 = a \tan 2 \left( k\_\tau \pm \sqrt{\left( a\_3 \sin \theta\_3 \right)^2 + \left( a\_3 \cos \theta\_3 + a\_2 \right)^2 - k^2} \right) - a \tan 2 \left( a\_3 \sin \theta\_3, a\_3 \cos \theta\_3 + a\_2 \right), \tag{8}$$

According to formula (4) and formula (5), take L (1,4) = R (3,4), L (3,4) = R (3,4), then:

$$\begin{cases} \cos \theta\_3 = \frac{A^2 + B^2 - a\_3^2 - a\_2^2}{2a\_2 a\_3} \\ \sin \theta\_3 = \pm \sqrt{1 - \left(\frac{A^2 + B^2 - a\_3^2 - a\_2^2}{2a\_2 a\_3}\right)^2} \\ \theta\_3 = a \tan 2(\sin \theta\_3 \cos \theta\_3) \end{cases} \tag{9}$$

In the formula, *k* = *d*1 + *d*5*az* − *a*4 1 − *a*2*z* − *pz*; *A* = *<sup>c</sup>*1*px* + *<sup>s</sup>*1*py* + *a*4*az* ± *d*5 1 − *a*2*z* ; *B* = *pz* − *d*1 − *d*5*az* ± *a*4 1 − *a*2*z* .

Both sides of formula (3) left multiply the inverse matrix 02*<sup>T</sup>*−1, then:

$$
\begin{bmatrix} c\_1 c\_2 & c\_2 s\_1 & -s\_2 & d\_1 s\_2 \\ -c\_1 s\_2 & -s\_1 s\_2 & -c\_2 & d\_1 c\_2 \\ -s\_1 & c\_1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} n\_x & o\_x & a\_x & p\_x \\ n\_y & o\_y & a\_y & p\_y \\ n\_z & o\_z & a\_z & p\_z \\ 0 & 0 & 0 & 1 \end{bmatrix} = \,^0T^{-1} \,^0T \, . \tag{10}
$$

$$\begin{aligned} \;^0\_2T^{-1}\;^0\_5T = \begin{bmatrix} c\_{34}c\_5 & -c\_{34}s\_5 & -s\_{34} & a\_2 + a\_4c\_{34} - d\_5s\_{34} + a\_3c\_3\\ s\_{34}c\_5 & -s\_{34}s\_5 & c\_{34} & d\_5c\_{34} + a\_4s\_{34} + a\_3s\_3\\ -s\_5 & -c\_5 & 0 & 0\\ 0 & 0 & 0 & 1 \end{bmatrix} \end{aligned} \tag{11}$$

According to formula (10) and formula (11), take L (1,3) = R (1,3), L(2,3) = R(2,3), then:

$$\begin{cases} \begin{aligned} \partial\_{34} &= a \tan 2 \left( \begin{array}{c} -\cos \theta\_1 \cos \theta\_2 a\_x - \cos \theta\_2 \sin \theta\_1 a\_y + \sin \theta\_2 a\_z \\ -\cos \theta\_1 \sin \theta\_2 a\_x - \sin \theta\_1 \sin \theta\_2 a\_y - \cos \theta\_2 a\_z \end{array} \right), \\\ \partial\_4 &= \partial\_{34} - \partial\_3 \end{aligned} \end{cases} \tag{12}$$

The inverse kinematics of the pickup manipulator is completed with the above computing. According to the position of the small ball detected by the binocular camera, the joint angle of the pickup manipulator can be calculated by using the inverse kinematics mode and realize the motion control.

#### *3.2. Objective Function and Motion Constraints*

⎡⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎣

#### 3.2.1. Objective Function

For the trajectory planning of the pickup manipulator, the objective function is constructed with the shortest picking time. Then the time of each trajectory curve is optimized in turn. The established objective function of the pickup manipulator is:

$$T\_{all} = \min \sum\_{j=1}^{m-1} h\_{j\prime} j = 1,2,3,\cdots,m-1,\tag{13}$$

In the formula, *Tall* is the total time that the pickup manipulator runs from the initial position to the final position, and *hj* is the time value obtained after decoding, *m* is the number of discrete path points that the pickup manipulator runs from the initial point to the picking target point.

#### 3.2.2. Motion Constraints

The time-optimal trajectory planning of the pickup manipulator is carried out under the constraint of the kinematics parameter of each joint. The constraint conditions are the maximum value of angular velocity and angular acceleration of each joint.

The constraint of angular velocity

.

The angular velocity of the joint *i* should meet the conditions:

$$\max \left\{ \left| \dot{\partial}\_{i}(t) \right| \right\} \le \dot{\partial}\_{i \max} \left( i = 1, 2, 3, \cdots, 5 \right), \tag{14}$$

.

In the formula, <sup>θ</sup>*i*(*t*) is the angular velocity of the joint *i* at time *t*, and θ*i*max is the maximum angular velocity of the joint *i*.

According to the conditions and work requirements of the pickup manipulator, the settings of joint constraints are shown in Table 1.


**Table 1.** Constraints on each joint.

Constraint of angular acceleration

The angular acceleration of the joint *i* should meet the conditions:

$$\max \left\{ \left| \bar{\partial}\_{i}(t) \right| \right\} \le \bar{\partial}\_{i \max} \left( i = 1, 2, 3, \cdots, 5 \right), \tag{15}$$

In the formula, .. <sup>θ</sup>*i*(*t*) is the angular acceleration of the joint *i* at time *t*, and .. θ*i*max is the maximum angular acceleration of the joint *i*.

#### *3.3. Adaptive Genetic Algorithm*

#### 3.3.1. Encoding and Decoding

The encoding of the genetic algorithm [21–23] is a process of converting the parameters from solution space into genetic spatial. The time target of trajectory planning is encoded by binary coding. The variation range of the optimization variables is relatively small; therefore, using a certain length of binary coding can ensure the accuracy of the solution. The time range of the pickup manipulator in the working state is set to [*t*0,*tf*]. If the time variable is represented by a binary coding of length *l*, [*t*0,*tf*] can be equally divided into 2*l* − 1 segments. Thus, the accuracy of the time parameter can be adjusted by adjusting the value of the coding length *l*. The longer the length of the binary coding, the better the performance of the time division, and the higher the accuracy of the time variable, as shown in formula (14). In this work, we take the binary code length *l* = 9, *tf* = 5.0, *t*0 = 0. An encoding example of the time target is 110001010.

$$\delta = \frac{t\_f - t\_0}{2^l - 1} \,\prime \tag{16}$$

Decoding is the reverse operation of the encoding, that is, the process of converting the binary coding of the time-optimal target into a real number. If the binary coding corresponding to the timeoptimal target is *x* : *x*1*x*2 ... *xl*−1*xl*, the decoding expression corresponding to the time variable of the pickup manipulator is:

$$t = t\_0 + \frac{t\_f - t\_0}{2^l - 1} \sum\_{i=1}^l x\_i 2^{l-i} \,\text{s} \tag{17}$$

#### 3.3.2. Initial Population

In the MATLAB software (R2015b, Mathworks, Natick, MA, America and 1984), the initial population of the time variable of the pickup manipulator is randomly generated by generating random numbers. Using the rand (n, l) command to generate a random matrix of n rows and l column, n represents the size of the population, and l represents the length of binary coding of individuals. Using the round (n, 1) command to round each element in the matrix off to the form of binary symbols 0 and 1, thereby generating an initial population of the pickup manipulator. The initial population is set to 30; that is, the population consists of 30 individuals.

#### 3.3.3. Fitness Function

The fitness function is mapped from the objective function. In order to convert the minimum value of running time of the pickup manipulator to the maximum value of the fitness function, the fitness function is designed as:

$$f = \begin{cases} \frac{1}{\bar{h}\_j^{\prime}}, & \max\left\{ \left| \dot{\theta}\_i(t) \right| \right\} \le \dot{\theta}\_{i\text{max}} \text{ and } \max\left\{ \left| \ddot{\theta}\_i(t) \right| \right\} \le \bar{\theta}\_{i\text{max}}\\ \frac{1}{\bar{h}\_j^{\text{max}}}, & \text{Otherwise} \end{cases} \tag{18}$$

In the formula, *h*max *j* represents the maximum value within the time limit of the time individual *j* that does not meet the motion constraint. max .<sup>θ</sup>*i*(*t*) is the maximum angular velocity of joint *i* in the time range of *hj*, max ..<sup>θ</sup>*i*(*t*) is the maximum angular acceleration of joint *i* in the time range of *hj*.

## 3.3.4. Operators

The genetic operator operation consists of three major operations: selection, crossover, and mutation. To deal with the time optimization of the pickup manipulator, they simulate the biological genetic evolution mechanism in different periods.

#### (1) Select Operation

The selection operation is an operation of evaluating and selecting individuals in the time population according to the fitness function of the time-optimal trajectory planning of the pickup manipulator. The commonly used selection algorithm is the fitness proportional method, which is also called the roulette method [24] or Monte Carlo selection method. So, this work takes the roulette method to select individuals in the time population. The solution is to calculate the individual fitness in the population according to the fitness function. An individual with big fitness will be selected in the next generation because the probability of an individual in the population being selected is proportional to the fitness. The specific steps are as follows:


$$p\_i = \frac{f(\mathbf{x}\_i)}{\sum\_{\mu=1}^{N} f(\mathbf{x}\_\mu)}, i = 1, 2, 3, \dots, N,\tag{19}$$

c. Calculate the cumulative probability of the individual:

$$q\_i = \sum\_{\nu=1}^i p(\mathbf{x}\_{\nu}), i = 1, 2, 3, \dots, N,\tag{20}$$


A visual depiction of the selection operation for the time individual of the pickup manipulator is shown in Figure 4. According to the probability *pi* in the time population, the individuals are sequentially assigned to the corresponding areas in the roulette and form a complete roulette. The position corresponding to each rotation of the turntable is uniform, and the rotational position is generated by a random function. The random number *r* represents the cumulative probability *qi*. When the wheel stops rotating, the area pointed by the pointer will be selected into the next generation population.

**Figure 4.** Roulette selection diagram.

#### (2) Cross Operation

The cross operation is an operation of partially exchanging the coding of two individuals to be optimized to generate new individuals. Since the time population is small and the single-point cross operation is simple [25], the cross operation is realized by a single point crossing method. The working principle of the cross operation is shown in Figure 5.

**Figure 5.** Cross and mutation principle of genetic algorithms.

Two pairs of individuals are respectively set as: *A* = (*<sup>a</sup>*1, *a*2, ... , *an*−1, *an*),

*B* = (*b*1, *b*2, ... , *bn*−1, *bn*). Single point cross operation is carried out on individuals A and B, and the two newly encoded individuals produced are:

$$\begin{cases} A\_1 = (a\_1, a\_2, \dots, a\_{k-1}, a\_k, b\_{k+1}, b\_{k+2}, \dots, b\_{n-1}, b\_n) \\\ B\_1 = (b\_1, b\_{2'}, \dots, b\_{k-1}, b\_k, a\_{k+1}, a\_{k+2'}, \dots, a\_{n-1}, a\_n) \end{cases} \tag{21}$$

#### (3) Mutation Operation

In the process of genetic algorithm operation, mutation takes an important role in restoring the population diversity and ensuring the global convergence of the algorithm. The mutation is an operation that randomly changes a certain bit in the individual coding with a small probability, which is usually set to 0.001–0.1. That is to say, it randomly replaces one of the bits 0 into 1 or replaces 1 with 0 in the binary coding. The principle of the mutation operation is shown in Figure 5.

#### (4) Termination Condition

The selection of the termination condition of the genetic algorithm is very important in the genetic algorithm. Improper selection of the termination condition will make the genetic algorithm convergence to the local best and make genetic algorithm early-maturing. The termination condition of the genetic algorithm is set according to the precision of the working time of the pickup manipulator and the requirement for rapid convergence in this work. In order to avoid converging to the local best, the maximum evolution algebra selected is set to 50 after multiple experiments.

(5) Adaptive Dynamic Adjustment

For the adaptive genetic algorithm, the adaptive genetic algorithm proposed by Algethami et al. can dynamically adjust the value of *pc* and *pm* according to the fitness value [26]. In the traditional genetic algorithm, the crossover probability and the mutation probability are fixed. So it is di fficult to adapt to the dynamic changes of the individual population and makes the search convergence and stability of the algorithm worse. In order to improve the optimization performance of the genetic algorithm, a cosine adaptive function is used to dynamically adjust the cross and mutation probability, as shown in the formula (22)–(23):

$$p\_c = \begin{cases} \frac{p\_{c1} + p\_{c2}}{2} + \frac{(p\_{c1} - p\_{c2})}{2} \cos(\frac{f - f\_{avg}}{f\_{max} - f\_{avg}} \pi), & f \ge f\_{avg} \\\ p\_{c1\prime} & f < f\_{avg} \end{cases} \tag{22}$$

$$p\_m = \begin{cases} \frac{p\_{m1} + p\_{m2}}{2} + \frac{(p\_{m1} - p\_{m2})}{2} \cos(\frac{f' - f\_{avg}}{f\_{max} - f\_{avg}} \pi), & f' \ge f\_{avg} \\\ p\_{m1\*} & f' < f\_{avg} \end{cases} \tag{23}$$

In the formula, *pc*1 is the cross probability when the individual fitness is the smallest, *pc*2 is the cross probability when the individual fitness is the largest. *pm*1 is the mutation probability when the individual fitness is the smallest, and *pm*2 is the mutation probability when the individual fitness is the largest.

Figure 6 shows the cross and mutation probability adjustment curve made by the cosine adaptive function. When the individual fitness is greater than the average fitness and is nearby, the cosine curve declines gradually and improves the cross and mutation probability in the adjustment process. It is beneficial to promote the change of the genetic structure of the individual and improve the ability of the global search in the population. When the individual fitness is near the maximum fitness value, the cosine curve is also smooth and reduces the probability of cross and mutation. It is beneficial to retain the excellent individual gene structure and promote the evolution direction of the population. In addition, when the individual fitness in the population is smaller than the current average fitness, the individual maintains the maximum crossover and mutation probability. It is conducive to expanding the diversity of the population and improving the overall optimization ability. In general, the optimization of the genetic algorithm by the cosine adaptive function is beneficial to improve the time optimization ability of the algorithm for the trajectory planning of the pickup manipulator. In the cosine adaptive function of the crossover and mutation probability, take *pc*1 = 0.7, *pc*2 = 0.1, *pm*1 = 0.08, *pm*2 = 0.01 according to experience and repeated experiments.

**Figure 6.** Cosine cross and mutation probability adjustment curve.

#### **4. Obstacle Avoidance Planning**

#### *4.1. Artificial Potential Field Function*

The artificial potential field function is a mathematical function expression of the virtual artificial potential field. The artificial potential field function includes the attraction potential field function, the repulsion potential field function, and the resultant potential field function. The negative gradients of the three potential field functions can generate attraction, repulsive force, and resultant force respectively, and make the manipulator moves under the resultant force finally.

#### 4.1.1. Attraction Potential Field Function

The distance between the target point and the end-effector is proportional to the attraction potential field. The farther the distance is, the stronger the potential field is generated, and vice versa. Thus, the attraction potential field function can be expressed as:

$$\begin{cases} \left. \mathcal{U}\_{\rm att}(X) = \frac{1}{2} \eta d^2(X, X\_{\mathcal{S}}) \right. \\\ d^2(X, X\_{\mathcal{S}}) = \left\| X - X\_{\mathcal{S}} \right\|^2 = \left[ \left( x - x\_{\mathcal{S}} \right)^2 + \left( y - y\_{\mathcal{S}} \right)^2 \right] \end{cases} \tag{24}$$

In the formula, η refers to attraction potential field gain factor, *X* = (*px*, *py*, *pz*) refers to the position of the end-effector, *Xg* refers to the position of the target point, *d*(*<sup>X</sup>*, *Xg*) refers to the Euclidean distance between the end-effector and the target point.

The attraction force of the target point on the manipulator is generated by the attraction potential field. It is a negative gradient of the attraction potential field function and draws the pickup manipulator towards the target point. The function expression is:

$$F\_{att}(X) = -\nabla l I\_{att}(X) = -\eta d(X, X\_{\mathfrak{J}}) \frac{\partial d(X, X\_{\mathfrak{J}})}{\partial X},\tag{25}$$

#### 4.1.2. Repulsion Potential Field Function

The distance between the obstacle and the end-effector is inversely proportional to the repulsive potential field. The closer the distance is, the stronger the potential field is, and vice versa. When the manipulator is close to the obstacle infinitely, the repulsion potential field tends to infinity. When the distance between them is greater than the distance affected by the repulsion potential field, the obstacle no longer affects the pickup manipulator. That is to say, the repulsion potential field becomes zero. Thus, the repulsion potential field function can be expressed as:

$$\begin{cases} \, \mathcal{U}\_{\text{rep}}(X) = \frac{1}{2} \varepsilon \left( \frac{1}{d(X, X\_{\text{obs}})} - \frac{1}{d\_0} \right)^2 \quad , X - X\_{\text{obs}} \le d\_0\\ \, \mathcal{U}\_{\text{rep}}(X) = 0 \end{cases}, \\ X - X\_{\text{obs}} \le d\_0 \tag{26}$$

*Appl. Sci.* **2020**, *10*, 935

In the formula, ε refers to repulsion potential field gain factor, *Xobs* refers to the position of obstacles in the work environment, *d*0 refers to the distance affected by the repulsion potential field.

The repulsion force of the obstacle on the pickup manipulator is generated by the repulsion potential field. It is the negative gradient of the repulsion potential field function and repels the pickup manipulator away from the obstacle. The function expression is:

$$F\_{\rm rep}(X) = -\nabla \mathcal{U}\_{\rm rep}(X) = \begin{cases} \ \varepsilon \left( \frac{1}{d(X, X\_{\rm obs})} - \frac{1}{d\_0} \right) \frac{1}{(X - X\_{\rm obs})^2} \frac{\partial d(X, X\_{\rm obs})}{\partial X}, X - X\_{\rm obs} \le d\_0\\ 0 & \text{, } X - X\_{\rm obs} > d\_0 \end{cases},\tag{27}$$

#### 4.1.3. Resultant Potential Field Function

The resultant potential field is superimposed by the attraction potential field and the repulsive potential field, and the resultant force is also superimposed by attraction force and repulsion force. The resultant potential field function and the resultant force function are:

$$\begin{cases} \mathcal{U}(X) = \mathcal{U}\_{\textit{att}}(X) + \sum\_{1}^{n} \mathcal{U}\_{\textit{rep}}(X) \\ \quad F(X) = F\_{\textit{att}}(X) + \sum\_{1}^{n} F\_{\textit{rep}}(X) \end{cases} \tag{28}$$

#### *4.2. Improved Method*

The artificial potential field method [27,28] is used for obstacle avoidance planning. It has the advantages of a simple and intuitive mathematical model, low computational complexity, and good real-time performance. However, there may be unreachable target points or local minimum value defects during the operation. These defects make it di fficult to complete the obstacle avoidance planning successfully [29]. Now, this work analyzes the two defects of the traditional artificial potential field method and improves them.

#### 4.2.1. Improvement of Target Point Unreachable Defect

The target point is unreachable; that is, the obstacle is distributed near the target point. So the pickup manipulator will never move to the target point due to the repulsive force of the obstacle. In order to solve the problem of an unreachable target point in the special case, the repulsion potential field function of the traditional artificial potential field method is improved. In order to enable the pickup manipulator to reach the target point in the special case, the relative distance term *dn*(*<sup>X</sup>*, *Xg*) between the pickup manipulator and the target point is increased based on the original repulsion potential field function. *n* is adjustment factor of the distance and the repulsion potential field can be adjusted according to the relative distance between the pickup manipulator and the target point.

In addition, the influence of the obstacle boundary is considered, and the obstacle radius r is introduced into the repulsion potential field function on the obstacle avoidance planning. Figure 7 shows that under the influence distance *d*0 the obstacle, the obstacle boundary is used as the collision condition. The distance *d*(*<sup>X</sup>*, *Xobs*) of the current point of the pickup manipulator to the obstacle boundary is calculated, and the repulsion potential field is constructed under this distance.

**Figure 7.** Schematic diagram of obstacle distance.

Thus, the mathematical expression of the improved repulsive potential field function is:

$$\begin{cases} \, \mathcal{U}\_{rp}^\*(X) = \frac{1}{2} \varepsilon (\frac{1}{d(X, X\_{\rm obs}) - r} - \frac{1}{d\_0})^2 d^n(X, X\_{\mathcal{S}}), X - X\_{\rm obs} \le d\_0\\ \, \mathcal{U}\_{rp}^\*(X) = 0, X - X\_{\rm obs} > d\_0 \end{cases},\tag{29}$$

The improved repulsion force is generated by a negative gradient of the improved repulsion potential field function. The function expression relationship is:

$$F\_{np}^\*(X) = -\nabla l I\_{np}^\*(X) = \begin{cases} F\_{np1}^\* + F\_{np2'}^\* X - X\_{\text{obs}} \le d\_0 \\ 0 & , X - X\_{\text{obs}} > d\_0 \end{cases} \tag{30}$$

When *X* − *Xobs* > *d*0, it means that the distance between the end-effector and the obstacle exceeds the boundary affected by the repulsive potential field. The repulsion force is set to zero. When *X* − *Xobs* < *d*0, the pickup manipulator is within the influence of the repulsion potential field. At this time, the repulsion force generated by the obstacle is composed of the repulsion component *F*∗*rep*1 and the compensating attraction component *F*∗*rep*2. The functional expressions are:

$$\begin{cases} F\_{rcp1}^\* = \varepsilon \left( \frac{1}{d(X, X\_{db}) - r} - \frac{1}{d\_0} \right) \frac{1}{(X - X\_{db})^2} \frac{\partial d(X, X\_{db})}{\partial X} d^n(X, X\_{\mathcal{S}}), X - X\_{db\mathcal{S}} \le d\_0 \\\ F\_{rcp2}^\* = -\frac{n}{2} \varepsilon \left( \frac{1}{d(X, X\_{db}) - r} - \frac{1}{d\_0} \right)^2 d^{n-1}(X, X\_{\mathcal{S}}) \frac{\partial d(X, X\_{\mathcal{S}})}{\partial X}, X - X\_{db\mathcal{S}} \le d\_0 \end{cases} \tag{31}$$

In the formula, *F*∗*rep*1 represents the repulsion force generated by the obstacle to the manipulator, pointing from the obstacle direction to the manipulator. *F*∗*rep*2 is the compensation of attraction force for the target point unreachable, pointing from the direction of the pickup manipulator to the target point. The modes of the respective vectors of *F*∗*rep*1and *F*∗*rep*2are:

$$\begin{cases} \|F\_{rep1}^{\star}\| = \varepsilon \left(\frac{1}{d(X, X\_{obs}) - r} - \frac{1}{d\_0}\right) \frac{1}{(X - X\_{obs})^2} d^n(X, X\_{\mathcal{S}}), X - X\_{obs} \le d\_0\\ \|F\_{rep2}^{\star}\| = \frac{n}{2} \varepsilon \left(\frac{1}{d(X, X\_{obs}) - r} - \frac{1}{d\_0}\right)^2 d^{n-1}\left(X, X\_{\mathcal{S}}\right), X - X\_{obs} \le d\_0 \end{cases} \tag{32}$$

Compared with the original repulsion force *Frep*, the improved repulsion component *F*∗*rep*1 becomes smaller, but the direction is unchanged. The increased compensating attraction component *F*∗*rep*2 points to the target point. So, the improved resultant repulsion force *<sup>F</sup>*<sup>∗</sup>*rep* becomes smaller and the direction tends toward the target point. The improved resultant repulsion force *<sup>F</sup>*<sup>∗</sup>*rep* is superimposed on the original attraction force, which makes the improved resultant force *F*∗ closer to the target point and solves the detection of the unreachable target.

The different values of the adjustment factor *n* will have different effects on the improved repulsion function *<sup>F</sup>*<sup>∗</sup>*rep*. The different values of *n* are analyzed below.

(1) When 0 < *n* < 1, the mathematical characteristics of *dn*(*<sup>X</sup>*, *Xg*) in *F*∗*rep*1 and *dn*−<sup>1</sup>(*<sup>X</sup>*, *Xg*) in *F*∗*rep*2 are analyzed, and the results are shown in Figure 8.

**Figure 8.** Mathematical characteristics when 0 < n < 1.

Analyzing the data in Figure 8, it can be founded that when *X* → *Xg* , *dn*(*<sup>X</sup>*, *Xg*) → 0, *dn*−<sup>1</sup>(*<sup>X</sup>*, *Xg*) → <sup>∞</sup>, then:

$$\begin{cases} \lim\_{X \to X\_{\mathcal{S}}} \|F^\*\_{rep1}\| = \lim\_{X \to X\_{\mathcal{S}}} \left[ \varepsilon \left( \frac{1}{d(X, X\_{obs}) - r} - \frac{1}{d\_0} \right) \frac{1}{(X - X\_{obs})^2} d^n(X, X\_{\mathcal{S}}) \right] = 0\\ \lim\_{X \to X\_{\mathcal{S}}} \|F^\*\_{rep2}\| = \lim\_{X \to X\_{\mathcal{S}}} \left[ \frac{n}{2} \varepsilon \left( \frac{1}{d(X, X\_{obs}) - r} - \frac{1}{d\_0} \right)^2 d^{n-1}(X, X\_{\mathcal{S}}) \right] = \infty \end{cases} \tag{33}$$

It can be found that when the pickup manipulator gradually approaches the target point, the improved repulsion component *F*∗*rep*1 approaches zero. The compensated attraction component *F*∗*rep*2 approaches infinity. Under the action of the resultant potential, the pickup manipulator can smoothly move to the target point.

(2) When *n* = 1, the mathematical characteristics of *dn*(*<sup>X</sup>*, *Xg*) in *F*∗*rep*1 and *dn*−<sup>1</sup>(*<sup>X</sup>*, *Xg*) in *F*∗*rep*2 are analyzed, and the results are shown in Figure 9.

**Figure 9.** Mathematical characteristics when n = 1.

Analyzing the data in Figure 9, it can be found that when *X* → *Xg* , *dn*(*<sup>X</sup>*,*Xg*) → 0, *dn*−<sup>1</sup>(*<sup>X</sup>*,*Xg*) → *c*, then:

$$\begin{cases} \lim\_{X \to X\_{\mathcal{S}}} \|F^\*\_{\text{rep}1}\| = \lim\_{X \to X\_{\mathcal{S}}} \left[ \varepsilon \left( \frac{1}{d(X, X\_{\text{obs}}) - r} - \frac{1}{d\_0} \right) \frac{1}{(X - X\_{\text{obs}})^2} d^n(X, X\_{\mathcal{S}}) \right] = 0\\ \lim\_{X \to X\_{\mathcal{S}}} \|F^\*\_{\text{rep}2}\| = \lim\_{X \to X\_{\mathcal{S}}} \left[ \frac{\eta}{2} \varepsilon \left( \frac{1}{d(X, X\_{\text{obs}}) - r} - \frac{1}{d\_0} \right)^2 d^{n-1}(X, X\_{\mathcal{S}}) \right] = \varepsilon \end{cases} \tag{34}$$

It can be found that when the manipulator gradually approaches the target point, the improved repulsion component *F*∗*rep*1 approaches zero. And the compensated attraction component *F*∗*rep*2 approaches

the constant c. The manipulator can smoothly move toward the target point under the action of the resultant potential.

(3) When *n* > 1, the mathematical characteristics of *dn*(*<sup>X</sup>*, *Xg*) in *F*∗*rep*1 and *dn*−<sup>1</sup>(*<sup>X</sup>*, *Xg*) in *F*∗*rep*2 are analyzed, and the results are shown in Figure 10.

**Figure 10.** Mathematical characteristics when n > 1.

Analyzing the data in Figure 10, it can be founded that when *X* → *Xg* , *dn*(*<sup>X</sup>*, *Xg*) → 0, *dn*−<sup>1</sup>(*<sup>X</sup>*, *Xg*) → 0, then:

$$\begin{cases} \lim\_{X \to X\_{\mathcal{S}}} \|F^\*\_{\text{rep1}}\| = \lim\_{X \to X\_{\mathcal{S}}} \Big[ \varepsilon \left( \frac{1}{d(X, X\_{\text{obs}}) - r} - \frac{1}{d\_0} \right) \frac{1}{(X - X\_{\text{obs}})^2} d^n(X, X\_{\mathcal{S}}) \Big] = 0\\ \lim\_{X \to X\_{\mathcal{S}}} \|F^\*\_{\text{rep2}}\| = \lim\_{X \to X\_{\mathcal{S}}} \Big[ \frac{1}{2} \varepsilon \left( \frac{1}{d(X, X\_{\text{obs}}) - r} - \frac{1}{d\_0} \right)^2 d^{n-1}(X, X\_{\mathcal{S}}) \Big] = 0 \end{cases} \tag{35}$$

It can be found that when the manipulator gradually approaches the target point, the improved repulsion component *F*∗*rep*1 and the compensated attraction component *F*∗*rep*2 approaches to zero at the same time. The manipulator can still move smoothly to the target point under the influence of the original potential attraction force *Fatt*.

According to the above three cases, different values of the adjustment factor *n* can make the pickup manipulator move smoothly to the target point. When *n* is 1, the compensated attraction force *F*∗*rep*2 tends to be constant, and the transition is smooth. So, this work takes *n* as 1 for operation.

#### 4.2.2. Improvement of the Local Minimum Value Defect

The local minimum value, that is, the repulsion force and the attraction force of the pickup manipulator reach the balance and fall into the local stable state. So, the resultant force becomes zero, and there is no driving force to ge<sup>t</sup> the pickup manipulator to the target point. Hu et al. used the angular migration in the X-Y plane to make end-effector jump out of local minimum value in 2012 [30]. In 2019, Huang et al. proposed a fuzzy improved APF algorithm and the problem of the local minimum value was overcome [31]. In order to solve the problem of local minimum value of the pickup manipulator, this work improves the artificial potential field method by increasing the virtual sub-target. Figure 11 shows that the sub-target point is set at the bottom of the obstacle influence boundary. The appearance of the sub-target point changes the original attraction potential field environment and breaks the original balance state of attraction force and repulsion force. Thus, the manipulator is separated from the local minimum point under the resultant potential field constructed by the sub-target. When the pickup manipulator reaches a new position and is no longer affected by the local minimum value, the virtual sub-target point is not working. The pickup manipulator continues to use the target point to perform the planning process with the artificial potential field method.

**Figure 11.** Force of improved local minimum value.

#### **5. Experimental Verification**

#### *5.1. Simulation Conditions*

The experimental object is a five-DOF pickup manipulator and the kinematics parameter are *d*1 = 240 mm, *a*2 = 330 mm, *a*3 = 210 mm, *a*4 = 50 mm, *d*5 = 90 mm. The selected obstacle radius is *r* = 10 mm.

#### *5.2. Experimental Verification*

5.2.1. The Comparative Experiment of the Improved Artificial Potential Field Method and the Rapidly-Exploring Random Tree\* Method

Create a work environment for the pickup manipulator, set the initial point of the end-effector *X*0 = [1 cm, 18 cm], target point *Xg* = [60 cm, 60 cm], and the center of obstacle M = [50 cm, 50 cm] to conduct the simulation experiment in MATLAB. The improved artificial potential field method is adopted for obstacle avoidance planning to obtain the path points of the end-effector, and the results are showed in Table 2. The rapidly-exploring Random Tree\* (RRT\*) method is adopted for obstacle avoidance planning to obtain the path points of the end-effector, and the results are showed in Table 3.


**Table 2.** Path points of the end-effector obtained by the improved artificial potential field method.

Figure 12 shows the path point obtained by the improved artificial potential field method for obstacle avoidance planning. When the end-effector is not affected by obstacles, the improved artificial potential field method can plan a straight-line trajectory to reduce the running distance and improve the working efficiency of the pickup manipulator. When the manipulator is affected by obstacles, the improved artificial potential field method can plan the obstacle avoidance path and make the pickup manipulator successfully reach the target point. The minimum obstacle avoidance radius is 2.873 cm, and it can be found in Table 2 at *P*20. Figure 13 shows the trajectory of the end-effector obtained by RRT\* method for obstacle avoidance planning. Due to the randomness of the sampling of RRT\* method, the generated path is often not the optimal path, which makes the manipulator run a longer distance. When the manipulator is affected by obstacles, the minimum obstacle avoidance radius is 11.566 cm, shown in Table 2 at *P*6 and is much higher than the improved artificial potential field method. That reduces the working efficiency of the manipulator.



**Figure 12.** Trajectory planning of the improved artificial potential field method.

**Figure 13.** Trajectory planning of the RRT\* method.

5.2.2. Simulation Experiment of the Improved Artificial Potential Field Method and Cosine Adaptive Genetic Algorithm

(1) General Obstacle Environment

Create a work environment for the pickup manipulator, set the initial point of the end-effector *X*0 = [59 cm, 0 cm, 15 cm], target point *Xg* = [45 cm, 20 cm, 0 cm], and the center of obstacle M = [53 cm, 10 cm, 20 cm] to conduct the simulation experiment in MATLAB. The improved artificial potential field method is adopted for obstacle avoidance planning to obtain the path points of the end-effector, and the results are showed in Table 4. The established Kinematics model is used to calculate the joint angle, and the results are shown in Table 5.


**Table 4.** Path points of the end-effector.



The primary selection of the running time between the path points is 2 s, and the established cosine adaptive genetic algorithm is used to optimize the time of the trajectory planning. The time optimization results of each joint at each path point are shown in Table 6.

**Table 6.** Time optimization results of the pickup manipulator at each path point.


In order to ensure that every joint reaches the joint position, the longest running time of the joints is taken as the running time of the pickup manipulator. The time optimization results in the obstacle environment are shown in Table 7.


**Table 7.** Comparison of time optimization results in the obstacle environment.

According to the time optimization results in Table 7, the running time of the pickup manipulator in each stage is shortened by 6.1%, 26.1%, 51.6%, 38.4%, 51.6%, 67.7%, 67.7%, 67.7%, and 70.6%, respectively. The overall time is shortened by 51.6%, and the optimization effect is obvious. Combine the joint angles in Table 5 and the time optimization results of each path point in Table 7 to conduct the motion simulation in ADAMS(Adams 2016, MSC, LA, America and 1963). Set the simulation time t = 8.72 s and the simulation step size = 200 for the simulation, and the results are shown in Figures 14 and 15.

**Figure 14.** Movements state of the pickup manipulator in the obstacle environment. (**a**) Initial state of the pickup manipulator. (**b**) End state of the pickup manipulator.

**Figure 15.** The displacement curve of the end-e ffector after trajectory optimization.

Figure 14 depicts the overall motion state of the pickup manipulator under the obstacle environment. Figure 14a shows the initial state of the pickup manipulator under the obstacle environment. If the pickup manipulator moves in a straight line without obstacle avoidance planning, it will collide with the cylindrical obstacle. Figure 14b shows the end state of the pickup manipulator. The running curve of the pickup manipulator is obtained by using the improved artificial potential field to avoid an obstacle in the obstacle environment and then using the cosine adaptive genetic algorithm to optimize the trajectory. It can be seen from the trajectory curve that the pickup manipulator can successfully avoid the obstacle and smoothly reach the target point along the path of the obstacle avoidance planning, and the trajectory optimization. Figure 15 shows the displacement curve of the end-effector along each coordinate axes. It can be seen from Figure 15 that the trajectory of the end-effector along the coordinate axes during the movement is continuous, without a large fluctuation phenomenon, and the motion law is reasonable. It proves the correctness of the theoretical derivation of the improved artificial potential field method and the cosine adaptive genetic algorithm.

(2) Obstacle Environment with the Problems of Local Minimum Value and Unreachable Target

Create a work environment with the problems of local minimum value and unreachable target for the pickup manipulator, set the initial point of the end-e ffector *Xo* = [60 cm, 0 cm, 15 cm], target point *Xg* = [45 cm, 10 cm, 15 cm], and the center of obstacle M = [49 cm, 6 cm, 16 cm] to conduct the simulation experiment in MATLAB. The improved artificial potential field method is adopted for obstacle avoidance planning to obtain the path points of the end-e ffector, and the results are showed in Table 8.


**Table 8.** Path points of the end-e ffector.

The primary selection of the running time between the path points is 2 s, and the established cosine adaptive genetic algorithm is used to optimize the time of the trajectory planning. In order to ensure every joint reaches the joint position in the same time, the longest-running time of the joints is taken as the pickup manipulator running time. The time optimization results in the obstacle environment are shown in Table 9.

According to the time optimization results in Table 9, the running time of the pickup manipulator in each path point is respectively shortened by 27.11%, 37.38%, 51.08%, 58.42%, 52.52%, 50.59%, 68.69%, 54.5%, and 84.35%. The overall running time is shortened by 53.85%, and the optimization e ffect is obvious. Combine the path points in Table 6 and the time optimization results of each path point in Table 9 to conduct the motion simulation in ADAMS. Set the simulation time t = 8.31 s and the simulation step size = 200 for simulation, and the result is shown in Figure 16.


**Table 9.** Comparison of time optimization results in obstacle environment.

**Figure 16.** End state of the pickup manipulator.

Figure 16 shows the end state of the pickup manipulator. The running curve of the pickup manipulator is obtained by using an improved artificial potential field to avoid an obstacle in the obstacle environment and then using the cosine adaptive genetic algorithm to optimize the trajectory. It can be seen from the trajectory curve that the pickup manipulator can successfully avoid the obstacle and smoothly reach the target point along the path of obstacle avoidance planning and trajectory optimization.

Figure 17 shows the displacement curve of the end-effector along each coordinate axes. It can be seen from Figure 17 that the trajectory of the end-effector along the coordinate axes is continuous, without large fluctuation. The issues of local minimum values and unreachable targets are solved, and the motion law is reasonable. It proves the correctness of the theoretical derivation of the the improved artificial potential field method and the cosine adaptive genetic algorithm.

**Figure 17.** The displacement curve of the end-effector after the trajectory optimization.

According to the above two experimental results, the pickup manipulator can successfully avoid the obstacle and smoothly reach the target point along the path of obstacle avoidance planning and trajectory optimization. When the obstacle point is close to the target point, the improved artificial potential field method can avoid the end-e ffector swing between the obstacle point and the target point and solve the problem of the unreachable target. When the end-e ffector is in local minimum value, the improved artificial potential field method can make the end-e ffector jump out of the local minimum value quickly and solve the problem of the local minimum value of the artificial potential field method. Combining with the improved artificial potential field method and cosine adaptive genetic algorithm, the overall running time of the pickup manipulator is, respectively, reduced by 51.6% and 53.85%. During the movement, the trajectory of the end-e ffector is continuous, without large fluctuations.

## **6. Conclusions**

(1) In order to shorten the working time of the pickup manipulator and improve its operating efficiency, this work establishes a time objective function for the pickup manipulator. According to the motion constraint conditions, the fitness function is designed, and the relation between fitness function and motion constraint is analyzed. The trajectory optimization model of the pickup manipulator is established by cosine adaptive genetic algorithm.

(2) In order to avoid collision between the pickup manipulator and the obstacle in the working environment, an improved artificial potential field method is proposed to analyze the obstacle avoidance planning of the pickup manipulator. For a defect of target unreachable of the traditional artificial potential field method, the distance term *dn*(*<sup>X</sup>*, *Xg*) between the pickup manipulator and the target point is increased. The obstacle radius *r* is introduced into the repulsion potential field function. For a defect of the local minimum value, the virtual sub-target point is added for improvement.

(3) This work designs a simulation platform of a five-DOF pickup manipulator. Combining improved artificial potential field method and cosine adaptive genetic algorithm to conduct trajectory optimization motion simulation on the five-DOF pickup manipulator. The results show that by combining the improved artificial potential field method and the cosine adaptive genetic algorithm, the pickup manipulator can perform obstacle avoidance planning. Moreover, the problems of unreachable targets and local minimums value are solved, and the trajectory optimization under obstacle avoidance conditions is e ffectively realized. However, the problem of the optimization of the obstacle avoidance path is not considered in this work.

**Author Contributions:** This paper is worked by five people and the contributions are listed by follows: conceptualization—Z.Z.; writing-original draft preparation—S.Z. and J.Y.; writing-review and editing—H.Z. and Z.L. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by [the National Key Research and Development Program of China] gran<sup>t</sup> number [2018YFB1308900], [the Key projects of the Tianjin Natural Science Foundation] gran<sup>t</sup> number [17JCZDJC30400].

**Acknowledgments:** This work was supported by the National Key Research and Development Program of China under Grant Nos 2018YFB1308900 and the Key projects of the Tianjin Natural Science Foundation under Grant Nos 17JCZDJC30400.

**Conflicts of Interest:** The authors declare no conflict of interest.
