# Event-Based Emergency Detection for Safe Drone
## 3 Proposed Methodology  
Our proposal is an event-based emergency detection method using the temporal (time) scope as a diagnosis method. The main idea of the time-window is to expect the drone to arrive at certain waypoints in a definite time-window [22]. The goal of this is to make sure there is no internal or external failure that affected the mission in any means by assuming that if the drone does not make it in time there is an issue.  
Many unexpected emergency conditions could possibly occur during autonomous drone missions, which are not easy to detect without strategic control methods. We designed our control method to operate in conjunction with existing control methods and handle abnormal situations, whereas the basic functionalities of a drone such as sensing and controlling are done with PID-based low-level control algorithms.  
We defined a safe drone framework to handle unexpected situations with our event-based intelligent controller operating in conjunction on a high-level with a mission controller in the middle and a PID controller at a low-level as shown in Figure 1[23]. The event-based intelligent controller uses the time-window for abnormality detection while the two other controllers work on the drone maneuver controls. The mission controller is a mid-level controller for path planning and navigating designed based on other studies (e.g., [24; 25; 26; 27; 28]).  
A time-window is a temporal scope with a minimum-acceptance time and maximum-acceptance time. The significance of this approach is that it is capable of handling emergency situations even without diagnosing the specific cause and situations. The individual time values (Tmax-initial, Tmin-initial) for each waypoint interval should be calculated before flight operations.  
During the flight, our controller will retrieve the current time and the state of the drone. The state of the drone includes information on which waypoint interval the drone is passing currently. By calculating the Tstart (the actual time the drone left the last waypoint) and the values of Tmax and Tmin, the drone can determine the finalized time-window Twindow. The calculation of the variables and the time-window is detailed below with definitions and Equations (1)-(4).  
Let Texp-int be the expected interval time from one waypoint to another.  
Let \(\alpha\) be the rate of maximum late arrival acceptance, and let \(\beta\) be the rate of maximum early arrival acceptance.  
Then we defined the maximum and minimum acceptable interval time as below.  
\[\text{T}_{\text{max-initial}}=\alpha\times\text{T}_{\text{exp}} \tag{1}\]  
\[\text{T}_{\text{min-initial}}=\beta\times\text{T}_{\text{exp}} \tag{2}\]  
Let Tstart be the actual time the drone left the previous waypoint.  
Then we defined the maximum and minimum acceptable time as below.  
\[\text{T}_{\text{max}}=\text{T}_{\text{start}}+\text{T}_{\text{max-initial}} \tag{3}\]  
\[\text{T}_{\text{min}}=\text{T}_{\text{start}}+\text{T}_{\text{min-initial}} \tag{4}\]  
where Tmin < Twindow < Tmax  
Let Twindow be the acceptable time-window range for the interval maneuver.  
Texp-int from the above equations is a statistic average value of a time interval from one waypoint to another. It is calculated by a function that takes the distance between two specific waypoints. In our case, we applied environmental wind in two opposing directions with the amount of maximum wind speed our drone can handle.  
Figure 1: Proposed safe drone framework. The event-based intelligent controller is designed to detect emergency situations with time-window check results and perform an emergency landing if needed. We mounted our event-based controller on top of lower-level controllers and designed it to work in conjunction. Our proposing method requires waypoint-based predefined flight plans in order to calculate the expected time-window and diagnose abnormality.