## 3 Turning Gait Planning in the Non-Inertial Reference (IRF)
### Planning of the COM Trajectory
\begin{array}{c}x_{\rm un}=\frac{\omega x_{\rm com}^{\rm IRF}-\dot{x}_{\rm com }^{\rm IRF}}{\omega}\\ x_{\rm st}=\frac{\omega x_{\rm com}^{\rm IRF}+\dot{x}_{\rm com}^{\rm IRF}}{ \omega}.\end{array}  \tag{11}\]  
We can then obtain an expression for \(x_{\rm un}\), as shown in Formula (12). Formula (12) is a first-order differential equation, and its eigenvalue is an integrity, so this mode is a divergent system. The input of the subsystem is the position of the ZMP because the value of \(\omega\) is constant:  
\[\dot{x}_{\rm un}(t)-\omega x_{\rm un}(t)=-\omega x_{\rm zmp}^{\rm IRF}(t). \tag{12}\]  
In order to match the state space shown in Formula (9), the input of the system is the velocity of the ZMP. We can rewrite the expression in the Formula (13) when the radius of the COM is approximately constant:  
\[\dot{x}_{\rm un}(t)-\omega x_{\rm un}(t)=-\omega\int_{0}^{t}\dot{x}_{\rm zmp }^{\rm IRF}(t)dt\approx-\omega\int_{0}^{t}(\dot{x}_{\rm zmp}(t)+\frac{2\dot{y} _{\rm zmp}^{\rm IRF}(t)\dot{y}_{\rm zmp}^{\rm IRF}(t)}{\omega^{2}f_{\rm com} })dt. \tag{13}\]  
Figure 6: Transformation between straight and turning walk. In the IRF, there is no inertial force in the forward direction \(y\) so the dynamics are the same as in the straight-line walk. We can calculate the \(\dot{y}^{\text{IRF}}_{\text{zmp}}\) and \(\dot{y}^{\text{IRF}}_{\text{zmp}}\) based on the traditional LIP model ahead of time. Although \(x_{\text{uni}}\) is divergent, we can find a ZMP trajectory whose initial condition satisfies \(x_{\text{un}}(t_{initial})=\omega\int_{t_{initial}}^{\infty}e^{-\omega(t-t_{ initial})}x^{\text{IRF}}_{\text{zmp}}(t)dt\) to make the trajectory of the COM stable. According to the definition of \(x_{\text{un}}\), each control cycle \(t_{initial}{=}k\delta\) can be used as the initial time for future trajectory planning. \(k\) can be \(1,2\cdots n\), and \(\delta\) is the control cycle. We can obtain the relationship between the state space and the velocity of ZMP to find this initial condition and the ZMP trajectory which is shown in Formula (14):  
\[\frac{\omega x^{\text{IRF}}_{\text{com}}-\dot{x}^{\text{IRF}}_{\text{com}}}{ \omega}=-\omega\int_{t_{\text{initial}}}^{\infty}e^{-\omega(t-t_{\text{initial} })}\int_{t_{\text{initial}}}^{\infty}\dot{x}^{\text{IRF}}_{\text{com}}dtdt. \tag{14}\]  
Here, we can obtain the relationship between the current state space of the COM, including the position and velocity and the future velocity of the ZMP. As is mentioned above, ZMP should be always in the supporting area to guarantee the stability of the robot, so the constraints of the velocity of ZMP are shown as Formula (15):  
\[x^{\text{min}}_{\text{zmp}}(t)\leq x^{\text{IRF}}_{\text{zmp}}(t_{initial})+ \int_{t_{\text{initial}}}^{t}\dot{x}^{\text{IRF}}_{\text{zmp}}(\tau)d\tau\leq x ^{\text{max}}_{\text{zmp}}(t). \tag{15}\]  
There are a lot of solutions to the COM trajectories that can satisfy the stable conditions for Formula (14). Through the optimal control theory, the input of the system is the velocity of ZMP, and we can reduce the value of the COM velocity deviating from the average speed, thus reducing the change in the COM velocity. We define the cost function (\(f\)) as the Formula (16):  
\[f(\dot{x}^{\text{IRF}}_{\text{com}}(t),t)=\int_{t_{\text{initial}}}^{\infty} {(\dot{x}^{\text{IRF}}_{\text{com}}(t)-x^{\text{average}}_{\text{com}})}^{2 }dt. \tag{16}\]  
We discretize Formula (16) and obtain Formula (17):  
\[f(\dot{x}^{\text{IRF}}_{\text{com}}(k+j),k)=\sum_{j=0}^{j=N}{(\dot{x}^{\text{ IRF}}_{\text{com}}(k+j)-x^{\text{average}}_{\text{com}})}^{2}\delta, \tag{17}\]  
where \(N\) is the number of sampling points, and \(\dot{x}^{\text{IRF}}_{\text{com}}((k+j)\) is the predicted COM velocity at the _jth_ sampling point. The control variable is the ZMP velocity. We should thus derive the relationship between the velocities of the COM and the ZMP. We can use the recursive method to predict the COM velocity after the velocities within the predicted time are known. These expressions are shown as Formula (18):  
\[