Medical Drone Managing System for Automated External Deﬁbrillator Delivery Service

: One of the common causes of a heart attack is ﬁbrillation, a condition that causes an irregular and often abnormally fast heart rate. There is scientiﬁc evidence that the survival rate of sudden cardiac arrest patients who are rescued with cardiopulmonary resuscitation (CPR) and with the use of an automated external deﬁbrillator (AED) is signiﬁcantly increased. Despite the recommendation that automated external deﬁbrillators should be installed in the workplace, along with a proper management system and training for employees on how to use the device, less than 70% of non-residential areas have an AED installed. The situation is even worse in residential areas, with less than 30% having an AED installed. This research concerns the development of a medical drone managing system that can deliver an AED in case of emergency. An application was developed that can be installed on the mobile phone and/or tablet of the patient or the accompanying person. In the event of a heart attack, the patient or the accompanying person can call a medical drone by sending coordinates to the drone station and a notiﬁcation to medical staff. The drone station administrator can respond by sending the drone, which automatically lands at the patient’s location. After being tested in a simulation situation, the operational ﬁeld test yielded satisfactory results. The medical drone can land within 1.5 m of the destination. The designed AED drone can be used not only to deliver AEDs, but also ﬁrst aid kits and prescribed drugs suitable for medical care. Such a system is especially useful in the current context of the COVID-19 pandemic.


Introduction
Heart disease, along with stroke and blood vessel disease, belong to the group of conditions together known as cardiovascular disease (CVD). Cardiovascular disease is a leading cause of death in Thailand, with 60,372 deaths attributed to CVD in Thailand in 2018 [1]. Cardiovascular disease can occur when arteries that supply blood and oxygen to the heart muscle become clogged with fatty material called plaque, blocking the blood supply to part of the heart, which can cause a heart attack. Cardiopulmonary resuscitation (CPR) is an emergency procedure that can help heart attack patients. When started immediately following cardiac arrest, CPR can double or triple the victim's chance of survival. However, CPR can only keep blood flowing to the heart and brain for a time. To restore the heart's normal rhythm, a device called an automatic external defibrillator (AED) must be used. It has been recommended that automated external defibrillators should be installed in the workplace, along with a proper management system and training for employees on how to use the device, which can hence increase the survival rate of heart attack patients by up to 75% [2]. Despite the recommendation, data obtained from the Swedish Register for Cardiopulmonary Resuscitation indicate that less than 70% of non-residential areas and less than 30% of residential areas have an AED installed [3]. many startups have launched drone managing systems that support delivery services. Flynow [11] is a cloud-based drone management solution that is easy to set up, cloudconnected, and easy to operate. The drone-in-a-box (DiaB) system of Flynow can control and manage a fleet of drones and a docking station remotely over the cloud via a single cloud-connected dashboard. Flynow has been successfully applied in medicine with the sky project in India, a project that bridges the gap between the medical facilities available to the urban and rural populations by providing medical care to people in remote areas [12]. Flyzip [13] is another drone managing system focused on the various operational aspects of drone delivery operations. Flyzip offers the operator a web-based dashboard that enables the user to plan and execute the delivery missions requested by the dispatcher remotely. It also provides autonomous vision-assisted precision landing on docking stations and charging pads, and precision hovering at the delivery location for dropping the package from a safe distance. Both Flyzip and Flynow are commercial drone managing systems that require high costs for first-time setup and annual fees.
In our research, we developed a low-cost medical drone managing system that can automatically deliver automated defibrillators to patients suffering a heart attack. The designed drone chassis used in our DIY drone is a carbon-fiber type due to its light weight and high strength. The drone chassis is installed with an AED storage compartment. The Schiller AED is used in our autonomous medical drone system. The total weight is approximately 5 kg. The system can also be applied to deliver other medical products including blood reservoirs, medical supplies, first aid kits, and prescriptions. The salient aspects and/or contributions of this paper are enumerated as follows: (1) We developed drone managing software for an AED delivery drone that can be remotely controlled to take off from the ground station and go to the patient, and then return from the patient to the ground station, operated by a drone administrator a few kilometers away. A waypoint between the patient who calls the drone and the drone station is computed and uploaded to the drone for automated cruising. (2) We exploited the real-time application of the PubNub cloud service to exchange information between the patient and the drone. The application enables the patient to request an AED drone from 5 km away. (3) An Android mobile application was developed and installed on the patient's mobile phone. The patient can call the drone in case of an emergency by a single click. The notification is then sent to the drone administrator to launch the drone from the ground station. The drone's geological location is updated and displayed on the mobile application in real time to estimate the arrival time. (4) A drone server application was developed to send the drone manually to any location by clicking the location on Google Maps. When combined with the patient's Android mobile application, this provides a medical drone managing system that can be applied to various medical service including delivering prescription drugs, assisting in road accidents, and delivering first aid kits. The system is especially useful for rehabilitation centers. (5) Our drone dispatching service aims to reduce the delay time between the onset of cardiac arrest and when the notification is received by the dispatcher. At the onset of cardiac arrest, the patient can instantly send a notification and their location to the drone pilot.

Materials and Methods
When a person experiences a heart attack, their survival rate depends on the time elapsed between the onset of the heart attack and the time they are treated with an AED. The aim of our medical drone managing system is to deliver an automated external defibrillator to a patient in less time. The system can respond to the AED request within 5 min for a maximum distance of 5 km. Our system consists mainly of two parts: (i) the drone server and (ii) the mobile application. The drone server functions as a watchdog to monitor AED requests. The mobile application is installed with an in-house application that can Drones 2022, 6, 93 4 of 17 request an AED drone by a single click on Google Maps. The patient's location is sent to the drone server via the PubNub cloud server. When the patient location is received by the drone server, the patient location, drone location, and computed literary waypoints will be displayed on the server's monitor. Once a mission is confirmed, the drone administrator then launches the drone. The AED drone will automatically fly to the patient's location via the literary points. Upon arrival at the patient's location, the drone administrator can switch to manual control for safe landing. The AED drone management system consists of four main parts: (i) the drone ground station, (ii) the drone mobile application, (iii) the cloud server, and (iv) the AED drone. Our AED drone managing system is shown in Figure 1.
for a maximum distance of 5 km. Our system consists mainly of two parts: (i) the drone server and (ii) the mobile application. The drone server functions as a watchdog to monitor AED requests. The mobile application is installed with an in-house application that can request an AED drone by a single click on Google Maps. The patient's location is sent to the drone server via the PubNub cloud server. When the patient location is received by the drone server, the patient location, drone location, and computed literary waypoints will be displayed on the server's monitor. Once a mission is confirmed, the drone administrator then launches the drone. The AED drone will automatically fly to the patient's location via the literary points. Upon arrival at the patient's location, the drone administrator can switch to manual control for safe landing. The AED drone management system consists of four main parts: (i) the drone ground station, (ii) the drone mobile application, (iii) the cloud server, and (iv) the AED drone. Our AED drone managing system is shown in Figure 1.

PubNub Cloud Server
PubNub is a secure global data stream network (DSN) and an easy-to-use application programming interface (API) for enabling real-time capabilities and bi-directional communication for web, mobile, IoT, and backend applications [14]. Simple functions used for bi-directional communication between devices are published messages and subscribed messages. The publish message method is used to send messages to a specified channel name. The publish function requires a publish key, channel name, and message. The subscribe message function works opposite to the publish message function. To receive a message, the message listener is called with a channel and a subscribe key that are the same as those of the device that publishes. Once the message has been received, a callback function is employed to perform some tasks set by the receiving device. One device can be both a subscriber and a publisher in bi-directional communication. In such cases, a publish key and a subscribe key are needed for one device.
In our AED drone, the PubNub cloud server is used to communicate between the drone server and the drone mobile application. The distance between the patient with the drone mobile app and the drone sever can be as far as 5 kilometers. Local Wi-Fi hot spots cannot be applied, and 4G/5G mobile broadband must be used in our autonomous medical drone system for communicating with the PubNub cloud server. The message that is sent between the drone server and the drone mobile application contains the patient's latitude and longitude. In the event of a heart attack, the patient and/or the accompanying

PubNub Cloud Server
PubNub is a secure global data stream network (DSN) and an easy-to-use application programming interface (API) for enabling real-time capabilities and bi-directional communication for web, mobile, IoT, and backend applications [14]. Simple functions used for bi-directional communication between devices are published messages and subscribed messages. The publish message method is used to send messages to a specified channel name. The publish function requires a publish key, channel name, and message. The subscribe message function works opposite to the publish message function. To receive a message, the message listener is called with a channel and a subscribe key that are the same as those of the device that publishes. Once the message has been received, a callback function is employed to perform some tasks set by the receiving device. One device can be both a subscriber and a publisher in bi-directional communication. In such cases, a publish key and a subscribe key are needed for one device.
In our AED drone, the PubNub cloud server is used to communicate between the drone server and the drone mobile application. The distance between the patient with the drone mobile app and the drone sever can be as far as 5 km. Local Wi-Fi hot spots cannot be applied, and 4G/5G mobile broadband must be used in our autonomous medical drone system for communicating with the PubNub cloud server. The message that is sent between the drone server and the drone mobile application contains the patient's latitude and longitude. In the event of a heart attack, the patient and/or the accompanying person will start the drone mobile application. The latitude and longitude of the patient is published to the drone server via the patient channel. The same message is subscribed by the drone server via the patient channel. Once the drone administrator is notified, the drone is launched from the drone station. During the flight, the drone latitude and longitude are sent back to the drone server via remote control radio telemetry before publishing to the drone mobile app via the drone channel. The drone mobile application subscribes to  Figure 2 shows the PubNub cloud service used in our AED drone.
person will start the drone mobile application. The latitude and longitude of the patient is published to the drone server via the patient channel. The same message is subscribed by the drone server via the patient channel. Once the drone administrator is notified, the drone is launched from the drone station. During the flight, the drone latitude and longitude are sent back to the drone server via remote control radio telemetry before publishing to the drone mobile app via the drone channel. The drone mobile application subscribes to the message and updates the drone location on Google Maps so the patient can estimate the arrival time of the AED drone. Figure 2 shows the PubNub cloud service used in our AED drone. Figure 2. PubNub cloud service. In the event of a heart attack, the patient or accompanying person activates the AED drone calling function. The location message is published to the drone server via the patient channel. Once the drone administrator is notified, the drone is launched from the drone station. The drone location is published to the drone mobile application via the drone channel.

Drone Ground Station
The drone ground station is designed to be mobile and can even operate the drones from a van equipped with 4G or 5G signals. The drone ground station consists of (1) the drone server, a powerful computer that uses an Android operating system; (2) the drone station; and (3) the drone server application. Figure 3 shows some parts of the drone ground station.

Drone Server
The drone server is the command center of the AED drone managing system. The main function is to behave like a watchdog waiting for the drone calling command. Our drone server is a high-performance computer running an Android operating system. In this study, we used the Microsoft Tablet Surface Pro7 I5/RAM 8GB/SSD 128 GB Platinum, running an Android operating system. Installed on the drone server is the DJI mobile SDK [15]. The key feature of the mobile SDK is to act as an interface between the drone, the drone remote control, and Google Maps. The mobile SDK displays the drone station icon and the drone icon on the map. In the case of drone calling by a patient, the coordinates of the patient will be sent to the drone server via the PubNub cloud server [16] and the patient icon will be displayed on the drone server monitor. The drone administrator also receives a notification. The decision to deliver a drone or cancel a mission can be made by Figure 2. PubNub cloud service. In the event of a heart attack, the patient or accompanying person activates the AED drone calling function. The location message is published to the drone server via the patient channel. Once the drone administrator is notified, the drone is launched from the drone station. The drone location is published to the drone mobile application via the drone channel.

Drone Ground Station
The drone ground station is designed to be mobile and can even operate the drones from a van equipped with 4G or 5G signals. The drone ground station consists of (1) the drone server, a powerful computer that uses an Android operating system; (2) the drone station; and (3) the drone server application. Figure 3 shows some parts of the drone ground station.

Drone Server
The drone server is the command center of the AED drone managing system. The main function is to behave like a watchdog waiting for the drone calling command. Our drone server is a high-performance computer running an Android operating system. In this study, we used the Microsoft Tablet Surface Pro7 I5/RAM 8GB/SSD 128 GB Platinum, running an Android operating system. Installed on the drone server is the DJI mobile SDK [15]. The key feature of the mobile SDK is to act as an interface between the drone, the drone remote control, and Google Maps. The mobile SDK displays the drone station icon and the drone icon on the map. In the case of drone calling by a patient, the coordinates of the patient will be sent to the drone server via the PubNub cloud server [16] and the patient icon will be displayed on the drone server monitor. The drone administrator also receives a notification. The decision to deliver a drone or cancel a mission can be made by the drone administrator. In the case of the decision to deliver a drone, the drone administer will launch a drone to the patient. The drone will take off and fly toward the patient via the recommended waypoint. The icon of the drone will be displayed on the drone server monitor in real time. the drone administrator. In the case of the decision to deliver a drone, the drone administer will launch a drone to the patient. The drone will take off and fly toward the patient via the recommended waypoint. The icon of the drone will be displayed on the drone server monitor in real time.

Drone Station
The AED drone is installed in a circular, dome-like opening drone station and is ready to take off at all times. The diameter of the base is 150 cm. When the drone is called, the dome lid opens instantly by triggering the solenoid lock, which will then release the weight attached to the lid. The dome cover acts as sun and rain protection when the drone is in a standby state. The drone has a lithium polymer (LIPO) battery that requires a charger. Therefore, the drone station was not designed as a charging station. As the accuracy of the GPS coordinate system has an error of ±3.0 m, when the drone is returned to base, it will not land on the drone station but rather outside the base. Once the drone has landed, the drone is placed in the drone station to prepare for the next mission. Figure  4a,b shows a designed drone station with the top view and the side view, respectively. The constructed drone station is shown in Figure 4c.

Drone Station
The AED drone is installed in a circular, dome-like opening drone station and is ready to take off at all times. The diameter of the base is 150 cm. When the drone is called, the dome lid opens instantly by triggering the solenoid lock, which will then release the weight attached to the lid. The dome cover acts as sun and rain protection when the drone is in a standby state. The drone has a lithium polymer (LIPO) battery that requires a charger. Therefore, the drone station was not designed as a charging station. As the accuracy of the GPS coordinate system has an error of ±3.0 m, when the drone is returned to base, it will not land on the drone station but rather outside the base. Once the drone has landed, the drone is placed in the drone station to prepare for the next mission. Figure 4a,b shows a designed drone station with the top view and the side view, respectively. The constructed drone station is shown in Figure 4c.

Drone Server Application
The drone server application installed on the drone server consists of two applications: the end-user experience software developing kit (UX SDK) [17] and the Waypoint software developing kit of DJI [18]. The UX SDK is related to the interface of all sensors, actuators, and the camera.
The function of the UX SDK to provide a graphic user interface (GUI) with a flight controller to manually control the drone. When starting the UX SDK, the application will display video data of the onboard camera. The user can manually launch the drone, control the flight, and land the drone. The second part is called the Waypoint application, which is used in the automatic flight controller. In Waypoint mode, the application will wait for the published location of the patient sent by the mobile application. Upon receiving the location, the Waypoint application will display the patient location and the drone location, and compute and display the literary point. When confirmation is received, the drone administrator will start the Waypoint operation. The drone will launch and fly to the patient's location. The drone administrator can switch to UX SDK when the drone arrives at the patient location and manually control the drone landing using video data as a guide. The Waypoint application can control the drone flight in two modes: manual and automatic.
In the manual mode, the drone administrator can click the drone destination location directly on Google Maps. In the automatic mode, the patient's location is automatically set on Google Maps when the AED drone is called by the patient. The Waypoint interface shown in Figure 5 consists of 13 components as follows.

Drone Server Application
The drone server application installed on the drone server consists of two applications: the end-user experience software developing kit (UX SDK) [17] and the Waypoint software developing kit of DJI [18]. The UX SDK is related to the interface of all sensors, actuators, and the camera.
The function of the UX SDK to provide a graphic user interface (GUI) with a flight controller to manually control the drone. When starting the UX SDK, the application will display video data of the onboard camera. The user can manually launch the drone, control the flight, and land the drone. The second part is called the Waypoint application, which is used in the automatic flight controller. In Waypoint mode, the application will wait for the published location of the patient sent by the mobile application. Upon receiving the location, the Waypoint application will display the patient location and the drone location, and compute and display the literary point. When confirmation is received, the drone administrator will start the Waypoint operation. The drone will launch and fly to the patient's location. The drone administrator can switch to UX SDK when the drone arrives at the patient location and manually control the drone landing using video data as a guide. The Waypoint application can control the drone flight in two modes: manual and (1) "Locate" is a button to find the location of the drone. When the button is pressed, the program will display an airplane icon (11) on the screen.
(2) "ADD" is a manual positioning button to send the drone to the desired position, from which 4-20 points can be selected.
(3) "Clear" is a button to clear the screen, used in conjunction with the second button. (4) "Config" is a flight mode configuration button used to set flight parameters including altitude and the speed of the drone.
(5) "Upload" is a button used to upload a set of flight coordinates to the drone. (6) "Home" is a button to call the drone back after completing the AED delivery mission. (7) "SEND" is a button to send the drone in automatic mode. When the patient requests an AED, the SEND button will flash with a notification signal. When the SEND button is pressed, the program will automatically calculate the coordinates ready to be uploaded. (8) "Start" is the button used to launch the drone. A flowchart of the Waypoint application is shown in Figure 6. When the application starts, it initializes Google's location service [19] (3), the PubNub subscribe and publish services [20] (4), the DJI flight controller [21] (5), and the Waypoint mission operator [22] (6). The application then waits for the AED request command from the mobile application and also waits for the command buttons to be pressed, including the UX activity button (7), the configuration button (12), the upload button (14), the send button (17), and the home button (19). When the UX or return button is pressed, the application switches to UX activity (9), which allows the drone administrator to manually control the drone as described in Section 2.2.3. When the AED request command is received, the application displays the drone and patient icons on Google Maps (11). The patient location is sent from the mobile application, which transmits their longitude and latitude to the PubNub subscribe service. After the AED request command is received, the application blinks the configuration button (12) to inform the drone administrator to set the flight configuration (13) including drone velocity, flight altitude, and type of finish mission. After the configuration is set, the upload button (14) blinks to inform the drone administrator to push the button, which computes (15) and displays the waypoint (16) on Google Maps. Once confirmed, the drone administrator then pushes the start button to launch the drone (18). Android studio programmers can refer to [18] for Waypoint SDK application development. A flowchart of the Waypoint application is shown in Figure 6. When the application starts, it initializes Google's location service [19] (3), the PubNub subscribe and publish services [20] (4), the DJI flight controller [21] (5), and the Waypoint mission operator [22] (6). The application then waits for the AED request command from the mobile application and also waits for the command buttons to be pressed, including the UX activity button (7), the configuration button (12), the upload button (14), the send button (17), and the home button (19). When the UX or return button is pressed, the application switches to UX activity (9), which allows the drone administrator to manually control the drone as described in Section 2.2.3. When the AED request command is received, the application displays the drone and patient icons on Google Maps (11). The patient location is sent from the mobile application, which transmits their longitude and latitude to the PubNub subscribe service. After the AED request command is received, the application blinks the configuration button (12) to inform the drone administrator to set the flight configuration (13) including drone velocity, flight altitude, and type of finish mission. After the configuration is set, the upload button (14) blinks to inform the drone administrator to push the button, which computes (15) and displays the waypoint (16) on Google Maps. Once confirmed, the drone administrator then pushes the start button to launch the drone (18). When the mission is completed, the drone administrator then pushes the home button to fly the drone back to the station.
Drones 2022, 6, x FOR PEER REVIEW 10 of 19 Figure 6. Flowchart of the Waypoint application.

Drone Mobile Application
The drone mobile application is used by the patient or the accompanying person to call a drone during a heart attack. The application can be installed on the Android phone of the patient. In case of an emergency, the drone mobile application will be operated. The program will display a window as shown in Figure 7a. The application consists of two pages: (1) CPR and (2) AED. The CPR page shown in Figure 7a provides information about performing CPR (manual cardiopulmonary resuscitation) for assisting a cardiac arrest patient. The AED page is used to call the drone. When the AED button on the AED page is

Drone Mobile Application
The drone mobile application is used by the patient or the accompanying person to call a drone during a heart attack. The application can be installed on the Android phone of the patient. In case of an emergency, the drone mobile application will be operated.
The program will display a window as shown in Figure 7a. The application consists of two pages: (1) CPR and (2) AED. The CPR page shown in Figure 7a provides information about performing CPR (manual cardiopulmonary resuscitation) for assisting a cardiac arrest patient. The AED page is used to call the drone. When the AED button on the AED page is pressed, the program displays the window in Figure 7b. On the AED page, the patient location is automatically shown, including the location of the nearby drone station. The patient or accompanying person can select the appropriate drone delivery location using the finger on the mobile screen or by selecting the current location button. The patient position will change. Once the location is selected, the user presses the call drone button, and the patient's geological location data including latitude and longitude are sent to the drone station so that the drone administrator can know where to send the drone. When a drone administrator decides to send a drone, the position of the drone is constantly updated know the drone's arrival time. For Android programmers, the mobile application is based on Google Maps Activity in the Android studio template [23]. the finger on the mobile screen or by selecting the current location button. The patient position will change. Once the location is selected, the user presses the call drone button, and the patient's geological location data including latitude and longitude are sent to the drone station so that the drone administrator can know where to send the drone. When a drone administrator decides to send a drone, the position of the drone is constantly updated know the drone's arrival time. For Android programmers, the mobile application is based on Google Maps Activity in the Android studio template [23]. A flowchart of the mobile application is shown in Figure 8. When the application starts, it initializes Google's location service (3) and PubNub's subscribe and publish services (4). The mobile application displays the CPR page to educate the user on how to perform CPR and also wait for the AED button to be pressed. When the AED button (8) is pressed, the application switches to AED activity (5), which displays the patient icon on Google Maps. If the call drone button is pressed, the mobile application sends the patient location (10), longitude and latitude, to the drone server. Once the drone server acknowledges the request, it publishes the drone location back to the mobile application. The subscribed drone location (11) is continually displayed and updated as the drone icon on Google Maps (12). On the AED page, the return (CPR) button is used to switch back to the CPR page. A flowchart of the mobile application is shown in Figure 8. When the application starts, it initializes Google's location service (3) and PubNub's subscribe and publish services (4). The mobile application displays the CPR page to educate the user on how to perform CPR and also wait for the AED button to be pressed. When the AED button (8) is pressed, the application switches to AED activity (5), which displays the patient icon on Google Maps. If the call drone button is pressed, the mobile application sends the patient location (10), longitude and latitude, to the drone server. Once the drone server acknowledges the request, it publishes the drone location back to the mobile application. The subscribed drone location (11) is continually displayed and updated as the drone icon on Google Maps (12). On the AED page, the return (CPR) button is used to switch back to the CPR page.

Results
To ensure proper operation of our autonomous medical drone system for AED delivery, we conducted two experiments: an operational test on the flight simulator and a field flight test.

Results
To ensure proper operation of our autonomous medical drone system for AED delivery, we conducted two experiments: an operational test on the flight simulator and a field flight test.

Operational Test on Flight Simulator
Prior to performing the field flight test of our automated medical drone system to deliver an AED, we performed an operational test with the flight simulator. A number of flight simulator software packages are available to test the drone [24]. The main objective of the flight simulator is to allow the drone user to practice flying the drone before flying it in a real situation. The flight simulator displays an animation of the drone and flight parameters such as flight speed, flight altitude, latitude, and longitude. To perform the operational test on the flight simulator, we proceeded as follows: (i) Connect the drone to the PC with installed flight simulator software via the USB port.
Turn on the drone and software to establish a connection. Set the drone location in the flight simulator to be some distance away from the current location. (ii) Connect the drone server (tablet installed with Waypoint and the UX SDK) with the drone remote control. Turn on the remote control to establish a connection. (iii) Run the drone mobile application and call the drone to the current location. The icon of the drone station, drone, and patient will appear in the drone server application, as shown in Figure 9a. (iv) On the drone server, click the "upload", "config", and "start" buttons to launch the drone to the destination. Observe the drone icon moving toward the patient, as shown in Figure 9b-d. Observe this also on the drone mobile application. (v) Observe the drone take off and land at the destination on the flight simulator. (vi) Activate the home maneuver by clicking the "home" button on the drone server. The drone will take off at the destination location and land at the drone station.

Field Flight Test
We conducted a flight field test by simulating a patient having a heart attack while exercising in a sport complex. The sport complex was located 2 km away from the drone station. In the event of a heart attack, an accompanying person calls the drone using the application. The drone administrator acknowledges the request and initiates AED drone delivery. Figure 10 shows the captured images of all stages, starting from the drone's takeoff from the drone station, the drone flying toward the patient location, the drone's arrival at the patient location, and the drone landing and completing the mission of AED delivery. The mission was successful. The weather conditions for the test fight date were as follows: temperature 29.4 • C, humidity 65%, and wind speed 12 km per hour. We also asked the drone administrator and volunteer for their opinions about the drone server application and the mobile application. The feedback was quite positive, especially regarding the ease of use, reliability, and accuracy of the application. The total elapsed time from the emergency call to the delivery of the AED was about 2 min, divided into ascending time of 6 s (30-m altitude), descending time of 12 s, and flight time of 2 min. The maximum flight time of the drone is 24 min for a payload of 800 g. Table 1 shows a comparison between the drone mission parameters of our drone and MeDrone. MeDrone does not report elapsed time, as the function of MeDrone is to deliver drugs that are not time sensitive.
(iv) On the drone server, click the "upload", "config", and "start" buttons to launch the drone to the destination. Observe the drone icon moving toward the patient, as shown in Figure 9b-d. Observe this also on the drone mobile application.
Observe the drone take off and land at the destination on the flight simulator. (vi) Activate the home maneuver by clicking the "home" button on the drone server.
The drone will take off at the destination location and land at the drone station. (c) (d) Figure 9. Operational test on flight simulator; (a-d) drone maneuvers from drone station to patient.

Field Flight Test
We conducted a flight field test by simulating a patient having a heart attack while exercising in a sport complex. The sport complex was located 2 kilometers away from the drone station. In the event of a heart attack, an accompanying person calls the drone using the application. The drone administrator acknowledges the request and initiates AED drone delivery. Figure 10 shows the captured images of all stages, starting from the

Discussion
The AED drone managing system for an automated external defibrillator delivery service was proposed in this research. The system consists of a drone ground station, a drone mobile application, an AED drone, and a cloud server. Despite the promising results, there are a number of issues that must be discussed for the completeness of the manuscript: The flying zone of the AED drone depends on the radio telemetry strength of the remote control. The flying zone covers the radius of 5 km from the drone station. The system is hence suitable for medium-sized rehabilitation centers or golf resorts that mostly serve the elderly who are prone to heart disease.

Discussion
The AED drone managing system for an automated external defibrillator delivery service was proposed in this research. The system consists of a drone ground station, a drone mobile application, an AED drone, and a cloud server. Despite the promising results, there are a number of issues that must be discussed for the completeness of the manuscript: (i) The flying zone of the AED drone depends on the radio telemetry strength of the remote control. The flying zone covers the radius of 5 km from the drone station. The system is hence suitable for medium-sized rehabilitation centers or golf resorts that mostly serve the elderly who are prone to heart disease. (ii) One of the missing features of our medical drone managing system for automated external defibrillator delivery is obstacle avoidance. The medical drone managing system is hence not suitable to be operated in a city, where many obstacles can be found, including electrical wires and tall buildings. To be used in a city, an obstacle avoidance feature should be added. (iii) Audio data should also be communicated between the patient and drone station. The available audio data can be used to advise the accompanying person and the nearby people to assist the patient in the case of an emergency. The audio data communication will be explored in future work. (iv) The cost of construction of this drone managing system is around USD 3500. The cost for personnel needed in the operation is USD 80,000 per year. Drone annual liability insurance is 200 USD/year. The total cost of the medical drone managing system is approximately USD 83,700 per year. (v) The system is recommended to be used at elderly resort facilities, university campuses, or golf court complexes. The nearest medical stations and their locations can be registered in the system. The distance between the nearest medical station and the patient can then be computed. When the AED drone emergency service is called, the system can send a notification to the AED drone station and also a medical station (hospital). The AED drone station will dispatch AED while the medical station (hospital) will dispatch emergency service personnel. (vi) To operate the proposed medical drone managing system, the following safety measure is needed to ensure the safety of both the operator and patient [25]: the drone operator must be well-trained, certified, and registered with the National Broadcasting and Telecommunication Commission. The drone operator must buy accidental insurance covering the costs that might be incurred by the injury or death of a third person caused by the drone's operation. The annual cost of insurance is 200 USD/year with total liabilities of USD 31,250 (1,000,000 Thai Baht), which include the loss of life or bodily injury of the third party. The drone managing system can be operated only in drone flying-allowed zones designated by the National Broadcasting and Telecommunication Commission. The drone should be equipped with an obstacle avoidance feature and anti-collision beacon lights, especially for autonomous flying, to prevent any hazardous event. A drone propeller guard must be used to prevent any injury, especially when the drone flies near living humans or animals. The designed drone weight should not exceed 24 lbs. The maximum altitude of flying the drone is limited to 400 feet above the ground. (vii) The AED drone managing system was designed to operate both in rural and urban areas. When used in a rural area, drone delivery can perform efficiently and smoothly, with fewer building obstacles. For urban areas, however, there are a lot of tall buildings that can obscure the drone flight mission. Our system will set the flight altitude at 30 m. When the AED drone is called, it will fly vertically to the set altitude and then fly to the patient location. This is to avoid tall buildings. Nevertheless, a drone operated in an urban area should be equipped with an obstacle sensing system with a sensing range between 1 and 30 m and the drone speed should be reduced to as low as 20 km/h from the maximum speed of 60 km/h. The communication between the drone and the drone remote control uses microwaves with a broadcasting frequency of 5.725-5.850 GHz and a max. transmitting distance of 8 km. The AED drone managing system is recommended to operate in an area with a radius of 5 km from the drone station. A weak telemetry signal will alarm in case the drone flies outside the operating zone.
With the current technology of 4G and 5G mobile phone systems, it can be ensured that all of the areas can have a 4G/5G signal to operate the drone mobile application. (viii) The source code for both the Waypoint/UX application and the mobile application in this research are available at [26]. (xi) The test flight of this research was conducted by a drone administrator who has been granted a certification of registration for radio communication in unmanned arial vehicles (UAVs) from the National Broadcasting and Telecommunications Commission of Thailand with a valid license ID since March 2020. The propose of the use of the aircraft under the granted certificate is to conduct aircraft research and development for academic/commercial use.

Conclusions
This research concerns the design and construction of an automated medical drone system for AED delivery. The system consists of four subunits: (i) the drone ground station, (ii) the drone mobile application, (iii) a cloud server, and (iv) an AED drone. The drone ground station is the command center that acts as a watchdog waiting to receive drone calls. The drone ground station consists of (1) a drone server, which is a powerful computer that runs on an Android operating system, (2) a drone server application, and (3) a drone station. The drone mobile application is installed on the mobile phone of the patient or the accompanying person. If someone experiences a heart attack, an accompanying person can run the drone mobile application to send their location to the drone server via the PubNub cloud server. Once notified, the drone administrator can launch a drone to fly from the drone station to the patient's location. The real-time drone location is displayed on both the drone server application and the mobile application. Once the drone has successfully landed at the patient location, the AED is removed from the AED compartment and used to resuscitate the patient. The drone administrator then commands the drone to automatically fly back to the drone station. Operational tests were successfully conducted on both a flight simulator and in a field flight test.