# Slip Estimation for Mars Rover Zhurong Based on Data Drive
## 3 Method
### Learning Algorithms  
In this paper, BP neural network was used to train models for their good nonlinear mapping ability and self-adaptability, as well as strong robustness and fault tolerance [33; 34]. The simple learning rules were easy to implement [35]. However, the models were prone to trap in local optima. In order to achieve better performance of models, GA was used to optimize the initialization weights and thresholds of the BP, based on the global search ability of GA. In our previous work, we used BP and GA-BP to establish slip_x models [36]. In this paper, we aimed to establish slip models which could predict slip_x and slip_y at the same time, so that the models could not only be used for slip early warning, but also guide path planning. BP neural network presented a multi-layer structure, as shown in Figure 7. It is typically composed of three layers: input layer, hidden layer, and output layer [37]. Input signals (\(x_{1},x_{2},\ldots\)\(x_{n}\)) were received by the input layer and reached the output layer after being processed by the hidden layer. Neurons in adjacent layers were connected by different weights (\(\omega_{ij},\omega_{jk}\)),  
\[h_{j}=f\big{|}\sum\omega_{ij}x_{i}-a_{j}\big{|},j=1,2,\ldots,l \tag{4}\]  
\[O_{k}=\psi\big{|}\sum h_{j}\omega_{jk}-b_{k}\big{|},k=1,2,\ldots,m \tag{5}\]  
where \(h_{j}\) and \(O_{k}\) are the output of the hidden layer and output layer, respectively. \(\omega_{ij}\) is the weight from the \(i_{\text{th}}\) input layer neuron to the \(j_{\text{th}}\) hidden layer neuron, and \(\omega_{jk}\) is the weight from the \(j_{\text{th}}\) hidden layer neuron to \(k_{\text{th}}\) output layer neuron. The hidden layer threshold is \(a_{\text{j}}\) and the output layer threshold is \(b_{k}\). \(f\) (\(x\)) and \(\psi(h)\) are the active function of the hidden \begin{table}
\begin{tabular}{c c c} \hline \hline
**Raw Data** & **Sampling Frequency** & **Usage** \\ \hline The rover’s pitch & 20 Hz & Input feature (1) \\ The rover’s roll & 20 Hz & Input feature (2) \\ The current of each wheel’s driving motor & 1 Hz & Calculate the input feature (3) \\ the angular velocity of each wheel’s driving motor & 1 Hz & Calculate the input feature (4) \\ The position of rover & 20 Hz & Calculate the slip of rover \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The data collected in ground tests. Figure 7: Topology structure of BP neural network model. layer and output layer, \(f\left(x\right)\) is the sigmoid type of nonlinear function, and \(\psi(h)\) is the linear function. When the actual output (\(y_{1}\),\(y_{2}\),... \(y_{m}\)) could not obtain the expected output values, it switched to error back propagation, and the connection weights and thresholds were modified according to the error, so that the output values would constantly approach the expected output. GA is a self-adaptive global optimization algorithm by simulating the genetic and evolution process of living beings in the natural environment. It encodes the parameters of certain problems as chromosomes, performing the selection based on survival of the fittest, and then obtaining new generations of individuals through crossover and mutation operation [38]. In this paper, GA was used to optimize the initial connection weights and thresholds of BPNN. The optimization process was described as follows. (1) Step 1: Encoding  
When the topology of BP was determined, connection weights and thresholds were encoded into chromosomes. The encoding length L was defined as follows:  
\[L=m+n+ml+ln, \tag{6}\]  
where \(m\), \(l\), and \(n\) are the numbers of neurons in input layer, hidden layer, and output layer, respectively. (2) Step 2: Calculating fitness function  
In order to obtain better performance of model, we defined the fitness function \(f_{fit}\) as Equation (7). \[f_{fit}=1/(\eta_{1}\cdot\sum(\hat{s}_{xi}-s_{xi})^{2}+\eta_{2}\cdot\sum(\hat{s }_{yi}-s_{yi})^{2}) \tag{7}\]  
where \(\hat{s}_{xi}\) and \(\hat{s}_{yi}\) represent the predicted slip_x and slip_y, respectively.