TIME-OPTIMAL PATH PLANNING MODEL USING GENETIC ALGORITHM IN RRR ROBOT

# TIME-OPTIMAL PATH PLANNING MODEL USING GENETIC ALGORITHM IN RRR ROBOT

Ortaköy Vocational School, Aksaray University, Turrkey
Department of Computer Engineering, Konya Food and Agriculture University, Turkey
Aksaray University, Department of Electrical and Electronics Engineering, Turkey

How to cite this article (APA): Demir, H, Tolun, MR, & Sari, F (2021). Time-optimal path planning model using genetic algorithm in rrr robot. International Journal of Engineering Technologies and Management Research, 8(5), 9. doi: 10.29121/ijetmr.v8.i5.2021.938

# Abstract

The mathematical expression of the kinematic equations of each joint is utilized for the path planning using a quantic polynomial in joint space. In this study, a time optimization model for path planning using genetic algorithms with a variety of crossover fraction and mutation rates is investigated. The optimization process is performed with MATLAB. Optimization using boundary conditions is performed with MATLAB. The result of the simulation, smooth speed graphs, angular position graphs, and the time when joint movements will complete the orbit as soon as possible are obtained. As a result of this study, a path planning model that can be applied to any robot is developed in joint space based on time optimization and can be used to shorten the task time, especially in task-based robots.

Keywords

Path Planning, Genetic Algorithm, Time Optimization

## INTRODUCTION

Trajectory planning is an important research topic in robot applications, and many research papers are published on this subject (Duque, Prieto, & Hoyos, 2017), (Markus, Agee, & Jimoh, 2013), (Ragaglia, Zanchettin, & Rocco, 2018). Robot trajectory planning means that the end-effector passing through specific points reaches the target point from the starting point. Each joint angle varies depending on the time in trajectory planning. The primary purpose of trajectory planning is to automatically create a collision-free trajectory for the robot by making a motion plan in an environment with obstacles. Trajectory planning can be done in Cartesian space or in Joint space. Trajectory planning in joint space is more straightforward than in Cartesian space. To make trajectory planning in joint space, the points given in Cartesian space must be found in the joint space using inverse kinematics. Robot trajectory planning research analyzes the velocity and acceleration of each joint. The mechanical properties of the robots determine the limits of the velocity and acceleration of the joints. For this reason, research is done on improving trajectory planning (Haiek, Aboulissane, Bakkali, & Bahaoui, 2019), (Jin, Kang, Zhang, & Yang, 2016), (Tan & Hu, 2002), (Zhang, Meng, Feng, & Shen, 2018).

The purpose of the methods generally used in trajectory planning is to avoid complex geometric processes (Abu-Dakka, Rubio, Valero, & Mata, 2013), (Machmudah, Parman, Zainuddin, & Chacko, 2013), (Mineo, Pierce, Nicholson, & Cooper, 2016), to reduce the processing time, to make the shortest trajectory planning (Cao, Jiang, & Yue, 2017), (Chen, Fang, Sun, & Qian, 2015), (Gasparetto & Zanotto, 2010), (Gu, Cai, Hu, Zhang, & Chen, 2019), (Kim & Kim, 2011), (Ko, Ryuh, Kim, Suprem, & Mahalik, 2015), (Xu, Xie, Zhuang, & Wang, 2010), and to optimize using different algorithms (Garrido, Yu, & Li, 2016), (Lara-Molina, Koroishi, & Dumur, 2015), (Švejda & Čechura, 0411). The most researched subject among these topics is to improve trajectory planning parameters using optimization techniques. The studies conducted in trajectory planning are mostly done in joint space because it is intuitive and straightforward. In addition, trajectory planning is carried out using polynomial interpolation algorithms in the joint space because these algorithms are not problematic for computing (Cao et al., 2017). The movements of the robot must be smooth and continuous without vibration. For this reason, the B-spline curve is generally used in interpolation methods, and optimum processing time and angular displacement, velocity, and acceleration graphs for each joint are found in trajectory planning studies (Gasparetto et al., 2010).

In this study, a trajectory planning model is created for the RRR robot arm based on time optimization. Since the first three joints affect Cartesian space's position, the robot arm in the RRR structure was preferred. Trajectory planning is done with quintic interpolation in the joint space, and time optimization is performed for each joint using a genetic algorithm. Attention has been paid to make the movements of the joints smooth and continuous.

## MATERIALS AND METHODS

Today, robots with six degrees of freedom (DOF) illustrated in Figure 1 are used in the industry because of their speed and flexibility. Mathematical models of robot arms contain highly nonlinear equations. The most common method for controlling robots is by looking at the look-up tables (Deshpande & George, 2014). The robot arms consist of interconnected links. Connections consist of revolute or prismatic joints. The relationship between the joints is defined by 4x4 transformation matrices. By multiplying these matrices, the matrix containing the final orientation and position obtained, and this process is called forward kinematics (Craig, 2004). Forward kinematic equations are simple and do not have complex equations (Schilling, 1990). It is passed from Cartesian space to joint space with the forward kinematic, while the inverse kinematic provides the transition from the joint space to the Cartesian space. The solution for going from point A to point B in Cartesian space is found with inverse kinematics. There are two methods for solving inverse kinematics which is the numerical solution and the closed-form. The closed-form is more preferred because it runs faster (Küçük, Kocaeli, & Bingül, 2004). There is only one general method to solve robot kinematics which is Denativ-Hartenberg (D-H) (Huang, Wang, Liu, & Cui, 2012), (Li, Cao, Guo, & Huang, 2015), (Redondo & LeSar, 2004).

The last three joints that make up the wrist structure are identical, but the first three joints that affect the position are different in industrial robots. The first three joints' joint properties are essential to classify the robots according to DOF (Bingül & Küçük, 2009). The first three joints determine the robot's position in Cartesian space, while the last three joints (Euler's wrist) define the robot's orientation, and the Euler's wrist is illustrated in Figure 2 .

The D-H table of the Euler's wrist is given in Table 1 , and the D-H parameters are the same for industrial robots.

In this study, three rotary joints are used in the robot configuration. This configuration is the basis of most industrial robots because they have a vast working space, and they are very flexible and fast. But their kinematic equations have very complicated. The robot configuration and the coordinate frames which are shown in Figure 3 has the three-rotary joint.

D-H method uses four main variables, which are the bond length between two axes ( ${a}_{i-1}$ ), the bond angle between axes (i-1) and i ( ${\alpha }_{i-1}$ ), the joint misalignment between overlapping bonds ( ${d}_{i}$ ), and the joint angle between two bonds ( ${\theta }_{i}$ ). The D-H variables for our design are shown in Table 2 .

The transformation matrix of a joint is obtained by using Equation 1 .

${{}^{i-1}T}_{i}=\left(\begin{array}{cccc}c{\theta }_{i}& -s{\theta }_{i}& 0& {a}_{i-1}\\ s{\theta }_{i}c{\alpha }_{i-1}& c{\theta }_{i}c{\alpha }_{i-1}& -s{\alpha }_{i-1}& -s{\alpha }_{i-1}{d}_{i}\\ s{\theta }_{i}s{\alpha }_{i-1}& c{\theta }_{i}s{\alpha }_{i-1}& c{\alpha }_{i-1}& c{\alpha }_{i-1}{d}_{i}\\ 0& 0& 0& 1\end{array}\right]$

The transformation matrices for each joint are given by:

$0{T}_{1}=\left(\begin{array}{cccc}{c}_{1}& -{s}_{1}& 0& 0\\ {s}_{1}& {c}_{1}& 0& 0\\ 0& 0& 1& {d}_{1}\\ 0& 0& 0& 1\end{array}\right]$
$1{T}_{2}=\left(\begin{array}{cccc}{c}_{2}& -{s}_{2}& 0& 0\\ 0& 0& 1& {l}_{1}\\ -{s}_{2}& -{c}_{2}& 0& 0\\ 0& 0& 0& 1\end{array}\right]$
$2{T}_{3}=\left(\begin{array}{cccc}{c}_{3}& -{s}_{3}& 0& {l}_{2}\\ {s}_{3}& {c}_{3}& 0& 0\\ 0& 0& 1& 0\\ 0& 0& 0& 1\end{array}\right]$
$3{T}_{4}=\left(\begin{array}{cccc}1& 0& 0& {l}_{3}\\ 0& 1& 0& 0\\ 0& 0& 1& 0\\ 0& 0& 0& 1\end{array}\right]$

The forward kinematic matrix is obtained by multiplying the transformation matrices.

${}_{4}{}^{0}T={}_{1}{}^{0}T{}_{2}{}^{1}T{}_{3}{}^{2}T{}_{4}{}^{3}T{}_{4}{}^{0}T=\left(\begin{array}{cccc}{r}_{11}& {r}_{12}& {r}_{13}& {p}_{x}\\ {r}_{21}& {r}_{22}& {r}_{23}& {p}_{y}\\ {r}_{31}& {r}_{32}& {r}_{33}& {p}_{z}\\ 0& 0& 0& 1\end{array}\right]$

The analytical solution approach is used for inverse kinematic solution. In this solution, rij is the rotation, and px, py, pz is the position specifying elements.

The forward kinematic matrix is written in Equation 6 as symbolically. Both sides of the equation are multiplied by ${\left({}_{1}{}^{0}T\right]}^{-1}$ .

${}_{4}{}^{0}T{\left({}_{1}{}^{0}T\right]}^{-1}={\left({}_{1}{}^{0}T\right]}^{-1}{}_{1}{}^{0}T{}_{2}{}^{1}T{}_{3}{}^{2}T{}_{4}{}^{3}T{}_{4}{}^{0}T{\left({}_{1}{}^{0}T\right]}^{-1}={}_{2}{}^{1}T{}_{3}{}^{2}T{}_{4}{}^{3}T$

When Equation 7 is solved, the joint variables are found.

${\theta }_{1}=Atan2\left(-{p}_{x},{p}_{y}\right)+Atan2\left(\mp \sqrt{{p}_{x}^{2}+{p}_{y}^{2}-{l}_{1}^{2}},{l}_{1}\right)$
$\begin{array}{l}{\theta }_{3}=Atan2\left(\mp \sqrt{1-{\left(\frac{{p}_{x}^{2}+{p}_{y}^{2}+\left({p}_{z}-{d}_{1}{\right)}^{2}-{l}_{3}^{2}-{l}_{2}^{2}}{2{l}_{3}{l}_{2}}\right)}^{2}}\\ ,\frac{{p}_{x}^{2}+{p}_{y}^{2}+\left({p}_{z}-{d}_{1}{\right)}^{2}-{l}_{3}^{2}-{l}_{2}^{2}}{2{l}_{3}{l}_{2}}\right)\end{array}$

## TRAJECTORY PLANNING

The trajectory planning is performed with three or higher-order polynomials in joint space. The inverse kinematic solution gives the initial and target positions of the end effector. A quantic (5-degree) polynomial is needed to obtain smoothing the path curve, shown in Equation 11 (Tan et al., 2002).

$\theta \left(t\right)={s}_{0}+{s}_{1}t+{s}_{2}{t}^{2}+{s}_{3}{t}^{3}+{s}_{4}{t}^{4}+{s}_{5}{t}^{5}$

At the start and endpoint, the velocity, acceleration, and displacement limits are given by:

$\theta \left(0\right)={\theta }_{0}\theta \left(f\right)={\theta }_{f}$
${\theta }^{\text{'}}\left(0\right)={\theta }_{0}^{\text{'}}{\theta }^{\text{'}}\left(f\right)={\theta }_{f}^{\text{'}}$
${\theta }^{″}\left(0\right)={\theta }_{0}^{″}{\theta }^{″}\left(f\right)={\theta }_{f}^{″}$

The velocity polynomial is obtained from the derivation of Equation 11. It is possible to find the acceleration equation by taking the derivation of the velocity polynomial. The coefficients of the angular position equation can be determined by:

${s}_{0}={\theta }_{0}$
${s}_{1}={\theta }_{0}^{\text{'}}$
${s}_{5}=\frac{12\left({\theta }_{f}-{\theta }_{0}\right)-6\left({\theta }_{f}^{\text{'}}+{\theta }_{0}^{\text{'}}\right){t}_{f}-\left({\theta }_{0}^{″}-{\theta }_{f}^{″}\right){t}_{f}^{2}}{2{t}_{f}^{5}}$
${s}_{2}=\frac{{\theta }_{0}^{″}}{2}$
${s}_{3}=\frac{20\left({\theta }_{f}-{\theta }_{0}\right)-\left(8{\theta }_{f}^{\text{'}}+12{\theta }_{0}^{\text{'}}\right){t}_{f}-\left({\theta }_{f}^{″}-3{\theta }_{0}^{″}\right){t}_{f}^{2}}{2{t}_{f}^{3}}$
${s}_{4}=\frac{30\left({\theta }_{f}-{\theta }_{0}\right)-\left(14{\theta }_{f}^{\text{'}}+16{\theta }_{0}^{\text{'}}\right){t}_{f}+\left(3{\theta }_{0}^{″}-2{\theta }_{f}^{″}\right){t}_{f}^{2}}{2{t}_{f}^{4}}$

## SIMULATION USING GENETIC ALGORITHMS

The technical characteristics of the electric motors used in the joints directly affect the path planning. Genetic algorithms are used for optimal path planning using the limits of electric motors.

Each robot arm reaches its target point by passing through n points. Therefore, the motion of each joint should be examined separately. If one of the joints completes its motion in ti time, the total motion time is expressed in Equation 16.

$T=\sum {t}_{i}$

The evolutionary Genetic Algorithm (G.A.) has been used to optimize the motion time. The objective function used in experimental studies to complete a certain movement as soon as possible is given in Equation 17.

hows the constraint conditions of the objective function. The constraint conditions determine the technical characteristics of the servo motors used in the joints.

In the optimization, selection mechanisms have determined scholastic uniformly. The population size is chosen as 200. Optimization was performed at different mutation rates and crossover fractions to achieve the best objective function. The crossover fraction is selected as 0.2, 0.5, and 0.8. Mutation rates are chosen as 0.01 and 0.02.P0 (X0 = 155.28, Y0 = 0, Z0 = 164.14) to P1 (X1 = 135.65, Y1 = 23.92, Z1 = 99.12)[HD1] In the simulation, the robot arm was moved from

Considering that the joints move sequentially, the robot completes the arm movement in 14.346 seconds. This period is sufficient for the robot to perform its movement smoothly as it is calculated as the shortest time in tests.

## CONCLUSIONS

In this study, the path planning for a specific movement in the joint space of a robot with RRR joint structure is considered. Since the first three joints in 6 joint industrial robots determine the position in Cartesian space, the robot structure in this study consists of three joints. The quintic path polynomial is created for the specified motion. Time optimization is realized with G.A. The constraint conditions used in optimization were velocity and acceleration, and the movements are provided to be smooth. The best objective function is found by diversifying the optimization parameters. In reference (Zhang et al., 2018), the path planning method in joint space is defined using genetic algorithms for PUMA 560 robot model. Optimization studies were made for a robot model. In this study, a time optimization model is developed using G.A. for industrial robot arms. The shortest working time of each joint is found for the specified movement. The time optimization model developed can reduce task time for robot structures designed to work fast, such as delta robots. The algorithm developed can be used to increase product output by shortening the task times of task-based robots.