# System for Evaluation and Compensation of Leg Length Discrepancy for Human Body Balancing
## 4 Human Body Balancing Algorithm
### Simulation Results
#### 4.1.2 Scenario 2: Human Body with LLD and Scoliosis  
The mass and height of the human body in Scenario 2 are 75 kg and 175 cm. The length difference between the left and right legs is \(\Delta l=-25\) mm, and the scoliosis angle is \(\phi=11^{\circ}\). The HBBA parameters are \(\varepsilon=0.2\) mm and \(\gamma=1\). The initial height of the left and right force plate is 424.4 mm. The HBBA in Scenario 2 was finished after four iterations, as shown in Figure 12. At the beginning of the simulation, the human body model was leaning toward the right (shorter) leg (Figure 12a), and the lumbar spine was leaning toward the left (longer) leg [32]. The final HBBA iteration is shown in  
Figure 11: Scenario 1: (**a**) \(CoM_{x}\), the position of the human body’s CoM; (**b**) reference height of the left (\(z_{Lref}\)) and right (\(z_{Rref}\)) force plate, current height of the left (\(z_{L}\)) and right (\(z_{R}\)) force plate; (**c**) the load on the left (\(m_{L}\)) and right (\(m_{R}\)) leg; (**d**) the balancing trigger signal (Q) marking the start of a new HBBA iteration; (**e**) position of the LASIS and RASIS markers, which are located on the pelvis; and (**f**) left and right force plate height difference (\(\Delta z\)), which corresponds with the LLD evaluation (\(\Delta l\)) in the HBBA’s final step. Figure 12e. Considering that the goal of human body balancing is load symmetry on the left and right leg, the human body with LLD and scoliosis will not have a level pelvis in the final step, as was the case in Scenario 1. In the initial state (\(k=0\)), the \(CoM_{x}\) is 14.88 mm, which is a consequence of the higher load on the right force plate (\(m_{R}=41.61\) kg) than the load on the left force plate (\(m_{L}=33.39\) kg). The location of the LASIS marker along the \(z\)-axis is 894.8 mm, and the position of the RASIS marker along the \(z\)-axis is 869.8 mm. The positions of the RASIS and LASIS markers, as well as the CoM position along the \(x\)-axis, point to the patient having LLD. The STRN and XYPH markers lie on the line \(p1\), and the XYPH and NAVE markers lie on the line \(p2\). The angle between the lines \(p1\) and \(p2\) is \(169^{\circ}\), showing that the subject has scoliosis, the angle of the scoliosis being \(\phi=11^{\circ}\). Considering that \(|CoM_{x}|\geq\varepsilon\), according to the algorithm in Figure 8 and Equation (18), the right platform should be lifted by 14.88 mm. The responses of the variables monitored during the runtime of the HBBA is shown in Figure 13. The values of the variables at the end of each iteration are shown in Table 2. According to Table 2, the HBBA gradually reduces the deviation of the CoM along the \(x\)-axis by lifting the right force plate with the 3-RPS parallel manipulator. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Iteration**} & \(CoM_{x}\) & \(z_{L}\) & \(z_{R}\) & \(\Delta z\) & \(m_{L}\) & \(m_{R}\) & **LASIS** & **RASIS** \\  & [mm] & [mm] & [mm] & [mm] & [kg] & [kg] & [mm] & [mm] \\ \hline \(k=0\) & 14.88 & 424.40 & 424.40 & 0 & 33.39 & 41.61 & 894.8 & 869.8 \\ \(k=1\) & 4.60 & 424.40 & 439.28 & \(-14.88\) & 36.22 & 38.78 & 894.8 & 884.6 \\ \(k=2\) & 1.48 & 424.40 & 443.88 & \(-19.48\) & 37.09 & 37.91 & 894.8 & 889.2 \\ \(k=3\) & 0.47 & 424.40 & 445.36 & \(-20.96\) & 37.37 & 37.63 & 894.8 & 890.7 \\ \(k=4\) & 0.17 & 424.40 & 445.83 & \(-21.43\) & 37.46 & 37.54 & 894.8 & 891.2 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Scenario 2: Figure 13 response values at the end of each iteration of the HBBA. Figure 12: Scenario 2: (**a**) Initial state of the human body with LLD and scoliosis (algorithm iteration \(k=0\)); (**b**) algorithm iteration \(k=1\); (**c**) algorithm iteration \(k=2\); (**d**) algorithm iteration \(k=3\); and (**e**) the human body with LLD and scoliosis is balanced (algorithm iteration \(k=4\)). The HBBA stops when in the final iteration (\(k=4\)) the \(CoM_{x}\) equals to 0.17 mm.