## 2 Angular Momentum Compensation
### Upper-Body Control Method Based on Angular Momentum  
We developed an angular momentum compensation method inspired by humans. In this method, the upper body, including the torso and arms, is controlled to compensate for the angular momentum generated by the movement of the legs during the flight phase. By using both torso and arms, the upper body can generate large angular momentum. In this paper, we present all vectors of position, angular velocity, linear momentum and angular momentum, and all rotation matrices in the Cartesian frame fixed on the ground. The inertia matrix is basically with respect to the center of mass position of the link presented in the Cartesian frame fixed on the ground. The process of the proposed method consists of four steps:  
1. Selection of an angular momentum reference for a waist of the robot;
2. Calculation of the angular momentum generated by legs movement;
3. Calculation of the angular momentum that needs to be generated by movement of the torso and arms;
4. Generation of movement of each upper-body joint. The angular momentum of the waist is first determined, based on if rotation in the yaw direction is needed. The angular momentum reference of the waist \(\mathbf{L}_{wast\_target}\) should be 0 kgm\({}^{2}\)/s to perform straight running motion. Second, the angular momentum generated by leg movement is determined. The legs are controlled with controllers for running. In our previous studies, the controller decided a landing position and swung the legs to achieve the desired landing. When the leg movement is different, the angular momentum generated by the legs also changes. The legs' angular momentum \(\mathbf{L}_{legs}\) is described by the following equation, considering the angular momentum of each link. \[\mathbf{L}_{legs}=\sum_{i=1}^{Lges\_link}\mathbf{L}_{i} \tag{1}\]  
where, \(\mathbf{L}_{i}\) is the angular momentum of the \(i^{\text{th}}\) link, which is generally calculated as shown in Equation (2) [19]. \[\mathbf{L}_{i}=\mathbf{c}_{i}\times\mathbf{P}_{i}+\mathbf{R}_{i}{}^{T}\bar{ \mathbf{I}}_{i}\mathbf{R}_{i}\mathbf{\omega}_{i} \tag{2}\]  
where, \(\mathbf{c}_{i}\) is the COM position of the \(i^{\text{th}}\) link, \(\mathbf{P}_{i}\) is the linear momentum of the \(i^{\text{th}}\) link, \(\mathbf{R}_{i}\) is the rotation matrix of the \(i^{\text{th}}\) link with respect to the COM position of the link, and \(\mathbf{\omega}_{i}\) is the angular velocity of the \(i^{\text{th}}\) link. The inertia matrices are known as the designed parameters including the moment of inertia and products of inertia. The rotation matrix and the angular velocity are measured by the joint angle sensors implemented in the robot, and the linear momentum is calculated with mass and the COM position. In the third step of the process, the angular momentum reference of the upper body \(\mathbf{L}_{upperbody\_target}\) is calculated from the angular momentum of the whole body at take-off \(\mathbf{L}_{all}\) and the angular momentum \(\mathbf{L}_{legs}\) generated by the leg movement. By the same method for the calculation of the angular momentum \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Joints** & **Movable Range Deg** & **Angular Velocity (S.D.) rpm** & **Torque (S.D.) Nm** \\ \hline Shoulder Pitch & \(-\)180–50 & 50 (15) & 21 (8.8) \\ Shoulder Roll & 0–180 & 25 (5.9) & 12 (6.8) \\ Shoulder Yaw & \(-\)80–60 & 29 (1.9) & 4.8 (2.2) \\ Elbow Pitch & \(-\)145–5 & 69 (12) & 17 (1.9) \\ Trunk Pitch & \(-\)45–30 & 18 (9.5) & 77 (27) \\ Trunk Roll & \(-\)50–50 & 14 (4.7) & 64 (25) \\ Trunk Yaw & \(-\)40–40 & 36 (9.2) & 40 (15) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Requirements for upper-body joints. \(\mathbf{L}_{legs}\) generated by the legs, the angular momentum of the whole body \(\mathbf{L}_{all}\) is calculated at take-off because it does not change during the flight phase.