The dynamic system method is an effective and relatively mature method for learning robot skills. At present, there are relatively few researches on obstacle avoidance algorithms based on dynamic systems. Considering the possible collision problem when the operator and the manipulator work together, this article proposes an obstacle avoidance algorithm for manipulators based on a dynamic system. The algorithm optimizes the end obstacle avoidance algorithm under the existing dynamic system learning method, by introducing reference point and reference direction, the problem of saddle point and local minimum point existing in obstacle boundary is solved. Finally, the simulation on Robotic System Toolbox and the experiment on Franka Emika Panda robot platform verify the effectiveness of the algorithm in end obstacle avoidance.