# Inverse Kinematics of Large Hydraulic Manipulator Arm Based on ASWO Optimized BP Neural Network
## 5 Simulation and Experimental Validation
### Simulation Verification  
The simulation verification process is shown in Figure 8. The target position \(X_{tgt}Y_{tgt}Z_{tgt}\) and the target attitude \(R_{tgt}\) are input into the ASWO-BP neural network inverse solution model, which results in a set of joint angles. Firstly, the DH forward solution is performed to obtain the theoretical position \(X_{tho}Y_{tho}Z_{tho}\), and secondly, the set of joint angles is input into the forward solution error compensation model to obtain the position compensation value \(X_{comp}Y_{comp}Z_{comp}\), and then the \(X_{tho}Y_{tho}Z_{tho}\) and \(X_{comp}Y_{comp}Z_{comp}\) are added together to obtain the actual position \(X_{act}Y_{act}Z_{act}\) of the end. Finally, the difference between \(X_{act}Y_{act}Z_{act}\) and \(X_{tgt}Y_{tgt}Z_{tgt}\) is calculated to obtain the simulation inverse solution error \(X_{error}Y_{error}Z_{error}\). In order to verify the performance of the ASWO algorithm, three algorithms (GA, PSO, and SWO) are used for comparison experiments. To ensure a fair comparison of the four algorithms, the individual dimension \(dim\), the population number \(N\), the maximum number of iterations \(T_{\text{max}}\), and the fitness value function are unified. According to the BP neural network topology, the total number of weights and biases is 833, so the dimension  
Figure 7: Topology of the BP neural network. \(dim\) is set to 833, the population number \(N\) is set to 100, and the maximum number of iterations \(T_{\max}\) is set to 50,000. In addition, to ensure a fair comparison among the four algorithms, other parameters were adjusted for each algorithm, and multiple sets of experiments were conducted to analyze the data and obtain optimal solutions. The following is the optimal parameter configuration for each algorithm. In the ASWO and SWO algorithms, the initial minimum number of populations \(N_{\min}\) is set to 80, the initial trade-off rate \(TR\) is set to 0.4, and the initial crossover probability \(CR\) is set to 0.3. The threshold \(th_{l}\) is set to 0.01 for the ASWO algorithm, \(th_{u}\) is set to 0.2, and \(m\) is set to 50. In the GA algorithm, the crossover rate \(CR\) is set to 0.3, and the variance rate \(VR\) is set to 0.1. In the PSO algorithm, the learning factors \(C_{1}\) and \(C_{2}\) are set to 2, and the inertia weight \(W\) is set to 0.6. From the best fitness curve in Figure 9, it can be seen that the GA algorithm has a stronger global search ability and can obtain a better solution in fewer iterations, but it has weaker local search ability, with a best fitness value of 1.946. The PSO algorithm, due to its stronger local search ability, is prone to falling into local optima, with a best fitness value of 0.826. The SWO algorithm, due to its fixed parameters, can sometimes remain in the local optimum for a long time and is difficult to escape from, with a best fitness value of 0.641. The ASWO algorithm has a faster decreasing fitness value compared to the other three algorithms, is less likely to be troubled by local optima, and obtains a better solution with fewer iterations, with a best fitness value of 0.343. The optimal solutions obtained by the four algorithms are used as the initial weights and biases of the BP neural network, respectively. After the training is completed, 464 sets  
Figure 8: Simulation verification process. Figure 9: Optimal fitness curves of four algorithms. of test data are substituted into the four models to obtain the joint error range, MSE, and three-direction position error range, as shown in Table 2.  
As can be seen from Table 2, compared with the other three algorithmic models, the first three joints of the ASWO-BP algorithm have smaller error ranges of (\(-0.305\)\(-0.368\))\({}^{\circ}\), (\(-0.412\)-\(0.374\))\({}^{\circ}\), and (\(-44.3\)-\(56.5\)) mm, respectively.The mean square error of the ASWO-BP algorithm is 0.173, which is lower than that of the optimal SWO-BP among the other three models, which is 0.394.