## 4 Dynamics and Control of Planar One-Legged Hopping Robots  
### The Hybrid Dynamics of a Planar One-Legged Hopping Robot  
In order to demonstrate the applications of the main results presented in the preceding sections, a planar hopping robot system [4], as shown in Figure 1, is employed to achieve this goal. The hopping robot has a single actuated linear spring leg and a rotational actuated body, and a torsion spring is installed in the hip joint. Suppose the mass of the leg and the body are \(m_{l}\) and \(m_{b}\), respectively, while the foot is massless. The moment of inertia of the leg and the body are \(J_{l}\) and \(J_{b}\), respectively. The length of the leg is \(l\), and its nature length is \(l_{0}\). The spring stiffness of the leg is \(k_{l}\) and the stiffness of the hip spring is \(k_{h}\). For the purpose of simplicity, the center of mass (CM) of the body and the leg are designed just on the hip joint, and the mass of the springs is supposed to be negligible. The generalized coordinates of the hopping system are defined to be \((x,z,\theta,\varphi,l)\), where \((x,z)\) denotes the position of the foot tip, \(\theta\) represents the angle between the leg and the horizontal plane, \(\varphi\) represents the angle between the body and the leg, and the positive direction of all angular variable is defined to be counter clockwise. The dynamics of the hopping robot in flight phase can be expressed as  
\[ \begin{array}{l}m\ddot{x}_{cm}=0,\\ m\ddot{z}_{cm}=-mg,\\ (I_{l}+J_{b})\,\ddot{\theta}+J_{b}\ddot{\varphi}=0,\\ J_{b}\ddot{\theta}+J_{b}\ddot{\varphi}+k_{h}(\varphi-\varphi_{0})=\tau_{f}, \end{array}  \tag{47}\]  
where \(\tau_{f}\) is the input torque of the hip joint, and the position of the CM of the robot is given as  
\[\left\{ \begin{array}{l}x_{cm}=x+l\cos\left(\theta\right),\\ z_{xm}=z+l\sin\left(\theta\right).\end{array} \right. \tag{48}\]  
Note that, in flight phase, the length of the leg is \(l=l_{0}\) since the leg can not be controlled in flight phase. Nevertheless, in stance phase, Equations (48) are the holonomic constraints of the hopping robot. Thus, the Jacobian matrix \(\mathbf{W}(\mathbf{q})\) of Equation (2) can be written as follows by Equation (3):  
\[W(q)=\left[ \begin{array}{cccc}1&0&l\sin\left(\theta\right)&0&-\cos\left( \theta\right)\\ 0&1&-l\cos\left(\theta\right)&0&-\sin\left(\theta\right)\end{array} \right] \tag{49}\]  
Figure 1: Model of a planar one-legged hopping robot. and the constraint forces are  
\[\lambda=\text{col}\left(\lambda_{x},\lambda_{z}\right). \tag{50}\]  
Thus, the dynamics of the hopping robot in stance phase can be written as  
\[\left\{ \begin{array}{l}m\ddot{x}_{cm}=\lambda_{x},\\ m\ddot{z}_{cm}=-mg+\lambda_{z},\\ \left(J_{l}+I_{b}\right)\ddot{\theta}+I_{b}\ddot{\varphi}=\lambda_{x}I\sin \left(\theta\right)-\lambda_{z}l\cos\left(\theta\right),\\ J_{b}\ddot{\theta}+J_{b}\ddot{\varphi}+k_{h}(\varphi-\varphi_{0})=\tau_{s},\\ \lambda_{x}\cos\left(\theta\right)+\lambda_{z}\sin\left(\theta\right)=0.\end{array} \right. \tag{51}\]  
By the constraint Equation (48) and the first two equations of Equation (51), the constraint forces \(\left(\lambda_{x},\lambda_{z}\right)\) can be resolved, and then the dynamics Equation (51) can be simplified to  
\[\left\{ \begin{array}{l}\left(J_{l}+J_{b}+ml^{2}\right)\ddot{\theta}+J_{b} \ddot{\varphi}+2 ml\dot{\theta}+mgl\cos\left(\theta\right)=0,\\ J_{b}\ddot{\theta}+J_{b}\ddot{\varphi}+k_{h}(\varphi-\varphi_{0})=\tau_{s}, \\ m\left(\ddot{l}-l\dot{\theta}^{2}\right)+mg\sin\left(\theta\right)+k_{l}(l-l_{0 })=F.\end{array} \right. \tag{52}\]  
We can verify that the dynamics Equation (52) are the same as that derived directly from the Euler-Lagrange equations. In order to get the equations of the state jumps for the hopping robot, from Equation (11), we have  
\[\left\{