# Head-Raising of Snake Robots Based on a Predefined Spiral Curve Method
## 3 Simulation on Head-Raising Motion  
According to the proposed algorithms, the phase-shifting process can be simulated. The parameters of the predefined curve are as follows: \(a=9.7\), \(b=1\), \(c=48.5\), \(n_{c}=2.5\), \(n=16\), \(l_{link}=97\) (mm), \(\hat{t}_{1}=1,552\) (rad), \(\hat{t}_{2}=1,555.1\) (rad), \(\hat{t}_{3}=1,567.7\) (rad), \(\varphi_{0}=1.6022\) (rad), and \(\varphi_{base}=pi\) (rad). According to Equation (3), the arc lengths of BS (\(S_{1}\)) and RS (\(S_{2}\)) can be calculated as \(S_{1}=431.8891\) (mm) and \(S_{2}=1,032.6\) (mm). The discrete independent variable is selected as \(t_{d}=[0,0.1,0.2,\dots,\hat{t}_{1},\hat{t}_{1}+0.001,\hat{t}_{1}+0.002,\dots, \hat{t}_{3}]\) with \(\Delta t_{1}=0.1\) and \(\Delta t_{2}=0.001\). To facilitate reading, all the symbols utilized in this paper are concluded in Appendix part, as shown in Table 1.  
Figure 8: Local coordinates fixed on the simplified Solidworks model and descriptions of roll, pitch and yaw angles. Label 1 corresponds to the initial configuration. Label 2, 3 and 4 describe the configurations after rotating roll angle, yaw angle and pitch angle, respectively. The snake begins to move from basic posture to final posture using the shape-fitting and phase-shifting algorithms. During the phase-shifting process, the phase \(\Delta S_{i}\) in every step can be selected manually. In this test, \(\Delta S_{i}\) is assumed constant and equal to \(\left(S_{1}+S_{2}\right)/n_{step}\), where the number of total steps \(n_{step}\) equals 500. Table 1 shows the data of \({}^{i}P_{1}\), \({}^{i}lnx_{p_{1}}\), \({}^{i}\alpha_{1}\), \({}^{i}\beta_{1}\), and \({}^{i}\gamma_{1}\) at steps 1, 2, 300, 499, and 500, respectively. Figure 9 shows the phase-shifting process, including the predefined spiral curve (Figure 9a) and snake posture at steps \(i=1\) (Figure 9b), \(i=147\) (Figure 9c), and \(i=500\) (Figure 9d), corresponding to the snake head at \(t=\hat{t}_{1}\), \(t=\hat{t}_{2}\), and \(t=\hat{t}_{3}\), respectively. We assume that the head-raising motion time is 50 s, that is, \(t_{time}\in(0,50)\). With Equation (12) and numerical derivation, the roll (\({}^{i}\gamma_{j}\)), pitch (\({}^{i}\beta_{j}\)), and yaw (\({}^{i}\alpha_{j}\)) angle sequences; relative angular velocity (\({}^{i}\dot{\gamma}_{j}\), \({}^{i}\dot{\beta}_{j}\), \({}^{i}\dot{\alpha}_{j}\)); and angular acceleration (\({}^{i}\ddot{\gamma}_{j}\), \({}^{i}\dot{\beta}_{j}\), \({}^{i}\ddot{\alpha}_{j}\)) can be obtained, as shown in the \(z\)-axis of Figure 10. The \(x\)- and \(y\)-axes represent the joint ID (\(ID=1,2,\ldots,15\)) and time, respectively. As the snake head moves from \(t=\hat{t}_{1}\) to \(t=\hat{t}_{2}\), the absolute value of \({}^{i}\gamma_{1}\) initially increases before the third joint point moves to \(t=\hat{t}_{1}\) and subsequently becomes constant because the first two links are constrained to a semicircle. Meanwhile, the absolute values of \({}^{i}\alpha_{1}\) and \({}^{i}\beta_{1}\) are zero. Similarly, the motion of the snake head moving from \(t=\hat{t}_{2}\) to \(t=\hat{t}_{3}\) can be divided into two stages. Before the third joint point moves to \(t=\hat{t}_{2}\), the absolute value of \({}^{i}\gamma_{1}\) initially decreases in the first stage and then subsequently increases in the second stage. In the meantime, the absolute value of \({}^{i}\alpha_{1}\) increases at varying speed. The absolute value of \({}^{i}\beta_{1}\) initially increases, subsequently decreases, and finally increases. Unsmooth angles are caused by the unsmooth transition of the piecewise function, which will be improved in future work. Thus, the shapes of the relative velocity and acceleration curve are full of sharp points. Moreover, the curves of the other joint points (\(ID=2,3,\ldots,15\)) have the same shape with phase lag. Figure 10: Angle, angular velocity, and angular acceleration during phase-shifting process. Distinguishing between the phase-shifting and head-raising processes is important.