# Unmanned Aerial Traffic Management System Architecture for U-Space In-Flight Services
## 4 UTM System Architecture
### Emergency Management  
The Emergency Management module is the component of the UTM system that handles the threatening or unexpected situations in the U-space ecosystem. The module centralizes all the information related to the events that may become a threat, either due to conflicting UAS operations or to external warnings (e.g., a jamming attack or a bad weather situation). After analyzing the threatening events, the EM determines which are  
Figure 8: A 4D grid representation of the airspace. The dark grey cells would be the neighboring cells of the black cell. Figure 7: The signed angle method is used to evaluate whether a tested waypoint (black dot) is inside or outside a polygonal geofence. (**Left**), an example where the angles of an external waypoint sum up to \(0^{\circ}\). (**Right**), an interior waypoint whose angles sum up to \(360^{\circ}\). the recommended actions to resolve the conflicts, and it sends them to the corresponding UAS operators. The EM is a central module in the UTM architecture and, as such, it interacts with the Monitoring, the USM, the DB, and the TD. The possible threats or conflicts are notified to the EM by the Monitoring or the USM modules. The former reports about conflicts related with the UAS flight plans, as it was explained in Section 4.4. The latter reports about external warnings coming from UAS technical issues, UAS operators or auxiliaries stakeholders in the U-space. For instance, this is the case of a jamming attack, a bad weather forecast, the declaration of a wildfire by the fire brigades or any other threatening event notified by emergency corps. Depending on the severity of each threat, the EM executes a decision-making procedure to determine the best possible actions to solve the conflict [34]. In this procedure, the EM takes into account the current flight plans for the involved UAS, the priority of their operations, and other restrictions in the airspace like the geofences. As output, the EM can decide to take three different types of actions: (i) to send a specific command to a particular UAS to terminate the flight, to go back to the flight plan, etc. ; (ii) to create a geofence to isolate the detected threat; and (iii) to propose an alternative flight plan to one or several UAS to resolve the conflict. In the first type of action, the EM acts, sending a notification to the corresponding UAS operator through the USM. In the second type of action, the EM creates a geofence and it interacts with the DB in order to update the database with geofences. In the third type of action, the EM sends the alternative recommended flight plans to the USM, which is in charge of forwarding them to the corresponding UAS. For the computation of these alternative plans, the EM receives the support of the TD module, which is requested to compute a series of alternative routes for the involved UAS, depending on the situation. The TD generates these routes by applying a set of predefined maneuvers for each UAS (see Section 4.6). Then, the EM selects which are the best alternative routes for all the UAS in conflict by minimizing the following value function:  
\[\sum_{i=1}^{N}\sum_{j=1}^{M}\alpha\cdot c_{ij}+\beta\cdot r_{ij}\ ; \tag{1}\]  
where \(N\) and \(M\) represent the number of conflicting UAS and the number of available maneuvers for each UAS, respectively; \(c_{ij}\) is the cost incurred if the UAS \(i\) executes the route \(j\); \(r_{ij}\) is the riskiness associated with the route \(j\) executed by the UAS \(i\); and \(\alpha,\beta\in[0,1]\) are the optimization weights. Each type of UAS maneuver considered by the TD will generate an alternative route for the UAS, with an associated cost and riskiness. The former is related to the additional time that the UAS has to travel to execute the route, while the latter measures the risk level of the route, e.g., how close it comes to other existing flight plans or geofences. The values of the weights assigned to the two terms need to be tuned by a human designer.