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.