Obstacle avoidance of mobile robots using modified artificial potential field algorithm

In recent years, topics related to robotics have become one of the researching fields. In the meantime, intelligent mobile robots have great acceptance, but the control and navigation of these devices are very difficult, and the lack of dealing with fixed obstacles and avoiding them, due to safe and secure routing, is the basic requirement of these systems. In this paper, the modified artificial potential field (APF) method is proposed for that robot avoids collision with fixed obstacles and reaches the target in an optimal path; using this algorithm, the robot can run to the target in optimal environments without any problems by avoiding obstacles, and also using this algorithm, unlike the APF algorithm, the robot does not get stuck in the local minimum. We are looking for an appropriate cost function, with restrictions that we have, and the goal is to avoid obstacles, achieve the target, and do not stop the robot in local minimum. The previous method, APF algorithm, has advantages, such as the use of a simple math model, which is easy to understand and implement. However, this algorithm has many drawbacks; the major drawback of this problem is at the local minimum and the inaccessibility of the target when the obstacles are in the vicinity of the target. Therefore, in order to obtain a better result and to improve the shortcomings of the APF algorithm, this algorithm needs to be improved. Here, the obstacle avoidance planning algorithm is proposed based on the improvement of the artificial potential field algorithm to solve this local minimum problem. In the end, simulation results are evaluated using MATLAB software. The simulation results show that the proposed method is superior to the existing solution.


Introduction
An intelligent mobile robot must reach the designated targets at a specified time.The robot must determine its location relative to its objectives at each step and issue a suitable strategy to achieve its target.Information about the environment is also needed to avoid obstacles and design optimal routes.In general, the objectives of this study are (1) improving the APF algorithm in order to trace the path and avoid obstacles by a mobile robot and (2) comparing the performance and efficiency of the proposed algorithm with the previous method, APF algorithm.In the real world, it gets a lot of use.For example, we have an automatic ship that we want to avoid collision with obstacles and to take the best possible route for a low cost.It is possible to detect the distance between the robot with the target and obstacles with the help of the sensor.However, the sensor discussion is separate from this article.
Mobile intelligent robot is a useful tool which can lead to the target and at the same time avoid obstacles facing it [1].There are conventional methods of obstacle avoidance such as the path planning method [2], the navigation function method [3], and the optimal regulator [4].The first algorithm that was proposed for the discussion of obstacle avoidance is the Bug1 algorithm.This algorithm is perhaps the simplest obstacle avoidance algorithm.In the first algorithm, Bug1, as shown in Fig. 1, the robot completely bypassed the first object, and then, it leaves the first object and performs at the shortest distance from the target.Of course, this approach is very inefficient, but it ensures that the robot is reachable for any purpose.In this algorithm, the current sensor readings play a key role.The weakness of this algorithm is the excessive presence of the robot alongside the obstacle [5].
In the second algorithm, Bug2, as shown in Fig. 2, the robot moves on the starting lineup to the target, and if it sees the obstacle, it will round the obstacle, and when it again reaches a point on the line between the start to the target, it leaves an obstacle.In this algorithm, the robot spends a lot of time moving along the obstacle, but this time is less than the previous algorithm [5].
In the following, Mr. Khatib introduced an algorithm called APF in 1985 [6].This algorithm considers the robot as a point in potential fields and then combines stretching toward the target and repulsion of obstacles.The final path of the output is the intended path.This algorithm is useful given that the trajectory is obtained by quantitative calculations.The problem is that in this algorithm, the robot can be trapped in the local minimum of potential fields and cannot find the path; hence, in this paper, some amendments have been made to resolve this issue, which is discussed in Section 3. Subsequently, in March 1991, Borenstein and Koren presented vector histogram field algorithm (VHF) [7].In this algorithm, with the help of one of the distance sensors, a planar map of the robot environment is prepared; in the next step, this planar map is translated into a polar histogram.This histogram is shown in Fig. 3, where the x-axis represents the angles around the obstacle and the y-axis represents the probability of an obstacle at the desired viewing angles.In this polar map, the peaks represent bulky objects and valleys represent low-volume objects; valleys below the threshold are suitable valleys for moving the robot; finally, the suitable valley which has a smaller distance to the target is selected from the valleys, and the position of this valley determines the angles of motion and speed of the robot [7].
Improvements on VFH led to the introduction of VFH -and VFH + [8].The next algorithm is the sensor Fig. 1 Bug1 algorithm with two points H1 and H2 as collision points.L1 and L2 are selected as the exit point Fig. 2 Bug2 algorithm with two points H1 and H2 as collision points.L1 and L2 are selected as the exit point fusion in certainty grids for mobile robots which is one of the well-known, powerful, and efficient algorithms for using a multi-sensor combination to identify the environment and determine the direction of movement.In this algorithm, the robot's motion space is decomposed into non-overlapping cells and is provided with a graphical motion environment, and then based on the algorithms for searching the graph, the path of the movement is determined [9].In the following, the Follow the Gap method (2012) was proposed [10]; in this algorithm, the robot calculates its distance with each obstacle.The robot can know the distance between obstacles by knowing its distance with each obstacle.The robot then detects the greatest distance between obstacles and calculates the center angles of the empty space.After the central angular momentum, the robot calculates the empty space, combines it with the target angle, and shows the ending angle.Obviously, in this combination, it is done on a weight basis, so that the obstacles that are closer to the robot are weighing more because their avoidance is a priority for the robot.Figure 4 shows how this method works.
Fuzzy logic and neuro-fuzzy networks can also be used to avoid obstacles.In this regard, fuzzy logic can be helpful in solving the problems caused by the ocean flow in the underlying surfaces [11].It should be noted that the algorithms discussed in the research background for avoiding an obstacle are different from each other, and each algorithm has proposed a separate and new method for avoiding obstacles.So far, novel methods to avoid obstacles in addition to the mentioned methods are also presented [12][13][14][15][16].In the following section, we first investigate the artificial potential field algorithm and then modify this algorithm in Section 3. In [17], the state-dependent Riccati equation (SDRE) algorithm is studied on the motion design of cable-suspended robots with uncertainties and moving obstacles.A method for controlling the tracing of a robot has been developed by the SDRE.In [18], the fuzzy logic method is used to predict the movement of obstacles and accelerate the linear velocity of the robot.In this paper, the movement trend of the obstacle in approaching the robot is divided away from the robot and translated by the robot.With respect to the three trends, the robot can increase the velocity, decrease the velocity to pass by the obstacle, or stop to wait for the obstacle to pass.Some simulation results show that the proposed method can help the robot avoid an obstacle without changing the initial path.In [19], we have a four-dimensional unmanned aerial vehicle's platform equipped with a miniature computer equipped with a set of small sensors for this work.The platform is capable of accurately estimating the precision mode, tracking the speed of the user, and providing uninterrupted navigation.The robot estimates its linear velocity by filtering a Kalman filter from the indirect and optical flow with the corresponding distance measurements.In [20], a new method for defining the path in the presence of obstacles is proposed, which describes the curve as a two-level intersection.The planner, based on the definition of the path along with the cascaded control architecture, uses a non-linear control technique for both control loops (position and attitude) to create a framework for manipulating multivariate behavior.The method has been shown to be able to create a safe path based on perceived obstacles in real time and avoiding collisions.Li et al. [21] refer to the tracking control of Euler-Lagrange system problems with external impediments in an environment containing obstacles.According to a new sliding discovery, a new tracking controller is proposed to determine the tracing, convergent errors reach zero as infinite time.In addition, based on the non-destructive sliding terminal, a simultaneous control algorithm with time constraints has also been developed to ensure that tracking errors are approaching a restricted area close to the source at a given time.By introducing multi-purpose collision avoidance functions, both controllers can ensure that the obstacle is avoided.In [22], the mobile sensor deployment (MSD) problem Fig. 3 Polar histogram [7] had been studied in mobile sensor networks (MSNs), aiming at deploying mobile sensors to provide target coverage and network connectivity with requirements of moving sensors.This problem is divided into two sub-problems, the Target COVerage (TCOV) problem and Network CONnectivity (NCON) problem.For the TCOV problem, it is proved that it is NP-hard.For a special case of TCOV, an extended Hungarian method is provided to achieve an optimal solution; for general cases, two heuristic algorithms are proposed based on the clique partition and Voronoi diagram, respectively.For the NCON problem, at first, an edge constrained Steiner tree algorithm is proposed to find the destinations of mobile sensors, and then, we used extended Hungarian to dispatch rest sensors to connect the network.Theoretical analysis and simulation results have shown that compared to extended Hungarian algorithm and basic algorithm, the solutions based on TV-Greedy have low complexity and are very close to the optimum.In [23], a novel approach is presented to obtain the optimal performance bounds for a multi-hop multi-rate wireless data network.First, the optimal relay placements are determined for a target terminal located at a distance D away from the access point.Second, for a general analytical PHY layer throughput model, the maximum achievable MAC throughput is determined as a function of the number of relays for a target located at distance D.
In all the research mentioned above, the local minimum problem has not been solved, and we designed the modified APF method to solve this problem.In this paper, in the second part, firstly, the previous method of APF algorithm is presented.Then, in Section 3, the APF method is modified to remedy the defects of this method.
2 Problem statement and formulation

Methods
The artificial potential field model suggested by Khatib [6] is a typical field model (Fig. 5).In the artificial potential field model, T represents the target for the robot to generate attraction and O represents the obstacles that produce repulsion for the robot.
In a planar space, the problem of avoiding the collision of a robot with an obstacle O is shown in Fig. 5.If X D indicates the target position, the control of the robot with respect to the obstacle O can be done in the artificial potential as follows: where U A , U R , and U ALL respectively represent attraction potential energy, repulsive potential energy, and artificial potential field.Then its gradient function can be written as follows: where F A is the attraction generated by the robot to reach the target position of X D and F R represents the force created by U R (X), which is caused by the repulsion of the obstacle.F A is proportional to the distance between the robot and the target.Then, the attraction k S factor is also considered, and the attraction potential U A (x) field is simply obtained as follows: Additionally, U R (X) is a non-negative, non-linear function that is continuous and differentiable, and its potential penetration must be limited to a particular region around the obstacle without undesired turbulence forces.Therefore, the equation U rep (X) is as follows: where X = (x, y) is the position of the robot, X OB = (x OB , y OB ) is the position of the obstacles, and is the shortest distance between a robot and a target in a planar space, Z is the repulsive increase factor, R R is the shortest distance be-tween the robot and obstacles in the planar space, and G 0 represents a safe distance from the obstacles [24].
According to the kinetic theory, the relation G 0 ≥ V MAX / 2A MAX is used, where V MAX denotes the maximum speed of the robot and A MAX represents the maximum speed of the acceleration (negative acceleration).So attraction and repulsion functions are written as follows: It is assumed that φ is the angle between the Xaxis and the line from the point of the robot to the obstacle.Then, both the repulsion components in the direction of the Xaxis and the Yaxis can be obtained.Given θ is the angle between the Xaxis and the line from the point of the robot to the target, the attraction components in the Xaxis and the Yaxis are considered as the following equations [24]: First, the force of the repulsion and attraction in the g-axis and the v-axis are calculated, and then, f is the angle between the resulting force and the d-axis.Finally, the angle of the steering command is calculated as follows: The next position of the robot can be continuously calculated according to the following function until it reaches the convergence condition: where L denotes the step size and X f and Y f represented the next position of the robot.Then, if the obstacles are simple particles, the artificial potential field model is used to secure the robot to the point of the target.However, there are several problems.First, the result from the sum of the two forces of attraction and repulsion in some places is zero, which results in stopping the robot moving or wandering around those points that are called local minimum.Second, when the target is surrounded by obstacles, the path cannot converge, and the robot cannot reach the target.In order to overcome these shortcomings, Section 3 addresses the modification of the artificial potential field algorithm.

Algorithm design
Researchers around the world have been researching about artificial potential field defects and have presented suggestions for improving this method [25][26][27][28][29][30][31][32][33][34][35][36][37].Here, a regulative agent has been added to improve the artificial potential field algorithm with the target of overcoming the minimum local and inaccessible target.When the robot is close to the target, this regulative agent reduces the attraction control as a linear function, and the repulsion decreases as a higher-order function (M ≥ 3).A flowchart illustrating the steps of the modified APF algorithm is given in Fig. 6.

Modified artificial potential field model
In the planar space, the modified function of the attraction field function is defined as follows: The modified attraction field function is written as follows: where X = (x, y) is the position of the robot, X ob = (x ob , y ob ) is the position of the obstacles, and X d = (x d , y d ) is the target position.R A is the shortest distance between the robot and the target in the planar space, and R A N is the regulative factor.The attraction function is the gradient across the attraction field, which is obtained as follows: In the same way, the repulsive function is a negative gradient from the field of repulsion, which is obtained as follows: Fig. 6 The framework of the modified APF algorithm As shown in Fig. 7, in the modified model, F R is decomposed into F R1 and F R2 , where F R1 is the component's force in the direction of the line between the robot and the obstacle and F R2 is the component's force in the direction of the line between the robot and the target.
The two components of repulsion and attraction in the direction of the x-axis and the y-axis can be obtained as follows [24]: The force of the repulsion and attraction on Xaxis and Yaxis are calculated, and the angle δ is calculated between the force and the Xaxis, where δ is the steering angle of the robot.
where L represents the step size and X f and Y f represent the next position of the robot.The regulative factor R A M is added to the modified model of this article.The function of this regulative factor is that if the robot cannot reach the target and M is in the interval (0, 1), F R1 when the robot is close to the target, it tends to be infinite and the path of convergence is created only with F R2 and F A .If M = 1, F rep2 tends to be constant and F R1 will be zero, and the path of convergence will be created only with F R2 and F A .If M = 0, F R1 and F R2 will all tend to be zero, and the path of convergence will be created only by attraction.In the final state, generally, if M is a real positive number, the robot does not face the local minimum cases or the inaccessibility of the target.

Simulation results and analysis
In this section, a comparison is firstly done between the simulation results of the artificial potential field algorithm and the modified artificial potential field, then the obstacle avoidance of the mobile robot is displayed against a variety of obstacles that are simulated using the modified artificial potential field algorithm.In the artificial potential field algorithm in which its relation was said in Section 2, if the value to the parameter be considered as Z = 100, M = 2, k S = 1.1, G 0 = 0.11, and L = 0.1 and obstacles on a circle of the radius R = 0.18, the result is as shown in Fig. 8; the robot is trapped and stands at the local minimum.Figure 9 shows that the repulsive force is more than the attraction at all stages, which means the robot is trapped at the local minimum.If these parameters are changed to any desired extent other than these values, there will be no change to the status of the robot at the local minimum.The mesh plot of this simulation as shown in Fig. 10.It describes the obstacles like summit, target act cavity and absorb the robot inside itself.
In the modified artificial potential field algorithm in which its relation was said in Section 3, if the value to the Figure 12 shows that with the number of steps of nearly 200 rounds, the attraction force is zeroed; that means, with this number of steps, the robot reaches the target.The mesh plot of this simulation in Fig. 13 shows that the obstacles like the summit and the target act like the cavity and absorb the robot into itself.
In the modified artificial potential field algorithm in which its relation was said in Section 3, if the value to Figure 15 shows that with the number of steps of nearly 400 rounds, the attraction force is zeroed; that means, with this number of steps, the robot reaches the target.The mesh plot of this simulation in Fig. 16 shows that the obstacles like the summit and the target act like the cavity and absorb the robot into itself.
In the modified artificial potential field algorithm in which its relation was said in Section 3, if the value to the parameter be considered as Z = 100, M = 2, k S = 1.1, G 0 = 2.1, and L = 0.5 and obstacles on a circle of the radius R = 7, the result is as shown in Fig. 17.It shows that the robot achieves the target by avoiding obstacles.Figure 18 shows that with the number of steps of nearly 700 rounds, the attraction force is zeroed; that means, with this number of steps, the robot reaches the target.The mesh plot of this simulation in Fig. 19 shows that the obstacles like the summit and the target act like the cavity and absorb the robot into itself.
In the modified artificial potential field algorithm in which its relation was said in Section 3, if the value to the parameter be. Figure 21 shows that with the number of steps of nearly 1000 rounds, the attraction force is zeroed; that means, with this number of steps, the robot reaches the target.The mesh plot of this simulation in Fig. 22 shows that the obstacles like the summit and the target act like the cavity and absorb the robot into itself.
In the modified artificial potential field algorithm in which its relation was said in Section 3, if the value to the parameter be considered as Z = 100, M = 2, k S = 1.1, G 0 = 0.3, and L = 0.1 and the obstacle is considered as X = 4; 4 ≤ Y ≤ 7, the result is as shown in Fig. 23.It shows that the robot achieves the target by avoiding obstacles.
Figure 24 shows that with the number of steps of nearly 900 rounds, the attraction force is zeroed; that means, with this number of steps, the robot reaches the target.The mesh plot of this simulation Figure 27 shows that with the number of steps of nearly 700 rounds, the attraction force is zeroed; that means, with this number of steps, the robot reaches the target.The mesh plot of this simulation in Fig. 28 shows that the obstacles like the summit and the target act like the cavity and absorb the robot into itself.

Fig. 7 Fig. 8
Fig. 7 Analysis of forces on a robot

Fig. 9 18 Fig. 10
Fig.9The energy amount of repulsion and attraction and their yields according to the number of steps in the artificial potential field algorithm for circular obstacles with radius R = 0.18

Fig. 11 Fig. 12
Fig.11The simulation result of the modified artificial potential field algorithm for circular obstacles with radius R = 0.18

Fig. 13 Fig. 14
Fig. 13 Mesh plot of the potential energy of attraction and repulsion in the modified artificial potential field algorithm for circular obstacles with radius R = 0.18

Fig. 15 30 Fig. 16
Fig.15The energy amount of repulsion and attraction and their yields according to the number of steps in the modified artificial potential field algorithm for circular obstacle with radius R = 30

Fig. 17 Fig. 18
Fig.17The result of simulating circular obstacles with radius R = 7 in the modified artificial potential field algorithm

Fig. 19 Fig. 20
Fig. 19 Mesh plot of the potential energy of attraction and repulsion in the modified artificial potential field algorithm for circular obstacles with radius R = 7

Fig. 21
Fig.21The energy amount of repulsion and attraction and their yields according to the number of steps in the modified artificial potential field algorithm for the curve-shaped obstacle

Fig. 23 Fig. 24
Fig.23The result of the straight line obstacle simulation in the modified artificial potential field algorithm

Fig. 25 Fig. 26 Fig. 27
Fig. 25 Mesh plot of the potential energy of attraction and repulsion in the modified artificial potential field algorithm for the straight line obstacle