A Mathematical Model for Controlling a Quadrotor UAV


 Given the recent surge in interest in UAVs and their potential applications, a great deal of work has lately been done in the field of UAV control. However, UAVs belong to a class of nonlinear systems that are inherently difficult to control. In this study we devised a mathematical model for a PID (proportional integral derivative) control system, designed to control a quadrotor UAV so that it follows a predefined trajectory. After first describing quadrotor flight dynamics, we present the control model adopted in our system (developed in MATLAB Simulink). We then present simulated results for the use of the control system to move a quadrotor UAV to desired locations and along desired trajectories. Positive results of these simulation support the conclusion that a quadrotor UAV spatial orientation control system based on this model will successfully fulfil its task also in real conditions.


CONTROL SYSTEMS FOR UNMANNED AERIAL VEHICLES UAVS
Multi-rotor flying platforms are a relatively young and dynamically developing field. Such devices are finding more and more applications, but they are still struggling with unsolved problems. With advances made in the development of materials, electronics, sensors and batteries, the size of micro UAVs now ranges from 0.1 to 0.5 metres in length and 0.1 to 5 kg in weight. The construction of a simple flying object of this type seems to be extremely simple, however, it poses serious challenges for designers and programmers. Due to the nature of the platform, active thrust control must be applied to maintain the robot in the air. Although simple PID (proportional integral derivative) controllers are sufficient for flight stabilisation, achieving control quality that allows practical use of this type of platform is still a challenge.
A class of unmanned aircraft with four rotors, known as quadrotors, is becoming increasingly popular. Given this surge of interest, much effort has lately gone into developing new control methods for quadrotors in particular. One example can be found in the HMX-4, which is a kind of quadrotor about 0.7 kg in weight, 76 cm in length between the ends of the rotor axes, and with flight time of about 3 minutes. Due to the weight limitation of this type of aircraft, no GPS or other instrumentation (such as accelerometers) can be added. Position and velocity data can be obtained via cameras. For feedback, it has an early micro electromechanical system (MEMS) for the pilot-assistant. The feedback linearisation controller controls the altitude and yaw angle. Because the qaudrotor drifts in the x-y plane under the control of this controller, a reversing controller is needed for attitude control.
Another commonly studied testbed uses a proportional-embedded PID controller to jointly control position and attitude [1,2,3,12,13]. The AscTec Hummingbird is a typical model of this type of quadrotor. This model has a wood or carbon fibre frame, making it robust and lightweight, at around 0.5 kg. These quadrotors have their own sensors for obtaining states. The controller regulates the plant based on the difference between the set points and the measured values. Another PID control system used is the STARMAC test table. This quadrotor has a weight of about 1.1-1.6 kg and can carry an additional payload of about 2.5 kg. One of the externally available trajectory tracking models is called the X4-flyer. This controller was developed to reduce vehicle orientation and keep it very low. The dynamic model was obtained using the Euler-Langrage method. The PID controller is used to control the hovering unmanned vehicle or track its trajectory [4,5,6,14,15].

Dynamics and control model
The rotors are designed to transmit force upward; their rotation also introduces torques. The forces and moments produced depend on the rotor speed. The main challenge is to control the appropriate speeds of the four rotors to ensure stable flight along the desired trajectory.  Figure 1 shows a simplified representation of how the rotors control the movement of a quadrotor. Rotors 1 and 3 rotate counter-clockwise and produce torque in the clockwise direction; conversely, rotors 2 and 4 rotate in a clockwise direction and produce torque in a counter-clockwise direction. All rotors produce force in the upward direction perpendicular to the plane of rotation. In the example shown in Fig. 1, the rotational speeds of rotors 2 and 4 are greater than those of rotors 1 and 3. The effective torque will therefore be in the counter-clockwise direction, and the quadrotor will deflect in the counter-clockwise direction. When the four rotors have the same rotational speed, the momentum in the counter-clockwise direction will balance the momentum in the clockwise direction. In order to develop a dynamic model of the quadrotor, we position the fuselage frame so that it is on the main axis of the quadrotor. As shown in Figure 1, the origin of the fuselage frame is positioned at the centre at point O of the quadrotor. One arm is selected as the X axis and the other as the Y axis.

Dynamic model
The structural frame of the UAV is denoted by the letter w and labelled X w , Y w , Z w as shown in cos sin sin cos cos sin sin cos cos sin cos sin sin co If r is the position vector of the centre of mass in the UAV frame, the acceleration of the centre of mass is given by the equation [8]: In the body frame, the components of the angular velocity of the robot are p, q and r. The relationship between these values and the angle derivatives of yaw, roll, pitch are [9]: Each rotor i produces a moment M i which is perpendicular to the plane of rotation. Rotors 1 and 3 produce moments in the -Z B direction. The moments of rotors 2 and 4 are in the opposite direction: Z B . The torque produced on the quadrotor is opposite to the direction of rotation of the blades, so that M1 and M3 act in the ZB direction, while M2 and M4 act in the opposite direction. The distance from the rotors' axis of rotation to the centre of the rotor is denoted by the letter L. By comparing the individual components of the quadrotor, the moment of inertia, I, is related to the centre of gravity along the X B -Y B -Z B axis. The angular acceleration is obtained using Euler's equations, as shown below: In this paper, we present the mathematical model for a PID controller for quadrotor control. The controller adjusts the process control inputs to minimize the error, which is the value of the difference between the measured process variable and the desired setpoint [10]. The roll and pitch angles are placed on the input. Using a backward step approach, two types of position control methods can be obtained. One is the UAV hover execution controller, which will control the rotor to maintain the rotor in the desired position. The other is a four-rotor control for tracking arbitrary trajectories in 3D [11,16,17].

Flight control controller
The quadrotor will hover when the nominal propulsion of the propellers is equal to the force of gravity, in other words when: and the engine speed: r T (t)the trajectory position, ψ T (t)the yaw angles, which are the path. Note that ψ T (t) = 0 for the UAV flight controller. The position error is given by: The recommended acceleration can be calculated using the PID law: For hovering: The relationship between desired accelerations and roll, pitch angles is as follows:

Height control
In the case of hovering, proportional-derivative control laws are used in a way: From the above equation we obtain the result for ω:

Simulation of a dynamic model
This section presents the numerical simulation results for the validation of the dynamic and control model discussed in the previous section. The parameters used for the simulation are shown below in Table 1.

Tab. 1. Parameters of the dynamic model.
Based on the dynamic model of the quadrotor, the control model was developed in MATLAB Simulink. For the simulation, the quadrotor flies from the initial position (0,0,0) to the final location (10,10,10) and hovers over this point (10,10,10). The distance units given here are expressed in metres. Fig. 4 shows the actual path the quadrotor travels.    To further verify the dynamic and control model with respect to following a desired trajectory (or target location), the quadrotor was put into motion along a circle with a centre at (5, 0) and a radius of 5 m. Fig. 8 shows the simulation result of the desired and actual trajectory of the quadrotor following the circular trajectory. Figs. 9 and 10 show the simulation result for the desired x and actual x, desired y and actual y for the circular path.   The control model was then verified, showing that the quadrotor moves from its resting position to the desired location and lands again. Fig. 11 shows a simulation of UAV motion. The quadrotor took off at point (0, 0, 0) flew to point (0, 0, 10), then was rotated and moved to point (10,10,10) and then landed at point (10, 10, 0). Fig. 11. Simulation of the outcome of the quadrotor's movement to successive desired locations.
The above numerical simulations showed that the quadrotor was able to navigate to any waypoint locations and follow any desired trajectories. Fig. 12 shows selected flight parameter waveforms presenting the operation of the unmanned aerial vehicle control system during the landing phase with the use of the on-board vision system. The data presented in the diagrams were obtained in simulations. The graphs obtained show that the applied algorithm allows a satisfactory quality of control of the aircraft to be achieved in the landing phase.

CONCLUSIONS
Existing control algorithms for multi-rotor UAV platforms leave room for superior systems that control altitude, position and flight trajectory while aiming at full autonomy of the aerial vehicle. The first obstacle to overcome in achieving this goal is the incorrect design of the mechanical structure. As a flying apparatus, a multi-rotor craft needs to have a very low empty weight while providing adequate rigidity and strength. At the same time, a key issue is the quality of the orientation measurement, essential in the platform stabilisation process. As the rigidity of the superstructure increases, the quality of control improves due to the smaller influence of the structural deformations on forces and measurements. At the same time, however, the impact of the interference generated by the moving elements and especially by the drive units on the quality of measurements increases. In this study, we focused on two problems: 1) obtaining a dynamic quadrotor model 2) route planning and route planning optimisation.
With respect to the first problem, the dynamics of the quadrotor was analysed and then a controller based on the PID method was developed. In this part, parameters were chosen to make this simulation model almost identical to a real quadrotor. Point-to-point navigation and trajectory experiments were then carried out using the simulation model developed based on the dynamics of the quadrotor. The results showed that the model worked well in practice. For the second problem, a trajectory of full coverage of a defined area was developed. Trajectory parameters were identified and the Langrage multiplier algorithm was used to obtain those parameters that minimised the total time required to traverse the entire trajectory.
To recap, then, in the study reported herein, we developed a mathematical model of quadrotor dynamics, which we then used, after its linearisation, to design a spatial orientation control system. Positive results of simulation tests allow us to assume that this system will fulfil its task also in real conditions.