# Event-Based Emergency Detection for Safe Drone
## 3 Proposed Methodology
### Event-Based Control Mechanism  
To explain the time-window mechanism in a logical order, even before the event-based emergency-detection system operates, the integrated low-level sensor-based controller will accept sensor data inputs and perform an internal control loop. After the low-level controller involvement, the event-based controller would diagnose emergencies based on time-window mechanisms, as shown in Figure 3.  
If the drone has reached the waypoint, the event-based controller will check whether the arrival time is in-bound of the pre-designated time-window. However, during the interval, the controller would simultaneously check whether the T\({}_{\text{max}}\) (maximum acceptable time) was exceeded. If the time is exceeded without arriving at the waypoint, it will diagnose an emergency and command the drone to perform an emergency landing. If  
Figure 2: Proposed safe drone architecture. We mounted our event-based controller on top of low-level controllers and expanded the decision-making system. Inside the event-based controller, the knowledge base stores the time-window data (e.g., T\({}_{\text{min}}\), T\({}_{\text{max}}\)) for each waypoint that is used in path-traveling drone operations.  
the arrival time is earlier than the T\({}_{\text{min}}\) (minimum acceptable time), the controller will command the drone to perform an emergency landing as well. In other cases where the drone has arrived within the time-window, the controller will either allow the drone to proceed to the next waypoint or perform the final landing procedure, as shown in Figure 4.  
As a result, our event-based controller would be able to detect both early arrivals and late arrivals. By restricting the drone's maneuvering time interval, we expect to provide a strict standard for drone controls and further ensure fail-safe missions.  
The theoretically ideal implementation of our event-based controller is to only operate in a discrete manner based on events such as waypoint arrivals and exceeding  
Figure 4: Control flowchart illustrating the control loop implemented in the event-based controller. The event-based controller will not accept both early and late arrivals at each designated waypoint. If the drone does not arrive inside the time-window, the event-based controller will consider the situation an emergency.  
Figure 3: Visual illustration of the time-window. 1 (T\({}_{\text{start}}\)) is counted when the drone leaves a waypoint and starts to head to another. If the drone arrives the waypoint at 2�, it is considered a too-early arrival, which is an abnormal situation. 3 is the minimum time boundary of a normal arrival. If the drone arrives at 3�, which is inside the normal boundary, it is considered a normal arrival and the drone would proceed to the next goal. As the drone passes 5�, which is the maximum time boundary, the time exceeds T\({}_{\text{max}}\) (max time), making the controller believe it is detecting an emergency and proceed with an emergency landing.  
time-windows. However, for the practicality of the algorithm, we recommend applying waypoints at narrow intervals to increase the diagnosing cycles and improve the calculation and control accuracy.