UAV Collision Detection Algorithm based on Formulafor Fast Calculation

Collision Avoidance System (CAS) is known as a pre-collision system or a forward collision warning system, and research has first begun as a vehicle safety system. In this paper, we propose an algorithm for collision detection of UAV. The proposed algorithm uses a mathematical method and detects the collision of the UAV by modeling it in a twodimensional plane. Using the mathematical modeling method, it is possible to determine the collision location of the UAV in advance. Experiments were conducted to measure the performance and accuracy of the proposed algorithm. In the experiment, we proceeded assuming three environments and were able to detect an accurate collision when the UAV moved. By applying the algorithm proposed in the paper to CAS, many collision accidents can be prevented. The proposed algorithm detects collisions through mathematical calculations. In addition, the movement time of the UAV was modeled in a 2D environment to shorten the calculation time.


Introduction
A drone was used for the first time for military use, but recently the market is rapidly growing for agricultural, service, and leisure purposes. As the market has grown rapidly, many hobby and leisure drones that can be purchased at low cost have become popular. However, as many drones are used, many accidents are occurring. For example, drone battery explosions, fires, injuries caused by collisions with drones, and safety accidents such as falls and collisions due to deviation from the adjustment distance are rapidly increasing. For this reason, a Collision Avoidance System(CAS) is essential in drones or UAV(Unmanned Aerial Vehicle) [1][2][3][4].
CAS is known as a pre-collision system or a forward collision warning system, and research has first begun as a vehicle safety system [5][6][7]. CAS research has been conducted in various fields as well as in the automobile field, and research is rapidly progressing in the field of aircraft and UAV. Although there are various studies related to CAS, the basic algorithm of CAS is to create a safe travel path without causing a collision from a starting point to a target point. The CAS structure is composed of three elements: search, recognition, and avoidance. Among the elements, search and recognition are responsible for collision detection. And the evasion performs a collision avoidance mission. For UAVs to perform their CAS mission, it is necessary to identify and collaborate with the surrounding environment when first flying. At this time, the obstacle information of the environment can be collected in real time through the mounted sensor of the board [8][9][10].
Since the UAV moves in autonomous driving without a pilot, a powerful CAS must be used. UAVs are much cheaper to operate than human-controlled airplanes. It is also more suitable for performing dangerous or repetitive tasks that are difficult for humans to perform. Because of the above advantages, UAVs can be used for civilian tasks such as mapping and rescue, or for military missions such as patrol and search. To perform this specific task, multiple UAVs can be used at the same time, and each UAV must establish a mobile sensor network. In addition, UAVs must have communication, navigation, and collision avoidance functions [11][12][13][14].
In this paper, we propose an algorithm for collision detection of UAV. The proposed algorithm uses a mathematical method and detects the collision of the UAV by modeling it in a two-dimensional plane. Using the mathematical modeling method, it is possible to determine the collision location of the UAV in advance. An additional reason to use mathematical models is performance. When the UAV driving mode is changed from a simple navigation mode to a collision detection mode, real-time processing performance of collision detection is important. Using the proposed algorithm, it is possible to determine the time until the collision of the UAV, the travel distance, and the collision point.

2.
Proposed Method UAV collision detection algorithm proposed in this paper models UAVs moving in three dimensions in two dimensions and expresses them with equations. Some assumptions are made for fast computation of the algorithm. Because it aims to detect collisions between UAVs, the UAV is moving and the initial and final positions are not considered. Figure 1 shows the situation in which collision occurs in two dimensions.

Proposed Method
In this section, we describe the equations that form the basis of the algorithms we want to present in our study. This formula is used to detect collisions and calculate collision points.

Collision Point between UAVs
As shown in Figure 2

454
To detect collisions between UAVs, the coordinate values of the two UAVs must be continuously monitored. That is, when two UAVs have the same coordinates ( = ), a collision occurs. Assuming that the coordinates of the two UAVs are the same, we can organize the expressions by . = . and . = . . Summarizing the previous equation, the equation is (6).
In order to determine whether two UAVs collide, we need to make sure that both UAVs converge to one point. That is, it is possible to determine whether collision occurs by evaluating whether, and are values between 0 and 1. That is, when the two conditions in Equation (8) are satisfied, the collision point occurs in the UAV moving line.
Although the predicted point of collision can be predicted by Equation (8), additional considerations must be taken to actually detect the collision. An additional consideration is the travel time of the UAV. The time at the current location of the two UAVs is compared, and if the difference is smaller than the threshold, collision avoidance should be performed. It is assumed that the current time of each UAV is and . When the difference between the two UAVs' current time is less than the threshold value, a collision occurs between the UAVs. At this time, the time difference must be less than the threshold value and greater than 0. In this case, the threshold value should consider the operating environment of the UAV and the hardware characteristics of the UAV.

Collision Detection
Algorithm 1 describes a collision detection technique based on the section 2.2. This algorithm is performed when the UAV is on the move. Periodically, and values are obtained, and when these values are between 0 and 1, and values are additionally obtained. When the difference between the values of and is less than , a collision avoidance operation is performed in anticipation of a collision. 1  2  3  4  5  6  7  8  9  10 let, is a threshold of time while moving UAVs do calculate the and ; if ( 0 < < 1) && (0 < < 1) ) then get current time of two UAVs, and ; if ( 0 ≤ | − | < ) then perform the collision avoidance; end end end

Results and Discussion
In order to verify the proposed algorithm, a simulation experiment was conducted. The experiment was performed assuming that the UAV was moving in a 2D environment. The experiment was divided into three categories. 1) When there is no collision point, 2) When an intersection occurs and a collision is expected. 3) When an intersection occurs but there is no collision. As such, experiments were performed based on three scenarios, and the detailed experiment environment is shown in Table 1.  , and as a result, Figures 3, 4, and 5 were obtained. In Figure 3, the two UAVs move horizontally at the same speed, so there are no intersections and collisions. That is, when ma and mb are calculated by Equation 7, the denominator becomes 0, so and cannot be obtained. This means that when two UAVs move, they do not intersect at the time 1 and 2 . Figure 4 shows the results of Category 1. Like Category 1, two UAVs are moving at the same speed. At this time, if the values of and are obtained using Equation (7), each is 0.5, which is greater than 0 and less than 1. It can be seen that a collision occurs at time 1 at (0,0). Figure 5 shows the results of Category 3. The two UAVs are moving at different speeds. At this time, if the values of ma and mb are obtained using Equation 7, each is 0.5, which is the same as the result in Figure 3. Calculating the intersection point of the UAV is (0,0), but no collision occurs. That is, because two UAVs move at different speeds, each UAV is sufficiently far away at the time 1

Conclusions
In this paper, we propose an algorithm to detect collisions that may occur when UAVs move. The proposed algorithm detects collisions through mathematical calculations. In addition, the movement time of the UAV was modeled in a 2D environment to shorten the calculation time. To use the collision detection algorithm, two values require the current location and time of the UAV. In order to evaluate the proposed algorithm, a simulation experiment was conducted, and as a result, it was possible to accurately determine whether or not a collision occurred. Future studies will further refine the UAV crash situation and add more variables for calculation.