# Designing a Reliable UAV Architecture Operating in a Real Environment
## 1 Introduction
Of course, the development of complete and consistent system models (GCS and UAV) does not guarantee that the prepared models do not contain any errors. In recent years, intensive work has been carried out on developing formal verification mechanisms for models prepared in SysML or UML [8]. Based on the UML-based scenario description methodology and the previous FHA decomposition, the process of designing and describing algorithms that support the occurrences of emergency situations during the flight takes place. Complex numerical algorithms are often used, the correctness of which must be proven. An example of such an algorithm is provided in the article [9]. The article presents the design of an algorithm for avoiding collisions between aerial platforms. The algorithms supporting safety also include algorithms for checking the correctness of the operation of GPS systems, algorithms for checking the possibility of a potential collision with terrain or other platforms, etc. Depending on the purpose of the air platform and the areas in which it can operate, the list of algorithms handling emergency situations can be very long. Each of these algorithms can have high computational complexity. Hence, appropriate onboard computers are selected depending on the class of the air platform. The article presents a description of the algorithm for avoiding collisions with another platform in the air, which is implemented on a medium-range UAV. Due to the size of the platform, the algorithm is implemented not only on GCS but also in the software of the platform itself. Due to its complexity, a separate thread of the onboard computer processor is allocated. However, it is not possible to assign one processor core to check the occurrence of each specified emergency situation (platforms of this type are too small). The article presents a formal way of modeling such an emergency situation from the stage of definition of action in the form of a Use Case in UML, through detailed State Machine models, to formal mathematical models. The final step in the design process is to design system testing procedures based on mission simulators and air tests. It is also necessary to develop the principles of documentation of the most critical procedures affecting flight safety and the documentation of the tests performed. An example of system tests is shown in the article. Testing guidelines can be found in the DO-178 [10] methodologies. This article presents the architecture concept for an unmanned aerial platform, which must operate in unfavorable environmental conditions, such as flight in an area with a large number of other air platforms. The methodology of designing a reliable UAV architecture, which can be used for autonomous flight, was presented. It is possible thanks to integrated algorithms such as detections and avoidance of collisions with other UAVs or detection of collisions with terrain obstacles. A method of modeling an unmanned platform operation scenario was also presented, in which algorithms for detection and avoidance of situations threatening the platform's security are integrated. Formal methods based on UML notation are used to describe the problem presented like the method of transforming the requirements described in the so-called Use Cases in UML on diagrams describing the dynamics of the system. In this article, we mainly rely on State Machines, which are the basic method for modeling the operation of real-time systems. A special case presented in the article is the automatic correction of the flight route to eliminate the possibility of a potential collision in the air with another platform. The article assumes that each of the platforms is equipped with the ADS-B (Automatic Dependent Surveillance Broadcast) system, which allows identifying the platforms' and the directions and speed of their movement. Algorithms of this type are usually built into unmanned platforms that fly long distances from the Ground Control Station, because flights at such a distance generate the risk of losing communication with GCS.