# Target Points Tracking Control for Autonomous Cleaning Vehicle Based on the LSTM Network
## 3 Proposed Trajectory Tracking Control Algorithm
### Trajectory Tracking Control System Description
According to the coordinate transformation relation, the angle \(\alpha_{t}\) and distance \(d_{t}\) between the current position and the target point can be acquired as Equations (13) and (14). It is stipulated that the positive value \(\alpha\) representing the target point is on the left side of the vehicle, while the negative value \(\alpha\) representing the target point is on the right side of the vehicle. \[\alpha_{t}=\tan^{-1}\left(\frac{y_{target}-y_{c}}{y_{target}-x_{c}}\right) \tag{13}\]  
\[d_{t}=\sqrt{\left(x_{target}-x_{c}\right)^{2}+\left(y_{target}-y_{c}\right)^{ 2}} \tag{14}\]  
Figure 4: The overall structure of the proposed trajectory tracking algorithm. The set of the observations used for reaching the target point on the reference path at the time step t is given by: \(O_{t}=\{\alpha_{t},d_{t},k_{1t},k_{2t},r_{t}\}\), The features of \(\alpha_{t}\) as well as \(d_{t}\) are chosen to replicate the driving habits of the human driver, because drivers tend to visually measure the distance and the angle to the target point. Then the speed and yaw rate are determined according to above three variables. \(k_{1t}\), \(k_{2t}\) represent the minimum distances from the obstructions to the two edges in front of the rectangular-shaped cleaning vehicle equipped with ultrasonic sensors. \(r_{t}\) is a value detected by the laser, which stands for the distance from the obstructions to the vehicle nose. Considering the length and width of the vehicle and above five values comprehensively, the vehicle can control the speed and yaw rate more intelligently when turning or approaching obstacles. For example, if the vehicle's length is too long to turn around a curve or the obstacle is too close to the vehicle's body, the control variables need to be fine-tuned the control parameters. So the input of the LSTM network is the observations data \(O_{t}\), whose features are scaled to remain in an acceptable range with respect to the activation function, and the output is the predicted data \(M\): \(M=\left\{v_{final},\omega\right\}\), where, \(v_{final}\) is the speed and \(\omega\) is the yaw rate to reach the target point. Figure 5 depicts the detail architecture of the proposed  
and unit variance to normalize the input data. During the training, the loss function is optimized as follows:  
\[loss=\lambda_{1}\frac{\sum_{i=1}^{n}\left(v_{final,i}-v_{i}^{\prime}\right)^{2}}{n }+\lambda_{2}{\sum}_{i=1}^{n}\frac{\left(\omega_{i}-\omega_{i}^{\prime}\right)^ {2}}{n}. \tag{15}\]  
where, \(v_{i}\) and \(\omega_{i}\) are the labels of the speed and yaw rate data in a batch, \(v_{i}^{\prime}\) and \(\omega_{i}^{\prime}\) are the predictive value obtained by the neural network. We set the weights \(\lambda_{1}=0.4\) and \(\lambda_{2}=0.6\) to reflect the importance of the yaw rate, which can influence the accuracy of path tracking, while the speed affects the efficiency of cleaning. For the minimization of the loss function, the Adam optimization is applied in the training process, with the dynamic learning rate start with 0.004 and decay with a rate of 0.0005, which can reduce the neural network training time without losing the prediction accuracy. The dropout rate is 0.8. In order to regularize the network, the L2 regularization is used. Combining all parameters and methods, the whole system model is optimized to improve the network performance.