Abstract
In this article, the dynamics model of a hexacopter equipped with a robotic arm has been formulated using Newton–Euler’s method and its stability was investigated. For disturbances emulation, a simplified pendulum method was used. This hexacopter configuration was not covered in scientific papers before. The resulting model is a nonlinear, coupled, and underactuated dynamics model, which includes aerodynamic effects and disturbances because of equipping the hexacopter with a robotic arm. The purpose of the presented article is to offer a comprehensive study of determining the inertia moments of the hexacopter using a simplified pendulum method, taking into consideration the effect of mass distribution and center of gravity changes, which are a result of the continuous movement of the manipulator during the hexacopter motion in the air. The experimental tests were made using SolidWorks application and were evaluated using LabVIEW in order to get a complete view of the disturbances, which were inserted into the dynamics model. The overall aircraft model was driven by four classical proportion, integral, and derivative controllers for the vehicle’s attitude and altitude of a desired trajectory in the space. These controllers were used to get a good understanding of how to evaluate and validate the model to make it an anti-disturbance model, in addition to their ease of design and fast response, but they require development in order to get optimal results. In future, a precise trajectory will be defined, and the controllers will be developed in order to get robust stability using nonlinear techniques and artificial intelligence.
Keywords
Introduction
This work focuses on modeling and simulation of a hexacopter type unmanned aerial vehicle (UAV). Choosing a hexacopter is challenging in the field of control because it is a highly nonlinear, multivariable, and underactuated system. It has stationary flight and high maneuverability. 1 An underactuated system is a mechanical system in which the dimension of the configuration space exceeds that of the control input space, that is, with fewer control inputs than the degrees of freedom. 2 Modeling of such a system is not a trivial problem due to the coupled dynamics of the aerial vehicle. 3
The contribution of this article lies in simplifying the dynamic modeling of the flying object equipped with a robotic arm. By deducing the equations of motion, with the inclusion of direct disturbances that represent the robotic arm movement, by the equations of force and moment, in comparison with other works of Lucia et al. 3 and Alvarez-Munoz et al., 4 which relied on a complex mechanism through the mathematical modeling of certain arms of fixed design, and adding it to the flying object equations. This is considered limited, complex, and does not cover the changes that may occur in the air and weather conditions to which the aircraft is exposed in the air far from laboratory conditions.
The adopted disturbances in this research are produced based on compound-pendulum method 5 –8 and studied to cover all the random changes that may face the aircraft, and which cannot be considered as constants. This method gives a complete and clear picture of the disturbances that are affecting the inertia moment, center of gravity (CG), and mass distribution in the coordinate frame of the aircraft during its movement in the air. The experimental tests of disturbances were taken using SolidWorks application and were checked by mathematical calculations. This method, which was not mentioned in literature before, gives a complete handling of noise determination and formulates random disturbances’ functions 9 that were inserted into the dynamics model of the hexacopter. Inertial moments amounts were studied according to the overall aircraft model, 10 –13 in addition to applying the theory of parallel axis of Huygens-Steiner, 14 which is concerned with studying the new inertia moment of the studied part relative to new axis of study parallel to the axis of the part to be studied.
The contribution of this research lies in deducing a precise and detailed mathematical model of a hexacopter type aircraft in comparison with other researches like Alvarez-Munoz et al. 15 that relied on assumptions and simplifications to make the modeling easier like mass distribution and other parameters in the body of the aircraft. The equations of motion of the whole system were designed using the Newton–Euler formulation for translational and rotational dynamics of a rigid body. 16 –18 The disturbances are presented as an environment for outdoors simulation, which is omitted in most of the scientific literature. 3,4,15 This article is structured as follows: initially, kinematics and dynamics are described. Then, equations of motion are derived for modeling and disturbances analysis. Finally, proportion, integral, and derivative (PID) controllers and simulation results are presented. The future work will focus on developing attitude, position, and altitude robust controllers to obtain proper strategies for autopilot stabilization and trajectory control.
The hexacopter reference frames
This section describes the dynamical model of the UAV hexacopter. The structure of the hexacopter and the engineering design are illustrated in Figure 1. In order to describe the hexacopter motion, only two reference frames are necessary: the earth inertial frame (E-frame) and the body-fixed frame (B-frame). The motion of an aircraft is always planned by using geographical maps, so it is useful to define an earth-fixed frame tangent to the earth surface. One of such a frame is the system that uses the North, East, and Down (NED) coordinates. 3,18 The origin of this reference frame is fixed in one point located on the earth surface, and the (X, Y, Z) axes are directed to the NED, respectively. This earth-fixed frame is seen as an inertial frame in which the absolute linear position (x, y, z) of the hexacopter is defined.

Hexacopter UAV structure and frames. UAV: unmanned aerial vehicle.
The mobile frame (X
B, Y
B, Z
B) is the body-fixed frame that is centered in the hexacopter CG and oriented as shown in Figure 1. The angular position of the body frame with respect to the inertial one is defined by Euler angles: roll φ, pitch θ, and yaw ψ. These together form the vector:
where
Aerodynamic forces and moments in axial flight
The hexacopter UAV systems are quite complex, and their movements are governed by several factors either mechanical or aerodynamic. Our aim is to provide the mathematical equations driving the dynamical behavior of the hexacopter by means of a generalization of the Quadcopter model presented in Sjoholm and Biel. 23 The motion of a rigid body can be decomposed into translational and rotational components. Therefore, in order to describe the dynamics of the hexacopter, the Newton–Euler equations that govern linear and angular motion are used. In order to get equations of motion of the entire system, the following assumptions have been made: The hexacopter is a rigid body, and it has a symmetrical structure. This leads to the following equations
where I 3×3 is a 3×3 identity matrix, 03×3 a 3×3 zero matrix, m Є R is the hexacopter total mass, and J Є R 3 is the diagonal inertia matrix.
Force analysis
Thrust force
The main force affecting the aircraft movement is the thrust force resulting from the motors and propellers that lift the aircraft in the air. The model consists of six motors, and according to the suggested engineering model in Figure 1, the motors in the model are parallel and perpendicular to the aircraft surface, so we conclude that the total thrust force vector of the aircraft is T and it is the sum of the propellers thrust force vectors

Thrust vector.
Then, the main rotor thrust can be expressed as a vector in the body-fixed frame as
By applying the small-angle assumption, T the total lift of the main hexacopter tilted in comparison to the motor shaft can be rewritten as
Then, thrust and torque are 16
where blade rotation is with angular velocity ω, CT and CQ are respectively thrust and torque coefficients, ρ is the air density, R is the blade radius, and A is the propelling disc area. The thrust and torque coefficients can be written as
where σ is the rotor solidity, CLα is the lift slope coefficient, CD is the drag coefficient, θb denotes the blade pitch angle, and γC and γi are the inflow factors. Finally, the total force of thrust generated by the six propellers is defined as
Drag force
It is the opposing force to the traveling of the solid body in the air, which is resulting from the aerodynamic friction
23
and it is similar to the characteristics of the systems damping elements. This force is related to the air density and to the velocity and can be expressed by the following equation at the body’s frame:
Gravitational force
The gravity force is directed toward the center of earth during the aircraft trip in air; therefore, it is possible to describe the relation of gravity force within the frame of the aircraft body that is acting at the CG by the following equation, 20 where g is gravity constant
Disturbance force
Other forces like the Coriolis force from the earth, the wind, and Euler forces are considered as a disturbance, summarized as Fdist
Therefore, the equations of motion that govern the translational motion based on Newton–Euler with respect to the body frame are
The equations of motion that governs the translational motion for the hexacopter with respect to the inertial (earth) frame are
Moments analysis
The aircraft is affected by several types of moments: the thrust moment resulting from the motors, the motors inertia moment, the aerodynamic moment, and the disturbances moment. Supposing, the inertia matrix of the aircraft is J, the structure of the aircraft is symmetric, noticing that the aircraft is affected by disturbances from the robotic arm, and the controllers and the load are in the center. The moments acting around the center of the aircraft can be analyzed as follows.
Propeller moments
The Mthrust is a part of the external moments acting on the system, described by the propeller thrust

Hexacopter architecture.
The aerodynamic moment
It is the moment resulting from the aerodynamic friction, and it affects negatively the total moment. The aerodynamic moment is expressed as:
Disturbance moment
It is the total of the disturbances affecting the torque around the aircraft axes resulting from disturbances in the motors movement: the wind and the load in the aircraft
Therefore, the equations of motion that govern the rotational motion based on Newton–Euler with respect to the body frame are
The equations of motion that governs the rotational motion for the hexacopter with respect to the inertial (earth) frame are
The suggested mathematical model as shown in the equations is characterized by nonlinearity, time variance, and close inner correlation among the system variables where any change in the input variables leads to changes in most of the output variables. Figure 4 shows a block diagram that contains the input and output variables of the dynamic model of the aircraft.

Mathematical model of the hexacopter.
Control mechanism
The block diagram in Figure 4 shows the variables of the mathematical model of a multi-propeller aircraft. The control mechanism is through controlling the motors speed variables
There are three movements that describe all possible combinations of attitude: roll (rotation around the X-axis by angle φ), pitch (rotation around the Y-axis by angle θ), and yaw (rotation around the Z-axis by angle ψ). The roll control is obtained by changing the velocity of motors 3, 4, 5, and 6, and this movement is called lateral motion. Then, the pitch control is obtained by changing the velocity of all motors, resulting in the longitudinal motion. Finally, the yaw control is obtained by changing the velocity of all motors.
The change of motors speed for attitude control should be fixed and based on differential control strategy as seen in Figure 3 and equations of moments, that is, the pitch control around the Y-axis is obtained by changing the torques around this axis by increasing (T 1, T 3, T 5) and decreasing another side (T 2, T 4, T 6) using the following equation
The roll control is obtained as follows
while the yaw control is based on the torque difference between the neighboring motors
Altitude control is obtained by changing all motors’ velocity with a fixed change. This is based on the force equations in Z component, noticing that the thrust is equivalent to the square of the motors angular velocities. To increase the altitude, all motors velocities must be increased, and vice versa. The equation that governs the altitude is:
Now we can put the equations that connect between artificial and real input vectors as follows, and Figure 5 shows the implementation

Angular motor velocities calculation using the artificial vector.
Studying the disturbances of the arm movement in space
The block diagram in Figure 6 is the complete mathematical model of the hexacopter aircraft with the addition of disturbances block. These disturbances represent the existence of a robotic arm with a payload, which affects the overall dynamics model of the aircraft by adding moments and forces that represent noise and was defined previously in the aircraft’s equations of motion in “Aerodynamic forces and moments in axial flight” section. The disturbances that are affecting the aircraft’s CG change with time as a result of the change in the robotic arm angles in all directions, therefore making the motion equations variable with time. In this research, we suppose the representation of the arm movement with a related payload as a compound pendulum with the adoption of a mathematical procedure.
5
–8
This gives a complete and clear picture of the disturbances that are affecting the inertia moment and CG in the coordinate frame of the aircraft during its movement in the air. Since the used aircraft model is a multirotor UAV model, which is considered a solid body with a symmetric form, the parameters of the change in the disturbances functions of the motion equations can be defined according to the following general form based on the pendulum model. The shape of the aircraft was supposed approximately as a rectangle as shown in Figure 7. The pendulum motion takes place according to the angles of motion (θ1, θ2, θ3) as illustrated in Figure 7, and these angles ranges are (

Block diagram of the hexacopter dynamics system.

General model of the pendulum movement disturbances.
The simplification based on the assumption that the pendulum motion occurs when the aircraft is fixed in the air in hovering position, therefore the aerodynamic effects resulting from airflow through the pendulum become neglected. In the following, the change in the overall CG and the inertia moment resulting from the pendulum motion will be studied mathematically and will be compared with the measurements resulting from the simulation depending on SolidWorks program and MATLAB program. Assuming the initial values of the pendulum angles are (
General specifications of the overall aircraft model.

The workplace of the payload CG. CG: center of gravity.
Studying the CG change
Through the study of the workspace changes of the pendulum motion in the 3-D space, the payload’s CG will draw in space a half sphere-like shape as in Figure 8. Due to these changes, the aircraft’s dynamics model CG will change accordingly through the axis of the aircraft body X B, Y B, Z B, as shown in Figure 9. These changes as a whole are considered similar to half-sphere shape too. As it is noticed from the curves and as shown in Table 2, the maximum value is reached by the elements of the centers of gravity of the model. The process of studying the workspace of the movement of the centers of gravity was made using computerized simulation.

The disturbances in the CG. (a) Disturbances along X B, (b) disturbances along Y B, (c) disturbances along Z B and (d) disturbances in 3-D. CG: center of gravity.
Maximum values reached by the elements of the disturbances in the CG.
CG: center of gravity.
Studying the inertia moment
The inertia mass moment of complex shaped bodies is calculated using experimental methods, which in turn enter into many calculations within the equations of the aircraft dynamics. Here, we will adopt mathematical methods in addition to simulation in the process of estimating the moment, where the inertia moment of the overall aircraft model is given according to the formula described in the relation below, through which the mathematical study has been simplified by dividing the overall aircraft model into several parts and each part was studied separately. Where our goal is to determine the amount of inertia moment of the overall aircraft model according to the basic coordinate system X B, Y B, Z B. 10
where
J: Inertia moment matrix of the overall aircraft dynamics model;
J
Body: Inertia moment matrix of the aircraft body;
J
Joint: Inertia moment matrix of the joint;
J
Link1: Inertia moment matrix of the first link; JLink2: Inertia moment matrix of the second link; and JLoad: Inertia moment matrix of the load.
Where the inertia moment matrix take, the general form shown in equation
The inertia for each part of the aircraft and the pendulum is studied according to several theories. Including the theory of parallel axis of Huygens-Steiner, 14 which is concerned with studying the new inertia moment of the studied part relative to a new axis parallel to its axis and shifted from it by a specific distance, as in the equation below. Through our study, we will decide the inertia moment of each part of the overall model according to the coordinates system X B, Y B, Z B.
where
where J0 : new inertia moment of the studied part according to new axes parallel to the output coordinates system by the angles α, β, and γ, as shown in Figure 10. While Jxx , Jyy , Jzz , Jxy , Jxz , and Jyz are the elements of the local inertia moment matrix of the studied part. The curves in Figures 11 to 16 illustrate the disturbances in the inertia moments of the aircraft overall dynamic model relative to the range of the pendulums angles change. As it is noticed from the curves and as shown in Table 3, the maximum value is reached by the elements of the inertia moments matrix of the model. Table 4 shows the errors between the calculated results based on SolidWorks program and the theoretical calculations of the values of specific samples of the pendulum angles in order to illustrate the difference between the derived values by simulation and the theoretical study.

Angles of difference between the local axis of the studied body and the new axis.

Jxx changes.

Jyy changes.

Jzz changes.

Jxy changes.

Jxz changes.

Jyz changes.
Maximum values reached by the elements of the inertia moments matrix of the overall model.
Errors between the calculated results based on SolidWorks program and the theoretical calculations.
These results can determine a clear vision of the disorders affecting the dynamics of the aircraft motion in space and help in implementing a model that is resistant to disturbances as much as possible in addition to designing an adaptive controller resistive to noise. Finally, we can analyze the general form of disturbances, which simulates the robotic arm motions and insert it into equations of motion specified in “Control mechanism” section. These disturbances were presented as shown in Figure 17 and were emulated based on the characteristics of the results of studies from the change of inertia moments and CG.

Force and momentum disturbances resulted from the robotic arm.
We analyzed the correlation between all parameters of the hexacopter in Figure 18. The artificial input up is changed to 10 to control the pitch angle, and the control inputs remained fixed as follows:

Stability study of the hexacopter variables due to change of input up with the existence of disturbances.
PID controller design
In this article, we presented four linear and classical PID controllers, these controllers were adopted as it is distinguished by its ease of design and fast response, and its parameters were tuned using Ziegler Nichols algorithm 24 to get the best performance. The controllers speed here is considered suitable in a way that enables tracking the vibrations and changes in order to avoid the vibrations in the output of the aircraft as much as possible. The aim of these controllers is to control attitude and altitude of the vehicle at desired trajectory in space. A mathematical model of PID is described as following equation 24
Parameter kc is the proportional gain, Ti is the integral time, and Td is the derivative time. These parameters are defined, in order to get the best performance by decreasing vibrations, steady-state errors, and response time.
Figure 19 shows a block diagram of PIDs controlling hexacopter. The parameters of each PID used in control are defined in the following equations

The block diagram of a PID controller connected to the hexacopter model. PID: proportion, integral, and derivative.
To control a hexacopter an application was conducted by LabVIEW using Runge–Kutta 2 method with a fixed step of 0.05 s. Four PID controllers were implemented to stabilize the altitude and attitude as shown in Figures 20 to 24. The curves show the control signal and the fast response of the controllers with the existence of disturbances, which emulates the existence of an arm in a non-laboratory environment. These controllers avoid the occurrence of vibrations in the output variables of the flying object as possible. The tuning process has been achieved after many experimental trials. Our scenario is the hovering flight at the altitude of multilevels in the air. Future work focuses on developing a precise trajectory control by using robust techniques to stabilize the whole system and drive the hexacopter to the desired trajectory of Cartesian position, attitude, and airspeed. The system’s parameters, which has been used in the simulation model, are listed in Table 5. Correlations were analyzed for all parameters of motion equations.

Stability response of altitude and control signal.

Stability response of pitch angle and control signal.

Stability response of roll angle and control signal.

Stability response of yaw angle and control signal.

Stability response of X and Y coordinate systems.
Parameters used in the simulation.
Stability analysis
Curves in Figures 20 to 24 show the control signal and the quick response of the controllers with the existences of disturbances, which emulate the existence of an arm in non-laboratory environment. These controllers avoid the occurrence of vibrations in the output variables of the flying object as possible. Taking into consideration an analytic study of the controller’s stability based on studying the unity response with several different levels of altitude and attitude according to Table 6, we find that these controllers are suitable but not ideal and require development in order to get optimal results. Currently developing the controllers is going on in order to get robust stability through including nonlinear techniques and artificial intelligence.
Stability response of PID controllers.
PID: proportion, integral, and derivative.
Conclusions
A real and complex dynamic model was considered, which addresses the nonlinearity, time variance, underactuation, and disturbance. This article gives a complete discussion of the determination of the moments of inertia by simplified pendulum method, in addition to taking into consideration the effects of mass distributions and CG change. These disturbances were inserted into the equations of motions, which also simulate a robotic arm motion while the aircraft model is flying in the sky. An application was conducted using SolidWorks and LabVIEW using Runge–Kutta 2 method. Correlations were analyzed for all parameters of motion equations. Four PID controllers were implemented to stabilize the altitude and attitude. These controllers’ parameters were tuned using Ziegler Nichols algorithm to get the best performance and avoid the occurrence of vibrations in the output variables of the flying object as possible. These controllers are suitable but not ideal and require improvement in order to get optimal results. Future work focuses on developing a precise trajectory control by using robust techniques to stabilize the whole system and leads the hexacopter to the desired trajectory of Cartesian position, attitude, and airspeed.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship and/or publication of this article: The contribution is sponsored by VEGA MŠ SR No 1/0367/15 prepared project, “Research and development of a new autonomous system for checking a trajectory of a robot” This publication is the result of implementation of the project: “UNIVERSITY SCIENTIFIC PARK: CAMPUS MTF STU - CAMBO” (ITMS: 26220220179) supported by the Research & Development Operational Program funded by the EFRR.
