CONTROL DESIGN FOR UNMANNED AERIAL VEHICLES WITH FOUR ROTORS

Altitude and attitude controlled quadcopter model is used for the behavior and control algorithm testing, before the implementation on the experimental setup. The main objective is the control system design which will achieve good task performance in the combination with the quadcopter dynamic model. Also, for the control model, it is important to be relatively easy to modify for the use of other control algorithms and to be easy to implement on the experimental setup. At the beginning of this article, the control system design process is described. Quadcopter dynamics equations are simplified by applying several assumptions and in that form are used for the controller synthesis. Quadcopter control system is split into inner and outer control loop because the quadcopter is underactuated system which means that the direct control of all of the degrees of freedom is not possible. In the second part, the PI-D control algorithm is described which is applied on the simplified quadcopter dynamic model. The inner loop controls roll, pitch and yaw angles together with the quadcopter altitude. Its outputs are four control variables. Outer loop controls quadcopter X and Y position. Its outputs are roll and pitch desired angles. Regulated quadcopter model behavior is shown for the three types of task. First, the achieving of position in space is simulated. Second, the reference trajectory tracking is shown. Last task shown is the reference trajectory tracking with added periodical disturbances. Simulations show bounded positions error of the regulated quadcopter system using PI-D controller for the different types of tasks performed under different conditions


INTRODUCTION
In order for the quadcopter to be able to execute tasks, control algorithms are needed to be implemented.The goal of the control system design is stabilization of the system state around the desired reference state, or changing that state according to some law, regardless of the inner or outer disturbances.That is achieved with the feedback, which allows comparison of the measured value of the process with the desired one.Prior the control algorithm implementation on the experimental setup, it must be tested in combination with the dynamic model [1].
Quadcopter has six degrees of freedom (6 DOF) and four control variables which means that the quadcopter is underactuated and dynamically unstable system.The only moving parts are the propulsor propellers which are rotating with respect to the fixed propulsor axis.Quadcopter frame has a cross (+) configuration where   and   axes go through the propulsors.  and   are body coordinate frame axes (body coordinate frame (system) ℱ  is fixed to the quadcopter body (frame)).Quadcopter frame is assumed to be a rigid structure.The only variable thing is considered to be the propellers revolutions per minute (RPM) that influence the quadcopter movement.

CONTROL SYSTEM DESIGN
Quadcopter dynamics is derived from the quadcopter dynamic model [2].The main equations are quadcopter accelerations as functions of the control variables: Control variables are a function of squared angular velocities of the propellers: where  is the distance between the quadcopters center of gravity and propulsors axis,  is the thrust coefficient,  is the drag coefficient,   is angular velocity of the propeller .
The objective of quadcopter stabilization is finding the values of the propellers angular velocities in a way that keeps the quadcopter in desired position and attitude.This is done by the means of the inverse kinematics, i.e. inverse dynamics.Unlike the direct problem, inverse operations are not always possible and are not always unique.Quadcopter dynamics has to be simplified in order to get simple inverse model that can be easy implemented in control algorithms.Equations ( 1)-( 6) have to be simplified with keeping in mind the following assumptions:  angular contributions to the accelerations are quite complex because they depend on a couple of parameters, most of which are a vector product of angular velocities.Keeping in mind that the quadcopter movement is near hover state, there are very little changes in angles, therefor those contributions can be ignored. angular accelerations are linked with the change of angles with respect to ℱ  .They are not equal to the accelerations of the Euler angles in ℱ  .Transformation matrix  defines the relation between the angular velocities with respect to ℱ  and the ones in ℱ  .Quadcopter movement being close to hovering state,  is close to the identity matrix, making the angular acceleration equations the same in ℱ  and ℱ  . control algorithm gives the control signals to the propulsors.With four control variables, in a single loop, it is not possible to regulate more than four DOF.Inner loop controls the altitude and attitude, while the outer loop controls quadcopter position by giving the attitude references to the inner loop.Quadcopter dynamics equations that are used in control synthesis are: ̈=  2   (13) where  ̈,  ̈,  ̈ are angular acceleration with respect to ℱ  .
Control algorithm as inputs has sensor data (or calculated data from the dynamic model) and reference data.Outputs of control algorithm are the angular velocities of four propellers, which can be, through dynamic model, translated to the pulse-width modulation (PWM) signal.Quadcopter, being an underactuated system, does not allow direct control of all of the DOFs.Control of positions  and  is achieved indirectly through control of roll and pitch angles in outer control loop.Quadcopter cannot move translationally without the rotation around one of the quadcopter axes.Outer control loop analyses sensor data and desired task data, and its outputs are desired angle values for the inner control loop which then controls the roll, pitch and yaw angles.Inner control loop is the core of the control algorithm.It analyses sensor and outer control loop data together with desired altitude task data.Its outputs are control variables which stabilize the position error through four basic quadcopter movements.From the equations ( 7)-( 10) control variables can be retrieved for the desired accelerations.PI-D controller is used for the desired accelerations assessment.
Inverted movement matrix is used for the calculation of the squared angular propeller velocities for four control variables:

PI-D CONTROLLER
Classic PID structure has a derivative term calculated from the error signal, which is a downside of that structure when it comes to the quadcopter control.If the task takes the form of the step function, output of the derivator will be an impulse which could bring the propulsors to the state of saturation and push the system outside of the linear space.That is the reason for the PI-D structure of the controller (Figure 2) in which the derivative term is being calculated from the sensor data.

INNER CONTROL LOOP
Inner control loop controls quadcopter altitude and attitude.Input variables for inner loop can be divided in two parts, task and sensor variables as shown in figure 2. Task variables are desired altitude and yaw angle that are given by the task that quadcopter needs to accomplish and desired roll and pitch angles, that are calculated in the outer control loop.Sensors give measured altitude, roll angle, pitch angle and yaw angle.Inner loop outputs are four control variables.

Altitude control
Equation for the thrust force control variable  1 is: where   ,   and   are three altitude PI-D controller parameters.  is the altitude error, where   =   −   .  is the desired altitude and   is the measured altitude.

Roll control
Equation for the roll moment control variable  2 is: where   ,   and   are three roll angle PI-D controller parameters.  is the roll angle error, where   =   −   .  is the desired roll angle and   is the measured roll angle.

Pitch control
Equation for the pitch moment control variable  3 is: Similar to the roll control,   ,   and   are three pitch angle PI-D controller parameters.  is the pitch angle error, where   =   −   .  is the desired pitch angle and   is the measured pitch angle.

Yaw control
Equation for the yaw moment control variable  4 is: where   ,   and   are three yaw angle PI-D controller parameters.  is the yaw angle error, where   =   −   .  is the desired yaw angle and   is the measured yaw angle.

OUTER CONTROL LOOP
Outer control loop is used because the quadcopter is underactuated system and it is not possible to control all of the quadcopter DOF directly.As said before, the inner loop directly controls 4 DOF, those being three angles and altitude.To be able to indirectly control   and   position, outer loop is used.Outer control loop, as its outputs, give desired roll and pitch angles to the inner loop for the desired   and   position.Outer control loop is superior to the inner control loop.
Equations ( 1) and ( 2) can be singled out which are the equations for the quadcopter   and   linear accelerations: Quadcopter dynamics of the   and   linear accelerations can be simplified in the similar way as the quadcopter dynamics equations ( 12) -( 15).Again, the quadcopter movement is observed as a hovering state, i.e. roll and pitch angles are very small (close to 0).Keeping that in mind, the equations ( 24) and ( 25) can be transformed to: Matrix notation of the equations ( 26) and ( 27): From the equation ( 28), roll and pitch angles are being calculated.Because of the assumption that the quadcopter movement is near the hovering state, thrust force  1 has to nullify the gravitational force allowing for the U 1 /m to be changed with the gravitational acceleration .
Equation for the desired roll and pitch angles is:

SIMULATION RESULTS
Behavior of the controlled quadcopter system depends on the dynamic model of the quadcopter and the control algorithm.Control algorithm input values are the values defined in the task as well as the dynamic model outputs.Control algorithm outputs are the four control variables which are also the dynamic model inputs.Simulation results are given for the three cases.First case is the simulation of the achieving the desired position.Second case is the reference trajectory tracking and the final case is the reference trajectory tracking with the addition of the periodic disturbance.

ACHIEVING THE DESIRED POSITION
The desired point in space, defined by three coordinates with respect to ℱ  , is arbitrarily chosen.The control algorithm is tuned for the quickest desired point achievement.Simulation time is 20 s. Figure 5 shows the quadcopter attitude which constantly changes until the quadcopter gets to the desired position.After achieving that, roll and pitch angles are 0. Yaw angle is arbitrarily chosen.

REFERENCE TRAJECTORY TRACKING
Chosen trajectory is of a helix shape because of the simple generating and displaying.Helix is a combination of three functions, two of which are of sinusoidal shape (   and   position), and one is linear (  position).Simulation time is set to 100 s.   Figure 9 shows that quadcopter quickly gets close to the reference trajectory and that is tracking it with bounded tracking error, being unable to achieve asymptotic error convergence due to the variable reference state.

REFERENCE TRAJECTORY TRACKING WITH ADDED PERIODICAL DISTURBANCES
In this case of trajectory tracking, periodical external force disturbances are added in XY plane.X coordinate disturbance profile have amplitude of 2 N, period of 10 seconds, duration of 0,5 second and phase delay of 8 seconds.Y coordinate disturbance profile have amplitude of 1,5 N, period of 15 seconds, duration of 1 second and phase delay of 6 seconds.Figure 12 shows quadcopter following the reference trajectory with bounded position error.Disturbances are affecting the quadcopter position and attitude, but in the acceptable boundaries which are not allowing the quadcopter to lose track of the reference trajectory.

CONCLUSIONS
This article has shown control design and control algorithm implementation which in the combination with the quadcopter dynamic model form regulated quadcopter system.During the control design phase, some assumptions were made in order to get simplified quadcopter dynamics equations.
Quadcopter behavior while performing different tasks in different conditions was shown by simulation where some control variables constraints were made with the goal of more realistic description of quadcopter behavior.Controller parameters where chosen empirically.
Outer control loop outputs are inner control loop inputs so the outer loop parameters were chosen in a way that in the combination with the inner loop parameters give the most suitable control variables.Simulation results have shown the stability, robustness and error boundedness of the PI-D controller.
Further work will include control algorithm implementation on the experimental setup.Also, more advanced control algorithms will be tested with the objectives to improve quadcopter system robustness and tracking performances as well as a better energy management.

Figure 4 .
Figure 4. Angular propeller velocities -achieving the desired position in space.

Figure 5 .
Figure 5. Quadcopter attitude -achieving the desired position in space.Figure6shows that after certain amount of time (cca.10 sec), depending of the controller parameters, quadcopter reaches the desired position (  = 15,   = 6,   = 10) and holds that state.

Figure 6
Figure 5. Quadcopter attitude -achieving the desired position in space.Figure6shows that after certain amount of time (cca.10 sec), depending of the controller parameters, quadcopter reaches the desired position (  = 15,   = 6,   = 10) and holds that state.

Figure 6 .
Figure 6.Quadcopter position -achieving the desired position in space.

Figure 7 .
Figure 7. Propeller angular velocities -reference trajectory tracking.Figure7shows propeller angular velocities which depend on the reference trajectory.

Figure 7
Figure 7. Propeller angular velocities -reference trajectory tracking.Figure7shows propeller angular velocities which depend on the reference trajectory.

Figure 11
Figure11shows changes of angular velocities which depend on the reference trajectory and given periodical disturbances.

Figure 12 .
Figure 12. 3D view of reference trajectory tracking with added periodical disturbances.
). , ,  are roll, pitch and yaw angles with respect to ℱ  . 1 ,  2 ,  3 ,  4 are control variables. is quadcopter mass,  is gravitational acceleration.  ,   ,   are moments of inertia with respect to ℱ  .  is the propulsors rotor and propeller moment of inertia. is overall propeller speed., ,  are angular velocities with respect to ℱ  , while ̇, ̇, ̇ are angular accelerations with respect to ℱ  .
where  ̈,  ̈,  ̈ are acceleration in the earth fixed coordinate frame (ℱ