# Application of External Torque Observer and Virtual Force Sensor for a 6-DOF Robot
## 5 Conclusions  
This article utilized personal computers and Raspberry Pi to create a virtual force sensor for a six-axis robotic arm. It detected external contact forces using a virtual force sensor for applications related to force control. The experiment confirmed that this system can establish an external torque observer and virtual force sensor for a six-axis robotic arm using a dynamic model with both the Raspberry Pi and personal computers. It was applied for force detection, and collision detection mechanisms were implemented using an external torque observer. The position and force hybrid control framework was achieved using the virtual force sensor. In terms of the dynamic model, this article compared the torque estimation effects of traditional mathematical models and machine learning models using personal computers and Raspberry Pi. The experimental results demonstrate that the correlation coefficient between the torque estimated by the dynamic model established using the mathematical model on the Raspberry Pi system and the actual torque was approximately 0.985. This value is higher than the correlation coefficient of the dynamic model established using the traditional mathematical model [4]. These findings provide evidence for the feasibility of torque estimation using the mathematical model. The correlation coefficient between the torque estimated by the machine learning model established using personal computers and \begin{table}
\begin{tabular}{c c c} \hline \hline  & **MAE (N)** & **RMSE (N)** \\ \hline \(F_{2}=20\) & 11.1700 & 16.2204 \\ \(F_{2}=30\) & 9.0563 & 10.5321 \\ \(F_{2}=40\) & 9.6231 & 11.1620 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Comparison of the force sensor and virtual force sensor. Figure 16: Results of the contact force control experiment: desired forces of 20 N (**a**), 30 N (**b**) and 40 N (**c**). the actual torque was approximately 0.988. This is higher than the correlation coefficient of the dynamic model established through the mathematical model on the Raspberry Pi system. This result demonstrates the feasibility of establishing a dynamic model through machine learning. The external torque observer and virtual force sensor were established through machine learning, and the accuracy of the virtual force sensor was affected by motor driver noise and model accuracy. The correlation coefficient of the estimated contact force was approximately 0.75, and the RMSE was approximately 13 N, which is better than the results obtained in [17; 18]. Through the collision detection experiment of the robotic arm, it was verified that the external torque observer established through the dynamic model in this system could stop the motion of the robotic arm within the recommended safety range in [25], improving the safety of human-robot collaboration. In the position and force hybrid control experiment, the control results of using the machine learning model to establish the virtual force sensor in personal computers and using the mathematical model to establish the virtual force sensor in Raspberry Pi were compared. From the experimental results, it can be observed that when the controlled contact force was 40 N, the utilization of the machine learning model on personal computers yielded control results with a Mean Absolute Error (MAE) of approximately 9.24 N and a Root Mean Square Error (RMSE) of approximately 14.60 N. On the other hand, when using Raspberry Pi, the MAE was approximately 9.62 N and the RMSE was approximately 11.16 N. It can be concluded from the experimental results that the position and force hybrid controller established using Raspberry Pi could achieve superior control outcomes. In subsequent fixed force control with different target contact forces, it was found that this system had better performance when controlling a fixed force of 30 N and 40 N. The accuracy of fixed force control not only depends on the estimation accuracy of the dynamic model but also on the command update rate of the controller.