# Online Foot Location Planning for Gait Transitioning Using Model Predictive Control
## 4 Foot Location Selection Based on MPC  
The expression for the HF is shown in Equation (1). \[\mathbf{p_{f}^{des}}=\mathbf{p_{h}^{ref}}+\mathbf{v^{COM}}\Delta t/2+k_{d} \left(\mathbf{v^{COM}}-\mathbf{v^{des}}\right) \tag{1}\]  
\(\mathbf{p_{f}^{des}}\) is the desired foot location of the quadruped robot. \(\mathbf{p_{h}^{ref}}\) is the location of the hip projected onto the ground. \(\mathbf{v^{COM}}\) is the current speed of the COM. \(\Delta t\) is the time the foot will spend on the ground. \(\mathbf{v^{des}}\) is the desired speed of the COM. All the variables above are in the world coordinate system. \(k_{d}\) is the gain of the difference between \(\mathbf{v^{COM}}\) and \(\mathbf{v^{des}}\). Due to the characteristics of different gaits, the posture of the quadruped robot after gait transitioning will have a large offset from the steady state. In this case, HF may choose a foot location that is not conducive to the stability of the quadruped robot's posture in order to correct the velocity offset. If it is desired to do a better job of transitioning between several different gaits, a heuristic gain value needs to be determined for each gait. Therefore, a new way of foot location planning is needed to enable gait transitioning of quadruped robots in multiple gaits with a single set of parameters. The variables used in the equations below are shown in Figure 3.  
The LIP model has been widely used in bipedal robot motion [17; 18]. The simplified LIP model allows better planning of the bipedal robot's foot location. LIP can also be applied to quadrupedal robots [19; 20]. With the virtual leg concept, a quadrupedal robot can be equated to a bipedal robot. At this point the quadruped robot can also apply the LIP model to plan the foot location. Therefore, the LIP model can be used to predict the velocity of the quadruped robot. In a single-point support, the COM is p  
Figure 3: A model of the quadruped robot is shown in the figure. The _World_ in the bottom left corner of the diagram indicates the defined world coordinate system. The black frame in the top right corner indicates the composition of the variables labelled in the model. \(\mathbf{p_{f}}\) is the position of the robot’s foot end. \(\mathbf{p}\) is the position of the robot’s COM. \(\mathbf{f}\) is the ground reaction force. All the variables mentioned are in the world coordinate system. The forward acceleration \(\ddot{x}\) is driven by the difference between the support foot position \(p_{x}\) and the COM position \(x\). \[\ddot{x}=\frac{g}{z_{0}}(x-p_{x}) \tag{2}\]  
where \(p_{x}\) represents the position of the supporting foot in the x-axis direction in the world coordinate system, and \(x\), \(\ddot{x}\) and \(z_{0}\) represent the position of the COM, the acceleration in the x-axis and the height in the z-axis in the world coordinate system, respectively. \(g\) is the acceleration of gravity in the z-axis in the world coordinate system. With the height of COM \(z_{0}\) constant, the value of \(\ddot{x}\) is determined only by \(x\) and \(p_{x}\). The lateral acceleration \(\ddot{y}\) is driven by the difference between the position of support foot \(p_{y}\) and the position \(y\) of the COM. \[\ddot{y}=\frac{g}{z_{0}}\big{(}y-p_{y}\big{)} \tag{3}\]  
where \(p_{y}\) represents the position of the supporting foot in the y-axis direction in the world coordinate system, and \(y\) and \(\ddot{y}\) represent the position of the COM and the acceleration in the y-axis under the world coordinate system, respectively. Let the COM state be \(\mathbf{x}=[x,\dot{x}]^{\mathbf{T}}\), then the equation of state is shown in Equation (4). \[\dot{\mathbf{x}}=\mathbf{A}\mathbf{x_{0}}+\mathbf{B}p_{x} \tag{4}\]  
\[\mathbf{A}= \begin{bmatrix}0&1\\ \frac{g}{z_{0}}&0\end{bmatrix} \mathbf{,B}= \begin{bmatrix}0\\ -\frac{g}{z_{0}}\end{bmatrix} \mathbf{,x_{0}}= \begin{bmatrix}x_{0}\\ \dot{x}_{0}\end{bmatrix}  \tag{5}\]  
\(\mathbf{x_{0}}\) is the robot's current state.