# Unmanned Aerial Traffic Management System Architecture for U-Space In-Flight Services
## 4 UTM System Architecture
### Monitoring  
The functionality of the Monitoring module is to monitor the state of the airspace and to detect potential conflicts or threats that need to be managed by the UTM system. In particular, the module deals with conflicts related with UAS trajectories. Thus, it detects: (i) whether a UAS gets out of its reserved flight volume; (ii) whether it is in conflict with a geofence; or (iii) whether two UAS lose a minimum required separation. For that, the Monitoring module periodically reads information from the DB about the UAS tracks and the geofences, and it analyzes that information to determine when a threatening situation should be reported to the EM. When the Monitoring notifies the EM, it indicates the type of the detected threat, a prediction of the time instant when the event will occur and a snapshot with the current predicted trajectories of the involved UAS. This last piece of information is sent so that the modules resolving the conflicts use exactly the same data to evaluate the situation and hence, time glitches and incoherent solutions are avoided. The first type of issue that is evaluated by the Monitoring module is related to the _Operational Volume_ that is reserved by each UAS operation (see Figure 6). The Operational Volume is a 4D space that consists of a 3D volume around the flight plan with a temporal component representing the time that the volume, as part of an operation, will be reserved in the U-space ecosystem. The Operational Volume is composed by: the _Flight Geometry_, which defines the volume of airspace where the UAS is intended to remain during its operation; and the _Contingency Volume_, which is an outer surrounding volume to account for environmental or performance uncertainties. The closest distance between the current UAS position and its flight plan is computed to determine whether the UAS is out of its Operational Volume. Figure 6: Graphical representation of the Operational Volume of a UAS operation (the orange arrow represents its radius). Given a flight plan, the green cylindrical volume around would represent its Flight Geometry (the green arrow indicates its radius), whereas the outer volume is the Contingency Volume. In addition, this module monitors possible intrusions in geofences. For that, every waypoint belonging to the predicted trajectory of each UAS is compared against the active geofences, to determine whether the UAS is already intruding a geofence or it is estimated to enter one in a short future time. This check is carried out in 4D, i.e., the 3D volume of the geofence and its activation time are taken into account. More specifically, apart from checking the waypoint altitude with the minimum and maximum altitudes of the geofence, an evaluation on the horizontal plane is done depending on the shape of the geofence. If it is cylindrical, the distance of the given waypoint to the cylinder center is computed and compared with the geofence radius. If the geofence is defined by a polygonal shape, the _signed angle_ method is applied. This method computes the sum of the angles between the segments that connect the test waypoint and each pair of points in the polygon. If this sum is \(360^{\circ}\), the waypoint is within the polygon, whereas it is outside if the sum is \(0^{\circ}\). Figure 7 depicts an example. Finally, the Monitoring module checks whether there is any loss of separation between UAS that needs to be notified. This check is done with a geometrical approach whose details can be seen in [33]. Basically, the idea is to discretize the airspace to model it as a 4D grid (see Figure 8), where each cell represents a 4D volume in space and time (\(dX\), \(dY\), \(dZ\), \(dT\)) and stores a list of all the UAS whose trajectory is estimated to be inside. Thus, each waypoint of a UAS trajectory only needs to be compared with other waypoints within the neighboring cells (space and time neighborhood). For each waypoint in the 4D grid, the distances to the waypoints in the lists of its neighboring cells are calculated.