# A Novel Virtual Sensor for Estimating Robot Joint Total Friction Based on Total Momentum
## 3 Simulation and Analysis  
### Simulation Setup  
To verify the performance of the algorithm proposed above, a 2 degrees of freedom (DOF) planar manipulator with gravity is simulated. A schematic diagram of the manipulator is shown in Figure 2. It is assumed that the mass of every rod is at the center of each link, and links have a weight of 0.5 kg and lengths of 1 m and 0.8 m for link 1 and 2, respectively. The reduction radio is \(\beta_{1}=\beta_{2}=1\). The rotor inertia of motors is \(J_{1}=J_{2}=10^{-4}\) kg\(\cdot\)m\({}^{2}\). The moment of inertia of the links relative to the Z-axis at the centers of mass (COM) is set as \(I_{1}=0.15\) kg\(\cdot\)m\({}^{2}\) and \(I_{2}=0.1\) kg\(\cdot\)m\({}^{2}\), respectively. Each joint of the simulated robot is controlled by classical inverse dynamics control. A diagram of the manipulator model is shown in Figure 2. The dynamics of the robots with friction disturbances are described as follows:  
\[\left[\begin{array}{cc}M_{11}&M_{12}\\ M_{21}&M_{22}\end{array}\right]+\left[\begin{array}{cc}\overline{B}_{1}&0\\ 0&\overline{B}_{2}\end{array}\right]\left[\begin{array}{c}\ddot{\partial}_{ 1}\\ \ddot{\partial}_{2}\end{array}\right]+\left[\begin{array}{cc}C_{0}\dot{ \vartheta}_{2}&-C_{0}\left(\dot{\vartheta}_{1}+\dot{\vartheta}_{2}\right)\\ C_{0}\dot{\vartheta}_{1}&0\end{array}\right]\left[\begin{array}{c}\dot{ \vartheta}_{1}\\ \dot{\vartheta}_{2}\end{array}\right]+\left[\begin{array}{c}G_{1}\\ G_{2}\end{array}\right]=\beta\tau_{M}-\tau_{f,tot}, \tag{21}\]  
\[\begin{array}{ll}&M_{11}=m_{1}r_{c1}^{2}+m_{2}\left(r_{1}^{2}+r_{c2}^{2}+2r_ {1}r_{c2}\cos q_{2}\right)+I_{1}+I_{2},\\ &M_{12}=M_{21}=m_{2}\left(r_{c2}^{2}+r_{1}r_{c2}\cos q_{2}\right)+I_{2},\\ &M_{22}=m_{2}r_{c2}^{2}+I_{2},\overline{B}_{1}=\overline{B}_{2}=\beta_{1}I_{1}= \beta_{2}J_{2},C_{0}=m_{2}r_{1}r_{c2}\sin q_{2},\\ &G_{1}=(m_{1}r_{c1}+m_{2}r_{1})g\cos q_{1}+m_{2}r_{c2}g\cos(q_{1}+q_{2}),\\ &G_{2}=m_{2}r_{c2}g\cos(q_{1}+q_{2}),\end{array} \tag{22}\]  
where \(\tau_{M}\) is known and calculated by the controller noted above. The PD coefficients in Figure 1 are manually tuned to \(K_{p1}=100\), \(K_{p2}=100\), \(K_{d1}=5\), and \(K_{d2}=5\).  
To verify the ability of the algorithm to estimate the total friction torque, a desired friction disturbance torque is needed. Therefore, the classic and complex Stribeck friction model is selected as the desired disturbance:  
\[\tau_{f,tot}=\left\{\begin{array}{l}[c^{+}+(s^{+}-c^{+})e^{-(\dot{\vartheta }_{i}/V_{s}^{+})^{2}}]\text{sgn}(\dot{q}_{i})+\alpha^{+}\dot{\vartheta}_{i}, \dot{\vartheta}_{i}>0\\ [c^{-}+(s^{-}-c^{-})e^{-(\dot{\vartheta}_{i}/V_{s}^{-})^{2}}]\text{sgn}(\dot{q} _{i})+\alpha^{-}\dot{\vartheta}_{i},\dot{\vartheta}_{i}<0\end{array}\right. \tag{23}\]  
where the Coulomb friction constants \(c^{+}\) and \(c^{-}\) are set to [6.85, 1.3] and [\(-\)6.85, \(-\)1.3], the static frictions \(s^{+}\) and \(s^{-}\) are set to [2, 0.3] and [\(-\)2, \(-\)0.3], the viscous friction constants \(\alpha^{+}\) and \(\alpha^{-}\) are set to [0.5, 0.5] and [\(-\)0.5, \(-\)0.5], and the switching speeds \(V_{s}^{+}\) and \(V_{s}^{-}\) are set to [1.5, 3] and [\(-\)1.5, \(-\)3], respectively.