## 4 Simulation Results
### Tracking Performance  
Two desired trajectory tracking cases are used in order to verify the effectiveness of the improved MPC for the biomimetic spherical robot. The first (Case I) is a line trajectory defined, as follows:  
\[p(t)= \begin{cases}x_{d}=0.5t\\ y_{d}=0.5t\end{cases} \quad 0\leq t\leq 15s \tag{30}\]  
In case I, the initial state of the robot is \(\mathbf{x}(0)=[0,0,0,0,0]^{T}\). Figure 6 shows the trajectory tracking result, where the blue curve is the expected trajectory and the red curve represents the simulated trajectory. It was found that the proposed MPC-based algorithm is able to drive the robot to land on and track the reference trajectory. To clearly visualize the tracking result, the state errors between the simulated trajectory and the expected trajectory are depicted in Figure 7. Although some state errors (\(x\),\(y\),\(r\)) are zero initially, the yaw angle of the robot is inconsistent with the reference value, which results in the change of the state errors at the next sampling time. However, it is obvious that all of the state errors converge to zero by the adjustment of the proposed controller at the end, which means that the robot lands on and tracks the desired trajectory accurately. Figure 8 shows the required control input signals. The force for controlling the surge changes with the position errors, and the torque that is used to control the yaw angle changes with the yaw angle error. The controller generates a slightly large input initially, aiming to make the robot converge to the desired trajectory as quickly as possible. Nevertheless, the change in input is moderate throughout the entire process, which respects the increased constrains of the input. In addition, the input is in the physical limit of the thrusters during tracking. As the errors between the expected and simulated values decrease, the control signals tend toward a constant value. The second one (case II) tracks a square trajectory that is defined by the following equation. Figure 8: Control input signals-Case I.  
Figure 6: The biomimetic spherical robot trajectory tracking on a xoy plane-Case I.  
Figure 7: The state errors of the biomimetic spherical robot-Case I. \[p(t) = \begin{cases}x_{d}=0.5t\\ y_{d}=3\end{cases} \quad 0\leq t\leq 35\text{s} \tag{31}\] \[p(t) = \begin{cases}x_{d}=17.5\\ y_{d}=3-0.5(t-35)\end{cases} \quad 35\text{s}<t\leq 70\text{s}\] \[p(t) = \begin{cases}x_{d}=17.5-0.5(t-70)\\ y_{d}=-14.5\end{cases} \quad 70\text{s}<t\leq 105\text{s}\] \[p(t) = \begin{cases}x_{d}=0\\ y_{d}=-14.5+0.5(t-105)\end{cases} \quad 105\text{s}<t\leq 140\text{s}\]  
The initial condition of the robot in case II is \(\mathbf{x}(0)=[0,4,\pi/4,0,0]^{T}\). Figure 9 shows the simulation result of case II. As this figure shows, the robot tracked the desired trajectory quickly although there were some sudden changes in yaw angle. Figure 10 shows the changes in the state errors while tracking a square trajectory. All of the errors increase sharply when the desired trajectory exhibits a sudden change in yaw. Moreover, the position errors oscillate slightly at the corners of the square trajectory, which is caused by the constraints of the input increment. However, all of the state errors tend toward nearly zero when the robot converges to the reference trajectory at the end of each line stage. The control input signals of the robot during the square-trajectory tracking are depicted in Figure 11. To drive the robot to converge as quickly as possible, the control input signal changes suddenly at the corresponding sampling time point when the yaw angle of the robot changes, as shown in this figure. Owing to the limit of the input increment, the input that was obtained by the proposed MPC method changes slightly several times to copy with the sudden change. In addition, all of the control signals are within the physical limit range of the thruster. When the robot tracks the reference trajectory accurately, the control input remains constant.