# A Novel Virtual Sensor for Estimating Robot Joint Total Friction Based on Total Momentum
## 3 Simulation and Analysis
### Simulation Results and Analysis
The virtual sensor, which is essentially a first-order low-pass filter, can suppress the high-frequency measurement noise signal, but not the low-frequency dynamic model errors signal [43]. Therefore, the performance of the designed virtual sensor for estimating the joint friction torque strongly depends on the dynamic model accuracy. To verify the accuracy of the estimated friction torque from the observer and the performance improvement in controller trajectory tracking based on the observed friction compensation, we performed another simulation in which the observed friction was compensated for by the robot controller. Then, we analyzed and compared the simulated trajectory tracking results for each robot joint. The input position for the simulation was a cosine curve: \(q_{d}=-\text{cos}(\pi t)+1\). The desired velocity was the derivative of this desired position. The desired friction disturbance, controller parameters, and robot dynamic inertia parameters are given above. The diagonal gain matrix \(K_{\mu}\) of the observer was selected as [360, 0; 260]. The joint position and velocity tracking errors before and after friction compensation are shown in Figure 4. To save space, only the curves of joint 1 are given. Figure 4a,b illustrate that the friction disturbance affects the joint motion performance. The blue curves show that the RMSE of position error is \(3.3\times 10^{-2}\) rad and the RMSE of velocity error is \(4.5\times 10^{-2}\) rad/s for joint 1 without friction torque compensation. To eliminate the effects of the friction disturbance and achieve a better motion control performance, the friction observed by the virtual sensor is compensated for by the controller. The results after compensation are the red curves shown in Figure 4.  
Notably, the RMSE of position error reduces to \(1.7\times 10^{-2}\) rad, and the RMSE of velocity error reduces to \(2.2\times 10^{-2}\) rad/s for joint 1 with friction torque compensation. Compared with the case with no friction torque compensation for the controller, the position and velocity tracking performance of joint 1 significantly improve. More error data have been presented in Table 2, which shows that the RMSE of position error decreases by 48.5% and the RMSE of velocity error is reduced by 51.1% in the simulations due to friction torque compensation. Therefore, it can be concluded that the estimated total friction torque is sufficiently accurate and that the joint trajectory tracking performance of  
and controller were developed by the authors in DSP and PC. The developed driver consisted of a TI DRV8301-HC-EVM board attached to a microcontroller unit TMS320F28035. The communication mode between the driver and the controller was the serial communication. The supply voltage was 24 volts. The controller algorithm was classical inverse dynamics control. It should be known that the gravity term should be ignored in the controller when there is no payload. The control and sampling periods were set to 1 ms. Two types of experiments, a velocity step experiment and a sinusoidal trajectory tracking experiment, were conducted. The velocity step experiment was performed to determine the appropriate gain coefficient \(K_{\mu}\) because the actual friction disturbance was not known. In addition, the velocity step experiment was conducted to verify that the observed friction disturbance compensation improved the ability of the controller to obtain a better velocity step response. The sinusoidal trajectory tracking experiment was used to validate that the observed friction torque compensation by the controller can be used to improve the trajectory tracking accuracy. Furthermore, to observe the effects of the velocity magnitude and payload on the observed friction torque and the effects of friction compensation on the trajectory tracking performance, motor low- and high-velocity motion experiments, without payload and with payload experiments, were performed.