1. Introduction
Today, quadrotor UAVs play a major role in many aspect of human life. Quadrotors have been used ranging from surveillance [
1], photography [
2,
3], agriculture [
4], to quadrotor racing [
5]. On the top of that, some implementations such as surveillance, is using more than one quadrotor (multi-quadrotor) in order to get more benefits. The advantage of quadrotor compared to other type of UAV is hovering ability. Furthermore, due to excellent maneuvering capability, quadrotors are able to do a mission with any kind of environment.
In the case of multi-quadrotor system, some circumstances such as flight formation and coordination, need to be computed carefully to avoid a collision between quadrotors. The environmental conditions and situations may also affect the stability of the quadrotor, either as a group or as a single quadrotor. The quadrotor may face some obstacles, different elevations, or even complex fight route that makes the quadrotor fly abruptly that may also affect the quadrotor stabilization. Besides that, every quadrotor in the group must be ensured in a stable state so it does not affect the stability of other quadrotor in the group. Therefore, the control performance of quadrotor is very important to ensure the stabilization of quadrotor.
On the scheduling point of view, quadrotor system can be abstracted as periodic task models. Each task at least has two parameters: period and execution time. This periodic task model first was introduced by Liu and Layland [
6] in which every task has two parameters: periods and execution time. In our typical quadrotor system, each quadrotor has four tasks: Equation of Motion (EOM) task, Stability Controllability Augmented System (SCAS) task, Waypoint following task and Network task. This task specification is responsible for specific function in quadrotor which will be explained in
Section 3. Therefore, quad-rotor system needs a middleware or operating system to handle task scheduling.
In robotics community, Robot Operating System (ROS) plays an important role for processing tasks of robot [
7]. ROS is a robotics middleware that provides a framework for developing robot software. However, although ROS is also popular in quadrotor simulation, ROS is not real-time. Generally, quadrotor is a hard-real-time system, meaning that all tasks should meet their deadline because any deadline miss could bring an accident to the quadrotor indirectly. Therefore, RTOS or real-time middleware is recommended as middleware of quadrotor system. There are many RTOS and real-time middleware available, either closed or open-source, for example: Linux, FreeRTOS, Real Time Application Interface (RTAI), VxWorks, Linux Testbed for Multiprocessor Scheduling in Real-Time (Litmus-RT), etc. With these RTOSs, tasks are guaranteed not to miss deadlines.
On the other hand, simulator technology is widely used as an important part of quadrotor development. Quadrotor simulator also useful for validation and testing. Engineers and researchers also use simulator to simulate quadrotor missions and its interactions with environments before they conduct a real-life experiment. Accidents can occur when something unexpected happens to the system, such as bugs, calculation errors, and design errors which can be fatal for quadrotor in real life implementation. These circumstances are even more complex in multi-quadrotor system. Hence, multi-quadrotor simulator platform is needed to reduce losses caused by a physical accident during flight tests. The main contributions of this paper includes:
Providing a real-time simulator for multi-quadrotor;
Developing a real-time-hypervisor based quadrotor simulator which makes each quadrotor can have resources independently to other quadrotors;
Implementing a waypoint following simulation of multi-quadrotor using this platform which proven our multi-quadrotor simulator environment is feasible to be used as a testbed for any multi-quadrotor experiment; and
Providing a performance evaluation and analysis, by recording a step-input responses, computation time, and response times of tasks.
In this paper, we develop a real-time multi-quadrotor simulator environment in hypervisor. In our simulator environment, each quadrotor simulator is run on a separate virtual machine (called domain). This separation allows each quadrotor to leverage its own resources (processor core) as if it were in real quadrotor. Hypervisor used in our simulator environment is RT-Xen, an open-source virtualization platform with real-time performance guarantees [
8] (explained in
Section 3.3). And for each domain, to guarantee a real-time performance, we installed Litmus-RT [
9,
10] which is a real-time extension of Linux (explained in
Section 3.3).
2. Related Works
There are some researchers who have developed their own quadrotor simulator for their own particular purpose. MATLAB-Simulink is one of the most popular tools for developing an UAV simulator, even though it is hardly to simulate in real-time manner. In [
11], a MATLAB-based quadrotor simulator has been developed to check the validity of the dynamic model and control algorithms of their in-house quadrotor. This paper [
12] also uses MATLAB-Simulink for modeling and control algorithms. In [
13], a quadrotor simulator platform and environment model has been implemented using MATLAB-Simulink with various sensors.
There are some widely known quadrotor simulator, either developed by quadrotor company for their own type of quadrotor or open-source simulator, for example: DJI Flight Simulator [
14] and RotorS. DJI Flight Simulator is designed for enterprise users of DJI drones. RotorS is a Gazebo-based UAV simulator which also provides some specific multi-quadrotor models [
15]. Gazebo is an open-source robot simulator which is also integrated with Open Dynamics Engine (ODE) as a physics engine, and OpenGL as an API for graphics rendering. RotorS developed by the Autonomous Systems Lab of ETH Zurich. But, both Gazebo and RotorS do not provide enough support for a quadrotor simulator environment.
The implementation of quadrotor simulator can be even more complex when it comes to multi-quadrotor system, since there must be some interaction between these quadrotors. A real-time multi-UAV simulator in [
16] was implemented in hardware-in-the-loop manner by using fixed-wing UAV as a model. But, this paper only provides a distributed architecture of multi-UAV simulator. Moreover, other focus of this research is CommLibX, a communication framework between simulation modules through virtual channels.
Other research, for example in [
17], developed a ‘near-real-time’ simulation environment for multi-UAV called MUSE (Multiple UAV Simulation Environment). In this simulation environment, each Simulink-based UAV runs on each individual PC connected through UDP network to the Ground Control Station (GCS). However, to do a simulation using this environment is very costly, especially when more UAVs are needed, because it needs one PC for one simulator.
The Drone Watch and Rescue (DWR) in [
18] was developed using web development technologies in client-server manner. Clients can run this simulator through any HTML5 web browser by sending a request to the server. The server which is responsible for the core of simulator would run quadrotor simulator after receiving any client’s request. But, in this simulator, the client is only receives and shows on the client’s screen the status of simulation, not runs the quadrotor simulator. Therefore, when running a multi-UAV simulator, all processes of all UAVs are executed in server.
OpenUAV [
7] offers a quadrotor simulator environment by leveraging Containers as a Service (CaaS) that makes users carry out simulation on the cloud. The core component of quadrotor simulator of OpenUAV was developed using Robot Operating System (ROS), Gazebo, and Docker (CaaS platform). But in this simulator, each quadrotor only uses containers, it does not own resource independently.
4. Experiments and Performance Evaluation
4.1. System Setup
Although there is no specific requirement for PC used in our quadrotor simulator environment except for storage which needs at least 22 GB for each domain (linux requirement), for experiment purpose in this research, we used two relatively similar PC specifications in terms of number of cores and memory size (as shown in
Table 3). In our experiment, number of cores determines the maximum number of quadrotors involved in flight simulation, since each VCPU represents one quadrotor.
Table 4 shows the virtual machine (domain) specifications and configurations in PC1.
Table 5 shows the virtual machine (domain) specification and configurations in PC2.
For experiment purposes, the quadrotor model used in our experiment is a simple generic model, and not a specific type/brands of quadrotor model.
Table 6 below shows the specifications of our generic quadrotor model. These quadrotor parameters are initialized in EOM process, as seen in Algorithm 2.
4.2. Implementations
Our multi-quadrotor simulator environment is implemented using C programming language. As mentioned in
Figure 6, each PC runs four domains of quadrotors and one domain for Domain-0. Domain-0 is responsible for controlling all domains (guest OSs) and also has a driver for direct access to the hardware [
8].
On GCS PC, GUI is divided into two windows: variable monitor and 3D Animations. The Animations is implemented using OpenGL library. For simulation experiment, user can fly either a single quadrotor or multi-quadrotor. In multi-quadrotor scenario, all quadrotors will automatically fly in formation to avoid colliding with each other.
Figure 7 shows the UI of GCS.
In our quadrotor simulator environment, there are two flight mode options: manual flight and waypoint following. Manual flight is selected if the user wants to fly the quadrotor manually using keyboard input or joystick. Meanwhile, waypoint following flight simulates the quadrotor that follows a particular trajectories/waypoints. However, in current implementation of multi-quadrotor simulation (both manual and waypoint following flight), a group of quadrotors always flies in formation.
For waypoint following mission purpose, coordinates can be inputted either using text file or arguments input in UI (terminal) by user. These waypoint input methods can be done in GCS. There are at least three variables needed to be inputted for waypoint following which is defined as a coordinate: x (position in x-axis), y (position in y-axis), and z (altitude in z-axis).
For a formation flight of multi-quadrotor, every quadrotor will get waypoint data that has been added by 2.5 m from the inputted coordinates, so every quadrotor will creates a distance of 2.5 m radius accordingly. Therefore, GCS will sends a command based on these waypoint coordinates to every quadrotor leader of group. This formation flight strategy is important because it makes sure all quadrotors do not collide with each other, or too close to other quadrotors.
4.3. Step Input Response
Step input response is applied for knowing how each quadrotor system responds to a sudden input. This kind of experiment is important because extreme deviation from a steady state may have crucial effects on the quadrotor systems. Therefore, step input response can gives information on the quadrotor stability. There are four kinds of step input that have been applied: lift command, roll command, pitch command, and yaw command. This similar step input response experiments on quadrotor simulator have been published also in our previous paper [
19]. The result of step input responses can be seen in
Figure 8 below.
In
Figure 8 above, it shows that the quadrotor system is back to the stable state several seconds after the application of a step input. Besides that, positions and angles do not come back to zero after 4 s for step-input of lift_cmd, after 7 s for step-input of pitch_cmd, after 7 s for step-input of roll_cmd, and after 6 s for step-input of yaw_cmd. This means the responses are stable and damped with small value of overshoot, settling time and steady state error.
4.4. Waypoint Following Simulation
For experiment purpose, waypoint following simulation is conducted by multi-quadrotor. The quadrotors fly from a starting point, following other designated waypoints and back to the starting point.
Figure 9 shows the example of waypoints following a route by quadrotors group 1 and group 2.
The waypoint simulation has been conducted with five waypoints that were inputted using text file. If waypoints are inputted directly using arguments in terminal, user can simulate another route by inputting another set of waypoints by making the current position of quadrotor as a starting point.
Figure 10 shows the distance between quadrotor followers and their quadrotor leader. Following the initial distance between quadrotors mentioned in
Section 4.2,
Figure 10 also shows that the positions of quadrotor followers are never too close to the quadrotor leader during the present flight mission. Therefore, it can avoid collision between quadrotors.
4.5. Computation Time
Computation time is a time it takes to compute a particular task/thread. In our quadrotor simulator, the computation time is recorded by getting the time right before particular task (or thread) is called and after it is finished (right before and after each process of Algorithms 1–3 is called). In this paper, three tasks are recorded: EOM task, SCAS task, and Waypoint Following task, which are the three most important tasks in our quadrotor simulator.
Figure 11 below shows the computation time of EOM, SCAS, and waypoint following tasks for every quadrotor during the flight mission shown in
Figure 9.
Table 7 shows the average and the maximum of computation times of EOM task, SCAS task and waypoint following task. This table also shows that the computation time of each quadrotor meets the real-time requirements (see the requirement in
Table 2).
4.6. Response Time
The system is considered real-time if the execution of task is completed before the deadline. In general, there are two types of real-time system: soft real-time system, and hard real-time system. Soft real-time system tolerates the deadline miss of task computation. In contrast, hard real-time system does not tolerate any deadline miss. The distinction between these two terms is based on the consequence of deadline miss to the system. Particularly, in hard real-time system, the system must hit every deadline. Any deadline miss occurring in the hard real-time system could be catastrophic. For example, if deadline miss occurs on important tasks in quadrotor system, the quadrotor may crash.
The easiest way to identify whether the system hit or miss the deadline is to check the response time of the task. Response time of task is the time between the task is released and the task is finished. Therefore, with assumptions that the deadline is equal to the period, the system is guaranteed not to miss the deadline as long as the response time is no longer than the period.
In our quadrotor simulator, the response time is recorded using one of feather-trace tools:
st-trace-schedule. This tool traces all events during simulation, from start to finish. Then,
st-job-stats tool produces a CSV file of task statistics of tracing result.
Table 8 shows the average response time, maximum response time and the appearance of deadline miss on each quadrotor, obtained by feather-trace tools.
Based on the task configurations shown in
Table 2 before, since it assumes the deadline of tasks are equal to their periods, which are 100 Hz (10 ms) for EOM task, 50 Hz (20 ms) for SCAS task, and 25 Hz (40 ms) for waypoint following task. Therefore, according to
Table 7, all tasks hit the shortest period (10 ms). Specifically for QrSim6, the 11.069232 ms of maximum response times is owned by one of QrSim6’s tasks which has a period of 40 ms.
5. Conclusions
5.1. Discussions
It is noted that the main purpose of developing a quadrotor simulator is for validation and testing in quadrotor development. The quadrotor simulator also can be used as a testbed for quadrotor related research before real-life experiment. Following these purposes, there are some advantages of our quadrotor simulator environment in this research as follows.
The proposed model is based on real-time hypervisor, so that it can be used for simulation in heterogeneous computing (multi-platform UAV).
Our quadrotor simulator is real-time guaranteed because the tasks implemented in our quadrotor simulator are a real-time tasks that run in Litmus-RT.
Our quadrotor simulator environment also provides a manual flight mode using any type control input such as joystick, keyboard, etc. So it can be used for drone pilot training.
Our quadrotor simulator also can be further developed to Software-In-The-Loop-Simulation (SILS) and Hardware-In-The-Loop-Simulation (HILS) configuration.
Along with some advantages, our quadrotor simulator environment in this research also has some disadvantages.
SCAS used in our quadrotor simualtor is Proportional Integratioj (PI) control.
The quadrotor data used for our quadrotor simulator is generic quadrotor, not a data from real quadrotor.
5.2. Concluding Remark
In this paper, we have presented our multi-quadrotor simulator in hypervisor environment. Our multi-quadrotor simulator offers a new approach to develop a multi-quadrotor simulator that almost resembles the real-life quadrotor by leveraging hypervisor technologies (RT-Xen). By using RT-Xen, we have made a multi-quadrotor simulator environment in which four quadrotors can run independently in one PC with their own computing resources, without compromising real-time principles. To ensure all tasks in every quadrotor simulator (domain) run in real-time, we have developed a quadrotor simulator using Litmus-RT, a real-time extension of Linux. In this paper, we have also developed multi-quadrotor simulation features, waypoint following and flight formation, which prove that our multi-quadrotor simulator environment is suitable to be used as a testbed for any kind of multi-quadrotor applications.
In this paper we have conducted step-input response tests which show there is no problem with stabilization of inner-loop control. In addition, we also have recorded the computation time of three important tasks, which shows there is no problem with the performance of the quadrotor. Furthermore, we also have traced and recorded the response time, which shows that three important tasks in quadrotor system: Stability Controllability Augmented System (SCAS), Equation of Motion (EOM), and waypoint following task, are finished before their deadlines; in fact, 20 ms, 10 ms, and 40 ms before the deadlines for SCAS, EOM, and waypoint following, respectively.
In general, multi-quadrotor simulator is a testbed for quadrotor research and development. Therefore, there are some future work possibilities and focuses based on this paper:
Further study and research on flight control in group UAV configuration.
Further study and research on the distance between the different drones of different groups and its relation with aerodynamic interference.
Using another specific types/brands quadrotor model, especially for Urban Air Mobility implementations.
Other multi-quadrotor missions and control researches area: collision avoidance, autonomous flight, multi-quadrotor reconnaissance mission, AI-based control.
A new task model for real-time multi-quadrotor simulator, such as mixed-critical real-time systems and multi-rate task model.
A new scheduling model or scheduling algorithm for hierarchical real-time systems.