# Research on Trajectory Planning and Tracking Methods for Coal Mine Mobile Robots
## 4 Experiments on Trajectory Planning and Tracking of CMRRs
### Experiments on Trajectory Tracking of CMRRs
#### 4.2.1 Trajectory Tracking Test on a Flat Surface in the Simulated Laneway  
The experiment of a robot tracking linear and sinusoidal curve-type trajectories was first performed sequentially in the flat ground area of the simulated tunnel. The experimental environment is shown in Figure 31.  
* Test 1: Linear trajectory tracking test  
A 4 m long linear trajectory is issued to the direction directly in front of the robot (\(x\)-axis). The MPC and PID trajectory tracking algorithms are run separately to compare the tracking effects of the two algorithms. The visualization results of the MPC algorithm and PID algorithm tracking straight line experiments in RVIZ are shown in Figure 32, where the red curve is the actual trajectory of the robot and the green curve is the published desired trajectory. Figure 31: Flat ground test in simulated laneway. Figure 30: Comparison of dynamic obstacle trajectories between MINCO trajectory method and Fast-Planner algorithm. Compare the effect of MPC algorithm and PID algorithm. The motion trajectory comparison graph of the robot moving from the initial point to the target point is shown in Figure 33. The \(Y\)-axis error is used as the comparison term. Since the published desired trajectory Y is a constant equal to 0 and X is from 1 m to 5 m, the robot tracking error can be clearly seen. Take the motion trajectory after the robot reaches the desired point, i.e., the trajectory after the \(X\)-axis is greater than 1 m for the correlation calculation. The maximum tracking error of the MPC algorithm is 0.041 m, and the standard deviation of the error is 0.008 m. The maximum tracking error of the PID algorithm is 0.041 m, and the standard deviation of the error is 0.01 m.  
From the above data and Figure 33, it can be seen that under the tracking control of both algorithms, the robot can track the desired trajectory well. At the same time, the maximum error is only 0.041 m. The difference in standard deviation between the two algorithms is also very small, within 0.002 m.  
* Test 2: Sine curve type trajectory tracking test  
Figure 33: Comparison of MPC and PID in linear motion trajectories. Figure 32: Linear tracking test results: (**a**) MPC algorithm tracking results, (**b**) PID algorithm tracking results. The red curve is the actual trajectory of the robot and the green curve is the published desired trajectory. A sinusoidal curve-type trajectory that varies in the positive direction of the \(X\)-axis for about one cycle was released 1 m directly in front of the robot. Subsequently, the MPC and PID trajectory tracking algorithms were run separately to compare the trajectory tracking effects of the two algorithms. The result plots in the RVIZ visualization interface when the MPC algorithm and the PID algorithm track the sinusoidal trials are shown in Figure 34, where the red curve is the actual trajectory of the robot and the green curve is the desired trajectory. Shown in Figure 35 is the comparison of the motion trajectory of the two algorithms MPC and PID for the robot moving from the initial point to the target point. Figure 36 shows the comparison of the tracking error of the two algorithms. Still, the trajectory after the \(X\)-axis is greater than 1 m for the calculation of the relevant indicators, the maximum tracking error of the MPC algorithm is 0.191 m, and the standard deviation of the error is 0.0514 m. The maximum tracking error of the PID algorithm is 0.192 m, and the standard deviation of the error is 0.049 m.  
Figure 34: Sine curve tracking test results: (**a**) MPC algorithm tracking results (**b**) PID algorithm tracking results. The red curve is the actual trajectory of the robot and the green curve is the desired trajectory. Figure 35: Comparison diagram of MPC and PID sinusoidal curve motion trajectories. From the above data and Figures 34 and 35, it can be seen that under the tracking control of both algorithms, the robot can track the desired trajectory.