Modeling and Nonlinear Control of a Quadcopter for Stabilization and Trajectory Tracking

This paper presents an adequate mathematical representation of a quadcopter’s system dynamics and effective control techniques. A quadcopter is an unmanned aerial vehicle (UAV) that is able to do vertical take-off and landing. This study presents a nonlinear quadcopter system’s mathematical modeling and control for stabilization and trajectory tracking. The mathematical model of the system dynamics of the quadcopter is derived using Newton and Euler equations with proper references to the appropriate frame or coordinate system. A PD control algorithm is developed for the nonlinear system for stabilization. Another nonlinear control technique called full state feedback linearization (FBL) using nonlinear dynamic inversion (NDI) is developed and implemented on the quadcopter system. However, there is a problem with the normal approach of the complete derivation of the full state FBL system using NDI as gathered from the literature review. In such an approach, the PD controller that was used for attitude stabilization was able to stabilize the angles to zero states, but the position variables cannot be stabilized because the state variables are not observable. Thus, a new approach where the position variables are mapped to the angle variables which are controllable so as to drive all states to zero stability was proposed in this study. The aim of the study was achieved but the downside is that it takes a longer time to achieve this stability so it is not efficient and should only be considered when absolute zero stability is the aim without considering time efficiency. The study further investigates the problem of nonlinear quadcopter system’s mathematical modelling and control for stabilization and trajectory tracking using the feedback linearization (FBL) technique combined with the PD controller. The proposed control algorithms are implemented on the quadcopter model using MATLAB and analyzed in terms of system stabilization and trajectory tracking. The PD controller produces satisfactory results for system stabilization, but the FBL system combined with the PD controller performs better for trajectory tracking of the quadcopter system.


Introduction
A quadcopter, also known as a quadrotor, is a rotor-based aerial vehicle. ey are multirotor aircrafts propelled by four rotors. To balance the torque, these rotors are built with two pairs of opposite rotors revolving clockwise and the other rotor pair moving anticlockwise. A quadcopter's dynamics are highly nonlinear; it is an underactuated system with six degrees of freedom and four control inputs which are the rotor velocities. e quadcopter is controlled by adjusting the rotors' angular speeds, which alters the quadcopter's torque and thrust characteristics. e quadcopter is designed with four rotors in cross-con guration, as shown in Figure 1. Two opposite rotors rotate in the same direction; the altitude and position of the quadcopter can be controlled by varying the rotor's angular speed. e quadcopter can be kept in a balanced position without spinning if the generated torque of the motors T1, T2, T3, and T4 is the same.
rust controls the quadcopter's altitude for ascending and descending and is achieved by increasing or reducing the rotational speed of motors 1, 2, 3, and 4, simultaneously. Roll is the movement of the quadcopter by tilting either left or right to allow side movements. Pitch is the movement of the quadcopter by tilting either front or back to allow forward or backward movement. Yaw is movement in a clockwise or anticlockwise manner while staying level to the ground to change the quadcopter's direction. ese flight motions can be achieved by controlling the rotational speeds of the four motors.
Quadcopter designs have recently been popular in UAV research. To control and stabilize the aircraft, these UAVs use an electrical control system and sensors [1]. e small unmanned aerial vehicles (SUAV) have become a reality, thanks to recent microcomputer technology, sensor technology, control systems, and dynamics theory advancements. Due to their compact size, low cost, and agility, these systems are being used in various applications.
Indoor quadcopters are usually relatively small in size and cannot utilize GPS for absolute positioning. ey thrive in the absence of strong winds and relatively stable light conditions and their missions are usually shorter than those of an outdoor quadcopter [2,3]. Outdoor quadcopters are relatively bigger in size than the indoor quadcopter and can utilize GPS for absolute positioning. ey are more durable and can fly for longer periods of time than indoor quadcopters [2]. A DJI Phantom 4 is an example of an outdoor quadcopter [4].
In the 1920s and 1930s, a few manned designs existed. ese vehicles were among the first heavier-than-air vertical take-off and landing (VTOL) vehicles to be successfully tested [1]. However, early prototypes performed poorly due to weak stability augmentation and restricted control authority, while latter versions required too much pilot effort. Historically, basic linear control techniques were used to ensure easy computation and flight stability, but due to improved modeling techniques and faster computational capabilities, it is now possible to run comprehensive nonlinear techniques in real-time [5]. e major components of a quadcopter are frame, propeller, motor, speed controller, flight controller, battery, transmitter, and receiver [6,7]. Linear control techniques can be implemented on the controller of a quadcopter by linearizing the system about an equilibrium point, but such approximation may not preserve the dynamics of the system at every point and are not usually very effective in practical scenarios.
As the range and complexity of applications for quadcopters expand on a daily basis, the control techniques utilized on the system must also improve. is paper aims to develop a mathematical model of a quadcopter system and implement nonlinear control techniques on the derived model for stabilization and trajectory tracking of a quadcopter. e full state feedback linearization (FBL) system control based on dynamic inversion for a nonlinear system of a quadcopter is derived and computed in this paper without the use of small-angle approximation.

Literature Survey
e mathematical modelling and control of a quadcopter are presented in [8]. A matrix approach and the use of bond graphs to describe the dynamic model of a quadrotor are elaborated in [9]. A more detailed derivation of the system dynamics is given in [10]. e work in [8] shows the basics of quadcopter modelling and control to serve as a stepping stone for future research advancement. A detailed study of the mathematical model of the quadcopter dynamics is given, and the differential state equations of the system dynamics are derived from both the Newton-Euler and Euler-Lagrange equations. A simple mathematical model is presented in this paper, neglecting several aerodynamic effects and the modelling of the electric motor spinning the rotors.
e developed model is simulated to analyze the behavior of the system, and control algorithms are implemented for stability and trajectory control of the system. e PD controller is used to achieve this, and a heuristic method is developed for trajectory control of the quadcopter flight. Integration of the PD controller and the heuristic method is used to minimize the disturbance on the quadcopter system caused by external forces. e PD control algorithm was integrated into the heuristic method because the heuristic method development did not account for unmodelled disturbances (wind). A decline in the performance of the PD controller was observed if the parameter values were extremely small or high. e necessity for an actual experimental prototype was identified, so those realistic and accurate findings could be acquired and comparison between the simulated results and real-life measurements would be possible. e PID controller may utilize the three controller terms of proportional, integral, and derivative gains to implement precise and optimum control output [11]. e controller attempts to minimize the error over time by adjusting the control variable u(t).
e proportional gain produces an output that is proportional to the error value e(t). is output is obtained by multiplying the error value by a proportional constant. e integral gain considers the past error values and seeks to reduce the residual error by adding a control effect obtained from the integration of the cumulative previous errors. e derivative gain anticipates or predicts the future behavior of the error and exerts a control effect produced by the rate of change of the error with respect to time [12]. e linear quadratic regulator (LQR) is a popular linear control algorithm that provides optimally controlled feedback gains to enable stability and high-performance design of closed-loop systems. e LQR controller is implemented on a linearized system and makes use of a mathematical algorithm to minimize a cost function with when the weighting factors are provided. e cost function is often described as the sum of deviations of certain key measurements from their desired values [13]. Several control algorithms have been researched for quadcopters for attitude stabilization and trajectory tracking. e objective is to implement a control algorithm that permits the quadcopter's states to converge to an unpredictable set of time-varying reference states. It is possible to control the quadcopter by linearizing the system dynamics around a stable point and applying linear control techniques, as shown in [14,15]. Nonlinear control algorithms such as backstepping, sliding mode [16,17], and feedback linearization [16,18] are effective for quadcopter control as better performances have been observed from their implementation. Numerous control algorithms for attitude control have been studied. ese include the PID controllers [5,8,10], inverse dynamic control, sliding-mode controller [19], linear quadratic regulator [5], and feedback linearization control [18][19][20]. A hierarchical control approach is used in [10], where different levels (controlling rotor rotational speed, vehicle attitude, and trajectory position) form feedback loops.
A review of control algorithms for autonomous quadrotors is presented in [20]. Several control algorithms are analyzed to propose hybrid systems that would combine the advantages of more than one control algorithm. e focus of this paper was to implement the optimal control algorithm of the quadrotor manned aerial vehicle for game counting in the protected game reserves in Africa. e control algorithms analyzed in this paper are PID, linear quadratic regulator (LQR), sliding-mode control, backstepping control, adaptive control, and artificial neural networks. From the review, no particular control algorithm gives the best performance in all required features in terms of fast response, disturbance rejection, stability, robustness, adaptability, optimality, and tracking ability. A hybrid control system could have the best combination of some of these features but does not guarantee overall optimum performance. Certain features are more important depending on the application of the quadrotors; hence, compromises would have to be made to implement control algorithms that excel in such areas of application. A quadrotor to be used for game counting is designed to prioritize specific characteristics such as high endurance, high agility, high cruising, low noise, and vertical take-off and landing ability. is paper concluded that the designed quadrotor would be suitable for assisting nature conservationists in game counting and obtaining accurate animal statistics. A PID controller with provision for angular acceleration feedback is utilized in [21] for attitude stabilization.
is causes significant gain increase resulting in higher bandwidth.
A comprehensive mathematical modelling of the kinematics and dynamics of a quadcopter system is described in [22]. e kinematic aspect of the modelling depicts the quadcopter motion without considering the forces acting on it, whereas the dynamics explain the forces causing the motion. is gives an overview of the response of quadcopters when under the influence of extraneous forces. Nonlinear state equations for the system were derived, and the manual method to obtain minimum steady-state error for PID tuning is presented. is research resulted in a quadcopter with a composite frame assembled and implemented in real-time for pitch, roll, and stabilization with PID control. e results yield adequate performance when the hardware configuration is at the hover point.
A thesis on quadcopter flight mechanics model and control algorithms is shown in [2]. e focus of this thesis was to develop a nonlinear model of quadcopter flight mechanics with suitable control algorithms for stabilization and implement in MATLAB/Simulink. e quadcopter dynamics were derived from the equation of motion and forces, and a nonlinear model was obtained based on these dynamics. Aerodynamic effects such as nonzero free steam and blade-flapping are ignored in the derivation of the system equations, but other forces such as air friction and drag forces are considered. For analysis of the system, the model is linearized at a stable hover point, and both the linear and nonlinear models are analyzed. e gradient descent method is used for controller tuning to obtain optimum control parameters, and the system is simulated for a given period of time. A better performance was observed from the automatically tuned PID controller (using the gradient descent method) than the manually tuned PID controller.
e design and control of quadrotors in relation to autonomous flying [1] are a thesis that entails the modelling, design, and control of small flying drones with a focus on vertical take-off and landing (VTOL) systems. In this thesis, an autonomous quadrotor called OS4 is modelled and simulated with various controllers. A more complex mathematical model is presented here as the system dynamics account for more realistic aerodynamic coefficients, sensor, and actuator models. e OS4 quadcopter model is simulated with five different control algorithms. e first one was based on Lyapunov theory and was implemented for attitude stabilization, but after simulation on OS4, it was observed that it was not stable enough to allow hover flight. e second control algorithm implemented was the PID controller, and it was suitable for attitude stabilization of the quadcopter system when flying near hover, but this was only possible in the absence of huge disturbances. e third control algorithm was an LQR controller that presented adequate stabilization, but this control algorithm was less adaptive than the PID. e fourth control algorithm was the backstepping controller, which achieved excellent stabilization and control in relatively large disturbances. e fifth control algorithm implemented was the sliding-mode technique, but this control algorithm did not give desirable results because the switching characteristics of the controller were not compatible with the dynamics of the quadcopter system. After the implementation and analysis of these five control algorithms, a suitable control algorithm was developed by integrating the PID and the backstepping Journal of Engineering 3 algorithm called integral backstepping. is was used for altitude, attitude, position, and trajectory control, and the implementation of this control algorithm on the OS4 enabled the system to take-off, hover, land, and avoid collisions. e thesis noted that the OS4 was the first collision avoidance quadcopter system. A fundamental drawback in quadrotor control is related to their high energy and power consumption [23]. erefore, a controller was proposed with a power reduction methodology and cuckoo search algorithm (CSA) for tuning the controller gains to control the quadrotor position by a PID controller while the orientation control is achieved through a model-based controller [24]. A control strategy composed of a sensor fault diagnosis unit and a disturbance observerbased sliding-mode controller for quadrotor helicopters to simultaneously accommodate sensor faults and external disturbances were developed and analyzed [25]. Another fault-tolerant control scheme [26] was proposed for attitude control using adaptive sliding-mode backstepping control to accommodate the actuator faults, despite actuator saturation limitation and disturbances.
Classical controllers for UAVs and quadcopters involve the use of small-angle approximations [27]. For instance, a cascaded PID controller was designed for trajectory tracking but was made to hover at an altitude where the nonlinear model is linearized [28]. Sophisticated architectures such as genetic algorithm, neural networks, fuzzy logic [29], and adaptative control have to be integrated to classical controllers in order to achieve stability, robustness, optimal control, complex manoeuvres, and large angles. An example is a novel deep learning-based robust nonlinear controller that improves control performance of a quadrotor during landing by combining a nominal dynamics model with a deep neural network (DNN) that learns high-order interactions. A nonlinear feedback linearization controller was designed using the learned model and prove system stability with disturbance rejection [30]. A self-tuning PID controller based on fuzzy logic was designed to cater for payload weight variation. An adaptive robust control (ARC) was utilized to compensate for the parametric uncertainty for the UAVs altitude control [31]. e comparison between the conventional PID and self-tuning PID base on fuzzy logic shows the superiority of the self-tuning PID compared to the PID for variable payload weight [32]. e effectiveness of the PID controller was enhanced by the implementation of a genetic algorithm to autotune the controllers in order to adapt to changing conditions [33]. Five different control systems that include a traditional PID controller, two fuzzy-PD controllers, and two controllers autotuned using a GA were designed based on the developed dynamic model and their performance was compared. e fuzzy-PD controllers showed effectiveness with large angles and complex paths.
In this section, previous works on modelling and control of a quadcopter were discussed and reviewed. A precise overview of those topics was analyzed and examined to provide a more rounded understanding of the quadcopter system components, modelling, and control. From the papers reviewed, the importance of implementing a good control for a quadcopter is emphasized and different linear and nonlinear control algorithms are studied. In this research, the FBL system control based on dynamic inversion for the nonlinear system will be derived and computed without the use of small-angle approximation in order to achieve greater accuracy in tracking of trajectory. e smallangle conditions of less than π/2 are realistic for many applications of a quadcopter but extremely small-angle approximations cannot achieve extreme manoeuvers [34].
is paper will focus on presenting an adequate mathematical representation of the system dynamics and effective control techniques for a quadcopter.

Methodology
is section describes the mathematical modelling, system stabilization, and trajectory tracking of a quadcopter. A state-space model of the quadcopter in terms of rotational and translational dynamics is first developed. For the quadcopter system stabilization, the control objective is to control the attitude variable and the linear motion of the quadcopter. Feedback linearization is used to linearize the nonlinear system dynamics so that linear control methods can be used. Trajectory tracking to take the quadcopter system from its current position to the desired position using the quadcopter's rotor angular velocities is achieved using both PD control (using small-angle approximation) and FBL (without small-angle approximation) control.

Mathematical Modelling.
A quadcopter is an aerial vehicle with four rotors that enable motion in different directions. Proper explanation of the system dynamics would require comprehension of the 6 degrees of freedom concept, which presents the position and orientation of the quadcopter in three dimensions (3-D). e 6 degrees of freedom ( Figure 2) describes the position of a body with six coordinates categorized in two reference frames. e first reference frame is the fixed coordinate system known as the inertial or Earth frame, which is depicted by the x, y, and z coordinates in the cardinal points of north, east, and down. e second reference frame is a mobile coordinate system known as the body frame, which is depicted by the ϕ, θ, and ψ angles with respect to the body center of gravity. e quadcopter is an underactuated nonlinear system because it has four inputs and six outputs. e system is complex and to control it, the quadcopter is modelled on the following assumptions [1]: (i) e structure is rigid (ii) e structure is axis symmetrical (iii) e center of gravity and the body-fixed frame origin coincide (iv) e propellers are rigid (v) rust and drag are proportional to the square of the propeller's speed.

Euler Angles.
e Euler angles are three angles introduced by Leonhard Euler to describe the orientation of a rigid body in a coordinate system. ey are also used to describe the relationship between two reference frames and convert the coordinates of a point in one reference frame to coordinates of the same point in another reference frame. Euler angles are denoted as ϕ, θ, and ψ for the roll, pitch, and yaw angles, respectively, and represent the rotations of a body about the axes of a coordinate system.
Any orientation of a rigid body can be achieved by the combination of the three basic Euler angles. e rotation matrices are given by the following equation [5]: where . e rotation matrix depicting the relationship between the inertial frame and the body frame is given as follows: R is a rotational matrix and is orthogonal such that

Reference Frame Transformation. We assume
x y z ϕ θ ψ T to be a vector of linear and angular positions in the inertial frame and let u v ω p q r T be a vector of linear and angular velocities in the body frame.
Typically, the derivative gain of angular positions should give angular velocities, but the angular positions and velocities above are in a different frame, so we require some transformation matrix to convert from one reference frame to another. Let Let Let Conversely,

Rotational Motion.
Assuming the quadcopter is a rigid body and using Euler's equations for rigid bodies, the dynamics equation in the body frame is given as follows: Journal of Engineering We also assume that the quadcopter has a symmetric structure with the four arms aligned with the body x-and yaxes. erefore, the inertia matrix I is a diagonal matrix in which I xx � I yy .
e gyroscopic forces Γ are caused by the combined rotation of the four rotors and the quadcopter body such that the equation is as follows: In matrix form, e external torque e roll torque component τ ϕ and the pitch torque component τ θ are obtained from standard mechanics where i � 1 and i � 3 motors are arbitrarily chosen to be on the roll-axis while i � 2 and i � 4 are arbitrarily chosen to be on the pitch-axis.
For the yaw-axis, the rotor axis is pointing in the zdirection in the body frame, and the torque created around the rotor axis is given as follows: where (−1) i+1 is positive for the i th propeller if the propeller is spinning clockwise and negative if it is spinning counterclockwise. e term I m _ ω i can be ignored because it is in a steady-state, _ ω i ≈ 0. erefore, the total torque about the z-axis is given by the sum of all the torques from each propeller as follows: erefore, the torque matrix can be written as follows: where k t is the thrust coefficient, k b is the drag coefficient, and l is the distance between the rotor and the center of mass of the quadcopter.

Translational Motion.
Using Newtonian equation to model the linear dynamics, the extraneous forces acting on the quadcopter are given as follows: Drag force F D is the force acting on the system as a result of fluid friction (air resistance). A simplified equation form is used where friction is modelled as being proportional to the linear velocity in all directions.
e angular velocity of the i th rotor creates a force F i in the direction of the rotor axis (z-direction). e combined forces create thrust T in the direction of the body z-axis such that Since it acts in the z-axis, 3.1.5. State-Space Model. From the rotational dynamics discussed, equation (8) can be rewritten as follows: From the linear dynamics discussed, equation (16) can be written out as follows: 6 Journal of Engineering

Quadcopter System Stabilization. A quadcopter has only four control inputs and primarily six outputs of interest
x y z ϕ θ ψ which makes it an underactuated system. is is resolved by separating it into two different control loops, with one working with attitude states and the other with position states. e quadcopter's angular motion is independent of the linear components, but the linear motion is determined by the angle variables. As a result, the goal is to control the attitude variable, which is independent of the linear motion and then control the linear motion. It is possible to integrate the attitude control with the trajectory controller once it is designed and optimized. e control architecture to be implemented on the quadcopter system is shown in Figure 3.

PID Control.
e general form of a PID controller is given as follows: where u(t) represents the control input, r(t) represents the desired state, and y(t) is the current or actual state. K P , K I, and K D are the gain parameters for the proportional, integral, and derivative gains of the PID controller. e proportional and derivative gains would be used for the quadcopter control. e torque generated is proportional to the angular velocities; therefore, we set the torques to be proportional to the controller output such that e input to the quadcopter system is the angular velocity of the rotors. Recall equation (15)relates the torque to the square of the angular velocity of the rotors; there are three equations, but four unknowns. e reason for this singularity is the use of Euler angles to model the quadcopter dynamics rather than quaternions [35]; physical singularities also occur due to the limitation of underactuation in the dynamics of a quadcopter.
To allow simplification, the total thrust T which affects the acceleration in the z-direction, is set to be equal to mg.
is constraint is enforced to keep the quadcopter flying. Converting this thrust equation to the appropriate reference frame and utilizing a PD to minimize the error in the z-axis, Solving for the angular velocities of the rotor ω 2 1 , ω 2 2 , ω 2 3 , ω 2 4 by computing equation (23) and equating it to equation (15), Simplifying equation (25) would give the equations as follows:

Feedback Linearization. Feedback linearization is a nonlinear control technique that has sparked a lot of interest
recently. e main concept is to mathematically convert nonlinear system dynamics into (fully or partially) linear ones, allowing linear control methods to be used. e goal is to design a controller such that it exactly cancels out the system dynamics.
From equation (21), we can replace € where k ax , k dx , and k x are gain values and replace € y, _ y, € z, and _ z accordingly.
Expanding equation (26) would give the following equation: Taking the square of both sides and adding equations together, we get the following equation: To obtain ϕ d , from the x-and y-axis portion of equation (27), let From equation (30),we get the following: Substituting equation (31) into equation (30),we get the following: , 8

Journal of Engineering
To obtain θ d , from the x-and z-axis portion of equation (27), let Substituting equations (32) and (33) into equation (30), We recall For equations (32) and (34), F x , F y , and F z are given as follows: From equations (6) and (23) in terms of desired angles, we can replace ϕ d � k ϕ (ϕ − ϕ d ), where k ϕ is the gain values, and replace θ d and ψ d accordingly: e angular velocities ω 1 , ω 2 , ω 3 , and ω 4 can be obtained using equation (25).

Trajectory Tracking.
Trajectory control aims to take the quadcopter system from its current position to the desired position by regulating the quadcopter's rotor angular velocities. Due to its complex dynamics, finding the best quadcopter trajectory is a huge challenge.

Trajectory Tracking with PD Control.
To relate the desired position x and y, which are not controllable to the desired angles of ϕ and θ that are controllable, we make two assumptions: (i) Small-angle approximation such that sin(x) ≈ x and cos(x) ≈ 1. (ii) e desired ψ angle is zero.
From the above assumptions, equation (21) can be simplified as follows.
Equations (27) and (28) can be rewritten as follows: θ des , ϕ des , and T des represent the desired values of pitch angle, roll angle, and thrust.

Trajectory Tracking with FBL Control.
To relate the desired position x and y, which are not controllable to the desired angles of ϕ and θ that are controllable using FBL control techniques, we make two assumptions: (i) No small-angle approximation (ii) he desired ψ angle is zero

Simulation and Results
e dynamic model and controllers are implemented in MATLAB 2021 for simulation with MATLAB programming language. For attitude stabilization, a PD controller is implemented on the nonlinear system to stabilize and drive the system states to zero. Simulation results for trajectory tracking using both PD and FBL control are presented. e quadcopter model is simulated with parameter values, as shown in Table 1 [8].
e initial conditions assigned to the system for simulation are given in Table 2.
e simulation progresses at 0.001-second intervals to a total time of 15 seconds. e control inputs (angular velocities of the rotors) are shown in Figure 4, and the positions x, y, and z and the angles ϕ, θ, and ψ are shown in Figure 5.
e control input remains constant, and hence, the angles remain the same, but the positions become unstable.

Attitude Stabilization.
A PD controller is implemented on the nonlinear system to stabilize and drive the system states to zero. e initial conditions assigned for the system remain the same, as shown in Table 2.
e control gain values for the PD controller are determined by manual tuning and are shown in Table 3.
e simulation progresses at 0.001-second intervals to a total time of 15 seconds. e angles ϕ, θ, and ψ are shown in Figure 6, the angular velocities of the rotors are shown in Figure 7, and the positions x, y, and z are shown in Figure 8. e angles are stabilized to zero after 10 seconds, and the position z is stabilized to zero after 5 seconds. e x and y positions do not stabilize to zero because the states are not observable.  Using the concept of trajectory tracking, an attempt can be made to drive the x and y positions to zero. is can be done by mapping the zero desired states of x and y to the desired ϕ and θ states, which are controllable as shown in equations (28)- (30). An additional proportional controller gain k Pxy , with a control gain of 0.04 is implemented to drive the system states to zero, and the simulation advances at 0.001-second intervals to a total time of 45 seconds. e angular velocities of the four rotors and the angles ϕ, θ , and ψ are shown in Figure 9; the modified positions x, y, and z are shown in Figure 10. e angles ϕ, θ, and ψ are stabilized to zero after 35 seconds, and the positions x, y, and z are stabilized to zero after 45 seconds.    e first control strategy is implemented with a PD controller, and the second strategy is a PD controller integrated with the linearized feedback system. e total time assigned for the simulation in both cases is 45 seconds.

Trajectory Tracking with PD Controller.
e comparison between the desired and actual trajectories for the first path is shown in Figure 11. Figure 12 shows the graph of the position variables against time.
Another trajectory path is simulated, and the result is shown in Figure 13. e graph of the position variables against time for this path is shown in Figure 14.
A similar result as shown in Figure 12 is also obtained; the quadcopter cannot follow the desired trajectory with precision.

Trajectory Tracking with Feedback Linearization and PD Controller.
e feedback linearization technique is implemented on the quadcopter model and simulated with a PD controller. e desired trajectory and the actual trajectory for the first path are shown in Figure 15. Figure 16 shows the graph of the position variables against time.
Another trajectory path is simulated, and the result is shown in Figure 17. A similar result as shown in Figure 15 is also obtained; the quadcopter can lock on to the desired trajectory with more accuracy with this control.

Result Analysis
Detailed analysis on the performance of the PD controller for stabilization and its integration with the FBL system is required to determine the most suitable control strategy. e results show that the feedback linearization technique with the PD control is more effective in trajectory tracking than the regular PD control.

Altitude Stabilization.
As discussed earlier, the PD controller with control gains shown in Table 3 was able to stabilize the angles to the desired zero state after 10 seconds and drive the z position variable to zero in 5 seconds. e x and y positions are eventually stabilized, but they do not stabilize to the desired zero state. By mapping the desired states of x and y to the desired ϕ and θ states which are controllable, an additional proportional controller gain is used to drive all the system states to zero. However, this approach is inefficient because it takes too long for the angles and position to stabilize. e angles ϕ, θ, and ψ stabilize to zero after 35 seconds, and the positions x, y, and z stabilize to zero after 45 seconds. e ϕ, θ, x, and y states experience overshoots before stabilizing to zero. Side-by-side comparisons of the angle and position variables of the two approaches are shown in Figures 18 and 19.

Trajectory
Tracking. e results of the two control strategies implemented for trajectory tracking were previously discussed. Better performance is observed in the feedback linearized system with a PD control. e   quadcopter is able to lock on to the desired trajectory and follow the path with accuracy in a lesser time period. Figures 20-22 show the desired and actual trajectory plot after 15, 30, and 45 seconds, respectively, for both the PD control and the FBL with a PD control.
e quadcopter system simulated with the FBL and PD control is able to lock on to the desired trajectory after the first 15 seconds, while the system with only the PD control is unable to do that properly even after 30 seconds. is shows that the feedback linearization technique with the PD  Figure 18: e angles ϕ, θ , and ψ stabilize to zero after 35 s; the ϕ and θ states experience overshoots before stabilizing to zero.  Figure 19: e position variables x, y, and z stabilize to zero after 45 s; the x and y states experience overshoots before stabilizing to zero. 16 Journal of Engineering   Journal of Engineering control is more effective in trajectory tracking than the regular PD control.

Conclusion
e mathematical modeling of the quadcopter system dynamics has been developed based on a few standard assumptions. is was achieved by adequately understanding the different coordinate systems involved, Euler angles, and the Newtonian equation to express the various extraneous forces acting on the quadcopter body. e state-space model of the system dynamics was obtained using Newton's and Euler's laws. e model was tested by simulating the quadcopter flight on MATLAB with already established parameters.
Attitude stabilization and control of the quadcopter system have been achieved by using a PD controller. e simulation showed that the PD control algorithm stabilized the system states to the desired states. However, the PD controller could not stabilize the x and y positions to the desired state because the state variables are not observable. Another mapping approach was considered to drive the x and y positions to the desired zero state, but this was achieved after a more extended period of time.
Two nonlinear control strategies were implemented for trajectory tracking of the quadcopter system. e simulation showed that the PD control was inferior to the FBL with PD control. e hybridization of FBI and PD approach presented accurate tracking of the desired trajectory in a lesser period of time as reflected in Figure 22.

Recommendation to Improve the New Technique.
e NDI technique used in feedback linearization of the system is implemented based on the assumption that all the states are available and measurable. Since this does not always seem to be the case, a further step in this control strategy can be the design of a suitable estimator or observer which can generate the possible outcomes of a full state from partial state variables. Another step forward in this research is the design of a controller to address the failure of one or more rotors. e quadcopter must be configured to apply the contingency algorithm once failure is detected based on inputs of the controller. Also, the proposed model and control techniques were evaluated using simulations only. Further studies can include the construction of the actual prototypes of a quadcopter to obtain more practical and accurate results.

Data Availability
No data were used in this study.

Conflicts of Interest
e authors declare that they have no conflicts of interest.