# Adaptive Neuro-Fuzzy Inference System Based Path Planning for Excavator Arm

Authors: Nga Thi-Thuy Vu; Nam Phuong Tran; Nam Hoai Nguyen
Journal: Journal of Robotics
 (2018)

---

## Abstract

This paper presents a scheme based on Adaptive Neuro-Fuzzy Inference Systems (ANFIS) to generate trajectory for excavator arm. Firstly, the trajectory is predesigned with some specific points in the work space to meet the requirements about the shape. Next, the inverse kinematic is used and optimization problems are solved to generate the via-points in the joint space. These via-points are used as training set for ANFIS to synthesis the smooth curve. In this scheme, the outcome trajectory satisfies the requirements about both shape and optimization problems. Moreover, the algorithm is simple in calculation as the numbers of via-points are large. Finally, the simulation is done for two cases to test the effect of ANFIS structure on the generated trajectory. The simulation results demonstrate that, by using suitable structure of ANFIS, the proposed scheme can build the smooth trajectory which has the good matching with desired trajectory even that the desired trajectory has the complicated shape.


---

## Body

## 1. Introduction

In the construction and mine fields, the excavator which is used to dig and transport of soil or coal is one of the important machines. The work environment of excavator is usually dangerous and harsh. Therefore, developing the automatic excavator system is the general trend. In the unmanual operation system, i.e., excavator system, the trajectory generation for the excavator base and arm is the hot spot because it determines the efficiencies of overall system.In the real, the excavator arm is a three-degree of freedom (3DOF) manipulator robot. The trajectory planning can be done in both working space and joint space. In the working space, the trajectory is built for end-effectors in three-dimension reference frame so it is quite visual. However, the trajectory built in this space has to face with problems of inverse kinematic and manipulator redundancy [1]. Therefore, in the most case, the trajectory of the manipulator robot is planned in the joint space [2].In the joint space, the trajectory is planned to meet some specific requirements such as time optimization, energy optimization, jerk optimization, obstacle avoidance, etc. In order to satisfy these conditions, the trajectory is usually predesigned with some via-points then the smooth curve is built using several interpolation such as polynomial, spline, Bezier, etc. In [3, 4] polynomial functions are used to generate the paths for robot arms. Reference [3] proposed a series of polynomials to create desired trajectory for robotic motion via a set of given point; they also addressed a problem of acceleration and jerk optimization. However, the main drawback of [3] is that numbers of parameter proportion to numbers of via-point, which leads to explosion of calculation when the numbers of given point are large. The problems of reducing vibration are solved in [4]; however, the generated trajectory is partial smooth. The Bezier Curve and modifier genetic algorithm are interested in [5] in order to create a path in dynamic field with avoiding obstacle and minimum path’s length.In recent year, neural networks and fuzzy systems which have ability to approximate functions and fit curves have been widely applied in the path planning field. These algorithms seem to be more flexible and potential than traditional one because the methods based on neural network and fuzzy system can create a path through many via-points without explosion of calculation. In [6–10], the shunting model technique is used to build neural network for path planning problems. In this method, the neural dynamics of each neuron is characterized by a shunting equation or simple additive equation [9]. The trajectories in [6]-[8] are generated for robots to avoid the static obstacles while in [9, 10] robots can work in dynamic environments with moving obstacles. The pulse-couple neural network is used in many application [11] and it is also applied into trajectory generation [12, 13]. This scheme can work in both static and dynamic environments but the complete information about working conditions is necessary. In the field of learning method, fuzzy system also is used to solve the path planning problems [14–17]. In [14] the fuzzy logic based on fuzzy sets algorithm is approached to plan the path for the robotic placement of fabrics on a work table. This fuzzy logic system is developed based on experimental data and it has ability to work with various materials and sizes, while optimal fuzzy scheme is introduced in [15] for path planning of manipulator robots. This is rule-based method which needs specific rules to generate the trajectory for robots and it can deal with moving obstacles. In order to generate a real-time and obstacle avoiding path for cushion robot, a fuzzy system which have capability to transform directly human knowledge in machine is utilized in [16]. Moreover, in [17] the fuzzy logic path planning algorithm is investigated to guarantee the safe motion with obstacle avoidance for mobile robot.For the excavator, in order to meet the requirement of automatic trend, there are also some researches focusing on path planning topic. In [18, 19], the laser scanner, camera, and sensors are used to build 3D trajectory for automated excavator. This method gives the good result in the clean environment but the reliability of laser scanner and camera will reduce in the dusty environment. In [20], the current position of excavator arm is feedback to control system to predict the trajectory for next cycle. The neural network is used in [21] to determine the characteristic of the soil. From this result, in combination with the reaction force exerted on the bucket, the optimal trajectory is generated for excavator arm. In [22–24], the velocity and acceleration of bucket are used to build the path for excavator arm. The generated trajectory is optimal but velocity and acceleration are difficult to measure.In this paper, an algorithm based on ANFIS is proposed to generate trajectory for excavator arm. Firstly, the trajectory is predesigned with some specific points in the work space to meet the requirements about the shape. Next, the inverse kinematic is used and optimization problems are solved to generate the via-points in the joint space. These via-points are used as training set for ANFIS to synthesis the smooth curve. In this scheme, the outcome trajectory satisfies the requirements about both shape and optimization problems. Moreover, the algorithm is simple in calculation as the numbers of via-points are large. Finally, the simulation is done for two cases to test the effect of ANFIS structure on the generated trajectory. The simulation results demonstrate that, by using suitable structure of ANFIS, the proposed scheme can build the smooth trajectory which has the good matching with desired trajectory even that the desired trajectory has the complicated shape.


## 2. Path Planning for Excavator Arm Based on ANFIS

### 2.1. Problem Description

Consider the excavator system as shown in Figure1. It is assumed that the base is fixed and the arm of excavator operates in thex0O0z0 plane.Figure 1
Block diagram of the excavator arm.To execute the digging task with satisfying technical constraints, the trajectory of excavator arm should go through some predesigned points. These points are selected from the desired shape, optimization criteria, constraints, etc. From given via-point, it is necessary to build the smooth curve for excavator to operate.In order to minimize the time and jerk, the following optimization problem should be solvent [25]:(1)findmin⁡J=kTN∑i=1n-1hi+kJ∫0tfq⃛t2dtsubjecttoq˙jt≤VCj,j=1,⋯,Nq¨jt≤WCj,j=1,⋯,Nq⃛jt≤JCj,j=1,⋯,NwherekT andkJ are scalars,N are the numbers of joint,n are the numbers of via-points of,hi is time interval between two via-points, q˙(t),q¨(t), and q⃛(t) are velocity, acceleration, and jerk of thejth joint, respectively, andVCj,WCj, andJCj is the bound of velocity, acceleration, and jerk for thejth joint, respectively.The objective function (1) can be expressed as follows [26]:(2)J=kTN∑i=1n-1hi+kJ∑j=1N∑i=1n-1αi,j-αi,j2hisubject to the constraints(3)max⁡αj,1,…αj,n≤VCj∀j=1…N,∀i=1…n-1max⁡αj,1,…αj,n≤WCj∀j=1…Nαj,i+1-αj,ihi≤JCj∀j=1…N,∀i=1…n-1where αi,j is the acceleration of thejth joint at theith via-point.Solve the optimal problem (2) by using Sequential Quadratic Programing technique (Optimization Toolbox of Matlab) to get the via-points.After getting suitable via-points, the ANFIS is used to create the smooth trajectory for three joints.


### 2.2. ANFIS System Design and Training

In this research, ANFIS is utilized like a tool for curve fitting. The task of designing reference trajectory is to create a smooth-continuous path which passes some given points. Three ANFIS systems, which are based on the Sugeno model, are designed to plan paths for three joints. Each ANFIS system uses the same membership function for fuzzy sets, so we are going to analyze and represent one of the three ANFIS systems.The input and output of each ANFIS system is time variable “t” and joint variable “theta”, respectively. Theith if-then rule is as follows:(4)Rulei:Iftis  small  then  theta=fitThe ANFIS architecture is shown as Figure2. It consists of five layers.Figure 2
The ANFIS architecture.(i) Layer 1: this layer performs a fuzzification process. The Gauss function is used as membership function in this study. It is defined as follows:(5)Oi1=μi=e-t-ci2/2σi2The parametersci andσi of first layer are typically referred as to the premise parameters.(ii) Layer 2: this layer is fixed and nonadaptive. Its node has a function which multiplies the incoming signals from the outputs of the previous layer to obtain the firing strength of conditional clauses. If there exists only one input, then(6)Oi2=αi=μi(iii) Layer 3: this layer also has not included trainable parameters. The output of each node is the ratio of theith rule’s matching degree to the total of all rules’ matching degree.(7)Oi3=αi¯=αi∑iαi(iv) Layer 4: the parameters of this layer can be modified to adapt to training data. The function in each node of the layer is defined as(8)Oi4=αi¯×fi=αi¯×pit1+riwherepi,ri are referred as to consequent parameters.(v) Layer 5: this layer has only one node. Its output is the sum of all outputs from the fourth layer.(9)O5=∑iαi¯fiFor training the ANFIS, it is able to apply the gradient method. But this method has slow convergence rate and tends to be trapped at local minima. To deal with this problem, [27] proposed a method, which is the combination of the gradient method and the least square estimator (LSE) method, namely, the hybrid algorithm. The training process is divided into two parts that is referred as forward-path and backward-path. In forward-path, premise parameters are kept unchanged, so the output of the ANFIS is a linear function of consequent parameters. Then, the least square error (LSE) method is applied to adjust these parameters. Next, the consequent parameters are fixed and premise parameters are updated based on the gradient algorithm. This hybrid algorithm is able to provide faster convergence and avoid the occurrence of local minima, because of the reduction in dimension of the search space. For these advantages of hybrid algorithm, we will use this method for the ANFIS training.


### 2.3. Path Planning Procedure

With the information in the previous parts, it is possible to generate the trajectory for excavator arm which satisfies some requirements about optimization and smooth. The sequence for this process has the following steps:(i) Step 1: get the desired points based on shaped and optimal issues, then use inverse kinematics to obtain the via-points in the joint space as training sample.(ii) Step 2: design ANFIS architecture.(iii) Step 3: train ANFIS.(iv) Step 4: use ANFIS to generate the trajectory for each joint.In this work, the inverse dynamic calculation for excavator arm is based on the [28].


## 2.1. Problem Description

Consider the excavator system as shown in Figure1. It is assumed that the base is fixed and the arm of excavator operates in thex0O0z0 plane.Figure 1
Block diagram of the excavator arm.To execute the digging task with satisfying technical constraints, the trajectory of excavator arm should go through some predesigned points. These points are selected from the desired shape, optimization criteria, constraints, etc. From given via-point, it is necessary to build the smooth curve for excavator to operate.In order to minimize the time and jerk, the following optimization problem should be solvent [25]:(1)findmin⁡J=kTN∑i=1n-1hi+kJ∫0tfq⃛t2dtsubjecttoq˙jt≤VCj,j=1,⋯,Nq¨jt≤WCj,j=1,⋯,Nq⃛jt≤JCj,j=1,⋯,NwherekT andkJ are scalars,N are the numbers of joint,n are the numbers of via-points of,hi is time interval between two via-points, q˙(t),q¨(t), and q⃛(t) are velocity, acceleration, and jerk of thejth joint, respectively, andVCj,WCj, andJCj is the bound of velocity, acceleration, and jerk for thejth joint, respectively.The objective function (1) can be expressed as follows [26]:(2)J=kTN∑i=1n-1hi+kJ∑j=1N∑i=1n-1αi,j-αi,j2hisubject to the constraints(3)max⁡αj,1,…αj,n≤VCj∀j=1…N,∀i=1…n-1max⁡αj,1,…αj,n≤WCj∀j=1…Nαj,i+1-αj,ihi≤JCj∀j=1…N,∀i=1…n-1where αi,j is the acceleration of thejth joint at theith via-point.Solve the optimal problem (2) by using Sequential Quadratic Programing technique (Optimization Toolbox of Matlab) to get the via-points.After getting suitable via-points, the ANFIS is used to create the smooth trajectory for three joints.


## 2.2. ANFIS System Design and Training

In this research, ANFIS is utilized like a tool for curve fitting. The task of designing reference trajectory is to create a smooth-continuous path which passes some given points. Three ANFIS systems, which are based on the Sugeno model, are designed to plan paths for three joints. Each ANFIS system uses the same membership function for fuzzy sets, so we are going to analyze and represent one of the three ANFIS systems.The input and output of each ANFIS system is time variable “t” and joint variable “theta”, respectively. Theith if-then rule is as follows:(4)Rulei:Iftis  small  then  theta=fitThe ANFIS architecture is shown as Figure2. It consists of five layers.Figure 2
The ANFIS architecture.(i) Layer 1: this layer performs a fuzzification process. The Gauss function is used as membership function in this study. It is defined as follows:(5)Oi1=μi=e-t-ci2/2σi2The parametersci andσi of first layer are typically referred as to the premise parameters.(ii) Layer 2: this layer is fixed and nonadaptive. Its node has a function which multiplies the incoming signals from the outputs of the previous layer to obtain the firing strength of conditional clauses. If there exists only one input, then(6)Oi2=αi=μi(iii) Layer 3: this layer also has not included trainable parameters. The output of each node is the ratio of theith rule’s matching degree to the total of all rules’ matching degree.(7)Oi3=αi¯=αi∑iαi(iv) Layer 4: the parameters of this layer can be modified to adapt to training data. The function in each node of the layer is defined as(8)Oi4=αi¯×fi=αi¯×pit1+riwherepi,ri are referred as to consequent parameters.(v) Layer 5: this layer has only one node. Its output is the sum of all outputs from the fourth layer.(9)O5=∑iαi¯fiFor training the ANFIS, it is able to apply the gradient method. But this method has slow convergence rate and tends to be trapped at local minima. To deal with this problem, [27] proposed a method, which is the combination of the gradient method and the least square estimator (LSE) method, namely, the hybrid algorithm. The training process is divided into two parts that is referred as forward-path and backward-path. In forward-path, premise parameters are kept unchanged, so the output of the ANFIS is a linear function of consequent parameters. Then, the least square error (LSE) method is applied to adjust these parameters. Next, the consequent parameters are fixed and premise parameters are updated based on the gradient algorithm. This hybrid algorithm is able to provide faster convergence and avoid the occurrence of local minima, because of the reduction in dimension of the search space. For these advantages of hybrid algorithm, we will use this method for the ANFIS training.


## 2.3. Path Planning Procedure

With the information in the previous parts, it is possible to generate the trajectory for excavator arm which satisfies some requirements about optimization and smooth. The sequence for this process has the following steps:(i) Step 1: get the desired points based on shaped and optimal issues, then use inverse kinematics to obtain the via-points in the joint space as training sample.(ii) Step 2: design ANFIS architecture.(iii) Step 3: train ANFIS.(iv) Step 4: use ANFIS to generate the trajectory for each joint.In this work, the inverse dynamic calculation for excavator arm is based on the [28].


## 3. Simulation and Results

In order to verify the effectiveness of this scheme, the simulation is setup based on Optimization and Fuzzy toolboxes of Matlab. The constraints for optimal problem are similar as in [25]. The parameters for ANFIS are presented in detail in the following.The simulation is done for two cases:(i)Case 1. The numbers of rule are 3 for each joint.(ii)Case 2. The numbers of rule are 6, 9, and 10 for the first, the second, and the third joint, respectively.For Case 1, the parameters of the ANFIS for each joint after training are shown in the Table1.Table 1
Parameters of the ANFIS after training.
c i σ i p i r i 1 s t joint 2.4929 3.1575 -0.0260 0.6923 2.8817 15.6040 0.0059 0.3450 3.4474 20.7265 -0.0102 1.0390  2 n d joint 1.2196 6.6245 -0.0359 -1.4945 1.3634 8.1598 -0.0171 -1.7741 0.9156 13.9925 0.0016 -2.0630  3 r d joint 1.5545 4.9146 0.0681 0.7954 4.0780 16.0198 0.0401 1.1314 3.3035 20.4656 0.0327 0.2277Simulation results for this case are shown in Figure3.Figure 3
Training result for Case 1.In Figure3, (a), (b), (c), and (d) are the matching errors of the first, the second, and the third joint and trajectory in the workspace, respectively. It can be seen from Figures 3(a), 3(b), and 3(c) that the matching error of each joint is quite small. The maximum absolute error is 0.015 rad for the first and the third joint, while this is about 0.006 rad for the second joint. In Figure 3(d), the desired trajectory and the approximated trajectory are presented. From this figure it is seen that the generated trajectory is quite close to the desired trajectory except the case of sudden change in the motion direction.ForCase 2, the numbers of rule for the first, the second, and the third joint are 10, 6, and 9, respectively. The parameters for each joint are given in Tables 2, 3, and 4. The results for this case are illustrated in Figure 4.Table 2
Parameters of the ANFIS after training for the1st joint (Case 2).
c i σ i p i r i 1.1440 0.1237 -0.0235 0.6894  1.4447 3.2746 -0.0236 0.6910  1.6017 6.2853 0.0179 0.6860  1.7003 7.4553 0.0518 -0.1467  0.7788 9.6823 0.0055 0.3601  0.4393 12.8548 0.0059 0.3972  0.5287 15.8631 0.0434 -0.1261  0.5801 18.8813 0.0434 -0.1256  0.4406 22.3654 0 0.7859  1.0550 25.0155 0 0.7855Table 3
Parameters of the ANFIS after training for the2nd joint (Case 2).
c i σ i p i r i 2.6620 0.5242 -0.0485 -1.5113  2.2012 4.6932 -0.0550 -1.4146  0.6739 10.0057 -0.0124 -1.8130  1.6379 15.2547 -0.0005 -2.0323  2.2804 19.8801 0.0034 -2.0965  2.0898 24.9830 0.0014 -2.0627Table 4
Parameters of the ANFIS after training for the3rd joint (Case 2).
c i σ i p i r i 1.9499 0.8483 0.0684 0.8396  2.3933 3.6964 0.0802 0.7339  0.4202 7.8501 0.0859 0.7016  0.8204 10.3098 0.0127 1.3822  0.5266 12.5082 -0.0044 1.6211  0.8842 16.2364 -0.0438 2.1717  0.5693 18.9473 -0.0471 2.2301  0.3972 22.3126 0.0001 1.2383  1.0464 25.0587 0 1.2392Figure 4
Training result for Case 2.In the Figure4, it is shown that the matching errors for all cases are insignificant, i.e., maximum absolute error for the first joint is 3e-3 rad, for the second joint is 5e-3 rad, and for the third joint is 4e-4 rad. The learned trajectory exactly follows the designed trajectory even under the condition of abrupt alteration of motion direction.From the above simulation results, it is feasible to build the trajectory for excavator arm using an ANFIS. By choosing suitable structure and parameters of neural network as well as the numbers of fuzzy rule, the ANFIS can create the smooth trajectory which has the good matching with desired one despite the condition that the desired trajectory has a complicated shape.


## 4. Conclusion

In order to generate the reference trajectory for excavator arm, a method has been shown in this paper. The proposed scheme is based on the optimal requirements combining with ANFIS technique. In comparison with methods using B-spline technique, the presented algorithm is simpler as the number of via-points is large, so the quality of the generated trajectory can be improved by increasing the number of via-points. Also, this characteristic helps the proposed method to deal with complicated shape trajectories. Finally, the simulation was shown for two cases to test the effect of the ANFIS structure on the generated trajectory. The simulation results demonstrated that, by using a suitable structure of the ANFIS, the proposed scheme can build the smooth trajectory which has the good matching with desired trajectory regardless of the fact that the desired trajectory has the complicated shape.



---

*Source: 2571243-2018-12-02.xml*