# Application of External Torque Observer and Virtual Force Sensor for a 6-DOF Robot
## 2 Related Research
Alongside simple position control, force control has gradually emerged as a prominent trend in robotic arm research [10; 11; 12]. Force sensors are used to measure the contact force at the end of the arm, and they are also utilized to compensate for and fine-tune the position commands. For trajectory tracking, another method is proposed in [13] to adjust the parameters of the internal position control loop based on sensing the force at the end of contact. The experimental results demonstrate that this method can ensure a stable device response. The virtual force sensor utilizes the inverse dynamics equation of the robotic arm to calculate the torque caused by external forces on each axis. It then converts this torque into the end contact force and torque of the arm in Cartesian coordinates using the Jacobian matrix. Using a Kalman filter to reduce torque noise from the driver is advantageous for estimating the external interference torque of each axis. This directly impacts the accuracy of the virtual force sensor [14; 15; 16]. Ref. [17] proposes that temperature influences frictional force. Experimental results demonstrate that the frictional torque produced by a preheated arm is reduced by approximately 33% during high-speed motion [18]. Taking into account the temperature effect mentioned earlier, a temperature effect model is incorporated into the friction term in the inverse dynamics to establish the virtual force sensor. When implementing polishing force control, the root mean square error of the external contact force is reduced from around 27.4 N to 21.4 N. After reviewing the relevant literature on force control and the virtual force sensor mentioned earlier, this paper will employ both traditional mathematical methods and machine learning techniques to compute the external disturbance torque derived from the inverse dynamics model in order to establish a virtual force sensor. This will be used to estimate the external contact force and perform position and force hybrid control. Additionally, the differences between the two methods will be compared. To achieve real-time control of the robot, the EtherCAT system is used with its transmission rate of 100 Mbps to enable the real-time control of the robotic arm [19; 20]. The experimental results show that using EtherCAT as the robot control system can provide a data exchange sampling rate of 10 kHz and a motion control position command control frequency of 1 kHz [21]. Using the EtherCAT control software TwinCAT developed by Beckhoff and ESC as the master controller, and the PIC24H developed by Microchip as the application controller, we verified the feasibility of CANopen over EtherCAT (CoE) and the experimental results demonstrate that CoE is suitable for data collection and motion control [22]. Using the EtherCAT master module IgH, based on the Linux system, to implement the EtherCAT distributed clock can lead to resource preemption problems due to the real-time nature of EtherCAT tasks. As a solution, the Linux system is equipped with a real-time patch to enable the real-time processing of EtherCAT interrupt events. The experimental results show that the synchronization time of the Linux real-time operating system is more accurate than that of the Windows platform, with a standard deviation of approximately 0.236 ns [23]. In the experiment, the real-time performance of the Linux system with RTAI and Xenomai was compared. The results showed that both were superior to using the Linux system alone. It was also found that Xenomai had slightly lower performance than RTAI, but it had a superior architecture, better platform compatibility, and was more conducive to system portability [24]. Therefore, this paper will use EtherCAT for controlling a six-axis robotic arm. TwinCAT will be used on the personal computer, while Xenomai with IgH will be installed on the Raspberry Pi 4B Linux system as the main control platform.