Platform for Simulating Six-rotor Unmanned Aerial Vehicle

1Department of Electronic Engineering, Ming Chuan University, Taoyuan 333321, Taiwan, ROC 2Graduate Institute of Automation Technology, National Taipei University of Technology, Taipei 106344, Taiwan, ROC 3Department of Electrical Engineering, National Ilan University, Yilan 260007, Taiwan, ROC 4Department of Electronic Engineering, China University of Science and Technology, Taipei 115311, Taiwan, ROC


Introduction
Unmanned aerial vehicles (UAVs) (1)(2)(3) are increasingly being used to obtain aerial images for use in infrastructure management, agriculture, surveillance, and videography. On the basis of the flight platform, UAVs can be divided into fixed-wing, single-rotor, and multi-rotor aircraft. The most common configuration at present involves multiple (four or six) rotors (otherwise referred to as spiral wings; SWs) to control roll, pitch, yaw, and attitude. The first multi-rotor aircraft, a four-axis vehicle referred to as the flying octopus, was introduced in the US in 1923. However, development in this field largely languished until 2005, when mathematical models of flight and attitude control made it possible to create stable aircraft with vertical takeoff and landing capability. The four-rotor configuration is currently the most popular owing to its relative simplicity; (4)(5)(6) however, the six-rotor design has a number of advantages in terms of mobility, stability, and safety (i.e., redundancy).
Recent advances in micro-electromechanical systems (MEMS) technology and embedded microcontrollers have made it possible to formulate balance control algorithms for a wide range of UAV configurations, including six-rotor vehicles. This has also made it possible to automate flight control operations using on-board systems, thereby eliminating the need to transmit finegrained correction commands or develop special skills for piloting the vehicles. Much of the interest in multi-rotor UAVs can be attributed to their outstanding maneuverability and low control threshold, both of which rely on a wide range of technologies, including (1) embedded microcontrollers, (2) MEMS inertial sensors, (3) pulse-modulation signal processing, and (4) wireless remote control systems.
Most of the existing literature is based on the theoretical derivation. (7,8) A simplified mathematical model of six-rotor aircraft has been proposed, (9) and an attitude controller has been designed by combining a proportional integral derivative (PID) controller and a dynamic inverse control method. A six-rotor aircraft was also taken as the research object in Ref. 10. Through the mechanical analysis of the aircraft body and rotor, in combination with rigid body mechanics and the Newton-Euler equation, a simplified mathematical model of the aircraft was obtained. On the basis of the simplified mathematical model, an attitude controller and a position controller using the PID algorithm were designed. Our primary objective in this study was to develop a flight control system for six-rotor UAVs based on motion equations describing the flight characteristics of the aircraft (elevation, roll, pitch, yaw, and attitude), while the speeds of the six motors are varied. In addition to the actual self-made flight control panel and keyboard remote controller of the six-rotor aircraft, in order to further understand the flight characteristics of the six-rotor aircraft, we deduce the motion equation of the aircraft, so as to explain the effect of the motion modes of the six motors on the rise and fall, left and right rolling, pitching, and yaw of the aircraft, and try to master the motion characteristics of the sixrotor aircraft as an important key to designing flight controllers.

Hardware Architecture
The UAV system in this study comprised a six-rotor aircraft frame, keyboard remote control device, microcontroller chip, and sensing elements (see Fig. 1). User commands (rotate left, rotate right, tilt left, tilt right, move forward, move backward, ascend, and descend) are transmitted to the UAV via a wireless transmission module (XBee S2C). They are received by the flight control board equipped with a control chip (AT90CAN128) for conversion into six groups of corresponding pulse width modulation (PWM) signals, which are sent to an electronic governor to drive the brushless DC motors.

Specifications of proposed six-rotor AUV
The airframe used in this paper was a DJI-F550 (DJI Inc.) with SWs of 550 mm and a frame weight of 478 g. The takeoff weight (including batteries) was 1200-2400 g (see Fig. 2). The propulsion system comprised brushless DC motors (DJI-2312E), an electronic governor (DJI-420LITE), and blades (DJI-Z-BLADE 9450).

Rotation matrix
In a three-dimensional (3D) space, the spatial relationship between any two coordinate systems can be described using a transformation matrix. With the airframe defined as and the inertial frame defined as (O e , X e , Y e , Z e ), the relationship between the two coordinate systems is referred to as the rotation matrix. A rotation matrix is a transformation matrix that is used to rotate points in the (O b , X b , Y b , Z b ) plane counterclockwise through an angle with respect to the airframe axis about the origin of the Cartesian coordinate system. In this study, the following three matrices are extensively used.  1. Rotation around the Z b axis is called the yaw angle φ (yaw), and its rotation matrix R(φ, z) is derived using the following equation: 2. Rotation around the Y b axis is called the θ pitch, and its rotation matrix R(θ, y) is derived using the following equation: 3. Rotation around the X b axis is called the ϕ roll, and its rotation matrix R(ϕ, x) is derived using the following equation: As shown in Eq. (4), the attitude of a six-rotor aircraft in 3D space can be obtained by following the rotation sequence. New aircraft coordinate systems {C} and {D} are respectively derived by rotating the yaw angle φ around the Z b axis and rotating the pitch angle θ around the Y c axis. Finally, the inertial coordinate {E} is derived by rotating the roll angle ϕ around the X d axis. Thus, aircraft coordinate system {B} and inertial coordinate system {E} can be The SWs of the proposed six-rotor UAV are attached to brushless DC motors mounted at the ends of identical spires extending radially from the fuselage with equal spacing (see Fig. 4). The six SW arrays are divided into two groups according to the direction in which they revolve (clockwise or counterclockwise), alternating around the fuselage. The fact that the two SW groups revolve in opposite directions means that the positive and negative torques generated on the horizontal plane offset each other. The attitude of the UAV can be manipulated by varying the rotation speeds of the SWs as follows: roll (X b -axis rotation), pitch (paired Y b -shaft rotation), and yaw (paired Z b -axis rotation).
The proposed UAV is operable in two flight modes:  and quasi-flight modes. Figure  5 presents the  flight mode, where the horizontal axis of the motor is taken as the forward direction of the aircraft, which is regarded as the X b axis in the rigid body coordinate system. Figure 6 presents the quasi- flight mode, where the forward direction of the aircraft is along the symmetric center of the motor, which is regarded as the X b axis in the rigid body coordinate system. When operating in the  flight mode, tilting the fuselage forward causes the camera (hovering below the fuselage) to be blocked by the wing. Thus, most six-rotor aircraft adopt the quasi-flight mode.

Derivation of motion equations
As shown in Fig. 7, the equations describing the motion of a rigid body in a 3D space must consider its position and attitude as well as the effects of gravity F g , helical lift F T , and aerodynamic drag F a . As outlined in Ref. 9, the relationship between the lift and rotational speed of an SW can be written as follows: where ω 1 (rad/s) indicates the speed of the front-right SW, ω 2 (rad/s) indicates the speed of the right SW, ω 3 (rad/s) indicates the speed of the rear-right SW, ω 4 (rad/s) indicates the speed of the front-left SW, ω 5 (rad/s) indicates the speed of the left SW, and ω 6 (rad/s) indicates the speed of the rear-left SW. c T is the lift coefficient of an SW, which is related to the power of the DC motor and the shape of the SW and is derived empirically in aerodynamic experiments. The effect of gravity on the six-rotor UAV can be expressed as follows: where g = 9.8 (N / kg) is the acceleration induced by gravity at sea level and m (kg) refers to the mass of the UAV. For the sake of simplicity, we disregarded the influence of aerodynamic drag F a in modeling the proposed six-rotor UAV. The direction of the lift force generated by the SWs and the direction of gravity are opposite along the Z b axis; therefore, Eqs. (5) and (6) can be combined as follows: where F T indicates the total lift produced by the six DC motors, such that direction F T e 3 is the Z b direction of the shaft. In accordance with Newton's second law, the motion equation describing the displacement of the six-rotor aircraft is easily derived as follows: As mentioned above, the rotation of the two SW groups in opposite directions leads to the canceling out of the positive and negative torques induced by the SWs under the effects of aerodynamic drag. The six DC motors produce the total lift force as well as aerodynamic and gyroscopic moments relative to the center of mass. Essentially, the SWs (and attached motors) behave as gyroscopes, which can be manipulated to alter the pitch and roll directions of the UAV. Taking m 1 as an example, 1 g x τ is the gyro moment acting in direction X b calculated using the following formula: where φ   indicates the angular velocity in the X b direction of rotation, J r is the moment of inertia of an SW, and 1 ω  is the rotation speed of SW-1. Under the counterclockwise rotation of SW-1, SW-3, and SW-5, the gyro moment can be expressed as Under the clockwise rotation of SW-2, SW-4, and SW-6, the gyro moment can be expressed as From Eqs. (10) and (11), we obtain the following gyro moment: The direction of flight is along the X b direction; therefore, the rotation of the UAV around the X b -axis is referred to as roll. Basically, roll can be achieved simply by adjusting the speeds of SW-1 and SW-2 while keeping the speeds of the other SWs constant. Equation (12) can be simplified as follows: Similarly, the gyro moment of the six-rotor aircraft rotating in the Y b direction is described as The flight direction of the six-rotor UAV is along the X b direction; therefore, the rotation of the UAV around the Y b -axis can be referred to as pitch. Basically, pitch can be achieved simply by adjusting the speeds of SW-1, SW-3, SW-4, and SW-6 while keeping the speeds of SW-2 and SW-5 constant: In addition to the gyroscopic moment, it is necessary to consider the aerodynamic moment produced by the rotation of the SWs in calculating the rotation attitude, which induces roll, pitch, and yaw motions. In this paper, the distance between the center of the six-rotor UAV and the center position of the SW is defined as ℓ, c T is the lift coefficient of the SW, and c Q is the torque coefficient of the SW, such that the aerodynamic torque is calculated as follows: (10) Combining the gyroscopic and aerodynamic torques of Eqs. (13), (15), and (16) allows us to express the total torque on the three axes in the UAV coordinate system as follows:  where   2  2  2  2  2  2  1  2  3  4  5  6   1  1  1  1  2  2  2  2   3  3  3  3  0  0  2  2  2  2   T   x  T  T  T  T  T  T   T   y  T  T  T  T   T We assume that the six-rotor UAV is symmetrical with respect to the x, y, and z axes in the coordinate system of the rigid body, such that the moment of inertia with respect to the principal axis can be simplified as On the basis of the relationship between the moment of inertia and the moment of inertia in rigid body dynamics, we can derive (20)

Principles of flight
The lift of the UAV can be controlled by adjusting the speed of the DC motor. To facilitate subsequent analysis, we define the following: where T 1 refers to the thrust for ascending, T 2 is the pitch moment, T 3 is the roll torque, and T 4 is the yaw moment.

Ascending and descending
When the speeds of the DC motors are increased simultaneously beyond the point at which the lift force exceeds the effects of gravity and air resistance, the UAV ascends. When the lift force is less than the effects of gravity and air resistance, the UAV descends. When the lift force equals the effects of gravity and air resistance, the UAV hovers at the current height. Figure  8 shows a diagram of the UAV ascending. Figure 9 shows a diagram of the UAV descending. When the speed of a motor increases Δw simultaneously, the six-axis motor speed is As indicated by Eqs. (20) and (21), this causes the ascending thrust T 1 to increase, while the roll moment is T 2 = 0, the pitch moment is T 3 = 0, and the yaw moment is T 4 = 0. When the UAV is in balance, the UAV can only ascend or descend; therefore, Eqs. (20) and (21) can be simplified as follows:  Equation (23) demonstrates theoretically that when the speeds of all six DC motors are increased/decreased simultaneously, the UAV ascends/descends in a straight line.

Pitch mode
Equation (22) ) and (21)]. When T 1 maintains a constant ascending thrust while the roll torque is T 2 = 0, the pitch torque is T 3 ≠ 0, and the yaw moment is T 4 = 0, the UAV undergoes a pitch maneuver.
The above equation shows that under the influence of the pitch moment, the UAV tilts forward or backward and then moves in the corresponding direction (see Figs. 10 and 11).

Roll mode
When the six-rotor UAV is hovering in the air, the speeds of all the motors can be derived using Eq. (22). If the speed of brushless DC motor m 2 is increased and the speed of m 5 is decreased, then the speeds of m 1 , m 3 , m 4 , and m 6 remain unchanged. At this time, we can refer to ω 5 = ω s − ω ∆ , ω 2 = ω s + ω ∆ , and ω 1 = ω 4 = ω 3 = ω 6 = ω s [Eqs. (20) and (21)] to maintain the ascending thrust T 1 , rolling torque T 2 ≠ 0, pitching torque T 3 = 0, and yaw torque T 4 = 0 when hovering, causing the UAV to roll. Equations (20) and (21) for this mode can be simplified as follows:    T  Y  m  T  Z  g  m  I  I  J  T  I  I (25) The above equation shows that under the influence of a roll moment, the UAV tilts to the left or right and then moves in the corresponding direction (see Figs. 12 and 13).

Yaw mode
Increasing the speeds of m 1 , m 3 , and m 5 while decreasing the speeds of m 2 , m 4 , and m 6 produces yaw in the clockwise direction. In this case, we can refer to ω 1 = ω 3 = ω 5 = ω s + ω  Under these conditions, the UAV is maintained in a hover by the thrust and rotated clockwise by the yaw moment (see Fig. 14). However, decreasing the speeds of m 1 , m 3 , and m 5 while increasing the speeds of m 2 , m 4 , and m 6 produces counterclockwise yaw motion (see Fig. 15).

UAV Simulation Platform
Our primary objective in this study was to establish a platform by which to conduct laboratory simulations of the proposed six-rotor UAV under standard operating parameters. Figure 16 shows a photograph of the simulation platform, including the flight controller, fixed seat, six thrust components m 1 -m 6 , six sets of rack fixed seats, keyboard remote control, XBee S2C wireless transmission module, and other core modules.
In this study, we designed and fabricated the flight control panel and remote control system to enable operation of the proposed six-rotor UAV in the laboratory. It was hoped that this would help to elucidate the principles governing the flight characteristics of the proposed six-rotor UAV and the effects of the various control modes. It is essential that on-board flight controllers be small enough to fit within the center of the airframe and light enough not to compromise the balance or lift capability of the UAV. The flight controller comprised three main components: a microcontroller chip (AT90CAN128), a triaxial accelerometer (ADXL335), and a 12 to 5 V voltage conversion chip (SPB05A). Using the Protel 99SE package software, we overlapped the first two components to reduce the size of the circuit board. The microcontroller chip   transmitted six sets of PWM signals as driving signals to the six DC motors. Figure 17 shows a schematic of the circuit board organized according to function. Figure 18 illustrates the doublesided layout of the board. The printed circuit board can be produced by an engraving machine through the Gerber files generated by Protel package software. Figure 19 shows the entity photo after the flight control board was made.     flight modes; (3) a display frame listing commands sent by the remote control system, the connection information, and the flight status; and (4) a display frame listing flight attitude information, including the pitch, roll, and yaw angles.

Experiments
Equations (8) and (20) are respectively used to describe the translational and rotational motions of the six-rotor UAV. In the MATLAB environment, the simulations were implemented using a first-order Taylor series. Table 1 lists the parameters of the six-rotor UAV model. Readers may also refer to the information manual provided by Dajiang Innovation Inc.

Dynamic simulations: Unlocking controls and takeoff
The takeoff procedure of the six-rotor UAV includes the following: (1) unlock and start; (2) enter electrically regulated start mode. The microcontroller sends PWM signals with a period of 2.5 ms (400 Hz) and a pulse wave of 940 µs to the DC motors; (3) enter motor standby mode by sending a PWM signal with a period of 2.5 ms (400 Hz) and a pulse wave of 1144 µs; (4) enter takeoff mode by sending a PWM signal with a period of 2.5 ms (400 Hz) and a pulse wave of 1608 µs. When the device enters takeoff mode, the speed of the six motors is between 10443 and 10632 rpm. In order to make the aircraft rise smoothly, the simulation program stipulates that the same speeds (ω 1 = ω 2 = ω 3 = ω 4 = ω 5 = ω 6 = 10500 rpm) be maintained for 5 s. At this time, the thrust required for the UAV to ascend is calculated as follows: In Fig. 21, the UAV is ascending continuously. Note that discussions pertaining to the controller are beyond the scope of this paper; therefore, all flight control operations were implemented using an open-loop control system. The UAV was made to hover in the air by first reducing the speed of the six DC motors to 5400 rpm and maintaining it at that level for at least 2 s. According to Eq. (27), reducing the DC motor speed to 5400 rpm produced a corresponding decrease in thrust to 40.25 N, such that the effect of inertia was exceeded by the effect of gravity and the vertical speed approached zero. Two seconds later, the speed of the DC motors increased to 9340 rpm, which increased the thrust to 120.05 N, causing the UAV to hover without descending at 46.26 m. Overall, the simulation results were in good agreement with the actual flight conditions.

Dynamic simulation: Pitch and forward/reverse movements
Note that if the UAV can be made to hover in the air, then it can be made to fly away simply by adjusting the attitude. However, in real-world situations, interference from wind or fluctuations in the speed of a motor can seriously compromise the balance of the UAV. The design of the closed-loop controller is crucial to compensate for fluctuations. The UAV is made to hover by maintaining the thrust at 120.05 N. As mentioned in Sect. 3.3, if the speeds of m 3 and m 6 are increased while the speeds of m 1 and m 4 are decreased and the speeds of m 2 and m 5 remain unchanged, then the UAV will pitch around the y-axis. In this simulation, ω 1 and ω 4 were reduced by 145 rpm, and ω 3 and ω 6 were increased by 145 rpm, such that the pitch torque was calculated as follows: ( )  where c x and Ω were obtained from Eq. (17). With the UAV hovering in the air, increasing the speeds of ω 3 and ω 6 by 145 rpm while decreasing the speeds of ω 1 and ω 4 by 145 rpm for 2 s caused the UAV to rotate θ = 0.246 rad = 14.12° around the y-axis, while maintaining the altitude at 46.28 m, as shown in Fig. 22. Figure 22 illustrates the pitch motion of the UAV around the y-axis when varying the speed of the SWs. However, reducing the rotation speeds of ω 1 and ω 4 causes a corresponding reduction in tension at the front of the UAV, whereas increasing the rotation speeds of ω 3 and ω 6 causes a corresponding increase in tension at the rear of the UAV. Thus, the left and right torques are kept in balance owing to the consistent rotation speeds of ω 2 and ω 5 .
The force of the horizontal component generated by the fore-and-aft pull of the UAV can also be used to drive the UAV forward along the x-axis. In Fig. 23, with the UAV hovering in the air at a constant pitch angle, the horizontal thrust generated by tension at the front and rear ends of the UAV caused it to move forward along the x-axis (48.9 m in 10 s), during which the elevation dropped to 45.23 m due to the corresponding angle of descent. In Fig. 24, with the UAV hovering in the air at a constant pitch angle, the horizontal thrust generated by tension at the front and rear ends of the UAV caused it to advance along the x-axis (78.1 m in 10 s), during which the elevation dropped to 41.43 m due to the corresponding angle of descent.

Dynamic simulation: Roll and forward/reverse movements
As mentioned in Sect. 3.3, if the speed of m 2 decreases while the speed of m 5 increases and the speeds of m 1 , m 3 , m 4 , and m 6 remain unchanged, then the UAV will roll around the x-axis. In this simulation, ω 2 was reduced by 256 rpm and ω 5 was increased by 256 rpm, such that rolling torque was derived as follows:  where c x and Ω were obtained from Eq. (17). With the UAV hovering in the air, increasing the speed of ω 5 while decreasing the speed of ω 2 for 2 s caused the UAV to rotate ϕ = 0.2814 rad = 16.12° around the x-axis while maintaining its elevation at 46.27 m, as shown in Fig. 25.
Reducing the speed of ω 2 to reduce tension on the right side and increasing the speed of ω 5 to increase tension on the left side while maintaining the speeds of the other motors balances the front and rear torques. The lateral thrust generated by the left and right pulls of the UAV can also be used to drive the UAV along the y-axis. In Fig. 26, with the UAV hovering in the air at a constant roll angle, lateral thrust generated by tension at the left and right ends of the UAV caused it to advance along the y-axis (48.92 m in 10 s), during which the elevation of the UAV dropped to 45.24 m due to the effect of the roll angle.

Dynamic simulation: Yaw motion
As mentioned in Sect. 3.3, increasing the speeds of m 1 , m 3 , and m 5 while decreasing the speeds of m 2 , m 4 , and m 6 induces yaw motion in the clockwise direction. In this simulation, ω 1 , ω 3 , and ω 5 were increased by 735 rpm while ω 2 , ω 4 , and ω 6 were reduced by 735 rpm, such that the yaw moment can be calculated as follows: ( ) 4 1.164 N m where c z and Ω were obtained from Eq. (17). With the UAV hovering in the air, increasing the speeds of ω 1 , ω 3 , and ω 5 while decreasing the speeds of ω 2 , ω 4 , and ω 6 induced yaw rotation in the clockwise direction. This caused the UAV to rotate φ = 0.594 rad = 34.04° around the z-axis while maintaining its elevation at 46.32 m, as shown in Fig. 27.

Conclusions and Directions for Future Research
Clarifying the characteristics of six-rotor UAVs to optimize flight performance requires a solid understanding of the underlying theory, including the derivation of motion equations and dynamic equations as well as the design of control systems. This paper outlines the motion equations for a novel six-rotor UAV as well as a proprietary flight simulation platform based on the MATLAB toolbox. The simulation system provides eight types of motion: ascending, descending, moving forward, moving backward, tilting to the left, tilting to the right, rotating to the left, and rotating to the right. Note that the MATLAB GUI toolbox cannot provide the visual appeal of professional rendering software, and its dynamic simulations in a 3D space are limited. We recommend that the Unity game engine be used in the future to improve the scope and precision of dynamic 3D simulations.
The sensor plays a key role in this paper. The system uses a three-axis accelerometer (ADXL335) to sense the tilt state of the six-axis flying wing, so as to change the speeds of six brushless DC motors and achieve the purpose of UAV balance control. To reduce the size of the circuit board, the three-axis accelerometer is placed under the microcontroller chip. The microcontroller continuously reads the roll and pitch angles of the three-axis accelerometer, and changes the PWM signal to adjust the speeds of the six propellers so that the UAV can maintain balance during the flight.