At present, robots show great application value in various industries, and the progress of the industry constantly puts forward higher requirements for the performance of robots, and robot control is an important part of robot application. It is difficult for the traditional PID controller to implement online tuning when it is faced with actual objects. Consequently, the neural network algorithm has been included into robot control methods in recent years; the PID controller based on BP neural network is the subject of this research. This study presents the current state of research, the basic concept behind BP neural networks, how they are used in controller design, and how to optimize the PID parameters of BP neural networks using a particle swarm optimization method. To increase system stability, the neural network is coupled with a PID controller. The adaptive learning capability of the neural network is utilized to modify PID control parameters online in real time. Targeting the trouble that it slips into a local minimum easily during the BP-PID self-learning process and the refined PSO algorithm is used to improve it. It makes sure that the BP-PID system converges to the global optimal solution. The proposed method can effectively improve the system control accuracy and control stability.