With the gradual development of smart factories, mobile robots are applied more and more widely in the factory. However, as there are many obstacles in the factory, the traditional artificial potential field method is easy to produce unreachable targets and local minimum values and other problems. This study improves the unreachable target and the local optimal solution of the traditional artificial potential field method in path planning. Firstly, a new repulsive potential field function is adopted to solve the problem of unreachable targets by adding an influence function to the repulsive potential field function in the original artificial potential field method. Secondly, for the local optimal solution, the artificial potential field method is combined with the simulated annealing method, and the additional subpoints in the simulated annealing method are applied to break the equilibrium state, so as to get out of the obstacles. Finally, through Matlab comparison, the travel time of the proposed algorithm in 10 obstacles is improved by 6.70% and the path length is reduced by 9.20% compared with algorithms in other literature. In 20 obstacles, the travel time of the proposed algorithm is improved by 9.10% and the path length is reduced by 12.10% compared with algorithms in other literature.