Abstract
In recent years, the collaborative robots have been widely used in vast fields, like aerospace, industrial, medical and household. Therefore, in robot collision detection, it is more and more important to ensure the safety of robot system. Compared with the traditional methods of installing sensors, a collision detection algorithm based on neural network (NN) is proposed. The current of the joint is estimated by neural network, and the threshold value is set to judge the occurrence of collision. This algorithm does not need to use the dynamic model of the robot, nor the acceleration. Moreover, the algorithm can be easily applied to existing systems without changing the structure of robots, which reduces the production cost. And a prototype with one degree of freedom (DOF) has been built to verify the validity of the algorithm.
Introduction
In recent years, collaborative robots have been widely used in aerospace, industrial production, medical and other fields. Collaborative robots are robots designed to work with humans in uncertain environments. The main concern is that they do not pose any threat to humans under any circumstances [1]. In complex environments, tight human-computer interaction will inevitably lead to physical contact, Haddadin and Hirzinger [2] outline the potential damage of robotic manipulators to humans, while Haddadin and Luca [3] introduce the main tasks of security protection. It is to detect the occurrence of a collision and determine its position and size. At present, many methods have been proposed for robot collision detection, such as installing torque sensors [4], visual sensors [5,6] or skin sensors [7,8] on a robot manipulator. Although these methods can detect the occurrence of a collision, they also bring many negative effects. For example, the installation of a torque sensor increases the size and complexity of the robot. It requires a redesign of the existing robot manipulator structure, the visual sensor has limited applications because the computational burden can be large in a dynamic environment. The method involves complex wiring, which increases the production can detect the occurrence of a collision, they also bring many negative effects. For example, the in-stallation of a torque sensor increases the size and complexity of the robot. It requires a redesign of the existing robot manipulator structure, the visual sensor has limited applications because the computational burden can be large in a dynamic environment. The method involves complex wiring, which increases the production cost to the field of sensorless collision detection.
The sensorless collision detection method is mainly based on the following principle: the collision is detected according to the slight deviation of the dynamic behavior of the structure during the movement of the robot or the collision force. At present, some researchers have proposed some problems in the sensorless collision detection algorithm [9,10], that is, they need to establish an accurate robot dynamics model when estimating the collision force, and the acceleration calculation is also introduced in the calculation process. In practice, the acceleration generally contains noise and is difficult to estimate, and it is difficult to accurately estimate the change in the attitude of the robot.
Due to the development of machine learning algorithms, the nonlinear properties and learning ability of NN make neural networks an advantageous solution to robot collision detection. Therefore, this paper proposes a NN-based sensorless collision detection algorithm. In this paper, neural network is used to replace the dynamic model of robot, and the detection threshold is set according to the current error estimated by neural network. In the process of calculating the current error, the algorithm can be easily implemented into the robot system without any additional sensors or acceleration information with noise. In addition, by using NN, the collision detection algorithm proposed in this paper can be more adaptive to the changes and uncertainties of the robot model, and does not require any optimization of the existing robot structure. Finally, the validity of the detection algorithm is verified by simulation and experiment.
Preliminaries
In order to make robot cooperate with human physically, a control strategy is proposed to detect the physical collision and interaction between human and robot. And this strategy only needs to measure the motor current, displacement and velocity information from the encoder of the robot joint.
Robot dynamic model
The dynamic model of an n-DOF robot manipulator can be described as follows:
Therefore, Eq. (3) can be rewritten as follows:
By substituting Eqs (2) into (6) and set 1∕T
c
= c (where c is constant), the expression for the estimated current
In this study, a 3-layer NN is built to estimate the current error and the proposed detection scheme is illustrated in Fig. 1.

Block diagram of proposed detection algorithm.
It can be seen from the Fig. 1 in each control cycle, the generated random trajectory is used to drive robot manipulator’s movement, and the estimated current and measured current are obtained from NN and encoder respectively, and the error between them is calculated to determine the collision detection threshold. If the error is below the pre-defined threshold, the controller determines that the manipulator is not affected by external forces and continues to work along the current trajectory. Meanwhile, the weights and biases of the NN are updated. However, if the error exceeds the detection threshold, the manipulator controller will be converted to the collision response module to stop the manipulator or change the current trajectory.
The performance of the proposed algorithm is demonstrated through Adams simulations. Like Fig. 2 a 2-DOF manipulator is considered, and we assumed each link is a uniform rod, with weight of 2.68 kg. The Denavit–Hartenberg (DH) notations of the simulated 2-DOF manipulator are listed in Table 1.

2-DOF robot manipulator.
DH notation of simulated 2-DOF manipulator
To create a powerful NN, the most important thing is the generation of the data set used in training. The data set should include all trajectories that affect the dynamics of the manipulator. During the execution of these trajectories, all the joints of the manipulator move simultaneously at every position between its boundaries. Therefore, n random trajectories are generated as inputs to the Adams simulation model, and the joint torque of the manipulator are obtained. Considering the existence of noise during the operation of the manipulator, random noise is added to the torque of each joint, and the current is calculated according to the Eq. (2).
Firstly, the NN is trained without collisions. The simulation is conducted with the sampling period of 2 ms. And NN consists of 6 input neurons, 20 hidden layer neurons and 2 output neurons. The inputs of NN are: joint 1 angle, velocity and previous current, joint 2 angle, velocity and previous current. Before the training starts, the 161014 datas having previously retrieved is partitioned in three sets: the training set, the validation set and the testing set with ratio 90/5/5 respectively, in order for overfitting to be avoided and better generalization to be achieved. After multiple training and initialization, it was found that when the learning rate was 0.001, the momentum coefficient was 0.9, and after 366 iterations, the lowest MSE value is obtained as shown in Fig. 3.

The lowest MSE value.
The predicted current and error value of each joint when without collision is shown in Fig. 4. According to the prediction results of the NN, the maximum value of the absolute values of the current error is 0.06761 A, and the detection threshold in this study will increase by 10% based on this value, which is to avoid the threshold being too small and causing misjudgment. Therefore, the detection threshold is set to ±0.07347 A. During the operation of the manipulator, three collisions are randomly added to the end of the Link 2. The collision start time is t = 2 s, t = 6 s and t = 11 s. The results of collision detection is shown in Fig. 5.

The predicted current and error.

Collision detection results of each joint.

Experiment platform.

The lowest MSE value.

The predicted current and error.

Collision detection results.
As can be seen from Fig. 5, all collisions were successfully detected in the two links. The detection time is calculated as the elapsed time from the start of a collision to the moment when the current error by the trained NN exceeds the threshold. From the Fig. 5, the joint 2 first detected the occurrence of each collision and the detection time is 0.106 s, 0.454 s and 0.65 s respectively.
In order to evaluate the feasibility of the proposed algorithm, experiments are performed using the system shown in Fig. 6. A 20 cm aluminum link is directly attached to a 400 watt servo motor to form a 1-DOF system, and a PC running Win.7 is used as the controller to program the movements of the robot manipulator and another one is used to collect data. A multi-motion controller (MMC) board is used to connect with the host PC through PCI bus. The servo driver outputs the value of the encoder to the host PC in real time.
In this experiment, the MMC is used to set the rotation of the motor at different velocity. Similarly, the angle, velocity and current data of the manipulator in no collision are collected as the input of NN. A total of 41000 datasets were collected and NN consists of 3 input neurons, 14 hidden layer neurons and 1 output neurons. When the learning rate was 0.001, the momentum coefficient was 0.9, and after 636 iterations, the lowest MSE value is obtained as shown in Fig. 7. And the predicted current and error value of joint when without collision is shown in Fig. 8. From the figure we can get the maximum value of the absolute values of the current error is 0.05572A, therefore, the detection threshold can be set to 0.06686A. After that, the manipulator re-runs and a collision occurs. It can be seen from the Fig. 9 that the proposed algorithm successfully detected the collision.
Conclusion
In this paper, a novel collision detection method based NN algorithm is proposed, which does not require the complex system dynamic model and acceleration. And from the above simulation and experiment results, it can be seen that the proposed method is easily implemented to existing systems without changing the structure of the robot manipulator and does not require additional sensors. Meanwhile, there is still a lot of work to be done, such as the use of dynamic threshold detection and other aspects of research.
