# Calculation of the Center of Mass Position of Each Link of Multibody Biped Robots
## 4 Validation of the Second Theoretical Formulation
### Validation  
In following, the example shown in Figure 6 with the characteristics shown in Table 1 is implemented in MATLAB using equations presented in Section 3. The validation consists to give as input the total CoM positions of each configuration and to verify that the CoM position of each link of the platform, calculated with the formulations of the Section 3, has the same value used in input.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Link** & **Weight [kg]** & \
\begin{tabular}{c} **Absolute CoM Position** \\ **Respect to \(\mathbf{X_{p}}\), \(\mathbf{Y_{p}}\), \(\mathbf{Z_{p}}\) [mm]** \\ \end{tabular} &
\begin{tabular}{c} **Relative CoM Position in** \\ **\(\mathbf{X_{p}}\)-\(\mathbf{Z_{p}}\) Plane [mm]** \\ \end{tabular} \\ \hline Foot 0 & 6.72 & 0, \(-\)200, 26.32 & L\({}_{\text{a}}\) = 100 & l\({}_{\text{a}}\) = 26.32, r\({}_{\text{a}}\) = 0 \\ Shin 0 & 0.95 & 0, \(-\)200, 300 & L\({}_{\text{b}}\) = 400 & l\({}_{\text{b}}\) = 200; r\({}_{\text{b}}\) = 0 \\ Thigh 0 & 1.16 & 0, \(-\)200, 750 & L\({}_{\text{c}}\) = 500 & l\({}_{\text{c}}\) = 250; r\({}_{\text{c}}\) = 0 \\ Foot 1 & 6.72 & 0, 200, 26.32 & L\({}_{\text{a}}\) = 100 & l\({}_{\text{a}}\) = 26.32, r\({}_{\text{a}}\) = 0 \\ Shin 1 & 0.95 & 0, 200, 300 & L\({}_{\text{b}}\) = 400 & l\({}_{\text{b}}\) = 200; r\({}_{\text{b}}\) = 0 \\ Thigh 1 & 1.16 & 0, 200, 750 & L\({}_{\text{c}}\) = 500 & l\({}_{\text{c}}\) = 250; r\({}_{\text{c}}\) = 0 \\ Waist & 0.94 & 0, 0, 1000 & / & / & / \\ \hline \hline \end{tabular}
\end{table}
Table 1: Characteristics of the robot.  
Figure 6: Example for implementing the formula.  
% MATLAB Example  
thb = 10 \"pi/180; %radiant angle of the link L\({}_{\rm b}\)  
thc = 10 \"pi/180; %radiant angle of the link L\({}_{\rm c}\)  
ma = 6.72; %kg weight of the Foot  
mb = 0.95; %kg weight of the link b  
mc = 1.16 + 0.94; %kg weight of the link c  
mw = mb + mc; %kg  
m2 = mu + mw; %kg  
ra = 0; %mm position of the CoM of the foot  
la = 26.32; %mm position of the CoM of the foot  
La = 100; %mm length of the foot in \(Zp\) direction  
Lb = 400; %mm length of the shin in \(Zp\) direction  
Lc = 500; %mm length of the thigh in \(Zp\) direction  
lb = 200; %mm INPUT CONDITION FOR VALIDATION  
lc = 250; %mm INPUT CONDITION FOR VALIDATION  
Z2a = (1/m2) *(ma *la + mb * (La + lb) + mc * (La + Lb + lc)); %mm Total CoM position in the configuration a  
X2a = 0; %mm Total CoM position in the configuration a  
Z2b = (1/m2) *(ma *la + mb * (La + lb *cos (thb)) + mc *(La + (Lb + lc *cos (thb))); %mm Total CoM position in the configuration b  
X2b = (1/m2) *(mb *lb *sin (thb) + mc *(Lb + lc *sin (thb)); %mm Total CoM position in the configuration b  
Z2c = (1/m2) *(ma *la + mb *(La + lb) + mc * (La + Lb + lc *cos (thc))); %mm Total CoM position in the configuration c  
X2c = (1/m2) *(mc *lc *sin (thc)); %mm Total CoM position in the configuration c  
rwb = (X2b *m2 - ma *ra)/mw; %mm from Equations (30) and (31)  
lwb = (Z2b *m2 - ma *la)/mw - La; %mm from Equations (30) and (31)  
rwc = (X2c *m2 - ma *ra)/mw; %mm from Equations (30) and (31)  
lwc = (Z2c *m2 - ma *la)/mw - La; %mm from Equations (30) and (31)  
B = mw * (lwb + La) - mb *La - mc *Lb *cos (thb) - mc *La; %change of variables  
C = mw * (lwc + La) - mb *La - mc * (La + Lb); %change of variables  
det_A = (mb *mc *cos (thb) * (cos (thc) - 1)); %from Equation (38)  
lb_validation = (mc * (B *cos (thc) - C *cos (thb)))/det_A; %mm from Equation (41)  
lc_validation = (mb * (C *cos (thb) - B))/det_A; %mm from Equation (41)