Aiming at the problem of safe obstacle avoidance of robotic arms,a model of shortest obstacle avoidance path planning of robotic arms based on the gravitational factor of artificial potential field was proposed.The influence of various parameters in the algorithm on the motion path of the end of the robot arm was studied.The gravitational factor was constructed,the shortest obstacle avoidance path planning model based on the gravitational factor was proposed,and the shortest obstacle avoidance path at the end of the mechanical arm and its optimal solution were solved using gradient descent method.The shortest path charac-teristics of different obstacle sizes and positions were studied and analyzed,and the joint angle path characteristics were analyzed using the plane model of the industrial SCARA robot.Experimental results show that the model parameters determine the radian change of the obstacle avoidance path.The algorithm proposed can adapt to the changes of the position and the size of obstacles,so that the end of the manipulator can avoid obstacles with the shortest path,and its motion trajectory can be tangent to the obstacles.