# Development and Testing of a Two-UAV Communication Relay System
## 4 Software Development
### Software Realization of Relay Process
First, the data loss rate and bit error rate (BER) were measured in the laboratory environment to choose the suitable data transmission rate for the relay system. Then, for outdoor tests, Received Signal Strength Indicator (RSSI), a measurement of the power present in a received radio signal, was measured. The RSSI value scales as 1.9\(\times\) the dBm signal strength, plus an offset, which means the RSSI is proportional to the dBm [35]. We tested both UAVs in two typical application scenerios in Hong Kong: one was to cross obstacles and the other was to extend the communication range. Finally, a BLOS demonstration was conducted to show the rundown and results of a whole application process in Taiwan. Notably, when the transmission power of the telemetry module is set to the maximum value, which is 20 dBm (100 mW), the typical range achieved using standard configuration and antenna is around 500 m. Due to the stringent flight regulation and the area constraint of the test site in Hong Kong, it is almost impossible for the authors to test the beyond-line-of-sight flight and the maximum power relay which would exceed the allowed flight area. Therefore, to demonstrate the relay function in Hong Kong, the authors have adjusted the transmission power of the radio to its minimum value (1/10 of the max.) so that the radios will disconnect at about 100 m. In this way, the relay methods can be tested in a relatively small area, otherwise, the telemetry modules will always be connected. In missions requiring long distance communication, the transmission power can be easily turned to a maximum value to get the best communication range. ### Indoor Tests

To investigate the reliability of our radio communication relay, the data loss rate and the BER were first tested indoors. Verifying the data loss rate and BER in an indoor environment under different data rates gave us knowledge about the usable bandwidth of the system and helped us estimate the maximum data rate that can be used in the flight tests. The GCS was configured to transfer data at a fixed data rate, and the statistics of the received data at UAV \"Son\" were measured. Two aspects of the data transfer were studied: the data loss rate, which is the percentage of data that was lost during transmission (data that was transmitted from GCS but was not received by UAV \"Son\"); and the BER, which was the percentage of data that was received by \"Son\" but did not pass the CRC test. Tests were conducted at four different data rates: 4 kilobits per second (kbps), 8 kbps, 12.8 kbps, and 16 kbps. Figure 14 shows the setup of the test. The percentages of data loss and BER with respect to the data rate are shown in Figure 15.

Figure 13: Graphic user interface (GUI) of Mini GCS. The tests indicated that when the data rate was equal to or higher than 4 kbps, the data lost percentage rose from 3% to 9% and the data error rate rose from 0.2% to 0.5%, approximately. A higher data rate resulted in both more data loss and a higher chance of data transmission errors. [PERSON] et al. (2017) estimated that the throughput of typical UAV mission commands is less than 10 kbps. In our tests, the current used data rate for a two-UAV system was about 8 kbps. Then, for communication relay applications with this system and configuration, a data rate of 8 kbps is recommended to ensure an acceptable compromised data lose and error rate. ### Cross-Obstacle Test

The outdoor flight tests were first conducted in the International Model Aviation Center of the Hong Kong Model Engineering Club (22\({}^{\circ}\)24\({}^{\prime}\)58.1\({}^{\prime\prime}\) N 114\({}^{\circ}\)02\({}^{\prime}\)35.4\({}^{\prime\prime}\) E). Figure 16 shows the Google map of the test site and final positions of the UAVs in the test. In the simulated cross-obstacle communication relay test, the UAV \"Son\" was designed to conduct a mission that takes off from the \"Home Position\", flies over a part of the forest with tall trees, and then lands on the road across the forest (UAV \"Son\" in Figure).