# An Algorithm for Solving Robot Inverse Kinematics Based on FOA Optimized BP Neural Network
## 1 Introduction  
Solving the problem of robot inverse kinematics is the basis of robot trajectory planning and motion control. Inverse kinematics is the mapping from Cartesian space to joint space [1, 2]. Its essence is to obtain the value of each joint variable from the position and posture of the end of the robot. Traditional methods for solving robot inverse kinematics include geometric [3, 4], algebraic [5, 6, 7], and iterative [8, 9] methods. The geometric method has strict requirements on the configuration of the robot, poor versatility, certain limitations, and the modeling and solving process is more complicated. The algebraic method can obtain closed solutions of simple mechanisms. However, it is difficult to obtain closed solutions of complex mechanisms. This method involves a quantity of coordinate transformations in the solution process, and the solution accuracy is relatively low. The iterative method solves the problem through repeated iterations. This method requires numerous calculations and is difficult to meet the requirements of real-time control. In view of the shortcomings of traditional methods, more and more intelligent algorithms are widely used in robot control, such as neural network algorithms [10, 11], genetic algorithms [12, 13, 14, 15], and particle swarm algorithms [16, 17, 18, 15]. Artificial neural network has powerful approximation ability when solving the problem of nonlinear mapping. Taking a large number of positive kinematics information of the robot as samples, through the training and learning of the BP neural network, the mapping from the Cartesian space to the joint space is realized. As a result, complicated calculation and derivation processes are avoided. The trained neural network has a fast calculation speed and can meet the requirements of real-time control. In [19], [PERSON] and [PERSON] proved that the double hidden layer BP neural network structure has advantages in solving the inverse kinematics of the manipulator. However, the traditional BP neural network has the disadvantages of large output error, easy to fall into a local extreme value, and slow convergence speed. In [15], [PERSON] et al. designed two scenarios of randomly selected points and following a specific trajectory in the robot workspace, compared four different optimization algorithms, and proved the effectiveness of the QPSO algorithm to solve the inverse kinematics of a 4-DOF serial robot. [PERSON] [20] used the analytical method to solve the inverse kinematics of the redundant manipulator and optimized it accordingly, but the solution process was complicated, and the solution accuracy was not high. In [21], [PERSON] et al. proposed global-local best inertia PSO algorithm and proved the effectiveness of the PSO algorithm in solving the optimal solution of redundant robots. [PERSON] and [PERSON] [22] proposed a series of improved GANs that use limited data to approximate the real model, effectively solving the inverse kinematics problem of high-dimensional nonlinear systems. [PERSON] and [PERSON] [23] proposed using the firefly algorithm to solve the inverse kinematics of a 7-DOF robot, but the population size has a great influence on the speed and quality of the solution. In [24], [PERSON] et al. proposed an intelligent algorithm that initializes the inverse kinematics solution with extreme learning machine and optimizes it with a genetic algorithm based on sequence mutation. This algorithm improves the efficiency of the solution while ensuring accuracy. Fruit fly optimization algorithm has few applications in the field of robot kinematics [25; 26; 27; 28]. The FOA algorithm has the characteristics of simple operation and fast convergence speed. This paper uses the FOA algorithm to optimize the threshold and weight of the BP neural network to improve the convergence speed and output accuracy of the neural network.