## 2 Rock-Drilling Robot Arm Modeling and Error Calculation
### ISBOA-BP-Based Localization Error Compensation Method for Rock-Drilling Robotic Arms  
ISBOA demonstrates a strong global search capability by simulating the secretary bird's behavior over a wide search space. This assists the BP neural network in efficiently optimizing its weights and biases, preventing it from becoming trapped in local optima and ultimately enhancing the accuracy of the final training outcome. In optimizing the BP neural network using the ISBOA, the neural network topology is first determined by processing the dataset. The positions generated by the good point set represent the search agents, i.e., the secretary bird individuals, in the ISBOA. The initial position of each agent represents a potential solution to the weights and biases in the neural network. According to the ISBOA strategy, the search agents explore and update their positions in the solution space, with fitness calculations performed at each population iteration. This iterative process evolves the search agents towards better solutions, eventually identifying the optimal search agent. The optimal weights and biases obtained from the ISBOA are then used as the initial weights and biases for training the BP neural network. The flow of the algorithm is illustrated in Figure 5.  
The BP neural network consists of an input layer, a hidden layer, and an output layer, with neurons in each layer connected by weights. In this study, the BP neural network takes seven joint values as input and outputs the error in the XYZ directions corresponding to these joint values. Therefore, the BP neural network has seven input nodes and three output nodes. After multiple experiments and analyses, it was found that the network achieves the best error prediction when the hidden layer consists of a single layer with 15 neurons and the tansig function is used as the activation function. The best results were obtained under these conditions. The network is trained with 1500 iterations, and the learning rate is set at 0.01. Given that the BP neural network has a total of 168 weights and biases, the individual dimension of the population in ISBOA is set to 168, and the  
Figure 5: Flowchart of the BP neural network algorithm optimized by ISBOA.  
population size is set to 50. The topology of the BP neural network used in this study is illustrated in Figure 6.  
To find the global optimal solution, the mean square error (MSE) between the predicted and actual values is used as the fitness function.  
\[MSE=\frac{1}{n}\sum_{i=1}^{n}{(e_{i}-\hat{e}_{i})^{2}} \tag{12}\]  
A smaller MSE value indicates a smaller gap between the predicted and true values, thereby reflecting a more accurate and optimal solution.  
In the sample data selected for this study, each group contains the values of seven joints of the robotic arm \(\theta_{i}(i=1\) to 7) and their corresponding end position errors \(E\), where \(E=(X_{error},Y_{error},Z_{error})\). The mapping model between the robotic arm's joint values and end positioning errors is constructed through network training.  
The process of positioning error compensation for the rock drilling robotic arm is as follows: first, determine the joint values of each joint of the robotic arm to be compensated, \(\theta_{i}^{aim}(i=1\) to 7), and use the mapping relationship established by the neural network to calculate the corresponding end positioning error \(E^{aim}\), i.e., the required compensation amount. Next, the theoretical position of the end, \(P_{t}^{aim}\), is calculated using the forward kinematics of the robotic arm. Finally, this theoretical position is added to the compensation amount to obtain the actual position of the end, \(P_{a}^{aim}=P_{t}^{aim}+E^{aim}\). The flow of the error compensation process is shown in Figure 7.