## 5 Inverse Kinematics Analysis
### The Solution of the Inverse Kinematics Model with the BP-SQP Algorithm  
According to the characteristics of the SQP algorithm, the SQP algorithm depends on the initial values greatly, and deviations will happen. The initial value of the SQP algorithm is optimized by the BP neural network to reduce the errors caused by dependence on the initial values. The BP neural network uses forward propagation for its output results and backpropagation for its errors. Therefore, it is not necessary to clarify the equation of the relationship between the output value and the input value in advance. The BP neural network only needs to complete its own training and rules to obtain the optimal output value after the input value is imported. The BP neural network is based on the back-propagation errors to achieve the training of the multi-front layer network and based on the gradient descent method to achieve the minimum mean square error between the expected and actual output. In the BP neural network, the number of layers, the adjacent combination form, and the number of nodes contained in each layer must be known in advance. Only by confirming the number of layers of the neural network and the number of nodes in each layer, the actual network structure can be confirmed. To simulate any continuous function, only a three-layer neural network is needed. According to the above analysis, the inverse kinematics model of the UR10 robot can be decomposed into several continuous and complex functions. When a continuous trajectory, which the same function is selected to represent, is executed by the UR10 robot, the three-layer neural network can be used to solve the inverse kinematics of the UR10 robot's trajectory. In this paper, a 3-layer BP neural network is employed to simulate the inverse kinematics of the UR10 robot. The three layers refer to the input layer, hidden layer, and output layer. The number of nodes in the input layer is the number of input independent variables. The input is the pose of the target point which includes the target point's pose matrix \(R\) and the position, \(x\), \(y\), and \(z\) coordinates. As the Euler angle leads to the problem of the UR10 robot's joints being locked, four elements are introduced to describe to target point's pose matrix. Equations (21) and (22) demonstrate the transformation between the rotation matrix \(R\) of the target point and the four elements \(q_{0}\), \(q_{1}\), \(q_{2}\), \(q_{3}\). Therefore, the number of nodes in the input layer of The BP neural network employed in this paper is seven. \[ \begin{bmatrix}q_{3}\\ q_{2}\\ q_{1}\\ q_{0}\end{bmatrix} = \begin{bmatrix}\sqrt{1+{R_{11}}^{2}+{R_{22}}^{2}+{R_{33}}^{ 2}}/2\\ \left({R_{21}-{R_{12}}}\right)/4{q_{3}}\\ \left({R_{13}-{R_{31}}}\right)/4{q_{3}}\\ \left({R_{32}-{R_{23}}}\right)/4{q_{3}}\end{bmatrix}  \tag{21}\]  
\[R= \begin{bmatrix}1-2{q_{1}}^{2}-2{q_{2}}^{2}&2q_{0}q_{1}-2q_{2}q_{3}&2q_{0}q_{2 }+2q_{1}q_{3}\\ 2q_{0}q_{1}+2q_{2}q_{3}&1-2{q_{0}}^{2}-2{q_{2}}^{2}&2q_{1}q_{2}-2q_{0}q_{4}\\ 2q_{1}q_{2}-2q_{1}q_{3}&2q_{1}q_{2}+2q_{0}q_{3}&1-2q_{0}^{2}-2{q_{1}}^{2}\end{bmatrix}  \tag{22}\]Since there is a large difference in orders of magnitude between X, Y, Z, and \(q_{0}\), \(q_{1}\), \(q_{2}\), \(q_{3}\), Z-score, which is a standardization equation, is used to convert all input values into the same order of magnitude. Equation (23) represents the Z-score equation. \[x^{\prime}=\frac{x-\mu}{\sigma} \tag{23}\]  
In Equation (23), \(\mu\) represents the mean value of the samples and \(\sigma\) represents the standard deviation. The number of nodes on the output layer is the number of dependent variables of the 3-layer BP network, whose output values are the six joint radians, \(\theta_{1}\), \(\theta_{2}\), \(\theta_{3}\), \(\theta_{4}\), \(\theta_{5}\), and \(\theta_{6}\). The number of nodes on the output layer of the 3-layer BP network is six. The number of nodes on the hidden layer of the BP neural network, which is often decided by the equations created by previous researchers, is undetermined.