Optimization of a neural network based direct inverse control for controlling a quadrotor unmanned aerial vehicle

UAVs are mostly used for surveillance, inspection and data acquisition. We have developed a Quadrotor UAV that is constructed based on a four motors with a lift-generating propeller at each motors. In this paper, we discuss the development of a quadrotor and its neural networks direct inverse control model using the actual flight data. To obtain a better performance of the control system of the UAV, we proposed an Optimized Direct Inverse controller based on re-training the neural networks with the new data generated from optimal maneuvers of the quadrotor. Through simulation of the quadrotor using the developed DIC and Optimized DIC model, results show that both models have the ability to stabilize the quadrotor with a good tracking performance. The optimized DIC model, however, has shown a better performance, especially in the settling time parameter.


Introduction
The quadrotor is an Unmanned Aerial Vehicle (UAV) which is included in the category of rotary wing with four rotors located at its four corners.The advantage of a UAV using this structure is laid on the ability of a UAV to perform Vertical Take Off and Landing (VTOL) and high maneuverability along its course.A quadrotor is designed to have the ability as a helicopter, with a simpler mechanical system but more stable in its maneuvers due to a four motors system.However, the quadrotor based UAV is very dynamic system with the ability to move at a six degree of freedom, leaving many problem, especially on the non-linear characteristic of the plant, coupling parameters, under actuated and gyro effect [1][2][3][4][5], which remains a challenge for researchers to develop a reliable robust controller system for an autonomous UAV.
In recent years, researches are focusing on the research on quadrotor's dynamic motion and movement, e.g.: Vertical Take-Off and Landing (VTOL), maneuvers and altitude stabilization [3,6], while others are focusing in the development of control algorithms.Many control algorithms have been developed for a Quadrotor, such as the classic Propositional Integral Derivative (PID) controller, Linear Quadratic (LQR) Algorithm, and Back stepping control algorithms [2,[7][8][9][10].These classical controllers, i.e., the PID and LQR algorithms, however, are not suitable for a nonlinear systems, while, back stepping control algorithms had shown poor performance in terms of its robustness.
The purpose of this research is to design an autonomous control of Quadrotor, firstly on its hovering movement, by using a neural networks based controller, i.e., the Direct Inverse Control (DIC) system.In this research, we have developed our own Quadrotor platform in the Computational Intelligence and Intelligent Systems Laboratory, University of Indonesia, and it is conducted in four phases of developments, namely: (1) the Quadrotor platform; (2) Avionic Experiment; (3) Design of DIC; (4) Optimization of DIC system.
In this paper, the optimization of the direct inverse control in Quadrotor Unmanned Aerial Vehicles for hovering mode is discussed in detail.Section 1 discusses the general problem of control of the Quadrotor.Section 2 introduces the structure of Quadrotor, the dynamics and kinematics of quadrotor model, the general architecture of the quadrotor control system, as well as the platform used.Section 3 discusses the neural network control algorithm.Finally, the results of several simulations are presented in Section 4. Then it is concluded in the last section.

The quadrotor and the neural network based control system
The cross configuration of quad rotor used for the basic movement of the UAV system, is shown in Figure 1.The rotational torque due to the four rotors can be cancelled each other by rotating the motors M1-M3 clockwise and M2-M4 counter clockwise with the same speed.As the rotational torque is eliminated by the four motors rotating movement, increasing or decreasing the rotor speed changes the lift force of the UAV system and can be controlled to make a possibility of a movement as shown in Figure 1a.Changing the speed of the four propellers at Modeling a quadrotor is not an easy task because of its complex structure.There are two reference frames that should be considered in quadrotor modeling, those are Earth Frame (EF) and Body Frame (BF) as shown in Fig.
2 [11].By using the Newton-Euler formula, dynamic models of Quadrotor with cross configuration can be written as (1) [9,11], while the relations of those basic movements to the squared of the propeller velocity are written in (2), as follows.
With ܺ ̈, ܻ ̈, ܼ ̈ the quadrotor linear acceleration along xyz-with respect to EF, ‫,‬ ‫,̈ݍ‬ ‫̈ݎ‬ the quadrotor angular acceleration around xyz-with respect to BF, ݉ the mass of the quadrotor, ݃ the acceleration due to gravity, ‫ܫ‬ , ‫ܫ‬ , ‫ܫ‬ the body moment of inertia around the xyzaxis, ‫,‬ ‫,ݍ‬ ‫ݎ‬ the quadrotor angular velocity around xyzwith respect to BF, ܷ ଵ the vertical thrust, ܷ ଶ the roll torque, ܷ ଷ the pitch torque, ܷ ସ the yaw torque, Ω the propeller speed, ܾ the thrust factor, ݀ the drag factor, and ݈ the distance between the center of quadrotor and the center of the propeller.
In general, the block diagram of a quadrotor control scheme is shown in Figure .3. The inner loop, which is the main part of the control system, is for the attitude control, while the outer loop is for the position control of a Quadrotor.Note that the position control for a quadrotor consists of two parts, namely the position control in the vertical plane or z-plane or the altitude control; and the position control in the horizontal plane or xy-plane.The purpose of the altitude controller is to keep the distance of the quadrotor to the ground, while the position control in the xy-plane maintains the horizontal position with regard to the starting point [4,5,12], which is also termed as the maneuvering control.
The Quadrotor platform that was developed and used in our entire experiments is shown in the Figure     From Figure 5, it is clear that in the control of NN with DIC method can be divided into two parts, namely (1) System Identification, (2) Inverse Model Calculation.Both are done using NN with appropriate number of neurons with back propagation method for training.From equations 1 and 2, it can be seen that variables which affect the movement and acceleration are as follows, the input u(t) is the speed of rotation of each rotor, while the output y(t) is the quadrotor flight dynamics ( ߶, ߠ, ߰, ‫,ݔ‬ ‫,ݕ‬ ‫.]41[)ݖ‬The configuration for training the NN for system identification is shown in Figure 6a, where the NN has 20 input neurons, a hidden layer with 15 neurons and an output layer with 4 output neurons.The output of the system identification consists of the parameters such as roll, pitch, yaw and altitude.The NN inverse model is shown in Figure 6b, where the NN also has the same architectural structure with that of the system identification model, with 20 input neurons, 15 hidden neurons and 4 output neurons.The output of the NN inverse model consists of four PWM signals which are used to control the BLDC motors.
The goal of the optimized DIC is to get better results compare with that of the original DIC, such as the smaller error or settling time.The first stage of optimization scheme is by providing the desired input (set point) to the DIC model.This stage produces new data of the dynamics and motor speed.These new data are used to retrain the inverse model, so we get a new weight of the NN for the inverse model, which is the optimized DIC algorithm.

Experiment Result
To test the DIC algorithm, experimental data are fed in to the DIC.The comparison results show that the control system using the DIC method has the ability to follow the trajectory as shown in the Figure 7.In a further flight experiment, desired reference set points are given to the input of DIC (roll= 0°; pitch = 0°; yaw = 266°; and altitude = 0.75m), and the results are shown in Figure 8, showing that the system is able to track the set point with MSSE equal to 1.2009.The optimized DIC is shown in Figure 9.The error of the roll and the pitch with optimized DIC method is smaller than previous one but the error of altitude with optimized DIC method is larger (Table 1).MSSE of optimized DIC method is 1.2698.

Conclusion
The DIC model and the Optimized DIC model have shown to work well that can stabilize the developed quadrotor system with good tracking performance.The Optimized DIC results show an improved performance of the neural networks DIC model in maintaining a hovering condition, however, the altitude performance of the quadrotor is decreased compare with that of the unoptimized DIC system.This decreasing altitude performance may due to the learning data sets were taken within the test-bed condition, where the quadrotor is held by the test-bed supporter.Experiment results also show that the settling time of the optimized DIC system, which can be reached in 9 seconds, is faster than that of the unoptimized DIC system which is reached in 40 seconds.The controller system for VTOL or maneuvering of our developed quadrotor system is developed and will be presented in the near future.
4. In order to have an input-output data of the Quadrotor platform, we use an open source Flight Control Unit (FCU) Ardupilot 2.5., as the inner loop controller.Meanwhile, for the outer loop controller a Radio Control (RC) is utilized, which is operated by human as the pilot.

Figure 6 .
Figure 6.Block diagram for training

Figure 7 .Figure 8 .
Figure 7. Simulation result of direct inverse control, real flight as trajectory input

Figure 9 .
Figure 9. Simulation result of optimized direct inverse control, hover set point as trajectory input

Table 1 .
Comparison between the DIC model and the optimized DIC model during hover attitude