## 3 DoFs Angles Estimation
### Estimation of the Shoulder Joint Angles  
The collected motion data from the IMU, mounted on the upper limb segments, are filtered and processed, as described in Section 3.1. Hence, the orientation of all the individual links and for each timestamp is determined in terms of the extracted roll, pitch and yaw angles. Using these orientation angles, the direction cosine matrix is calculated for each upper limb segment, specifying also the required rotation sequence. This is a dynamic procedure and takes place for every timestamp that updated inertial measurements are received by the sensor nodes.  
Having described before the shoulder joint as a spherical wrist configuration for a robotic arm model [38], the shoulder joint angles' variables \(\theta_{1}\), \(\theta_{2}\) and \(\theta_{3}\) can be assigned to the roll, pitch and yaw angles, with respect to the coordinate frame \(O_{0}x_{0}y_{0}z_{0}\) (Figure 1). The mathematical expressions that relate the two sets of angles, result from the following analysis.  
The shoulder joint rotations are described by a sequence of the three elemental rotations that occur around the axes of the origin coordinate system, which remains motionless, adopting the convention of the Tait-Bryan angles [47]. The sequence of elemental rotations is important in the estimation process. So, in case of a different definition in the sequence of the elemental rotations, the corresponding transformation matrix representation must be re-estimated.  
The orientation transformation among the origin frame 0 and the frame 4 of the upper limb model (Figure 1) is given by the Equation (10). This equation results from the transformation matrix \(T_{0}^{4}\) of the forward kinematics based on the DH parameterization. On the other side, the corresponding representation for the Tait-Bryan angles \(Z_{a}X_{\beta}Y_{\gamma}\) configuration has the form of Equation (11). \(X\), \(Y\) and \(Z\) are the transformation matrices of the elemental rotations around the fixed frame axes \(x\), \(y\) and \(z\), accordingly. Hence, this equation represents an angle \(\alpha\) rotation around \(z\) axis, followed by an angle \(\beta\) rotation around \(x\) axis and, an angle \(\gamma\) rotation around \(y\) axis of the fixed frame.  
\[R_{0}^{4}=\begin{pmatrix}s\theta_{1}c\theta_{3}+c\theta_{1}s\theta_{2}s\theta _{3}&c\theta_{1}c\theta_{2}&s\theta_{1}s\theta_{3}-c\theta_{1}s\theta_{2}c \theta_{3}\\ -c\theta_{1}c\theta_{3}+s\theta_{1}s\theta_{2}s\theta_{3}&s\theta_{1}c\theta _{2}&-c\theta_{1}s\theta_{3}-s\theta_{1}s\theta_{2}c\theta_{3}\\ -c\theta_{2}s\theta_{3}&s\theta_{2}&c\theta_{2}c\theta_{3}\end{pmatrix} \tag{10}\]  
\[\mathcal{R}=Z_{a}X_{\beta}Y_{\gamma}=\begin{pmatrix}c\alpha c\gamma-s\alpha s \beta s\gamma&-s\alpha c\beta&c\alpha s\gamma+s\alpha s\beta c\gamma\\ s\alpha c\gamma+c\alpha s\beta s\gamma&c\alpha c\beta&s\alpha s\gamma-c \alpha s\beta c\gamma\\ -c\beta s\gamma&s\beta&c\beta c\gamma\end{pmatrix} \tag{11}\]  
The parameter \(\alpha\) of Equation (11) should not be confused with the Denavit-Hartenberg parameter \(\alpha\) noted in Table 3 and Equation (1). Solving over the corresponding items of the matrices presented in Equations (10) and (11), we conclude to the results of Equation (12):  
\[\theta_{1} =\alpha+pi/2 \tag{12}\] \[\theta_{2} =\beta\] \[\theta_{3} =\gamma\]  
By replacing the estimated values of angles \(\theta_{1}\), \(\theta_{2}\) and \(\theta_{3}\) in the transformation matrix \(T_{0}^{4}\), the posture of the upper arm is extracted with respect to the \(O_{\text{C}}x_{\text{C}}y_{\text{C}}z_{\text{C}}\) coordinate frame, as it is defined in Figure 1.