# System for Evaluation and Compensation of Leg Length Discrepancy for Human Body Balancing
## 4 Human Body Balancing Algorithm
### Simulation Results
#### 4.1.1 Scenario 1: Human Body with LLD  
The mass and height of the human body in Scenario 1 are 75 kg and 175 cm. The length difference between the right and left leg is \(\Delta l=30\) mm, and the scoliosis angle is \(\phi=0^{\circ}\). The HBBA parameters are \(\varepsilon=0.2\) mm and \(\gamma=1\). The initial height of the left and right force plates is 424.4 mm. The HBBA in Scenario 1 finished after five iterations, as shown in Figure 10. At the beginning of the simulation, the human body model, presented face-in, was leaning toward the left (shorter) leg (Figure 10a), and in the final HBBA iteration, the human body model is balanced (Figure 10f). In the initial state (\(k=0\)), the \(CoM_{x}\) is \(-19.35\) mm, which is the result of a bigger load on the left force plate (\(m_{L}=43.22\) kg) than the load on the right force plate (\(m_{R}=31.78\) kg). The position of the LASIS marker along the \(z\)-axis equals to 869.8 mm, and the position of the RASIS marker along the \(z\)-axis is 899.8 mm. The positions of the LASIS and RASIS markers, as well as the position of the CoM along the \(x\)-axis, point out to the patient having LLD. The markers STRN, XYPH and NAVE lie on the same line, which points to the fact that patient has no scoliosis. Considering that the \(|CoM_{x}|\geq\varepsilon\), according to the algorithm in Figure 8b and Equation (18), the left platform will be lifted by 19.35 mm. The responses of the variables monitored during the runtime of the HBBA are shown in Figure 11. The values of these variables at the end of each iteration  
Figure 9: Virtual simulation system. are shown in Table 1. The HBBA, according to Table 1, gradually reduces the CoM's deviation along the \(x\)-axis by lifting the left force plate with the 3-RPS parallel manipulator. Every new calculation of the \(CoM_{x}\) for the purpose of adjusting the force plate height will be done following the rising edge of the balancing trigger signal shown in Figure 11d that is generated when the human body on the force plate is static. At every change of the force plate's height, there is a trough in the \(CoM_{x}\) (Figure 11a). This is due to the increased force which the left leg is applying on the force plate following the acceleration of the manipulator. The HBBA stops when in the final iteration (\(k=5\)) the \(CoM_{x}\) amounts to \(-0.09\) mm. The height of the left force plate \(z_{L}\) is 454.31 mm, and the height of the left force plate \(z_{R}\) is 424.4 mm. The difference in load of the left (\(m_{L}=37.53\) kg) and right (\(m_{R}=37.47\) kg) legs on their respective force plate is 0.06 kg, which points to the balance of the human body being achieved. The location of the LASIS marker along the \(z\)-axis is 899.7 mm, and the position of the RASIS marker along the \(z\)-axis is 899.8 mm. The difference in the markers' height is 0.1 mm, which denotes that the pelvis is level. According to Equation (20), the difference in height between the left and right force plate \(\Delta z\) is 29.91 mm. The LLD evaluation based on Equation (21) is \(\Delta I=29.91\) mm, which following Equation (21) means that the right leg is longer than the left leg by 29.91 mm, while the simulated height difference between the left and right leg equaled to 30 mm. The precision of the HBBA will depend on the defined deviation \(\varepsilon\). By lowering the deviation \(\varepsilon\), the number of the HBBA's iteration increases, which can prolong the