# System for Evaluation and Compensation of Leg Length Discrepancy for Human Body Balancing
## 3 Mathematical Model of the System
### Inverse Kinematic of the 3-RPS Parallel Manipulator  
The 3-RPS parallel manipulator has three degrees of freedom (3-DOF). The solution to the inverse kinematic problem (IKP) for the 3-RPS parallel manipulator is the length of the linear actuators \(d_{i}\) for a set position and orientation (\(\alpha\), \(\beta\), \(z\)) of the moving platform. According to Figure 6, the closed loop equation for each individual linear actuator length \(d_{i}\) (\(i\) = 1, 2, 3) can be defined as [22,25]:  
\[d_{i}{}^{A}\mathbf{\dot{s}}_{i}={}^{A}\mathbf{p}+{}^{A}\mathbf{R}_{B}{}^{B} \mathbf{b}_{i}-{}^{A}\mathbf{a}_{i} \tag{1}\]  
where  
* \({}^{A}\mathbf{\dot{s}}_{i}\) is the unit vector of the prismatic joint;
* \({}^{A}\mathbf{p}\) is the position vector of the moving platform center in the frame {A};
* \({}^{A}\mathbf{R}_{B}\) is the rotation matrix of the moving frame {B} with respect to the frame {A};
* \({}^{B}\mathbf{b}_{i}\) is the position vectors of spherical joints in the frame {B}; and
* \({}^{A}\mathbf{a}_{i}\) is the position vectors of revolute joints in the frame {A}.  
The length of the prismatic joint actuators can also be defined as a scalar product of Equation (1) with itself. The position vectors of revolute joints \({}^{A}\mathbf{a}_{i}\) (\(i=1,2,3\)) in the frame {A} are:  
\[{}^{A}\mathbf{a}_{1}=\left[\begin{array}{c}r_{A}\\ 0\\ 0\end{array}\right],{}^{A}\mathbf{a}_{2}=\left[\begin{array}{c}-\frac{1}{2}r _{A}\\ \frac{\sqrt{3}}{2}r_{A}\\ 0\end{array}\right],{}^{A}\mathbf{a}_{3}=\left[\begin{array}{c}-\frac{1}{2}r _{A}\\ -\frac{\sqrt{3}}{2}r_{A}\\ 0\end{array}\right] \tag{2}\]  
where \(r_{A}\) is the radius of the circumscribed circle of the equilateral triangle \(A_{1}A_{2}A_{3}\). Position vectors of spherical joints \({}^{B}\mathbf{b}_{i}\) (\(i=1,2,3\)) in the frame {B} are:  
\[{}^{B}\mathbf{b}_{1}=\left[\begin{array}{c}r_{B}\\ 0\\ 0\end{array}\right],{}^{B}\mathbf{b}_{2}=\left[\begin{array}{c}-\frac{1}{2}r _{B}\\ \frac{\sqrt{3}}{2}r_{B}\\ 0\end{array}\right],{}^{B}\mathbf{b}_{3}=\left[\begin{array}{c}-\frac{1}{2}r _{B}\\ -\frac{\sqrt{3}}{2}r_{B}\\ 0\end{array}\right] \tag{3}\]  
Figure 6: Geometry of 3-RPS parallel manipulator.  
where \(r_{B}\) is the radius of the circumscribed circle of the equilateral triangle \(B_{1}B_{2}B_{3}\). The rotation matrix \({}^{A}\mathbf{R}_{B}\) of the moving frame {B} with respect to the frame {A} is as follows:  
\[{}^{A}\mathbf{R}_{B}=\left[\begin{array}{ccc}u_{x}&v_{x}&w_{x}\\ u_{y}&v_{y}&w_{y}\\ u_{z}&v_{z}&w_{z}\end{array}\right] \tag{4}\]  
A detailed presentation of the IKP of a 3-RPS parallel manipulator is given in [18]. The position vector of the center of the force plate \({}^{B}\mathbf{c}\) in the frame {B} is:  
\[{}^{B}\mathbf{c}=\left[\begin{array}{ccc}0&0&h_{c}\end{array}\right]^{T} \tag{5}\]  
The position vector of the center of the force plate \({}^{A}\mathbf{c}\) in the frame {A} is:  
\[{}^{A}\mathbf{c}={}^{A}\mathbf{p}+{}^{A}\mathbf{R}_{B}{}^{B}\mathbf{c} \tag{6}\]  
The IKP for the left (\(j=L\)) and right (\(j=R\)) 3-RPS parallel manipulators is defined as follows:  
\[\left[\begin{array}{ccc}d_{1j}&d_{1j}&d_{1j}\end{array}\right]^{T}=\text{IKP} _{j}\left(\alpha_{j},\beta_{j},z_{j}\right) \tag{7}\]  
where \(\alpha_{j}\) is the rotation of the force plate \(j\) around the \(x\)-axis, \(\beta_{j}\) is the rotation of the force plate around the \(y\)-axis and \(z_{j}\) is the position of the force plate on the \(z\)-axis.